ClipTimeline

A timeline of clips on tracks, like the scenes of a sequencer. The host sets value; the user edits it:

  • a click selects a clip, shift adds it to or removes it from the selection, a click on empty space clears it; dragging on empty space selects the clips in a rectangle, with shift adding them

  • dragging a clip moves the selected clips in time and across tracks, with alt it moves copies of them; dragging an edge of a clip trims it, keeping its fades within it

  • the handles at the top left and the top right of a clip set how long the selected clips fade in and out, see TimelineClip.fadeIn and TimelineClip.fadeOut

  • mod+c, mod+x and mod+v copy, cut and paste the selected clips, see clipboard; pasted clips start at the pointer

  • with the ClipTimelineTool.RAZOR a click cuts a clip in two, see splitClip

  • a double click on empty space adds the clip that newClip gives; delete and backspace remove the selected clips

  • the wheel zooms in time around the pointer, sideways scrolling, the middle button and alt on empty space pan, shift and the wheel scroll the tracks; dragging in the ruler scrubs, see scrubbed

Clips snap to multiples of snap, to the edges of other clips and to the playhead. valueChanged fires once per finished edit, which is recorded by recordEdit, so that it can be undone. Clips on one track may overlap; clips on tracks past the last are shown on the last.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var accent: ColorRGBa

the color of clips without a color of their own, of the outline of the selected clips and of the playhead

Link copied to clipboard

the attributes of the element, which attribute selectors like [label="OK"] select, see setAttribute

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

the clipboard of copy, cut and paste, shared by all timelines unless it is replaced

Link copied to clipboard
Link copied to clipboard

builds the menu that opens when the element is clicked with the right button, null for none

Link copied to clipboard

The radius of the corners of this in pixels, of its org.openrndr.panel.style.borderRadius: in pixels, or a percentage of its shorter side; at most half of it

Link copied to clipboard
Link copied to clipboard

what the element does in drag and drop, see DragAndDrop

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

the history of the control manager of this element, null when it is not in one

Link copied to clipboard
var end: Double?

the time where the timeline ends or loops, drawn as a marker, null for none

Link copied to clipboard
open override val handlesDoubleClick: Boolean = true
Link copied to clipboard
open override val handlesKeyboardFocus: Boolean = true
Link copied to clipboard
open val heightHint: Double?
Link copied to clipboard
var id: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var layoutOffset: Vector2

an offset of the element from where it is laid out, while it moves there, see org.openrndr.panel.animateMoveFrom

Link copied to clipboard

false for elements that place their children themselves, like the spans of RichText

Link copied to clipboard

The largest scrollLeft: how far the content of the element extends beyond its right side, as found by the last layout.

Link copied to clipboard

The largest scrollTop: how far the content of the element extends beyond its bottom, as found by the last layout.

Link copied to clipboard

the shortest a clip can be trimmed or cut to, in seconds

Link copied to clipboard
Link copied to clipboard
var newClip: (track: Int, time: Double) -> TimelineClip??

the clip to add for a double click on empty space, at track and the time under the pointer, snapped; null, or a null result, adds nothing

Link copied to clipboard
val Element.ownTransform: Matrix44?

The transform of the element itself, in the coordinates of the window, around its transform origin; null when it has none

Link copied to clipboard
open val paintArea: Rectangle

The area the element draws in, on the screen: its box and what is drawn around it, like knobs, focus rings and outlines. Only the areas of the elements that changed are drawn again, a control that draws further than this gives a larger area.

Link copied to clipboard

the text of the control manager of the element, null when it is not in one

Link copied to clipboard
Link copied to clipboard

the time of the playhead, drawn over the ruler and the tracks, null for none

Link copied to clipboard
var recordEdit: (name: String, undo: () -> Unit, redo: () -> Unit) -> Unit

Records an edit of this element, named name, in the history so that it can be undone and redone, by default in org.openrndr.panel.editHistory. A program can take this over, like to keep the edits in a history of its own.

Link copied to clipboard
val screenArea: Rectangle
Link copied to clipboard
val screenPosition: Vector2
Link copied to clipboard
val Element.screenTransform: Matrix44?

the transform of the element by its own transform and those of its ancestors, null when there are none

Link copied to clipboard

how far the content of an element that scrolls is scrolled to the left, in pixels

Link copied to clipboard
val scrollTarget: Vector2

where the content is scrolled to: the end of smooth scrolling, or the scroll position

Link copied to clipboard
Link copied to clipboard

how far the tracks are scrolled down, in pixels

Link copied to clipboard
val scrubbed: Event<Double>

the time under the pointer while it drags in the ruler, for the host to move its transport to

Link copied to clipboard

the indices of the selected clips in the clips of value

Link copied to clipboard
val selectionChanged: Event<Set<Int>>

