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::livesApp Class Reference

class "livesApp". More...

#include <liblives.hpp>

Public Member Functions

 livesApp ()
 Constructor with no arguments.
 
 livesApp (int argc, char *argv[])
 Constructor with argc, argv arguments. More...
 
 ~livesApp ()
 Destructor: closes the LiVES application. More...
 
bool isValid () const
 Returns whether the instance is valid or not. More...
 
bool isReady () const
 
bool isPlaying () const
 Equivalent to status() == LIVES_STATUS_PLAYING. More...
 
const setgetSet ()
 
const effectKeyMapgetEffectKeyMap ()
 
const playergetPlayer ()
 
const multitrackgetMultitrack ()
 
bool removeCallback (ulong id) const
 Remove a previously added callback. More...
 
ulong addCallback (lives_callback_t cb_type, modeChanged_callback_f func, void *data) const
 Add a modeChanged callback. More...
 
ulong addCallback (lives_callback_t cb_type, appQuit_callback_f func, void *data) const
 Add an appQuit callback. More...
 
ulong addCallback (lives_callback_t cb_type, objectDestroyed_callback_f func, void *data) const
 Add an objectDestroyed callback. More...
 
lives_dialog_response_t showInfo (livesString text, bool blocking=true)
 Show Info dialog in the LiVES GUI. More...
 
livesString chooseFileWithPreview (livesString dirname, lives_filechooser_t chooser_type, livesString title=livesString(""))
 Allow the user choose a file via a fileselector. More...
 
clip openFile (livesString fname, bool with_audio=true, double stime=0., int frames=0, bool deinterlace=false)
 Open a file and return a clip for it. More...
 
livesStringList availableSets ()
 Returns a list of available sets. More...
 
livesString chooseSet ()
 Allow the user to choose a set to open. More...
 
bool reloadSet (livesString setname)
 Reload an existing clip set. More...
 
bool setInteractive (bool setting)
 Change the interactivity of the GUI application. More...
 
bool interactive ()
 Returns whether the GUI app is in interactive mode. More...
 
bool deinterlaceOption ()
 Returns last setting of deinterlace by user. More...
 
lives_interface_mode_t mode ()
 Get the current interface mode of the livesApp. More...
 
lives_interface_mode_t setMode (lives_interface_mode_t mode)
 Set the current interface mode of the livesApp. More...
 
lives_status_t status () const
 Get the current operational status of the livesApp. More...
 
bool cancel ()
 If status() is LIVES_STATUS_PROCESSING, cancel the current processing if possible. More...
 

Protected Member Functions

ulong addCallback (lives_callback_t cb_type, private_callback_f func, void *data) const
 

Detailed Description

class "livesApp".

Represents a single LiVES application. Note that currently only one such instance can be valid at a time, attempting to create a second concurrent instance will return an invalid instance.

Constructor & Destructor Documentation

lives::livesApp::livesApp ( int  argc,
char *  argv[] 
)

Constructor with argc, argv arguments.

argv array is equivalent to commandline options passed to the LiVES application.

Parameters
argccount of number of arguments
argv[]array of options.
lives::livesApp::~livesApp ( )

Destructor: closes the LiVES application.

Deletes any callbacks which were set for this instance.

Member Function Documentation

ulong lives::livesApp::addCallback ( lives_callback_t  cb_type,
modeChanged_callback_f  func,
void *  data 
) const

Add a modeChanged callback.

Parameters
cb_typemust have value LIVES_CALLBACK_MODE_CHANGED.
funcfunction to be called when this signal is received.
datadata to be passed to callback function
Returns
unsigned long callback_id
See Also
LIVES_CALLBACK_MODE_CHANGED
removeCallback().
ulong lives::livesApp::addCallback ( lives_callback_t  cb_type,
appQuit_callback_f  func,
void *  data 
) const

Add an appQuit callback.

Parameters
cb_typemust have value LIVES_CALLBACK_APP_QUIT
funcfunction to be called when this signal is received.
datadata to be passed to callback function
Returns
unsigned long callback_id
See Also
LIVES_CALLBACK_APP_QUIT
removeCallback().
ulong lives::livesApp::addCallback ( lives_callback_t  cb_type,
objectDestroyed_callback_f  func,
void *  data 
) const

Add an objectDestroyed callback.

Parameters
cb_typemust have value LIVES_CALLBACK_OBJECT_DESTROYED
funcfunction to be called when this signal is received.
datadata to be passed to callback function
Returns
unsigned long callback_id
See Also
LIVES_CALLBACK_OBJECT_DESTROYED
removeCallback().
livesStringList lives::livesApp::availableSets ( )

Returns a list of available sets.

The list returned depends on the setting of prefs::tmpDir(). This may be an expensive operation as it requires accessing the underlying filesystem. If the set is invalid, an empty livesStringList is returned.

Returns
a list<livesString> of set names.
See Also
reloadSet().
set::save().
bool lives::livesApp::cancel ( )

If status() is LIVES_STATUS_PROCESSING, cancel the current processing if possible.

Returns
true if the processing was cancelled.
livesString lives::livesApp::chooseFileWithPreview ( livesString  dirname,
lives_filechooser_t  chooser_type,
livesString  title = livesString("") 
)

Allow the user choose a file via a fileselector.

Only has an effect when status() is LIVES_STATUS_READY, otherwise returns an empty livesString. After returning, the setting that the user selected for deinterlace may be obtained by calling deinterlaceOption(). This value can the be passed into openFile(). Chooser type will direct the user towards the type of file to choose, however there is no guarantee that a file of the "correct" type will be returned. If the user cancels then an empty livesString will be returned.

Parameters
dirnamedirectory name to start in (or NULL)
chooser_typemust be either LIVES_FILE_CHOOSER_VIDEO_AUDIO or LIVES_FILE_CHOOSER_AUDIO_ONLY.
titletitle of window to display, or NULL to use a default title.
Returns
the name of the file selected.
See Also
openFile().
livesString lives::livesApp::chooseSet ( )

Allow the user to choose a set to open.

Only has an effect when status() is LIVES_STATUS_READY, and there are no currently open clips, otherwise returns an empty livesString. If the user cancels, an empty livesString is returned. The valid list of sets to choose from will be equivalent to the list returned by availableSets().

Returns
the name of the set selected.
See Also
reloadSet().
availableSets().
bool lives::livesApp::deinterlaceOption ( )

Returns last setting of deinterlace by user.

Returns
value that the user selected during the last filechooser with preview operation. This value may be passed into openFile().
See Also
openFile().
const effectKeyMap & lives::livesApp::getEffectKeyMap ( )
Returns
the current effectKeyMap.
const multitrack & lives::livesApp::getMultitrack ( )
Returns
the multitrack object for this livesApp.
const player & lives::livesApp::getPlayer ( )
Returns
the player for this livesApp.
const set & lives::livesApp::getSet ( )
Returns
the current set.
bool lives::livesApp::interactive ( )

Returns whether the GUI app is in interactive mode.

Returns
true if GUI interactivity via menus and keyboard accelerators is enabled.
See Also
setInteractive().
bool lives::livesApp::isPlaying ( ) const

Equivalent to status() == LIVES_STATUS_PLAYING.

Returns
true if status() == LIVES_STATUS_PLAYING.
See Also
status().
bool lives::livesApp::isReady ( ) const
Returns
true if status() == LIVES_STATUS_READY.
See Also
status().
bool lives::livesApp::isValid ( ) const

Returns whether the instance is valid or not.

A valid instance is connected to a running LiVES application.

Returns
true if instance is connected to a running LiVES application.
lives_interface_mode_t lives::livesApp::mode ( )

Get the current interface mode of the livesApp.

If the livesApp is invalid, returns LIVES_INTERFACE_MODE_INVALID.

Returns
current mode.
See Also
setMode().
clip lives::livesApp::openFile ( livesString  fname,
bool  with_audio = true,
double  stime = 0.,
int  frames = 0,
bool  deinterlace = false 
)

Open a file and return a clip for it.

Only works when status() is LIVES_STATUS_READY, otherwise an invalid clip is returned. If the file pointed to cannot be opened as a clip, an invalid clip is returned. If interactive() is true, the user may cancel the load, or choose to load only part of the file.

Parameters
fnamethe full pathname of the file to open
with_audioif true the audio will be loaded as well as the video
stimethe time in seconds from which to start loading
framesnumber of frames to open (0 means all frames)
deinterlaceset to true to force deinterlacing
Returns
a clip.
See Also
chooseFileWithPreview().
deinterlaceOption().
bool lives::livesApp::reloadSet ( livesString  setname)

Reload an existing clip set.

Only works when status() is LIVES_STATUS_READY, otherwise false is returned. A set may not be accessed concurrently by more than one copy of LiVES. The valid list of sets is equivalent to the list returned by availableSets(). If setname is an empty livesString, chooseSet() will be called first to get a set name.

Parameters
setnamethe name of the set to reload.
See Also
chooseSet().
availableSets().
bool lives::livesApp::removeCallback ( ulong  id) const

Remove a previously added callback.

Parameters
idvalue previously returned from addCallback.
Returns
true if playback was stopped.
bool lives::livesApp::setInteractive ( bool  setting)

Change the interactivity of the GUI application.

Interactivity is via menus and keyboard accelerators

Parameters
settingset to true to allow interaction with the GUI.
Returns
the new setting.
See Also
interactive().
lives_interface_mode_t lives::livesApp::setMode ( lives_interface_mode_t  mode)

Set the current interface mode of the livesApp.

Only works if status() is LIVES_STATUS_READY. If the livesApp is invalid, returns LIVES_INTERFACE_MODE_INVALID.

Parameters
modethe interface mode to set to
Returns
the new interface mode.
See Also
mode().
lives_dialog_response_t lives::livesApp::showInfo ( livesString  text,
bool  blocking = true 
)

Show Info dialog in the LiVES GUI.

Only has an effect when status() is LIVES_STATUS_READY.

Parameters
texttext to be diaplayed in the dialog.
blockingif true then function will block until the user presses "OK"
Returns
if blocking, returns the response code from the dialog.
lives_status_t lives::livesApp::status ( ) const

Get the current operational status of the livesApp.

Returns
current status.
See Also
isReady().
isPlaying().

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