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

class "clip". More...

#include <liblives.hpp>

Public Member Functions

 clip ()
 Creates a new, invalid clip.
 
bool isValid () const
 Check if clip is valid. More...
 
int frames ()
 Number of frames in this clip. More...
 
int width ()
 Width of the clip in pixels. More...
 
int height ()
 Height of the clip in pixels. More...
 
double FPS ()
 Framerate (frames per second) of the clip. More...
 
double playbackFPS ()
 Framerate (frames per second) that the clip is/will be played back at. More...
 
livesString name ()
 Human readable name of the clip. More...
 
int audioRate ()
 Audio rate for this clip. More...
 
int playbackAudioRate ()
 The current playback audio rate for this clip, which may differ from audioRate(). More...
 
int audioChannels ()
 Number of audio channels (eg. More...
 
int audioSampleSize ()
 Size in bits of audio samples (eg. More...
 
bool audioSigned ()
 Returns whether the audio is signed (true) or unsigned (false). More...
 
lives_endian_t audioEndian ()
 Returns the endianness of the audio. More...
 
double audioLength ()
 Returns the length in seconds for audio in the clip If the clip is invalid, returns 0. More...
 
int selectionStart ()
 Start of the selected frame region. More...
 
int selectionEnd ()
 End of the selected frame region. More...
 
bool selectAll ()
 Select all frames in the clip. More...
 
bool setSelectionStart (unsigned int start)
 Set the selection start frame for the clip. More...
 
bool setSelectionEnd (unsigned int end)
 Set the selection end frame for the clip. More...
 
bool switchTo ()
 Switch to this clip as the current foreground clip. More...
 
bool setIsBackground ()
 Switch to this clip as the current background clip. More...
 
bool operator== (const clip &other)
 

Protected Member Functions

 clip (ulong uid, livesApp *lives=NULL)
 

Protected Attributes

ulong m_uid
 

Detailed Description

class "clip".

Represents a clip which is open in LiVES.

See Also
set::nthClip()
livesApp::openFile()
player::foregroundClip()
player::backgroundClip()

Member Function Documentation

int lives::clip::audioChannels ( )

Number of audio channels (eg.

left, right) for this clip. If the clip is video only, 0 is returned. If clip is not valid then 0 is returned.

Returns
int audio channels, or 0 if clip is not valid.
lives_endian_t lives::clip::audioEndian ( )

Returns the endianness of the audio.

If clip is video only or not valid then the return value is undefined.

Returns
bool audio signed.
double lives::clip::audioLength ( )

Returns the length in seconds for audio in the clip If the clip is invalid, returns 0.

Returns
the length of the clip audio, in seconds.
int lives::clip::audioRate ( )

Audio rate for this clip.

If the clip is video only, 0 is returned. If clip is not valid then 0 is returned. Note this is not necessarily the same as the soundcard audio rate which can be obtained via prefs::audioPlayerRate().

Returns
int audio rate, or 0 if clip is not valid.
See Also
playbackAudioRate()
int lives::clip::audioSampleSize ( )

Size in bits of audio samples (eg.

8, 16, 32) for this clip. If the clip is video only, 0 is returned. If clip is not valid then 0 is returned.

Returns
int audio sample size, or 0 if clip is not valid.
bool lives::clip::audioSigned ( )

Returns whether the audio is signed (true) or unsigned (false).

If clip is video only or not valid then the return value is undefined.

Returns
bool audio signed.
double lives::clip::FPS ( )

Framerate (frames per second) of the clip.

If the clip is audio only, 0.0 is returned. If clip is not valid then 0.0 is returned.

Returns
double framerate of the clip, or 0.0 if clip is not valid.
int lives::clip::frames ( )

Number of frames in this clip.

If the clip is audio only, 0 is returned. If clip is not valid then 0 is returned.

Returns
int number of frames, or 0 if clip is not valid.
int lives::clip::height ( )

Height of the clip in pixels.

If the clip is audio only, 0 is returned. If clip is not valid then 0 is returned.

Returns
int height in pixels, or 0 if clip is not valid.
bool lives::clip::isValid ( ) const

Check if clip is valid.

A clip is valid if it is loaded in a valid livesApp instance, and the livesApp::status() is not LIVES_STATUS_NOTREADY.

See Also
livesApp::openFile().
Returns
true if the clip is valid.
livesString lives::clip::name ( )

Human readable name of the clip.

If clip is not valid then empty livesString is returned.

Returns
livesString name, or empty livesString if clip is not valid.
bool lives::clip::operator== ( const clip other)
inline
Returns
true if the two clips have the same internal id, and belong to the same livesApp.
int lives::clip::playbackAudioRate ( )

The current playback audio rate for this clip, which may differ from audioRate().

If the clip is video only, 0 is returned. If clip is not valid then 0 is returned. Note this is not necessarily the same as the soundcard audio rate which can be obtained via prefs::audioPlayerRate(). If livesApp::mode() is LIVES_INTERFACE_MODE_MULTITRACK then this will return multitrack::audioRate().

Returns
int playback audio rate, or 0 if clip is not valid.
See Also
audiorate().
double lives::clip::playbackFPS ( )

Framerate (frames per second) that the clip is/will be played back at.

This may vary from the normal FPS(). During playback it will be equivalent to player::FPS(). If livesApp::mode() is LIVES_INTERFACE_MODE_MULTITRACK then this will return multitrack::FPS(). IF the clip is invalid, 0. is returned.

Returns
the playback framerate
See Also
player::setCurrentFPS().
player::FPS().
bool lives::clip::selectAll ( )

Select all frames in the clip.

if the clip is invalid does nothing. Only works is livesApp::status() is LIVES_STATUS_READY or LIVES_STATUS_PLAYING.

Returns
true if the operation was successful.
int lives::clip::selectionEnd ( )

End of the selected frame region.

If the clip is audio only, 0 is returned. If clip is not valid then 0 is returned.

Returns
int frame selection end, or 0 if clip is not valid.
int lives::clip::selectionStart ( )

Start of the selected frame region.

If the clip is audio only, 0 is returned. If clip is not valid then 0 is returned.

Returns
int frame selection start, or 0 if clip is not valid.
bool lives::clip::setIsBackground ( )

Switch to this clip as the current background clip.

Only works if livesApp::status() is LIVES_STATUS_READY or LIVES_STATUS_PLAYING and livesApp::mode() is LIVES_INTERFACE_MODE_CLIP_EDITOR. If the clip is invalid, nothing happens and false is returned.

Returns
true if the switch was successful.
See Also
player::setBackgroundClip()
bool lives::clip::setSelectionEnd ( unsigned int  end)

Set the selection end frame for the clip.

If the new end is < selectionStart() then selection start will be set to the new end. If the clip is invalid there is no effect. Only functions if livesApp::status() is LIVES_STATUS_READY or LIVES_STATUS_PLAYING.

Parameters
endthe selection end frame which must be in range 1 <= end <= frames().
See Also
setSelectionStart().
bool lives::clip::setSelectionStart ( unsigned int  start)

Set the selection start frame for the clip.

If the new start is > selectionEnd() then selection end will be set to the new start. If the clip is invalid there is no effect. Only functions if livesApp::status() is LIVES_STATUS_READY or LIVES_STATUS_PLAYING.

Parameters
startthe selection start frame which must be in range 1 <= start <= frames().
See Also
setSelectionEnd().
bool lives::clip::switchTo ( )

Switch to this clip as the current foreground clip.

Only works if livesApp::status() is LIVES_STATUS_READY or LIVES_STATUS_PLAYING and livesApp::mode() is LIVES_INTERFACE_MODE_CLIP_EDITOR. If clips are switched during playback, the application acts as if livesApp::loopMode() were set to LIVES_LOOP_MODE_CONTINUOUS. If the clip is invalid, nothing happens and false is returned.

Returns
true if the switch was successful.
See Also
player::setForegroundClip()
int lives::clip::width ( )

Width of the clip in pixels.

If the clip is audio only, 0 is returned. If clip is not valid then 0 is returned.

Returns
int width in pixels, or 0 if clip is not valid.

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