liblives  2.4.1-svn
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Protected Member Functions | List of all members
lives::block Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
mthe multitrack object
trackthe track number. Values < 0 indicate backing audio tracks.
timethe time in seconds on the timeline.
Returns
the block on the given track at the given time.

Member Function Documentation

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.

Returns
the clip which is the source of frames for this block.
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.

Returns
whether the block is contained in an active multitrack instance.
double lives::block::length ( )

Returns the duration in seconds of the block.

If the block is invalid, returns -1.

Returns
duration in seconds.
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.

Parameters
trackthe new track to move to.
timethe timeline time in seconds to move to.
Returns
true if the block could be moved.
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().

Returns
true if the block was removed.
See Also
multitrack::insertBlock().
double lives::block::startTime ( )

Returns the start time in seconds of the block.

If the block is invalid, returns -1.

Returns
start time in seconds.
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.

Returns
the current track number for this block.

The documentation for this class was generated from the following files: