liblives
2.4.1-svn
|
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 set & | getSet () |
const effectKeyMap & | getEffectKeyMap () |
const player & | getPlayer () |
const multitrack & | getMultitrack () |
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 |
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.
lives::livesApp::livesApp | ( | int | argc, |
char * | argv[] | ||
) |
Constructor with argc, argv arguments.
argv array is equivalent to commandline options passed to the LiVES application.
argc | count 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.
ulong lives::livesApp::addCallback | ( | lives_callback_t | cb_type, |
modeChanged_callback_f | func, | ||
void * | data | ||
) | const |
Add a modeChanged callback.
cb_type | must have value LIVES_CALLBACK_MODE_CHANGED. |
func | function to be called when this signal is received. |
data | data to be passed to callback function |
ulong lives::livesApp::addCallback | ( | lives_callback_t | cb_type, |
appQuit_callback_f | func, | ||
void * | data | ||
) | const |
Add an appQuit callback.
cb_type | must have value LIVES_CALLBACK_APP_QUIT |
func | function to be called when this signal is received. |
data | data to be passed to callback function |
ulong lives::livesApp::addCallback | ( | lives_callback_t | cb_type, |
objectDestroyed_callback_f | func, | ||
void * | data | ||
) | const |
Add an objectDestroyed callback.
cb_type | must have value LIVES_CALLBACK_OBJECT_DESTROYED |
func | function to be called when this signal is received. |
data | data to be passed to callback function |
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.
bool lives::livesApp::cancel | ( | ) |
If status() is LIVES_STATUS_PROCESSING, cancel the current processing if possible.
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.
dirname | directory name to start in (or NULL) |
chooser_type | must be either LIVES_FILE_CHOOSER_VIDEO_AUDIO or LIVES_FILE_CHOOSER_AUDIO_ONLY. |
title | title of window to display, or NULL to use a default title. |
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().
bool lives::livesApp::deinterlaceOption | ( | ) |
Returns last setting of deinterlace by user.
const effectKeyMap & lives::livesApp::getEffectKeyMap | ( | ) |
const multitrack & lives::livesApp::getMultitrack | ( | ) |
const set & lives::livesApp::getSet | ( | ) |
bool lives::livesApp::interactive | ( | ) |
Returns whether the GUI app is in interactive mode.
bool lives::livesApp::isPlaying | ( | ) | const |
bool lives::livesApp::isReady | ( | ) | const |
bool lives::livesApp::isValid | ( | ) | const |
Returns whether the instance is valid or not.
A valid instance is connected to a running LiVES application.
lives_interface_mode_t lives::livesApp::mode | ( | ) |
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.
fname | the full pathname of the file to open |
with_audio | if true the audio will be loaded as well as the video |
stime | the time in seconds from which to start loading |
frames | number of frames to open (0 means all frames) |
deinterlace | set to true to force deinterlacing |
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.
setname | the name of the set to reload. |
bool lives::livesApp::removeCallback | ( | ulong | id | ) | const |
Remove a previously added callback.
id | value previously returned from addCallback. |
bool lives::livesApp::setInteractive | ( | bool | setting | ) |
Change the interactivity of the GUI application.
Interactivity is via menus and keyboard accelerators
setting | set to true to allow interaction with the GUI. |
lives_interface_mode_t lives::livesApp::setMode | ( | lives_interface_mode_t | 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.
text | text to be diaplayed in the dialog. |
blocking | if true then function will block until the user presses "OK" |
lives_status_t lives::livesApp::status | ( | ) | const |
Get the current operational status of the livesApp.