• Shotcut QML Scripting API
  • org.shotcut.qml
  • TimelineDock
  • TimelineDock QML Type

    The timeline dock controller, available as the timeline context property. More...

    Import Statement: import org.shotcut.qml

    Properties

    Signals

    Methods

    Detailed Description

    timeline is injected into the Timeline QML view and exposes properties and methods for querying and controlling clip selection, the playhead position, the current track, and audio recording.

    Property Documentation

    currentTrack : int

    The zero-based index of the currently focused timeline track. Settable.


    isRecording : bool

    true when audio recording is in progress. Read-only.


    loopEnd : int

    The end frame of the current loop region, or -1 if no loop is set. Read-only.


    loopStart : int

    The start frame of the current loop region, or -1 if no loop is set. Read-only.


    position : int

    The current playhead position in frames. Settable — setting this seeks the player.


    selection : list<var>

    The current clip selection as a list of point values where x is the track index and y is the clip index. Settable.


    Signal Documentation

    clipOpened(var producer)

    Emitted when a clip is opened for source preview. producer is the opened clip's producer.

    Note: The corresponding handler is onClipOpened.


    currentTrackChanged()

    Emitted when currentTrack changes.

    Note: The corresponding handler is onCurrentTrackChanged.


    durationChanged()

    Emitted when the total timeline duration changes.

    Note: The corresponding handler is onDurationChanged.


    isRecordingChanged(bool recording)

    Emitted when recording starts or stops. recording is true when recording begins.

    Note: The corresponding handler is onIsRecordingChanged.


    loopChanged()

    Emitted when the loop region start or end time changes.

    Note: The corresponding handler is onLoopChanged.


    positionChanged(int position)

    Emitted when the playhead time position changes.

    Note: The corresponding handler is onPositionChanged.


    selectionChanged()

    Emitted when the clip selection changes.

    Note: The corresponding handler is onSelectionChanged.


    showStatusMessage(string message)

    Emitted to request a message be shown in the status bar.

    Note: The corresponding handler is onShowStatusMessage.


    Method Documentation

    int addAudioTrack()

    Appends a new audio track and returns its track index.


    int addVideoTrack()

    Appends a new video track and returns its track index.


    void alignSelectedClips()

    Aligns selected clips to a common track using audio analysis.


    void append(int trackIndex)

    Appends the current source clip to the track at trackIndex.


    bool changeGain(int trackIndex, int clipIndex, double gain)

    Sets the audio gain of the clip at (trackIndex, clipIndex). Returns true on success.


    void copy(int trackIndex, int clipIndex)

    Copies the clip at (trackIndex, clipIndex) to the clipboard.


    void createMarker()

    Creates a new marker at the current playhead position.


    void createOrEditMarker()

    Creates a new marker at the playhead, or opens the edit dialog if one already exists there.


    void createOrEditSelectionMarker()

    Creates a range marker spanning the current clip selection, or edits the existing one.


    void deleteMarker(int markerIndex)

    Deletes the marker at markerIndex, or the marker at the playhead if markerIndex is -1.


    void detachAudio(int trackIndex, int clipIndex)

    Detaches the audio of the clip at (trackIndex, clipIndex) to an audio track.


    void editMarker(int markerIndex)

    Opens the edit dialog for the marker at markerIndex.


    void fadeIn(int trackIndex, int clipIndex, int duration)

    Sets the fade-in duration (frames) for the clip at (trackIndex, clipIndex). Pass -1 for clipIndex to use the clip under the playhead.


    void fadeOut(int trackIndex, int clipIndex, int duration)

    Sets the fade-out duration (frames) for the clip at (trackIndex, clipIndex). Pass -1 for clipIndex to use the clip under the playhead.


    list<var> getGroupForClip(int trackIndex, int clipIndex)

    Returns the list of all clip coordinates (point values) in the same group as the clip at (trackIndex, clipIndex).


    void incrementCurrentTrack(int by)

    Moves the current track focus up or down by by tracks.


    void insert(int trackIndex, int position, string xml, bool seek)

    Inserts the producer described by xml at time position on trackIndex, rippling downstream clips. Pass -1 for position to use the playhead. If seek is true, moves the playhead to the end of the inserted clip.


    void insertAudioTrack()

    Inserts a new audio track above the current track.


    void insertTrack()

    Inserts a new track of the same type as the current track above it.


    void insertVideoTrack()

    Inserts a new video track above the current track.


    bool isFloating()

    Returns true if the timeline dock is currently floating (undocked).


    bool isMultitrackSelected()

    Returns true if the timeline output is currently selected.


    void lift(int trackIndex, int clipIndex, bool ignoreTransition)

    Lifts (removes content from) the clip at (trackIndex, clipIndex), leaving a blank of the same duration. If ignoreTransition is true, adjacent transitions are not affected.


    void liftSelection()

    Removes all selected clips, replacing them with blanks.


    bool mergeClipWithNext(int trackIndex, int clipIndex, bool dryrun)

    Merges the clip at clipIndex with the following clip on trackIndex. If dryrun is true the merge is validated but not applied; returns true when valid.


    bool moveClip(int fromTrack, int toTrack, int clipIndex, int position, bool ripple)

    Moves the clip at (fromTrack, clipIndex) to position on toTrack. If ripple is true, downstream clips shift to fill the gap. Returns true on success.


    void moveTrack(int fromTrackIndex, int toTrackIndex)

    Moves the track at fromTrackIndex to toTrackIndex.


    void moveTrackDown()

    Moves the current track one position downward.


    void moveTrackUp()

    Moves the current track one position upward.


    void openProperties()

    Opens the Properties panel for the currently selected clip. Static method.


    void overwrite(int trackIndex, int position, string xml, bool seek)

    Overwrites at time position on trackIndex with the producer described by xml. Pass -1 for position to use the playhead. If seek is true, moves the playhead to the end of the overwritten region.


    void recordAudio()

    Starts audio recording into the current track at the playhead position.


    void remove(int trackIndex, int clipIndex, bool ignoreTransition)

    Removes the clip at (trackIndex, clipIndex), replacing it with a blank. If ignoreTransition is true, adjacent transitions are not affected.


    void removeSelection(bool withCopy)

    Removes all selected clips. If withCopy is true, the clips are copied to the clipboard before removal (cut).


    void removeTrack()

    Removes the current track (and all its clips) from the timeline.


    void replace(int trackIndex, int clipIndex, string xml)

    Replaces the clip at (trackIndex, clipIndex) with the producer described by xml. If xml is empty, uses the current source clip.


    void restoreSelection()

    Restores the previously saved clip selection.


    void seekInPoint(int clipIndex)

    Seeks the playhead to the in-point of the clip at clipIndex on the current track.


    void seekNextEdit()

    Seeks the playhead to the nearest edit point (clip boundary) after the current position.


    void seekNextMarker()

    Seeks the playhead to the next marker after the current position.


    void seekPrevMarker()

    Seeks the playhead to the previous marker before the current position.


    void seekPreviousEdit()

    Seeks the playhead to the nearest edit point (clip boundary) before the current position.


    void selectAll()

    Selects all clips on all tracks.


    void selectAllOnCurrentTrack()

    Selects all clips on the current track.


    void selectMultitrack()

    Selects the timeline output, deselecting any clips.


    void selectTrackHead(int trackIndex)

    Selects the track and its header of the track at trackIndex.


    int selectedTrack()

    Returns the index of the selected track when a single track is selected, or -1 otherwise.


    void setTrackComposite(int trackIndex, bool composite)

    Sets whether the video track at trackIndex composites (composite) over lower tracks.


    void setTrackLock(int trackIndex, bool lock)

    Locks (lock = true) or unlocks the track at trackIndex.


    void setTrackName(int trackIndex, string value)

    Renames the track at trackIndex to value.


    void stopRecording()

    Stops an in-progress audio recording.


    void toggleOtherTracksHidden(int trackIndex)

    Hides all video tracks except trackIndex, or shows all if already in that state.


    void toggleOtherTracksMute(int trackIndex)

    Mutes all tracks except trackIndex (solo), or unmutes all if already soloed.


    void toggleTrackHidden(int trackIndex)

    Toggles visibility of the video track at trackIndex.


    void toggleTrackMute(int trackIndex)

    Toggles mute on the track at trackIndex.


    void trimClipIn(bool ripple)

    Trims the in-point of the clip under the playhead to the current time position. If ripple is true, downstream clips shift accordingly.


    void trimClipOut(bool ripple)

    Trims the out-point of the clip under the playhead to the current time position. If ripple is true, downstream clips shift accordingly.