the selection changed

Link copied to clipboard

the seconds that clips snap to, 0 for none; they also snap to the edges of other clips and to the playhead

Link copied to clipboard

the two clips that clip is cut into at the time at, like to have the second start where the first ends in what it shows; null for two clips with the same label, color and tag as clip

Link copied to clipboard
Link copied to clipboard
open val textInputArea: TextInputArea?

Where text is typed in this element while it has the focus: the line of the caret, in the coordinates of the window, with the caret from its left edge. The control manager gives it to the window, so that input methods place their candidates and on-screen keyboards next to the caret; null for elements that do not take text.

Link copied to clipboard

the tool that the pointer uses

Link copied to clipboard

the tool changed

Link copied to clipboard
open var tooltip: String?

the text shown next to the pointer when it rests on the element, null for none

Link copied to clipboard
Link copied to clipboard

the tracks and clips

Link copied to clipboard

the bindings of values of the element, checked every frame, see org.openrndr.panel.binding.bindValue

Link copied to clipboard

the value changed: at the end of an edit by the user, or set by the program

Link copied to clipboard

the time at the left edge of the tracks

Link copied to clipboard
open val widthHint: Double?
Link copied to clipboard

pixels per second

Functions

Link copied to clipboard
Link copied to clipboard
fun Element.animateMoveFrom(from: Vector2)

Moves the element from from, a point of the window where its top-left corner was, to where it is laid out in the next frame, like when it moved to another place in a list

Link copied to clipboard
inline fun append(builder: Element.() -> Unit)
open fun append(element: Element)
Link copied to clipboard
fun attribute(name: String): String?

the value of the attribute name, null when the element does not have it

Link copied to clipboard
fun <T> Element.bindValue(changed: Event<*>, property: KMutableProperty0<T>, elementValue: () -> T, setElementValue: (T) -> Unit): PropertyBinding<T>

binds the value of this element to property, see bindValue

fun <T> Element.bindValue(changed: Event<*>, get: () -> T, set: (T) -> Unit, elementValue: () -> T, setElementValue: (T) -> Unit): PropertyBinding<T>

Binds the value of this element to get and set: when changed happens, elementValue is set with set, and when get changes, setElementValue shows it in the element

Link copied to clipboard
fun Element.button(vararg classes: String, label: String = "button", init: Button.() -> Unit): Button
Link copied to clipboard
fun Element.canvas(vararg classes: String, init: Canvas.() -> Unit): Canvas
Link copied to clipboard
fun childIndex(element: Element): Int?
Link copied to clipboard
Link copied to clipboard
open override fun close()
Link copied to clipboard
fun Element.colorEditor(vararg classes: String, init: ColorEditor.() -> Unit): ColorEditor
Link copied to clipboard
fun Element.colorpicker(vararg classes: String, init: Colorpicker.() -> Unit): Colorpicker
Link copied to clipboard
Link copied to clipboard
fun Element.console(vararg classes: String, init: Console.() -> Unit = {}): Console

a Console, init sets it up

Link copied to clipboard
fun Element.containsScreenPoint(position: Vector2): Boolean

true when the point position of the window is in the box of the element as it is drawn, transformed

Link copied to clipboard

sets the menu that opens when this element is clicked with the right button, see Element.contextMenu

Link copied to clipboard

copies the selected clips to the clipboard

Link copied to clipboard
fun Element.curveEditor(vararg classes: String, init: CurveEditor.() -> Unit): CurveEditor
Link copied to clipboard

copies the selected clips to the clipboard and removes them

Link copied to clipboard
fun <T> Element.dataTable(rows: List<T>, columns: List<Column<T>>, vararg classes: String, rowHeight: Double = 24.0, init: DataTable<T>.() -> Unit = {}): DataTable<T>
Link copied to clipboard

removes the selected clips

Link copied to clipboard
Link copied to clipboard
fun Element.div(vararg classes: String, init: Div.() -> Unit): Div
Link copied to clipboard
fun Element.dock(vararg classes: String, init: Dock.() -> Unit): Dock

a Dock, init adds its panels with Dock.panel

Link copied to clipboard
open override fun draw(drawer: Drawer)
Link copied to clipboard
fun Element.dropdownButton(vararg classes: String, id: String? = null, label: String = "button", init: DropdownButton.() -> Unit): DropdownButton
Link copied to clipboard
inline fun <reified T> elementWithId(id: String): T?
Link copied to clipboard
Link copied to clipboard
fun Element.envelopeButton(vararg classes: String, init: EnvelopeButton.() -> Unit): EnvelopeButton
Link copied to clipboard
fun Element.envelopeEditor(vararg classes: String, init: EnvelopeEditor.() -> Unit): EnvelopeEditor
Link copied to clipboard
fun Element.expressionArea(vararg classes: String, init: ExpressionArea.() -> Unit): ExpressionArea
Link copied to clipboard
fun Element.fadeIn(duration: Double = 0.15)

