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

    A two-level item model representing the timeline: tracks at the top level, clips within each track. More...

    Import Statement: import org.shotcut.qml

    Properties

    Signals

    Methods

    Detailed Description

    MultitrackModel is available as the multitrack context property in the Timeline dock. The top level rows are tracks (video or audio); each track's children are the clips on that track.

    Track/Clip Roles (partial)

    Role nameApplies toDescription
    nametrack, clipDisplay name
    commentclipClip comment
    resourceclipSource file path
    isBlankclipWhether this is a blank (gap)
    startclipStart position in frames on the timeline
    durationtrack, clipDuration in frames
    inPointclipIn-point of the source media
    outPointclipOut-point of the source media
    isMutetrackWhether the track is muted
    isHiddentrackWhether the track is hidden
    isAudiotrack, clipWhether this is an audio track/clip
    isLockedtrackWhether the track is locked
    fadeInclipFade-in duration in frames
    fadeOutclipFade-out duration in frames
    isTransitionclipWhether this clip is a transition
    isFilteredtrack, clipWhether filters are attached
    speedclipPlayback speed multiplier
    groupclipClip group identifier

    Property Documentation

    filtered : bool

    true when timeline clips are being filtered/searched. Read-only.


    scaleFactor : real

    The horizontal zoom/scale factor of the timeline. Settable.


    trackHeaderWidth : int

    The width of the track header column in pixels. Settable.


    trackHeight : int

    The display height of each track row in pixels. Settable.


    Signal Documentation

    aboutToClose()

    Emitted just before the timeline is closed/cleared.

    Note: The corresponding handler is onAboutToClose.


    closed()

    Emitted after the timeline has been closed.

    Note: The corresponding handler is onClosed.


    created()

    Emitted when a new tractor (timeline) is created.

    Note: The corresponding handler is onCreated.


    durationChanged()

    Emitted when the total timeline duration changes.

    Note: The corresponding handler is onDurationChanged.


    filteredChanged()

    Emitted when the filtered state changes.

    Note: The corresponding handler is onFilteredChanged.


    modified()

    Emitted whenever timeline content changes.

    Note: The corresponding handler is onModified.


    scaleFactorChanged()

    Emitted when scaleFactor changes.

    Note: The corresponding handler is onScaleFactorChanged.


    seeked(int position)

    Emitted when the playhead is moved to time position.

    Note: The corresponding handler is onSeeked.


    showStatusMessage(string message)

    Emitted to display a message in the status bar.

    Note: The corresponding handler is onShowStatusMessage.


    trackHeightChanged()

    Emitted when trackHeight changes.

    Note: The corresponding handler is onTrackHeightChanged.


    Method Documentation

    int addTransition(int trackIndex, int clipIndex, int position, bool ripple, bool rippleAllTracks)

    Adds a transition between the clip at (trackIndex, clipIndex) and its neighbor at time position. ripple and rippleAllTracks control whether downstream clips shift. Returns the clip index of the resulting transition.


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

    Returns true if adding a transition at time position between clipIndex and its neighbor on fromTrack / toTrack would be valid. ripple indicates whether ripple mode is active.


    void audioLevelsReady(var index)

    Called by the audio waveform worker when waveform data for index is ready. Triggers a data refresh for the corresponding clip.


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

    Sets the audio gain of the clip at (trackIndex, clipIndex).


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

    Sets the fade-in duration (frames) of the clip at (trackIndex, clipIndex).


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

    Sets the fade-out duration (frames) of the clip at (trackIndex, clipIndex).


    void joinClips(int trackIndex, int clipIndex)

    Joins the clip at clipIndex with the following clip on trackIndex into one clip.


    void liftClip(int trackIndex, int clipIndex)

    Lifts (clears) the clip at (trackIndex, clipIndex), leaving a blank.


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

    Moves the clip at (fromTrack, clipIndex) to time position on toTrack. If ripple is true, clips on toTrack shift to close the gap. If rippleAllTracks is true, all tracks ripple. Returns true on success.


    void reload(bool asynchronous)

    Reloads all track and clip data. If asynchronous is true, audio levels are recalculated in the background.


    void removeClip(int trackIndex, int clipIndex, bool rippleAllTracks)

    Removes the clip at (trackIndex, clipIndex). If rippleAllTracks is true, all tracks shift to close the gap.


    void removeTransition(int trackIndex, int clipIndex)

    Removes the transition at (trackIndex, clipIndex).


    void setTrackComposite(int row, bool composite)

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


    void setTrackHidden(int row, bool hidden)

    Sets the hidden state of the video track at row to hidden.


    void setTrackLock(int row, bool lock)

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


    void setTrackMute(int row, bool mute)

    Sets the mute state of the track at row to mute.


    void setTrackName(int row, string value)

    Renames the track at row to value.


    void splitClip(int trackIndex, int clipIndex, int position)

    Splits the clip at (trackIndex, clipIndex) at time position (frames from timeline start).


    int trimClipIn(int trackIndex, int clipIndex, int delta, bool ripple, bool rippleAllTracks)

    Trims the in-point of the clip at (trackIndex, clipIndex) by delta frames. If ripple is true, clips on trackIndex shift to fill the gap. If rippleAllTracks is true, all tracks ripple. Returns the number of frames actually trimmed.


    int trimClipOut(int trackIndex, int clipIndex, int delta, bool ripple, bool rippleAllTracks)

    Trims the out-point of the clip at (trackIndex, clipIndex) by delta frames. If ripple is true, downstream clips shift. If rippleAllTracks is true, all tracks ripple. Returns the number of frames actually trimmed.