liblives
2.4.1-svn
|
class "multitrack". More...
#include <liblives.hpp>
Public Member Functions | |
bool | isValid () const |
returns whether the multitrack is valid or not. More... | |
bool | isActive () const |
returns whether the multitrack is active or not. More... | |
bool | setCurrentTrack (int track) const |
Set the current track if isActive() is true. More... | |
int | currentTrack () const |
If isActive() is true, then this method returns the current active track. More... | |
double | setCurrentTime (double time) const |
Set the current playback start time in seconds. More... | |
double | currentTime () const |
Return the current playback time in seconds. More... | |
livesString | trackLabel (int track) const |
If isActive() is true, then this method returns the label for a track. More... | |
bool | setTrackLabel (int track, livesString label=livesString()) const |
Set the label for a track. More... | |
lives_gravity_t | gravity () const |
Returns the value of the multitrack gravity. More... | |
lives_gravity_t | setGravity (lives_gravity_t mode) const |
Set the gravity mode for multitrack. More... | |
lives_insert_mode_t | insertMode () const |
Returns the value of the multitrack insert mode. More... | |
lives_insert_mode_t | setInsertMode (lives_insert_mode_t mode) const |
Set the gravity mode for multitrack. More... | |
int | addVideoTrack (bool in_front) const |
Append a new video track into the timeline. More... | |
int | numVideoTracks () const |
Returns the number of video tracks for multitrack. More... | |
int | numAudioTracks () const |
Returns the number of audio backing tracks for multitrack. More... | |
double | FPS () const |
Return the framerate of the multitrack in frames per second. More... | |
block | insertBlock (clip c, bool ignore_selection_limits=false, bool without_audio=false) const |
Insert frames from clip c into currentTrack() at currentTime() If ignore_selection_limits is true, then all frames from the clip will be inserted, otherwise (the default) only frames from clip::selectionStart() to clip::selectionEnd() will be used. More... | |
livesString | wipeLayout (bool force=false) const |
Wipe the current layout, leaving a blank layout. More... | |
livesString | chooseLayout () const |
Allow the user to graphically choose a layout to load for the set. More... | |
livesStringList | availableLayouts () const |
Return a list of the available layouts for the currently loaded set. More... | |
bool | reloadLayout (livesString filename) const |
Reload the selected layout, replacing the current multitrack layout. More... | |
livesString | saveLayout (livesString name) const |
Save the current layout using the name supplied. More... | |
livesString | saveLayout () const |
Save the current layout using the current layout name. More... | |
clip | render (bool render_audio=true, bool normalise_audio=true) const |
Render the current layout to a new clip and return it. More... | |
effect | autoTransition () const |
Returns the current autotransition effect for multitrack mode. More... | |
bool | disableAutoTransition () const |
Set the current autotransition effect for multitrack mode to "None" (no effect). More... | |
bool | setAutoTransition (effect autotrans) const |
Set the current autotransition effect for multitrack mode. More... | |
bool | operator== (const multitrack &other) const |
Protected Member Functions | |
multitrack (livesApp *lives=NULL) | |
multitrack | |
Protected Attributes | |
livesApp * | m_lives |
The linked LiVES application. | |
class "multitrack".
Represents the multitrack object in a livesApp.
int lives::multitrack::addVideoTrack | ( | bool | in_front | ) | const |
Append a new video track into the timeline.
Only works if isActive() is true, and livesApp::status() is LIVES_STATUS_READY.
in_front | set to true to insert a video track in front of existing video tracks. Otherwise insert will be behind. |
effect lives::multitrack::autoTransition | ( | ) | const |
Returns the current autotransition effect for multitrack mode.
If no effect is set, returns an invalid effect. If the owning livesApp::isInvalid() is true, or if livesApp::Status() is LIVES_STATUS_NOTREADY, returns an invalid effect.
livesStringList lives::multitrack::availableLayouts | ( | ) | const |
Return a list of the available layouts for the currently loaded set.
If livesApp::isReady() is false, or if no set is loaded, then an empty livesStringList is returned.
livesString lives::multitrack::chooseLayout | ( | ) | const |
Allow the user to graphically choose a layout to load for the set.
Only works if livesApp::status() is LIVES_STATUS_READY and isActive() is true, otherwise an empty livesString is returned.
double lives::multitrack::currentTime | ( | ) | const |
Return the current playback time in seconds.
If isActive() is true this returns the current player time in the multitrack timeline (equivalent to to player::playbackTime(), and during playback, equivalent to player::elapsedTime() plus a constant offset). This function works when livesApp::status() is LIVE_STATUS_READY or LIVES_STATUS_PLAYING. If isActive() is false, 0. is returned.
int lives::multitrack::currentTrack | ( | ) | const |
If isActive() is true, then this method returns the current active track.
The active track defines the insertion point for video and audio, along with the currentTime(). If isActive() is false, or the livesApp::status is not LIVES_STATUS_READY or LIVES_STATUS_PLAYING then the return value is undefined.
bool lives::multitrack::disableAutoTransition | ( | ) | const |
Set the current autotransition effect for multitrack mode to "None" (no effect).
If the livesApp::status() is not LIVES_STATUS_READY or LIVES_STATUS_PLAYING, returns false and nothing happens.
double lives::multitrack::FPS | ( | ) | const |
Return the framerate of the multitrack in frames per second.
If isActive() is false, returns 0. Otherwise when the livesAPP::status() is LIVES_STATUS_PLAYING, player::FPS() takes this value.
lives_gravity_t lives::multitrack::gravity | ( | ) | const |
Returns the value of the multitrack gravity.
This value, together with the insertMode() defines what happens when a block is inserted, moved or deleted. If isActive() is false, the return value is undefined.
block lives::multitrack::insertBlock | ( | clip | c, |
bool | ignore_selection_limits = false , |
||
bool | without_audio = false |
||
) | const |
Insert frames from clip c into currentTrack() at currentTime() If ignore_selection_limits is true, then all frames from the clip will be inserted, otherwise (the default) only frames from clip::selectionStart() to clip::selectionEnd() will be used.
If without_audio is false (the default), audio is also inserted. Frames are automatically resampled to fit layout::fps(). Depending on the insertMode(), it may not be possible to do the insertion. In case of failure an invalid block is returned. If the current track is a backing audio track, then only audio is inserted; in this case if without_audio is true an invalid block is returned. Only works if livesApp::status() is LIVES_STATUS_READY and isActive() is true. Note: the actual place where the block ends up, and its final size depends on various factors such as the gravity() setting, the insertMode() setting, and the location of other blocks in the layout. The insertion may cause other blocks to relocate.
c | the clip to insert from |
ignore_selection_limits | if true then all frames from the clip will be inserted |
without_audio | if false then audio is also inserted |
lives_insert_mode_t lives::multitrack::insertMode | ( | ) | const |
Returns the value of the multitrack insert mode.
This value, together with gravity() defines what happens when a block is inserted, moved or deleted. If isActive() is false, the return value is undefined.
bool lives::multitrack::isActive | ( | ) | const |
returns whether the multitrack is active or not.
This is equivent to livesApp::mode() == LIVES_INTERFACE_MODE_MULTITRACK.
bool lives::multitrack::isValid | ( | ) | const |
returns whether the multitrack is valid or not.
A valid multitrack is one which is owned by a valid livesApp, whose livesApp::status() is not LIVES_STATUS_NOTREADY.
int lives::multitrack::numAudioTracks | ( | ) | const |
Returns the number of audio backing tracks for multitrack.
If isActive() is false, 0 is returned.
int lives::multitrack::numVideoTracks | ( | ) | const |
Returns the number of video tracks for multitrack.
If isActive() is false, 0 is returned.
|
inline |
bool lives::multitrack::reloadLayout | ( | livesString | filename | ) | const |
Reload the selected layout, replacing the current multitrack layout.
Only works if livesApp::status() is LIVES_STATUS_READY and isActive() is true. The layout must be "owned" by the currently loaded set, otherwise an error may be shown and it will not be loaded. If filename is an empty livesString, chooseLayout() will be called first to get the layout name. If livesApp::interactive() is true, the user will have a chance to save the current layout (if any) first.
filename | the filename of the layout to load |
clip lives::multitrack::render | ( | bool | render_audio = true , |
bool | normalise_audio = true |
||
) | const |
Render the current layout to a new clip and return it.
Only works if isActive() is true, and livesApp::status() is LIVES_STATUS_READY, and the current layout is not empty. If livesApp::interactive() is true, the user may choose to cancel the operation, or to render fewer than all frames. After rendering, if prefs::mtExitRender() is true, the livesApp::mode() will change to LIVES_INTERFACE_MODE_CLIPEDIT, and isActive() will change to false.
render_audio | true if audio should be rendered in addition to video. |
normalise_audio | if true then the audio volume is normalized (backing audio gets half volume, video tracks get half volume) |
livesString lives::multitrack::saveLayout | ( | livesString | name | ) | const |
Save the current layout using the name supplied.
The layout will be saved in the layouts directory for the currently loaded set, so the name should not include any directory component. Only works if the livesApp::status() is LIVES_STATUS_READY, and the current layout is not empty, otherwise an empty livesString is returned. Note that this WILL work even if isActive() is false. If livesApp::interactive() is true, the user may choose to cancel the operation. If the layout name is empty, the user will be prompted graphically to enter a name. If the set name is empty, the user will be prompted to enter a set name (if livesApp::interactive() is true; otherwise this will fail and an empty string will be returned). Rarely it will not be possible to save a layout (if it was generated by recording events, and it contains generated audio or video).
name | the name to save the layout |
livesString lives::multitrack::saveLayout | ( | ) | const |
Save the current layout using the current layout name.
Only works if the livesApp::status() is LIVES_STATUS_READY, and the current layout is not empty, otherwise an empty livesString is returned. Note that this WILL work even if isActive() is false. If livesApp::interactive() is true, the user may choose to cancel the operation. If the layout name has not been previously set, the user will be prompted graphically to enter a name. If the set name is empty, the user will be prompted to enter a set name (if livesApp::interactive() is true; otherwise this will fail and an empty string will be returned). Rarely it will not be possible to save a layout (if it was generated by recording events, and it contains generated audio or video).
bool lives::multitrack::setAutoTransition | ( | effect | autotrans | ) | const |
Set the current autotransition effect for multitrack mode.
If the livesApp::status() is not LIVES_STATUS_READY or LIVES_STATUS_PLAYING, returns false and nothing happens. If the effect is not a transition, false is returned and nothing happens. If the effect is invalid, this is the same as calling disableAutoTransition().
autotrans | the new autotransition effect for multitrack. |
double lives::multitrack::setCurrentTime | ( | double | time | ) | const |
Set the current playback start time in seconds.
This is also the insertion point for insertBlock(). Only works if the livesApp::status() is LIVES_STATUS_READY and isActive() is true. Setting the current time may cause the timeline to stretch visually (i.e zoom out). The miminum value is 0.0; values < 0.0 will be ignored. This function is synonymous with player::setPlaybackTime().
time | the time in seconds to set playback start time to. |
bool lives::multitrack::setCurrentTrack | ( | int | track | ) | const |
Set the current track if isActive() is true.
Only works when livesApp::status() is LIVES_STATUS_READY or LIVES_STATUS_PLAYING.
track | a value >= 0 represents a video track, a value < 0 represents a backing audio track. |
lives_gravity_t lives::multitrack::setGravity | ( | lives_gravity_t | mode | ) | const |
Set the gravity mode for multitrack.
If isActive() is false, nothing happens and an undefined value is returned, otherwise if livesApp::status() is not LIVES_STATUS_READY or LIVES_STATUS_PLAYING, nothing happens.
mode | the new gravity mode to set. |
lives_insert_mode_t lives::multitrack::setInsertMode | ( | lives_insert_mode_t | mode | ) | const |
Set the gravity mode for multitrack.
If isActive() is false, nothing happens and an undefined value is returned, otherwise if livesApp::status() is not LIVES_STATUS_READY or LIVES_STATUS_PLAYING, nothing happens.
mode | the new insert mode to set. |
bool lives::multitrack::setTrackLabel | ( | int | track, |
livesString | label = livesString() |
||
) | const |
Set the label for a track.
This is for display purposes only and has no other effect. If isActive() is false, the track label is not changed, and false is returned. If the label is not provided, or is an empty livesString, the user will be prompted to enter a name at runtime.
track | the track number. Must be >= 0. |
label | a livesString containing the text to label the track with. |
livesString lives::multitrack::trackLabel | ( | int | track | ) | const |
If isActive() is true, then this method returns the label for a track.
track | the track number. A value >= 0 represents a video track, a value < 0 represents a backing audio track. |
livesString lives::multitrack::wipeLayout | ( | bool | force = false | ) | const |
Wipe the current layout, leaving a blank layout.
If force is false, then the user will have a chance to cancel (if livesApp::interactive() is true), or to save the layout. Only works if livesApp::status() is LIVES_STATUS_READY and isActive() is true. Otherwise, the layout will not be wiped, and an empty livesString will be returned.
force | set to true to force the layout to be wiped. |