fades the element in over duration seconds

Link copied to clipboard
fun Element.fcurveEditor(vararg classes: String, init: FCurveEditor.() -> Unit): FCurveEditor
Link copied to clipboard
Link copied to clipboard
fun Element.findAll(predicate: (Element) -> Boolean): List<Element>
Link copied to clipboard
Link copied to clipboard
fun findFirst(element: Element, matches: (Element) -> Boolean): Element?
Link copied to clipboard
fun findNext(premise: (Element) -> Boolean): Element?
Link copied to clipboard
fun findPrevious(premise: (Element) -> Boolean): Element?
Link copied to clipboard
Link copied to clipboard
fun frame()

shows all clips, and the end marker

Link copied to clipboard
fun Element.gradientEditor(vararg classes: String, init: GradientEditor.() -> Unit): GradientEditor
Link copied to clipboard
fun Element.h1(vararg classes: String, init: H1.() -> String): H1
Link copied to clipboard
fun Element.h2(vararg classes: String, init: H2.() -> String): H2
Link copied to clipboard
fun Element.h3(vararg classes: String, init: H3.() -> String): H3
Link copied to clipboard
open fun heightForWidth(width: Double): Double?

the height of the content of the element when it is width wide, for content that wraps; null when it has none

Link copied to clipboard
fun Element.histogram(vararg classes: String, init: Histogram.() -> Unit): Histogram
Link copied to clipboard
fun <T : Element> Element.initElement(classes: Array<out String>, element: T, init: T.() -> Unit): T
Link copied to clipboard

the styles of this element and its descendants are computed again before the next redraw

Link copied to clipboard
Link copied to clipboard

Determines whether the current element, or any of its ancestors, has a display style of Display.NONE.

Link copied to clipboard
fun Element.knob(vararg classes: String, init: Knob.() -> Unit): Knob
Link copied to clipboard
fun Element.label(vararg classes: String, init: Label.() -> String): Label
Link copied to clipboard
fun Element.layout(init: Element.() -> Unit)
Link copied to clipboard
fun Element.localPosition(position: Vector2): Vector2

position, a point of the window, in the coordinates of the element before its transforms

Link copied to clipboard
fun Element.menuBar(vararg classes: String, init: MenuBar.() -> Unit): MenuBar

a MenuBar that init adds menus to

Link copied to clipboard
fun move(steps: Int)
Link copied to clipboard
fun next(): Element?
Link copied to clipboard
fun Element.nodeEditor(vararg classes: String, init: NodeEditor.() -> Unit): NodeEditor

a NodeEditor, init adds its nodes and wires

Link copied to clipboard
fun Element.numberField(vararg classes: String, init: NumberField.() -> Unit): NumberField
Link copied to clipboard
fun Element.p(vararg classes: String, init: P.() -> String): P
Link copied to clipboard
fun paste(time: Double? = null, track: Int? = null)

Pastes the clips of the clipboard such that the earliest starts at time and the topmost is on track, the others where they were from those, all within the tracks; the pasted clips are selected. Without a time: at the pointer when it is over the tracks, snapped, else at the playhead, else right after the copied clips. Without a track: at the pointer, else where they were.

Link copied to clipboard
fun Element.plot(vararg classes: String, init: Plot.() -> Unit): Plot
Link copied to clipboard
open fun prepare()

Called in every frame before the styles are computed, by the control manager, so that the element can change its children for what is in view, like a VirtualList

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Element.rangeSlider(vararg classes: String, init: RangeSlider.() -> Unit): RangeSlider
Link copied to clipboard
fun remove(element: Element): Element?
Link copied to clipboard
open fun replace(builder: Element.() -> Unit)
Link copied to clipboard

The layout is computed again before the next redraw, of the element and its descendants, and of the elements around it as far as its size can change theirs, see org.openrndr.panel.document.Document.layoutRequests

Link copied to clipboard

Draws the element again, what it shows changed. The layout is computed again when the size hints of the element changed; changes to the children, the classes, states and styles of elements and to scrolling lay out again by themselves, other changes that move or size elements call Element.requestLayout.

Link copied to clipboard
fun Element.richText(vararg classes: String, init: RichText.() -> Unit): RichText

a RichText that init adds spans to

Link copied to clipboard
fun root(): Element
Link copied to clipboard
fun Element.scope(vararg classes: String, init: Scope.() -> Unit): Scope
Link copied to clipboard
fun screenPosition(time: Double, track: Int): Vector2

the point of the window where time is on the track at track, in the middle of its row

Link copied to clipboard
fun scrollIntoView(margin: Double = 0.0)

