JvmPianoRollSession

Properties

Link copied to clipboard
open override val clipboardCount: Int
Link copied to clipboard
open override val clipReferenceId: String?

The document reference id of the clip being edited, or null.

Link copied to clipboard
open override val durationSeconds: Double
Link copied to clipboard
open override val error: String

Empty when the last edit succeeded.

Link copied to clipboard
open override var focusedNote: Int

The note the detail editor is on, or -1.

Link copied to clipboard
open override val isDirty: Boolean
Link copied to clipboard
open override val maxNote: Int
Link copied to clipboard
open override val minNote: Int
Link copied to clipboard
open override val notes: List<PianoRollNote>
Link copied to clipboard
open override val selectedNoteCount: Int
Link copied to clipboard

The selection context this session publishes its note selection in; hand it to ProjectSelectionService.snapshot and friends. null when the session has none.

Functions

Link copied to clipboard
open override fun beginDrag()

A move drag works from the notes as they were when it began, so each update re-applies one delta rather than accumulating rounding. The session holds that snapshot: say when the drag starts, how far it has moved, and whether it ended or was cancelled.

Link copied to clipboard
open override fun cancelDrag()
Link copied to clipboard
open override fun commit(app: AppModel): Boolean

Writes the session back to the clip, through the undo history.

Link copied to clipboard
open override fun createNote(startSeconds: Double, durationSeconds: Double, note: Int, velocity: Float)
Link copied to clipboard
open override fun deleteNote(index: Int)
Link copied to clipboard
open override fun finishDrag(index: Int, originalStart: Double, originalEnd: Double, originalNote: Int)
Link copied to clipboard
open override fun isNoteSelected(index: Int): Boolean
Link copied to clipboard
open override fun isObjectSelected(referenceId: String): Boolean
Link copied to clipboard
open override fun loadNotes(snapshot: PianoRollSnapshot?)
Link copied to clipboard
open override fun matchesSource(snapshot: PianoRollSnapshot): Boolean

Whether this session was built from that snapshot's UMP stream. False means the clip changed underneath and the session must be reloaded — which is what stops an edit being applied to a clip it was not made against.

Link copied to clipboard
open override fun moveSelection(timeDeltaSeconds: Double, pitchDelta: Int)
Link copied to clipboard
open override fun noteReferenceId(index: Int): String?

The document reference id of the note at index, or null for an unknown index.

Link copied to clipboard
open override fun performAction(action: PianoRollAction, pasteSeconds: Double = 0.0)
Link copied to clipboard
open override fun resizeNote(index: Int, startSeconds: Double, durationSeconds: Double, note: Int)
Link copied to clipboard
open override fun selectNote(index: Int, additive: Boolean = false, toggle: Boolean = false)

index -1 clears the selection.

Link copied to clipboard
open override fun selectObject(referenceId: String, additive: Boolean = false, toggle: Boolean = false)

Selects (or, with toggle, flips) a note or automation point by reference id, then makes this session's context the active one. additive keeps the rest of the selection.

Link copied to clipboard
open override fun syncSelection()

Re-reads the session's selection from the selection service, for when it changed elsewhere.