Go to the documentation of this file.
11 #ifndef HAS_LIBLIVES_H
12 #define HAS_LIBLIVES_H
17 #define LIVES_VERSION_MAJOR 3
22 #define LIVES_VERSION_MINOR 2
27 #define LIVES_VERSION_MICRO 0
32 #define LIVES_CHECK_VERSION(major, minor, micro) (major > LIVES_VERSION_MAJOR || (major == LIVES_VERSION_MAJOR && (minor > LIVES_VERSION_MINOR || (minor == LIVES_VERSION_MINOR && micro >= LIVES_VERSION_MICRO))))
124 #define LIVES_CHAR_ENCODING_DEFAULT LIVES_CHAR_ENCODING_UTF8
204 #include <inttypes.h>
211 typedef unsigned long ulong;
235 typedef class livesApp livesApp;
240 typedef class set set;
245 typedef class clip clip;
250 typedef class effectKey effectKey;
255 typedef class effectKeyMap effectKeyMap;
260 typedef class effect effect;
266 typedef class player player;
278 typedef class block block;
284 typedef class livesString livesString;
290 typedef list<livesString> livesStringList;
300 class livesString :
public std::string {
303 livesString(
const string &str,
size_t pos,
size_t len = npos,
305 len), m_encoding(e) {}
310 template <
class InputIterator>
311 livesString(InputIterator first, InputIterator last,
338 typedef void *(*callback_f)(
void *);
348 typedef list<closure *> closureList;
349 typedef list<closure *>::iterator closureListIterator;
375 typedef bool (*private_callback_f)(_privateInfo *,
void *);
383 typedef bool (*modeChanged_callback_f)(livesApp *, modeChangedInfo *,
void *);
390 typedef bool (*appQuit_callback_f)(livesApp *, appQuitInfo *,
void *);
398 typedef bool (*objectDestroyed_callback_f)(livesApp *,
void *);
427 livesApp(
int argc,
char *argv[]);
440 bool isValid()
const;
446 bool isReady()
const;
453 bool isPlaying()
const;
463 const effectKeyMap &getEffectKeyMap();
468 const player &getPlayer();
480 bool removeCallback(
ulong id)
const;
537 livesString chooseFileWithPreview(livesString dirname,
lives_filechooser_t chooser_type, livesString title = livesString(
""));
553 clip openFile(livesString fname,
bool with_audio =
true,
double stime = 0.,
int frames = 0,
bool deinterlace =
false);
563 livesStringList availableSets();
575 livesString chooseSet();
587 bool reloadSet(livesString setname);
596 bool setInteractive(
bool setting);
611 bool deinterlaceOption();
649 closureList &closures();
651 void setClosures(closureList cl);
653 bool setPref(
const char *prefidx,
bool val)
const;
654 bool setPref(
const char *prefidx,
int val)
const;
655 bool setPref(
const char *prefidx,
int bitfield,
bool val)
const;
664 closureList m_closures;
667 effectKeyMap *m_effectKeyMap;
675 void init(
int argc,
char *argv[]);
677 void operator=(livesApp
const &);
678 livesApp(
const livesApp &other);
712 bool isValid()
const;
755 double playbackFPS();
783 int playbackAudioRate();
799 int audioSampleSize();
821 double audioLength();
829 int selectionStart();
854 bool setSelectionStart(
unsigned int start);
863 bool setSelectionEnd(
unsigned int end);
882 bool setIsBackground();
887 inline bool operator==(
const clip &other) {
888 return other.m_uid == m_uid && m_lives == other.m_lives;
903 typedef vector<ulong> clipList;
904 typedef vector<ulong>::iterator clipListIterator;
925 bool isValid()
const;
932 livesString name()
const;
944 bool setName(livesString name = livesString())
const;
957 bool save(livesString name,
bool force_append =
false)
const;
972 unsigned int numClips()
const;
980 clip nthClip(
unsigned int n)
const;
989 int indexOf(clip c)
const;
996 livesStringList layoutNames(
unsigned int n)
const;
1001 inline bool operator==(
const set &other)
const {
1002 return other.m_lives == m_lives;
1007 set(livesApp *
lives = NULL);
1013 void update_clip_list(
void);
1037 bool isValid()
const;
1042 bool isPlaying()
const;
1048 bool isRecording()
const;
1058 void setSepWin(
bool setting)
const;
1064 bool sepWin()
const;
1072 void setFullScreen(
bool setting)
const;
1078 bool fullScreen()
const;
1088 void setFS(
bool setting)
const;
1113 bool setForegroundClip(clip c)
const;
1122 clip foregroundClip()
const;
1133 bool setBackgroundClip(clip c)
const;
1142 clip backgroundClip()
const;
1158 double setPlaybackStartTime(
double time)
const;
1172 int setVideoPlaybackFrame(
int frame,
bool background =
false)
const;
1189 double videoPlaybackTime(
bool background =
false)
const;
1202 double setAudioPlaybackTime(
double time)
const;
1217 double audioPlaybackTime()
const;
1227 double elapsedTime()
const;
1240 double setCurrentFPS(
double fps)
const;
1250 double currentFPS()
const;
1260 int currentAudioRate()
const;
1289 bool setPingPong(
bool setting)
const;
1300 bool pingPong()
const;
1309 bool resyncFPS()
const;
1315 inline bool operator==(
const player &other)
const {
1316 return other.m_lives == m_lives;
1321 player(livesApp *
lives = NULL);
1337 friend effectKeyMap;
1350 bool isValid()
const;
1376 int numMappedModes();
1387 int setCurrentMode(
int mode);
1405 bool setEnabled(
bool setting);
1423 int appendMapping(effect e);
1436 bool removeMapping(
int mode);
1444 effect at(
int mode);
1453 inline bool operator==(
const effectKey &other) {
1454 return other.m_key == m_key && m_lives == other.m_lives;
1458 effectKey(livesApp *
lives,
int key);
1474 class effectKeyMap {
1483 bool isValid()
const;
1500 effectKey at(
int i)
const;
1509 size_t size()
const;
1514 inline bool operator==(
const effectKeyMap &other)
const {
1515 return other.m_lives == m_lives;
1524 inline effectKey operator [](
int i)
const {
1525 return effectKey(m_lives, i);
1530 effectKeyMap(livesApp *
lives);
1560 effect(
const livesApp &
lives, livesString hashname,
bool match_full =
false);
1577 effect(
const livesApp &
lives, livesString package, livesString fxname, livesString author = livesString(),
int version = 0);
1585 bool isValid()
const;
1590 inline bool operator==(
const effect &other) {
1591 return other.m_idx == m_idx && m_lives == other.m_lives;
1596 effect(livesApp *m_lives,
int idx);
1622 bool isValid()
const;
1686 bool moveTo(
int track,
double time);
1721 bool isValid()
const;
1727 bool isActive()
const;
1736 bool setCurrentTrack(
int track)
const;
1746 int currentTrack()
const;
1758 double setCurrentTime(
double time)
const;
1770 double currentTime()
const;
1778 livesString trackLabel(
int track)
const;
1789 bool setTrackLabel(
int track, livesString label = livesString())
const;
1833 int addVideoTrack(
bool in_front)
const;
1841 int numVideoTracks()
const;
1848 int numAudioTracks()
const;
1882 block insertBlock(clip c,
bool ignore_selection_limits =
false,
bool without_audio =
false)
const;
1893 livesString wipeLayout(
bool force =
false)
const;
1902 livesString chooseLayout()
const;
1910 livesStringList availableLayouts()
const;
1924 bool reloadLayout(livesString filename)
const;
1941 livesString saveLayout(livesString name)
const;
1957 livesString saveLayout()
const;
1969 clip render(
bool render_audio =
true,
bool normalise_audio =
true)
const;
1979 effect autoTransition()
const;
1988 bool disableAutoTransition()
const;
2000 bool setAutoTransition(effect autotrans)
const;
2005 inline bool operator==(
const multitrack &other)
const {
2006 return m_lives == other.m_lives;
2177 #endif // __cplusplus
2179 #endif //HAS_LIBLIVES_H
@ LIVES_AUDIO_PLAYER_UNKNOWN
Unknown / invalid.
@ LIVES_GRAVITY_NORMAL
no gravity
@ LIVES_INSERT_MODE_NORMAL
@ LIVES_STATUS_PROCESSING
application is processing, commands will be ignored
@ LIVES_INTERFACE_MODE_MULTITRACK
multitrack mode
@ LIVES_AUDIO_PLAYER_JACK
Audio playback is thorugh Jack.
int audioPlayerRate(const livesApp &lives)
lives_callback_t
Callback types.
bool setAudioSource(const livesApp &lives, lives_audio_source_t asrc)
const char * version(void)
@ LIVES_AUDIO_SOURCE_EXTERNAL
Audio source is external to LiVES.
@ LIVES_DIALOG_RESPONSE_INVALID
INVALID response.
@ LIVES_CALLBACK_MODE_CHANGED
sent when interface mode changes
lives_dialog_response_t
Dialog response values.
@ LIVES_CALLBACK_OBJECT_DESTROYED
sent when livesApp object is deleted
@ LIVES_AUDIO_PLAYER_PULSE
Audio playback is through PulseAudio.
bool setAudioFollowsVideoChanges(const livesApp &lives, bool setting)
lives_audio_source_t audioSource(const livesApp &lives)
@ LIVES_DIALOG_RESPONSE_RESET
Reset button clicked.
@ LIVES_INTERFACE_MODE_CLIPEDIT
clip editor mode
lives_status_t
LiVES operational status.
lives_audio_player_t audioPlayer(const livesApp &lives)
@ LIVES_AUDIO_PLAYER_MPLAYER2
Audio playback is through mplayer2.
lives_endian_t
Endian values.
@ LIVES_CHAR_ENCODING_FILESYSTEM
file system encoding (UTF-8 on windows, local8bit on others)
bool audioFollowsVideoChanges(const livesApp &lives)
@ LIVES_CALLBACK_FRAME_SYNCH
sent when a frame is displayed
@ LIVES_STATUS_READY
application is ready for commands
bool sepWinSticky(const livesApp &lives)
double maxFPS(const livesApp &lives)
bool setMtExitRender(const livesApp &lives, bool setting)
lives_gravity_t
Multitrack gravity.
@ LIVES_CALLBACK_CLIPSET_OPENED
sent after a clip set is opened
@ LIVES_STATUS_INVALID
livesApp instance is invalid
@ LIVES_CALLBACK_APP_QUIT
sent when app quits
@ LIVES_AUDIO_PLAYER_MPLAYER
Audio playback is through mplayer.
@ LIVES_DIALOG_RESPONSE_YES
Yes button clicked.
@ LIVES_AUDIO_SOURCE_UNKNOWN
Unknown / invalid.
@ LIVES_AUDIO_SOURCE_INTERNAL
Audio source is internal to LiVES.
@ LIVES_STATUS_PREVIEW
user is previewing an operation, commands will be ignored
@ LIVES_GRAVITY_LEFT
inserted blocks gravitate to the left
lives_insert_mode_t
Multitrack insert modes.
@ LIVES_CHAR_ENCODING_UTF8
UTF-8 char encoding.
@ LIVES_LOOP_MODE_NONE
no looping
@ LIVES_CALLBACK_PLAYBACK_STOPPED_RD
@ LIVES_DIALOG_RESPONSE_ACCEPT
Accept button clicked.
@ LIVES_CALLBACK_CLIPSET_SAVED
sent after a clip set is closed
@ LIVES_LOOP_MODE_CONTINUOUS
both video and audio loop continuously
@ LIVES_CALLBACK_CLIP_OPENED
sent after a clip is opened
livesString currentAudioDir(const livesApp &lives)
@ LIVES_CALLBACK_PLAYBACK_STARTED
sent when a/v playback starts or clip is switched
@ LIVES_STATUS_NOTREADY
application is starting up; not ready
lives_interface_mode_t
LiVES operation mode.
@ LIVES_FILE_CHOOSER_AUDIO_ONLY
file chooser options for single audio file
lives_audio_source_t
Audio sources.
@ LIVES_INTERFACE_MODE_INVALID
livesApp instance is invalid
bool isRealtimeAudioPlayer(lives_audio_player_t player_type)
livesString currentVideoLoadDir(const livesApp &lives)
@ LIVES_DIALOG_RESPONSE_OK
OK button clicked.
@ LIVES_CALLBACK_CLIP_CLOSED
sent after a clip is closed
bool setAudioFollowsFPSChanges(const livesApp &lives, bool setting)
@ LIVES_CALLBACK_PRIVATE
for internal use
lives_mt * multitrack(weed_plant_t *event_list, int orig_file, double fps)
create and return lives_mt struct
lives_char_encoding_t
Character encoding types.
bool setSepWinSticky(const livesApp &lives, bool setting)
@ LIVES_DIALOG_RESPONSE_CANCEL
Cancel button clicked.
void binding_cb(lives_callback_t cb_type, const char *msgstring, ulong id)
lives_audio_player_t
Audio players.
@ LIVES_LOOP_MODE_FIT_AUDIO
video keeps looping until audio playback finishes
@ LIVES_CALLBACK_RECORD_STOPPED
sent when record stops (TODO)
@ LIVES_AUDIO_PLAYER_SOX
Audio playback is through Sox.
@ LIVES_DIALOG_RESPONSE_SHOW_DETAILS
Show details button clicked.
@ LIVES_CALLBACK_PLAYBACK_STOPPED
sent when a/v playback ends sent when a/v playback ends and there is recorded data for rendering/prev...
livesString tmpDir(const livesApp &lives)
@ LIVES_CALLBACK_RECORD_STARTED
sent when record starts (TODO)
@ LIVES_DIALOG_RESPONSE_RETRY
Retry button clicked.
boolean normalise_audio(int fnum, double start, double end, float thresh)
int rteKeysVirtual(const livesApp &lives)
@ LIVES_DIALOG_RESPONSE_NONE
Response not obtained.
@ LIVES_DIALOG_RESPONSE_ABORT
Abort button clicked.
@ LIVES_GRAVITY_RIGHT
inserted blocks gravitate to the right
bool mtExitRender(const livesApp &lives)
bool audioFollowsFPSChanges(const livesApp &lives)
@ LIVES_CHAR_ENCODING_LOCAL8BIT
8 bit locale file encoding
@ LIVES_DIALOG_RESPONSE_NO
No button clicked.
lives_filechooser_t
Filechooser hinting types.
#define LIVES_CHAR_ENCODING_DEFAULT
Default character encoding.
lives_loop_mode_t
Player looping modes (bitmap)
@ LIVES_STATUS_PLAYING
application is playing, only player commands will be responded to
@ LIVES_FILE_CHOOSER_VIDEO_AUDIO
file chooser options for single video or audio file