liblives
2.4.1-svn
|
class "block". More...
#include <liblives.hpp>
Public Member Functions | |
bool | isValid () const |
returns whether the block is valid or not. More... | |
block (multitrack m, int track, double time) | |
Returns a reference to the block on the specified track at the specified time. More... | |
double | startTime () |
Returns the start time in seconds of the block. More... | |
double | length () |
Returns the duration in seconds of the block. More... | |
clip | clipSource () |
Returns the clip which is the source of frames for this block. More... | |
int | track () |
Returns the track number to which this block is currently attached. More... | |
bool | remove () |
Removes a block from the multitrack timeline. More... | |
bool | moveTo (int track, double time) |
Move the block to a new track at a new timeline time. More... | |
Protected Member Functions | |
block (multitrack *m=NULL, ulong uid=0l) | |
Protected initialiser. | |
class "block".
Represents a sequence of frames from the same clip on the same track which forms part of a layout. This is an abstracted level, since layouts are fundamentally formed of "events" which may span multiple tracks.
lives::block::block | ( | multitrack | m, |
int | track, | ||
double | time | ||
) |
Returns a reference to the block on the specified track at the specified time.
If no such block exists, returns an invalid block.
m | the multitrack object |
track | the track number. Values < 0 indicate backing audio tracks. |
time | the time in seconds on the timeline. |
clip lives::block::clipSource | ( | ) |
Returns the clip which is the source of frames for this block.
If the block is invalid, returns an invalid clip.
bool lives::block::isValid | ( | ) | const |
returns whether the block is valid or not.
A block may become invalid if it is deleted from a layout for example. Undoing a deletion does not cause a block to become valid again, you need to search for it again by time and track number. If the livesApp::mode() is changed from LIVES_INTERFACE_MODE_MULTITRACK, then all existing blocks become invalid.
double lives::block::length | ( | ) |
Returns the duration in seconds of the block.
If the block is invalid, returns -1.
bool lives::block::moveTo | ( | int | track, |
double | time | ||
) |
Move the block to a new track at a new timeline time.
Depending on the value of multitrack::insertMode(), it may not be possible to do the insertion. In case of failure 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 multitrack::gravity() setting, the multitrack::insertMode() setting, and the location of other blocks in the layout. The insertion may cause other blocks to relocate. If the block is invalid, nothing happens and false is returned.
track | the new track to move to. |
time | the timeline time in seconds to move to. |
bool lives::block::remove | ( | ) |
Removes a block from the multitrack timeline.
Upon being removed, the block becomes invalid. Undoing the operation does not cause the block to become valid again, although it can be searched for using the constructor. If the block is invalid, nothing happens and false is returned. Only works if livesApp::status() is LIVES_STATUS_READY. May cause other blocks to move, depending on the setting of multitrack::gravity().
double lives::block::startTime | ( | ) |
Returns the start time in seconds of the block.
If the block is invalid, returns -1.
int lives::block::track | ( | ) |
Returns the track number to which this block is currently attached.
A track number < 0 indicates a backing audio track. If the block is invalid, returns 0.