Scrolls the elements that scroll this element so that it is in view, with margin pixels around it, each by its StyleSheet.scrollBehavior

Link copied to clipboard
fun scrollTo(left: Double = scrollTarget.x, top: Double = scrollTarget.y, smooth: Boolean? = null)

Scrolls the content to left and top, within the content: smoothly when the StyleSheet.scrollBehavior of the element is smooth and smooth is not false, and the element is in a control manager

Link copied to clipboard
fun Element.sequenceEditor(vararg classes: String, init: SequenceEditor.() -> Unit): SequenceEditor
Link copied to clipboard
fun setAttribute(name: String, value: String?)

sets the attribute name to value, or removes it when value is null; the styles are computed again

Link copied to clipboard
fun Element.slideOut(x: Double, y: Double, width: Double, height: Double, vararg classes: String, aboveY: Double? = null, closeDelayMillis: Long = 0, init: SlideOut.() -> Unit): SlideOut
Link copied to clipboard
fun Element.slider(vararg classes: String, init: Slider.() -> Unit): Slider
Link copied to clipboard
fun Element.slidersVector2(vararg classes: String, init: SlidersVector2.() -> Unit): SlidersVector2
Link copied to clipboard
fun Element.slidersVector3(vararg classes: String, init: SlidersVector3.() -> Unit): SlidersVector3
Link copied to clipboard
fun Element.slidersVector4(vararg classes: String, init: SlidersVector4.() -> Unit): SlidersVector4
Link copied to clipboard
fun splitAt(time: Double, all: Boolean = false): Boolean

cuts the selected clips that time is in, or all clips it is in when all is set or none is selected, in two at time, those that are long enough to leave both parts minimumDuration; the parts after the cut are selected. True when a clip was cut

Link copied to clipboard
fun Element.splitPane(vararg classes: String, vertical: Boolean = false, init: SplitPane.() -> Unit): SplitPane

a SplitPane, see there

Link copied to clipboard
fun Element.style(function: StyleSheet.() -> Unit): StyleSheet

Applies the provided styling function to the element's stylesheet. If the element does not already have a stylesheet, a new one is created and the function is applied to it.

Link copied to clipboard
fun Element.tabs(vararg classes: String, init: Tabs.() -> Unit): Tabs

adds Tabs, init adds their pages with Tabs.tab

Link copied to clipboard
fun Element.textArea(vararg classes: String, init: TextArea.() -> Unit): TextArea
Link copied to clipboard
inline fun <reified T : TextElement> Element.textElement(classes: Array<out String>, init: T.() -> String): T
Link copied to clipboard
fun Element.textfield(vararg classes: String, init: Textfield.() -> Unit): Textfield
Link copied to clipboard
fun Element.textInput(vararg classes: String, init: TextInput.() -> Unit): TextInput
Link copied to clipboard
fun Element.timeline(vararg classes: String, init: Timeline.() -> Unit): Timeline
Link copied to clipboard
fun Element.toggle(vararg classes: String, init: Toggle.() -> Unit): Toggle
Link copied to clipboard
fun <T> Element.treeView(roots: List<T>, childrenOf: (T) -> List<T>, label: (T) -> String = { it.toString() }, vararg classes: String, rowHeight: Double = 24.0, init: TreeView<T>.() -> Unit = {}): TreeView<T>

a TreeView of roots, whose children childrenOf gives, labeled by label

Link copied to clipboard
fun Element.viewBox(viewBox: ViewBox)
fun Element.viewBox(program: Program, f: ViewBox.() -> Unit): ViewBoxElement
Link copied to clipboard
fun <T> Element.virtualList(items: List<T>, rowHeight: Double, vararg classes: String, row: Div.(item: T, index: Int) -> Unit): VirtualList<T>

a VirtualList of items with rows of rowHeight pixels that row builds

Link copied to clipboard
fun Element.visit(function: Element.() -> Unit)
Link copied to clipboard
fun Element.visitVisible(function: Element.() -> Unit)
Link copied to clipboard
fun <T : Any> Element.watchListDiv(vararg classes: String, watchList: List<T>, builder: WatchListDiv<T>.(T) -> Unit)
Link copied to clipboard
fun <T : Any> Element.watchObjectDiv(vararg classes: String, watchObject: T, builder: WatchObjectDiv<T>.(T) -> Unit): WatchObjectDiv<T>

Creates a Div element with the provided classes, and runs builder to populate the Div any time watchObject changes.

Link copied to clipboard
fun <T : Any> Element.watchPropertyDiv(vararg classes: String, watchProperty: KMutableProperty0<T>, builder: WatchPropertyDiv<T>.(T) -> Unit)
Link copied to clipboard
fun Element.xyPad(vararg classes: String, init: XYPad.() -> Unit): XYPad