Go to the documentation of this file.
51 #ifndef HAS_LIVES_MAIN_H
52 #define HAS_LIVES_MAIN_H
59 #define STD_STRINGFUNCS
62 # define WARN_UNUSED __attribute__((warn_unused_result))
63 # define GNU_PURE __attribute__((pure))
64 # define GNU_DEPRECATED(msg) __attribute__((deprecated(msg)))
65 # define GNU_CONST __attribute__((const))
66 # define GNU_MALLOC __attribute__((malloc))
67 # define GNU_MALLOC_SIZE(argx) __attribute__((alloc_size(argx)))
68 # define GNU_MALLOC_SIZE2(argx, argy) __attribute__((alloc_size(argx, argy)))
69 # define GNU_ALIGN(argx) __attribute__((alloc_align(argx)))
70 # define GNU_ALIGNED(sizex) __attribute__((assume_aligned(sizex)))
71 # define GNU_NORETURN __attribute__((noreturn))
72 # define GNU_FLATTEN __attribute__((flatten)) // inline all function calls
73 # define GNU_HOT __attribute__((hot))
74 # define GNU_SENTINEL __attribute__((__sentinel__(0)))
75 # define GNU_RETURNS_TWICE __attribute__((returns_twice))
81 # define GNU_MALLOC_SIZE(x)
82 # define GNU_MALLOC_SIZE2(x, y)
83 # define GNU_DEPRECATED(msg)
85 # define GNU_ALIGNED(x)
90 # define GNU_RETURNS_TWICE
93 #include <sys/types.h>
106 #define LIVES_PAINTER_IS_CAIRO
107 #define LIVES_LINGO_IS_PANGO
109 #define PAINTER_QPAINTER
114 #include <sys/file.h>
121 #ifndef GDK_WINDOWING_X11
122 #define GDK_WINDOWING_X11
130 #define LIVES_OS_UNIX G_OS_UNIX
133 #include <gdk/gdkkeysyms.h>
135 #if GTK_CHECK_VERSION(3, 0, 0)
145 #if !GTK_CHECK_VERSION(3, 0, 0)
151 #include <gdk/gdkwayland.h>
154 #ifdef GDK_WINDOWING_WAYLAND
155 #ifndef GDK_IS_WAYLAND_DISPLAY
156 #define GDK_IS_WAYLAND_DISPLAY(a) FALSE
160 #include <sys/stat.h>
168 #define __STDC_CONSTANT_MACROS
178 #define ulong unsigned long
181 #define QUOTEME(x) #x
184 #define MAX_FILES 65535
188 #ifndef PREFIX_DEFAULT
189 #define PREFIX_DEFAULT "/usr"
194 #define PREFIX PREFIX_DEFAULT
197 #define LIVES_DIR_SEP "/"
198 #define LIVES_COPYRIGHT_YEARS "2002 - 2020"
200 #if defined (IS_DARWIN) || defined (IS_FREEBSD)
202 #define off64_t off_t
205 #define lseek64 lseek
209 #define DEF_FILE_PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
211 #define ALLOW_NONFREE_CODECS
215 #define WARN_FILE_SIZE 500
220 #define MAX_FRAME_WIDTH 100000.
221 #define MAX_FRAME_HEIGHT 100000.
223 #define ENABLE_DVD_GRAB
225 #ifdef HAVE_MJPEGTOOLS
226 #define HAVE_YUV4MPEG
234 #include <liboil/liboil.h>
238 #define LIVES_INLINE static inline
239 #define LIVES_GLOBAL_INLINE inline
241 #define LIVES_INLINE static
242 #define LIVES_GLOBAL_INLINE
243 #define LIVES_LOCAL_INLINE
246 #define LIVES_LOCAL_INLINE LIVES_INLINE
253 #define PATH_MAX MAX_PATH
255 #define PATH_MAX 4096
261 #define strip_ext(fname) lives_strdup((char *)(fname ? strrchr(fname, '.') ? lives_memset(strrchr(fname, '.'), 0, 1) \
262 ? fname : fname : fname : NULL))
266 #define squared(a) ((a) * (a))
268 #define sig(a) ((a) < 0. ? -1.0 : 1.0)
271 #define ROUND_I(a) ((int)((double)(a) + .5))
274 #define NORMAL_CLAMP(a, b) (ROUND_I((a)) < 0 ? 0 : ROUND_I((a)) > ROUND_I((b)) ? ROUND_I((b)) : ROUND_I((a)))
277 #define UTIL_CLAMP(a, b) (NORMAL_CLAMP((a), (b)) <= 0 ? ROUND_I((b)) : ROUND_I((a)))
280 #define INT_CLAMP(i, min, max) ((i) < (min) ? (min) : (i) > (max) ? (max) : (i))
283 #define CEIL(a, b) ((int)(((double)(a) + (double)(b) - .000000001) / ((double)(b))) * (b))
286 #define ALIGN_CEIL(a, b) (((int)(((a) + (b) - 1.) / (b))) * (b))
289 #define ALIGN_CEIL64(a, b) ((((int64_t)(a) + (int64_t)(b) - 1) / (int64_t)(b)) * (int64_t)(b))
292 #define FLOOR(a, b) ((int)(((double)(a) - .000000001) / ((double)(b))) * (b))
295 #define SIGNED_DIVIDE(a, b) ((a) < 0. ? -fabs((a) / (b)) : fabs((a) / (b)))
298 #define ABS_THRESH(a, b) (((a) + (b)) >> 31) | (((b) - (a)) >> 31)
300 #define myround(n) ((n) >= 0. ? (int)((n) + 0.5) : (int)((n) - 0.5))
302 #ifdef NEED_ENDIAN_TEST
303 #undef NEED_ENDIAN_TEST
304 static const int32_t testint = 0x12345678;
305 #define IS_BIG_ENDIAN (((char *)&testint)[0] == 0x12) // runtime test only !
329 #define WEED_ADVANCED_PALETTES
332 #include "../libweed/weed-host.h"
333 #include "../libweed/weed.h"
334 #include "../libweed/weed-events.h"
335 #include "../libweed/weed-palettes.h"
336 #include "../libweed/weed-effects.h"
338 #include <weed/weed-host.h>
339 #include <weed/weed.h>
340 #include <weed/weed-events.h>
341 #include <weed/weed-palettes.h>
342 #include <weed/weed-effects.h>
345 #if NEED_LOCAL_WEED_UTILS
346 #include "../libweed/weed-utils.h"
348 #include <weed/weed-utils.h>
357 #define NEED_FOURCC_COMPAT
359 #ifdef NEED_LOCAL_WEED_COMPAT
360 #include "../libweed/weed-compat.h"
362 #include <weed/weed-compat.h>
378 #define IGN_RET(a) ((void)((a) + 1))
381 #define EXPECTED(x) __builtin_expect((x), 1)
382 #define UNEXPECTED(x) __builtin_expect((x), 0)
389 #define INSTALL_CANLOCAL (1ul << 0)
398 #ifdef NEW_CHECKSTATUS
405 } lives_importance_t;
409 lives_importance_t
import;
413 #define XCAPABLE(foo, EXE_FOO) ((capable->has_##foo->present == UNCHECKED \
414 ? ((capable->has_##foo->present = \
415 (has_executable(EXE_FOO) ? PRESENT : MISSING))) : \
416 capable->has_##foo->present) == PRESENT)
417 #define GET_EXE(foo) QUOTEME(foo)
418 #define PRESENT(foo) (XCAPABLE(foo, GET_EXE(foo)) == PRESENT)
419 #define MISSING(foo) (XCAPABLE(foo, GET_EXE(foo)) == MISSING)
441 #define ANNOY_DISPLAY (1ul << 0)
442 #define ANNOY_DISK (1ul << 1)
443 #define ANNOY_PROC (1ul << 2)
444 #define ANNOY_NETWORK (1ul << 3)
445 #define ANNOY_SOUNDS (1ul << 4)
446 #define ANNOY_DEV (1ul << 5)
447 #define ANNOY_OTHER (1ul << 6)
449 #define ANNOY_FS (1ul << 32)
450 #define ANNOY_CONT (1ul << 33)
451 #define ANNOY_PERIOD (1ul << 34)
452 #define ANNOY_SPONT (1ul << 35)
453 #define ANNOY_TIMED (1ul << 36)
454 #define ANNOY_LOCK (1ul << 37)
456 #define RES_HIDE (1ul << 0)
457 #define RES_SUSPEND (1ul << 1)
458 #define RES_STOP (1ul << 2)
459 #define RES_BLOCK (1ul << 3)
460 #define RES_MUTE (1ul << 4)
462 #define RESTYPE_ACTION (1ul << 16)
463 #define RESTYPE_CONFIG (1ul << 17)
464 #define RESTYPE_SIGNAL (1ul << 18)
465 #define RESTYPE_CMD (1ul << 19)
466 #define RESTYPE_LOCKOUT (1ul << 20)
467 #define RESTYPE_TIMED (1ul << 21)
468 #define RESTYPE_MONITOR (1ul << 22)
480 char color_settings[64];
481 char display_settings[64];
482 char ssv_settings[64];
483 char pow_settings[64];
568 char startup_msg[1024];
629 #define DEF_ALIGN (sizeof(void *) * 8)
657 #define N_RECENT_FILES 16
781 #define IMG_TYPE_BEST IMG_TYPE_PNG
783 #define AFORM_SIGNED 0
784 #define AFORM_LITTLE_ENDIAN 0
786 #define AFORM_UNSIGNED 1
787 #define AFORM_BIG_ENDIAN (1<<1)
788 #define AFORM_UNKNOWN 65536
799 #define WEED_LEAF_HOST_DEINTERLACE "host_deint" // frame needs deinterlacing
800 #define WEED_LEAF_HOST_TC "host_tc" // timecode for deinterlace
801 #define WEED_LEAF_HOST_DECODER "host_decoder" // pointer to decoder for a layer
802 #define WEED_LEAF_HOST_PTHREAD "host_pthread" // thread for a layer
804 #define CLIP_NAME_MAXLEN 256
806 #define AV_TRACK_MIN_DIFF 0.001
808 #define IS_VALID_CLIP(clip) (clip >= 0 && clip <= MAX_FILES && mainw->files[clip])
809 #define CURRENT_CLIP_IS_VALID IS_VALID_CLIP(mainw->current_file)
811 #define IS_TEMP_CLIP(clip) (IS_VALID_CLIP(clip) && mainw->files[clip]->clip_type == CLIP_TYPE_TEMP)
812 #define CURRENT_CLIP_IS_TEMP IS_TEMP_CLIP(mainw->current_file)
814 #define CLIP_HAS_VIDEO(clip) (IS_VALID_CLIP(clip) ? mainw->files[clip]->frames > 0 : FALSE)
815 #define CURRENT_CLIP_HAS_VIDEO CLIP_HAS_VIDEO(mainw->current_file)
817 #define CLIP_HAS_AUDIO(clip) (IS_VALID_CLIP(clip) ? (mainw->files[clip]->achans > 0 && mainw->files[clip]->asampsize > 0) : FALSE)
818 #define CURRENT_CLIP_HAS_AUDIO CLIP_HAS_AUDIO(mainw->current_file)
820 #define CLIP_VIDEO_TIME(clip) ((double)(IS_VALID_CLIP(clip) ? mainw->files[clip]->video_time : 0.))
822 #define CLIP_LEFT_AUDIO_TIME(clip) ((double)(IS_VALID_CLIP(clip) ? mainw->files[clip]->laudio_time : 0.))
824 #define CLIP_RIGHT_AUDIO_TIME(clip) ((double)(IS_VALID_CLIP(clip) ? (mainw->files[clip]->achans > 1 ? \
825 mainw->files[clip]->raudio_time : 0.) : 0.))
827 #define CLIP_AUDIO_TIME(clip) ((double)(CLIP_LEFT_AUDIO_TIME(clip) >= CLIP_RIGHT_AUDIO_TIME(clip) \
828 ? CLIP_LEFT_AUDIO_TIME(clip) : CLIP_RIGHT_AUDIO_TIME(clip)))
830 #define CLIP_TOTAL_TIME(clip) ((double)(CLIP_VIDEO_TIME(clip) > CLIP_AUDIO_TIME(clip) ? CLIP_VIDEO_TIME(clip) : \
831 CLIP_AUDIO_TIME(clip)))
833 #define IS_NORMAL_CLIP(clip) (IS_VALID_CLIP(clip) \
834 ? (mainw->files[clip]->clip_type == CLIP_TYPE_DISK \
835 || mainw->files[clip]->clip_type == CLIP_TYPE_FILE \
836 || mainw->files[clip]->clip_type == CLIP_TYPE_NULL_VIDEO) : FALSE)
838 #define CURRENT_CLIP_IS_NORMAL IS_NORMAL_CLIP(mainw->current_file)
840 #define LIVES_IS_PLAYING (mainw && mainw->playing_file > -1)
842 #define LIVES_IS_RENDERING (mainw && ((!mainw->multitrack && mainw->is_rendering) \
843 || (mainw->multitrack && mainw->multitrack->is_rendering)) \
844 && !mainw->preview_rendering)
846 #define CURRENT_CLIP_TOTAL_TIME CLIP_TOTAL_TIME(mainw->current_file)
848 #define CURRENT_CLIP_IS_CLIPBOARD (mainw->current_file == 0)
863 #define LIVES_DIRECTION_FWD_OR_REV(dir) ((dir) == LIVES_DIRECTION_BACKWARD ? LIVES_DIRECTION_REVERSE : (dir))
864 #define LIVES_DIRECTION_SIG(dir) ((lives_direction_t)sig(dir))
865 #define LIVES_DIRECTION_PAR(dir) ((lives_direction_t)((dir) & 1))
866 #define LIVES_DIRECTION_OPPOSITE(dir1, dir2) (((dir1) == LIVES_DIR_BACKWARD || (dir1) == LIVES_DIR_REVERSED) \
867 ? (dir2) == LIVES_DIR_FORWARD : \
868 ((dir2) == LIVES_DIR_BACKWARD || (dir2) == LIVES_DIR_REVERSED) \
869 ? (dir1) == LIVES_DIR_FORWARD : sig(dir1) != sig(dir2))
870 typedef union _binval {
877 typedef struct _lives_clip_t {
919 char title[1024], author[1024], comment[1024], keywords[1024];
941 #define LIVES_CLIP_HEADER_VERSION 102
959 char undo_text[32], redo_text[32];
991 char binfmt_rsvd[4096];
1042 #define LIVES_EXT_SRC_UNKNOWN -1
1043 #define LIVES_EXT_SRC_NONE 0
1044 #define LIVES_EXT_SRC_DECODER 1
1045 #define LIVES_EXT_SRC_FILTER 2
1046 #define LIVES_EXT_SRC_FIFO 3
1047 #define LIVES_EXT_SRC_STREAM 4
1048 #define LIVES_EXT_SRC_DEVICE 5
1049 #define LIVES_EXT_SRC_FILE_BUFF 6
1062 #define IMG_BUFF_SIZE 262144
1112 #define USE_MPV (!capable->has_mplayer && !capable->has_mplayer2 && capable->has_mpv)
1113 #define HAS_EXTERNAL_PLAYER (capable->has_mplayer || capable->has_mplayer2 || capable->has_mpv)
1119 #define USE_16BIT_PCONV
1132 #define BACKEND_NAME EXEC_SMOGRIFY
1135 #include <sys/time.h>
1204 boolean all_config(LiVESWidget *, LiVESXEventConfigure *, livespointer ppsurf);
1205 boolean all_expose(LiVESWidget *, lives_painter_t *, livespointer psurf);
1241 LiVESResponseType
do_system_failed_error(
const char *com,
int retval,
const char *addinfo,
boolean can_retry,
1256 char *
ds_critical_msg(
const char *dir,
char **mountpoint, uint64_t dsval);
1257 char *
ds_warning_msg(
const char *dir,
char **mountpoint, uint64_t dsval, uint64_t cwarn, uint64_t nwarn);
1272 LiVESResponseType
do_resize_dlg(
int cwidth,
int cheight,
int fwidth,
int fheight);
1287 boolean rdet_suggest_values(
int width,
int height,
double fps,
int fps_num,
int fps_denom,
int arate,
1288 int asigned,
boolean swap_endian,
boolean anr,
boolean ignore_fps);
1290 int arate,
int asigned,
boolean swap_endian,
boolean anr,
boolean save_all);
1338 LiVESResponseType
do_dir_perm_error(
const char *dir_name,
boolean allow_cancel);
1377 void response_ok(LiVESButton *button, livespointer user_data);
1383 void d_print(
const char *fmt, ...);
1396 boolean d_print_urgency(
double timeout_seconds,
const char *fmt, ...);
1397 boolean d_print_overlay(
double timeout_seconds,
const char *fmt, ...);
1403 boolean read_file_details(
const char *file_name,
boolean only_check_for_audio,
boolean open_image);
1404 boolean add_file_info(
const char *check_handle,
boolean aud_only);
1423 void save_file(
int clip,
int start,
int end,
const char *filename);
1428 void save_frame(LiVESMenuItem *menuitem, livespointer user_data);
1429 boolean save_frame_inner(
int clip,
int frame,
const char *file_name,
int width,
int height,
boolean from_osc);
1435 boolean recover_files(
char *recovery_file,
boolean auto_recover);
1441 void backup_file(
int clip,
int start,
int end,
const char *filename);
1447 boolean read_headers(
int clipno,
const char *dir,
const char *file_name);
1485 #define is_layer_ready(layer) (weed_get_boolean_value((layer), WEED_LEAF_THREAD_PROCESSING, NULL) == WEED_FALSE \
1486 && weed_get_voidptr_value(layer, WEED_LEAF_RESIZE_THREAD, NULL) == NULL)
1492 int width,
int height,
int target_palette);
1494 int width,
int height, LiVESInterpType interp,
boolean fordisp);
1498 int height,
int tpalette,
const char *img_ext);
1501 int width,
int height, LiVESError **gerrorptr);
1518 boolean layer_from_png(
int fd,
weed_layer_t *layer,
int width,
int height,
int tpalette,
boolean prog);
1532 void resize(
double scale);
1534 void set_main_title(
const char *filename,
int or_untitled_number);
1541 void set_colours(LiVESWidgetColor *colf, LiVESWidgetColor *colb, LiVESWidgetColor *colf2,
1542 LiVESWidgetColor *colb2, LiVESWidgetColor *coli, LiVESWidgetColor *colt);
1560 void splash_msg(
const char *msg,
double pct);
1563 void get_letterbox_sizes(
int *pwidth,
int *pheight,
int *lb_width,
int *lb_height,
boolean player_can_upscale);
1565 #if GTK_CHECK_VERSION(3, 0, 0)
1566 void calibrate_sepwin_size(
void);
1567 boolean expose_pim(LiVESWidget *, lives_painter_t *, livespointer);
1568 boolean expose_sim(LiVESWidget *, lives_painter_t *, livespointer);
1569 boolean expose_eim(LiVESWidget *, lives_painter_t *, livespointer);
1573 int lives_system(
const char *com,
boolean allow_error);
1574 ssize_t
lives_popen(
const char *com,
boolean allow_error,
char *buff, ssize_t buflen);
1576 int lives_open3(
const char *pathname,
int flags, mode_t mode);
1578 ssize_t
lives_write(
int fd, livesconstpointer buf, ssize_t count,
boolean allow_fail);
1579 ssize_t
lives_write_le(
int fd, livesconstpointer buf, ssize_t count,
boolean allow_fail);
1580 ssize_t
lives_read(
int fd,
void *buf, ssize_t count,
boolean allow_less);
1581 ssize_t
lives_read_le(
int fd,
void *buf, ssize_t count,
boolean allow_less);
1586 #define BUFFER_FILL_BYTES_SMALL 64
1587 #define BUFFER_FILL_BYTES_SMALLMED 1024
1588 #define BUFFER_FILL_BYTES_MED 4096
1589 #define BUFFER_FILL_BYTES_BIGMED 16386
1590 #define BUFFER_FILL_BYTES_LARGE 65536
1592 #define BUFF_SIZE_READ_SMALL 0
1593 #define BUFF_SIZE_READ_SMALLMED 1
1594 #define BUFF_SIZE_READ_MED 2
1595 #define BUFF_SIZE_READ_LARGE 3
1596 #define BUFF_SIZE_READ_CUSTOM -1
1598 #define BUFF_SIZE_WRITE_SMALL 0
1599 #define BUFF_SIZE_WRITE_SMALLMED 1
1600 #define BUFF_SIZE_WRITE_MED 2
1601 #define BUFF_SIZE_WRITE_BIGMED 3
1602 #define BUFF_SIZE_WRITE_LARGE 4
1649 int lives_chdir(
const char *path,
boolean no_error_dlg);
1651 char *
lives_fgets(
char *s,
int size, FILE *stream);
1652 size_t lives_fread(
void *ptr,
size_t size,
size_t nmemb, FILE *stream);
1662 ssize_t
lives_readlink(
const char *path,
char *buf,
size_t bufsiz);
1663 boolean lives_setenv(
const char *name,
const char *value);
1671 int lives_cp(
const char *from,
const char *to);
1674 int lives_mv(
const char *from,
const char *to);
1676 int lives_chmod(
const char *target,
const char *mode);
1677 int lives_cat(
const char *from,
const char *to,
boolean append);
1678 int lives_echo(
const char *text,
const char *to,
boolean append);
1679 int lives_ln(
const char *from,
const char *to);
1697 char *
get_dir(
const char *filename);
1714 void get_location(
const char *exe,
char *val,
int maxlen);
1742 boolean check_file(
const char *file_name,
boolean check_exists);
1747 boolean dirs_equal(
const char *dira,
const char *dirb);
1750 char *
lives_pad(
char *,
size_t minlen,
int align);
1753 void activate_url(LiVESAboutDialog *about,
const char *link, livespointer data);
1766 void calc_maxspect(
int rwidth,
int rheight,
int *cwidth,
int *cheight);
1767 void calc_midspect(
int rwidth,
int rheight,
int *cwidth,
int *cheight);
1768 void calc_minspect(
int rwidth,
int rheight,
int *cwidth,
int *cheight);
1774 int clipno,
int frameno,
double atime,
boolean affects_current);
1776 int frameno,
double atime,
boolean affects_current);
1781 boolean do_std_checks(
const char *type_name,
const char *type,
size_t maxlen,
const char *nreject);
1782 boolean is_legal_set_name(
const char *set_name,
boolean allow_dupes,
boolean leeway);
1789 boolean get_frames_sizes(
int fileno,
int frame_to_test,
int *hsize,
int *vsize);
1798 void add_to_recent(
const char *filename,
double start,
int frames,
const char *file_open_params);
1800 void set_undoable(
const char *what,
boolean sensitive);
1801 void set_redoable(
const char *what,
boolean sensitive);
1810 void minimise_aspect_delta(
double allowed_aspect,
int hblock,
int vblock,
int hsize,
int vsize,
int *width,
int *height);
1818 LiVESList *
buff_to_list(
const char *buffer,
const char *delim,
boolean allow_blanks,
boolean strip);
1821 LiVESList *
get_set_list(
const char *dir,
boolean utf8);
1823 char *
subst(
const char *
string,
const char *from,
const char *to);
1833 #define cfile mainw->files[mainw->current_file]
1834 #define CLIPBOARD_FILE 0
1835 #define clipboard mainw->files[CLIPBOARD_FILE]
1837 #define LIVES_TV_CHANNEL1 "http://www.serverwillprovide.com/sorteal/livestvclips/livestv.ogm"
1843 #define LIVES_NO_DEBUG
1845 #ifndef LIVES_NO_DEBUG
1846 #define LIVES_DEBUG(x) fprintf(stderr, "LiVES debug: %s\n", x)
1847 #else // LIVES_NO_DEBUG
1848 #define LIVES_DEBUG(x) dummychar = x
1849 #endif // LIVES_NO_DEBUG
1850 #endif // LIVES_DEBUG
1853 #ifndef LIVES_NO_INFO
1854 #define LIVES_INFO(x) fprintf(stderr, "LiVES info: %s\n", x)
1855 #else // LIVES_NO_INFO
1856 #define LIVES_INFO(x) dummychar = x
1857 #endif // LIVES_NO_INFO
1858 #endif // LIVES_INFO
1861 #ifndef LIVES_NO_WARN
1862 #define LIVES_WARN(x) fprintf(stderr, "LiVES warning: %s\n", x)
1863 #else // LIVES_NO_WARN
1864 #define LIVES_WARN(x) dummychar = x
1865 #endif // LIVES_NO_WARN
1866 #endif // LIVES_WARN
1869 #ifndef LIVES_NO_ERROR
1870 #define LIVES_ERROR(x) {fprintf(stderr, "LiVES ERROR: %s\n", x); break_me(x);}
1871 #else // LIVES_NO_ERROR
1872 #define LIVES_ERROR(x) dummychar = x
1873 #endif // LIVES_NO_ERROR
1874 #endif // LIVES_ERROR
1876 #ifndef LIVES_CRITICAL
1877 #ifndef LIVES_NO_CRITICAL
1878 #define LIVES_CRITICAL(x) {fprintf(stderr, "LiVES CRITICAL: %s\n", x); break_me(x); raise (LIVES_SIGSEGV);}
1879 #else // LIVES_NO_CRITICAL
1880 #define LIVES_CRITICAL(x) dummychar = x
1881 #endif // LIVES_NO_CRITICAL
1882 #endif // LIVES_CRITICAL
1885 #ifndef LIVES_NO_FATAL
1886 #define LIVES_FATAL(x) {fprintf(stderr, "LiVES FATAL: %s\n", x); lives_notify(LIVES_OSC_NOTIFY_QUIT, x), \
1887 break_me(x); _exit (1);}
1888 #else // LIVES_NO_FATAL
1889 #define LIVES_FATAL(x) dummychar = x
1890 #endif // LIVES_NO_FATAL
1891 #endif // LIVES_FATAL
1893 #ifndef USE_STD_MEMFUNCS
1895 #ifdef _lives_malloc
1897 #define lives_malloc _lives_malloc
1899 #ifdef _lives_realloc
1900 #undef lives_realloc
1901 #define lives_realloc _lives_realloc
1905 #define lives_free _lives_free
1907 #ifdef _lives_memcpy
1909 #define lives_memcpy _lives_memcpy
1911 #ifdef _lives_memcmp
1913 #define lives_memcmp _lives_memcmp
1915 #ifdef _lives_memset
1917 #define lives_memset _lives_memset
1919 #ifdef _lives_memmove
1920 #undef lives_memmove
1921 #define lives_memmove _lives_memmove
1923 #ifdef _lives_calloc
1925 #define lives_calloc _lives_calloc
1934 #define RESEEK_ENABLE
1937 #endif // #ifndef HAS_LIVES_MAIN_H
weed_plant_t * event_list_back
boolean lives_freep(void **ptr)
boolean is_writeable_dir(const char *dir)
void do_program_not_found_error(const char *progname)
void clear_mainw_msg(void)
boolean lives_setenv(const char *name, const char *value)
LiVESResponseType do_header_read_error_with_retry(int clip) WARN_UNUSED
void pull_frame_threaded(weed_layer_t *layer, const char *img_ext, ticks_t tc, int width, int height)
uint8_t * ptr
buffer size for write, bytes left to read in case of read
void lives_buffered_rdonly_slurp(int fd, off_t skip)
void catch_sigint(int signum)
@ CLIP_DETAILS_HEADER_VERSION
void pump_io_chan(LiVESIOChannel *iochan)
void do_quick_switch(int new_file)
void unfade_background(void)
void do_encoder_img_fmt_error(render_details *rdet)
void * lives_pixbuf_save_threaded(void *saveargs)
save frame to pixbuf in a thread.
ticks_t lives_get_current_playback_ticks(ticks_t origsecs, ticks_t origusecs, lives_time_source_t *time_source)
lives_file_buffer_t * get_file_buffer(int fd)
lives_checkstatus_t has_curl
lives_img_type_t lives_image_type_to_img_type(const char *lives_image_type)
void add_to_ascrap_mb(uint64_t bytes)
void do_write_failed_error_s(const char *filename, const char *addinfo)
boolean recover_files(char *recovery_file, boolean auto_recover)
void do_rmem_max_error(int size)
void fade_background(void)
boolean do_save_clipset_warn(void)
boolean check_dir_access(const char *dir, boolean leaveit)
void set_undoable(const char *what, boolean sensitive)
ssize_t lives_readlink(const char *path, char *buf, size_t bufsiz)
LiVESResponseType do_dir_perm_error(const char *dir_name, boolean allow_cancel)
void procw_desensitize(void)
boolean prepare_to_play_foreign(void)
boolean start_playback(int type)
Header file for liblives.
int lives_list_strcmp_index(LiVESList *list, livesconstpointer data, boolean case_sensitive)
void resize(double scale)
volatile off64_t aseek_pos
audio seek posn. (bytes) for when we switch clips
frames_t calc_new_playback_position(int fileno, ticks_t otc, ticks_t *ntc)
boolean ask_permission_dialog_complex(int what, char **argv, int argc, int offs, const char *sudocom)
lives_interlace_t interlace
interlace type (if known - none, topfirst, bottomfirst or : see plugins.h)
char * ds_warning_msg(const char *dir, char **mountpoint, uint64_t dsval, uint64_t cwarn, uint64_t nwarn)
@ CLIP_TYPE_VIDEODEV
frames from video device
boolean do_mt_rect_prompt(void)
@ CLIP_DETAILS_RESERVED15
void wait_for_stop(const char *stop_command)
void make_custom_submenus(void)
boolean render_choice_idle(livespointer data)
uint32_t get_approx_ln(uint32_t val) GNU_CONST
boolean lives_read_buffered_eof(int fd)
void do_no_sets_dialog(const char *dir)
lives_checkstatus_t has_smogrify
int lives_cp_recursive(const char *from, const char *to, boolean incl_dir)
void get_letterbox_sizes(int *pwidth, int *pheight, int *lb_width, int *lb_height, boolean player_can_upscale)
calculate sizes for letterboxing
boolean lives_unsetenv(const char *name)
void set_default_comment(lives_clip_t *sfile, const char *extrat)
uint64_t lives_10pow(int pow) GNU_CONST
boolean rdet_suggest_values(int width, int height, double fps, int fps_num, int fps_denom, int arate, int asigned, boolean swap_endian, boolean anr, boolean ignore_fps)
boolean paste_enough_dlg(int lframe)
char * lives_pad_ellipsize(char *, size_t fixlen, int padlen, LiVESEllipsizeMode mode)
@ CANCEL_USER_PAUSED
cancelled and paused
boolean get_frames_sizes(int fileno, int frame_to_test, int *hsize, int *vsize)
void lives_sync(int times)
ssize_t lives_read_le(int fd, void *buf, ssize_t count, boolean allow_less)
boolean check_for_disk_space(boolean fullcheck)
void wait_for_cleaner(void)
void activate_url_inner(const char *link)
const char * version(void)
void do_mt_no_jack_error(int warn_mask)
void do_no_autolives_error(void)
boolean can_write_to_config
weed_plant_t * event_list
lives_checkstatus_t has_pulse_audio
@ CLIP_DETAILS_RESERVED10
boolean do_header_write_error(int clip)
boolean check_for_recovery_files(boolean auto_recover)
uint64_t get_approx_ln64(uint64_t x) GNU_CONST
boolean findex_bk_dialog(const char *fname_back)
lives_checkstatus_t has_autolives
int lives_cp(const char *from, const char *to)
void play_file(void)
play the current clip from 'mainw->play_start' to 'mainw->play_end'
boolean after_foreign_play(void)
char * lives_ellipsize(char *, size_t maxlen, LiVESEllipsizeMode mode)
void do_after_crash_warning(void)
boolean string_lists_differ(LiVESList *, LiVESList *)
lives_checkstatus_t has_midistartstop
lives_checkstatus_t has_youtube_dl
lives_checkstatus_t has_ffmpeg
void * ext_src
points to opaque source for non-disk types
void do_rendered_fx_dialog(void)
void do_cd_error_dialog(void)
int count_resampled_frames(int in_frames, double orig_fps, double resampled_fps)
int lives_chmod(const char *target, const char *mode)
lives_checkstatus_t has_du
LiVESResponseType do_file_perm_error(const char *file_name, boolean allow_cancel)
void do_encoder_sox_error(void)
@ CANCEL_APP_QUIT
application quit
boolean lives_fsync(int fd)
boolean restore_clip_binfmt(int clipno)
double lives_fix(double val, int decimals) GNU_CONST
int lives_cat(const char *from, const char *to, boolean append)
void update_play_times(void)
like get_play_times, but will force redraw of audio waveforms
void do_aud_during_play_error(void)
void get_dirname(char *filename)
lives_checkstatus_t has_wmctrl
int calc_frame_from_time(int filenum, double time)
nearest frame [1, frames]
lives_checkstatus_t has_identify
float ** audio_waveform
values for drawing the audio wave
int bpp
bits per pixel of the image frames, 24 or 32
off_t lives_lseek_buffered_rdonly_absolute(int fd, off_t offset)
boolean no_proc_sys_errors
skip system error dialogs in processing
LiVESList * lives_list_sort_alpha(LiVESList *list, boolean fwd)
boolean open_scrap_file(void)
frames_t frames
number of video frames
lives_clip_type_t clip_type
weed_leaf_num_elements_f _weed_leaf_num_elements
void do_audrate_error_dialog(void)
boolean lives_string_ends_with(const char *string, const char *fmt,...)
boolean d_print_urgency(double timeout_seconds, const char *fmt,...)
boolean do_layout_alter_audio_warning(void)
void threaded_dialog_pop(void)
void do_clip_divergence_error(int fileno)
void update_progress(boolean visible)
boolean do_reload_set_query(void)
int lives_open2(const char *pathname, int flags)
void set_interactive(boolean interactive)
void pad_init_silence(void)
void load_frame_image(int frame)
int verhash(char *version)
boolean do_mt_lb_warn(boolean lb)
lives_checkstatus_t has_mktemp
int lives_open3(const char *pathname, int flags, mode_t mode)
weed_leaf_set_flags_f _weed_leaf_set_flags
weed_plantptr_t lives_proc_thread_t
lives proc_threads API
@ LIVES_DIRECTION_FORWARD
void set_colours(LiVESWidgetColor *colf, LiVESWidgetColor *colb, LiVESWidgetColor *colf2, LiVESWidgetColor *colb2, LiVESWidgetColor *coli, LiVESWidgetColor *colt)
boolean check_for_ratio_fps(double fps)
int calc_frame_from_time2(int filenum, double time)
nearest frame [1, frames+1]
boolean add_lmap_error(lives_lmap_error_t lerror, const char *name, livespointer user_data, int clipno, int frameno, double atime, boolean affects_current)
char * lives_pad(char *, size_t minlen, int align)
boolean do_theme_exists_warn(const char *themename)
boolean needs_update
loaded values were incorrect, update header
boolean lives_alarm_clear(lives_alarm_t alarm_handle)
void do_threaded_dialog(const char *translated_text, boolean has_cancel)
boolean startup_message_info(const char *msg)
@ CANCEL_KILL
normal - kill background processes working on current clip
weed_plant_free_f _weed_plant_free
void calc_aframeno(int fileno)
void free_track_decoders(void)
size_t get_token_count(const char *string, int delim)
void do_locked_in_vdevs_error(void)
@ CLIP_TYPE_GENERATOR
frames from generator plugin
double pointer_time
pointer time in timeline, + the playback start posn for clipeditor (unless playing the selection)
@ CLIP_DETAILS_RESERVED21
boolean lives_buffered_rdonly_set_reversed(int fd, boolean val)
@ CANCEL_USER
user pressed stop
void add_resnn_label(LiVESDialog *dialog)
double calc_time_from_frame(int clip, int frame)
boolean has_binfmt
DO NOT remove or alter any fields before this ^^^^^.
uint64_t * cache_objects
for future use
boolean get_clip_value(int which, lives_clip_details_t, void *retval, size_t maxlen)
void do_no_in_vdevs_error(void)
void do_dir_perm_access_error(const char *dir_name)
LiVESResponseType do_error_dialogf(const char *fmt,...)
boolean do_warning_dialog(const char *text)
lives_img_type_t lives_image_ext_to_img_type(const char *img_ext)
void do_set_load_lmap_error(void)
boolean do_yuv4m_open_warning(void)
boolean prompt_remove_layout_files(void)
char * workdir_ch_warning(void)
boolean do_warning_dialogf(const char *fmt,...)
int lives_open_buffered_rdonly(const char *pathname)
boolean load_from_scrap_file(weed_layer_t *layer, int frame)
boolean resize_message_area(livespointer data)
lives_checkstatus_t has_composite
int lives_touch(const char *tfile)
boolean ensure_isdir(char *fname)
char * dump_messages(int start, int end)
uint64_t make_version_hash(const char *ver)
void splash_msg(const char *msg, double pct)
@ UNDO_REC_AUDIO
record audio to selection
@ CLIP_DETAILS_RESERVED12
LiVESInterpType get_interp_value(short quality, boolean low_for_mt)
char * unhash_version(uint64_t version)
void do_mt_set_mem_error(boolean has_mt)
int lives_cp_keep_perms(const char *from, const char *to)
int create_nullvideo_clip(const char *handle)
boolean rewrite_recovery_file(void)
char * clip_detail_to_string(lives_clip_details_t what, size_t *maxlenp)
char * get_dir(const char *filename)
@ CLIP_DETAILS_RESERVED26
lives_img_type_t img_type
boolean do_move_workdir_dialog(void)
@ UNDO_RENDER
resample/reorder/resize/apply effects
boolean startup_message_choice(const char *msg, int msgtype)
@ CLIP_TYPE_TEMP
temp type, for internal use only
@ CLIP_TYPE_DISK
imported video, broken into frames
lives_checkstatus_t has_xdotool
double real_pointer_time
pointer time in timeline, can extend beyond video, for audio
@ CLIP_DETAILS_RESERVED30
void do_do_not_close_d(void)
void do_chdir_failed_error(const char *dir)
void set_signal_handlers(SignalHandlerPointer sigfunc)
void do_card_in_use_error(void)
void fullscreen_internal(void)
weed_plant_t * next_event
int save_to_scrap_file(weed_layer_t *layer)
ssize_t lives_read_buffered(int fd, void *buf, ssize_t count, boolean allow_less)
lives_file_buffer_t * find_in_file_buffers_by_pathname(const char *pathname)
boolean do_set_rename_old_layouts_warning(const char *new_set)
size_t * aw_sizes
size of each audio_waveform in units of floats (i.e 4 bytes)
void do_splash_progress(void)
lives_checkstatus_t has_mpv
lives_checkstatus_t has_gio
lives_direction_t
use REVERSE / FORWARD when a sign is used, BACKWARD / FORWARD when a parity is used
void find_when_to_stop(void)
boolean check_frame_count(int idx, boolean last_chkd)
check number of frames is correct for files of type CLIP_TYPE_DISK
void do_optarg_blank_err(const char *what)
void lives_slist_free_all(LiVESSList **)
boolean do_layout_recover_dialog(void)
@ MISSING
not yet implemented (TODO)
boolean add_file_info(const char *check_handle, boolean aud_only)
boolean checked
thumbnail cache, list of lives_tcache_entry_t
void do_jack_noopen_warn(void)
boolean do_please_install(const char *exec, uint64_t guidance_flags)
lives_pid_t lives_fork(const char *com)
void open_set_file(int clipnum)
boolean write_headers(lives_clip_t *file)
boolean no_proc_read_errors
skip read error dialogs in processing
void do_set_noclips_error(const char *setname)
void do_audio_import_error(void)
weed_plant_list_leaves_f _weed_plant_list_leaves
int get_frame_count(int idx, int xsize)
sets mainw->files[idx]->frames with current framecount
lives_checkstatus_t has_gconftool_2
int lives_echo(const char *text, const char *to, boolean append)
int lives_open_buffered_writer(const char *pathname, int mode, boolean append)
void do_abortblank_error(const char *what)
void do_need_mplayer_mpv_dialog(void)
@ CANCEL_ERROR
cancelled because of error
int lives_utf8_strcasecmp(const char *s1, const char *s2)
@ CLIP_DETAILS_PB_FRAMENO
void close_ascrap_file(boolean remove)
ssize_t lives_write_le_buffered(int fd, livesconstpointer buf, ssize_t count, boolean allow_fail)
boolean reload_clip(int fileno, int maxframe)
char * get_menu_name(lives_clip_t *sfile, boolean add_set)
lives_checkstatus_t has_encoder_plugins
lives_whentostop_t
which stream end should cause playback to finish ?
int stored_layout_idx
M highest value used.
lives_proc_thread_t pumper
LiVESWidget * create_question_dialog(const char *title, const char *text)
void set_sel_label(LiVESWidget *label)
lives_checkstatus_t has_ffprobe
int cb_src
source clip for clipboard; for other clips, may be used to hold some temporary linkage
LiVESResponseType do_info_dialog_with_expander(const char *text, const char *exp_text, LiVESList *)
void do_need_mplayer_dialog(void)
boolean do_existing_subs_warning(void)
boolean create_event_space(int length_in_eventsb)
lives_checkstatus_t has_icedax
void d_print(const char *fmt,...)
void recover_layout_map(int numclips)
char * get_val_from_cached_list(const char *key, size_t maxlen, LiVESList *cache)
boolean do_yesno_dialog(const char *text)
void do_bad_layout_error(void)
@ LIVES_DIRECTION_REVERSE
boolean int_array_contains_value(int *array, int num_elems, int value)
int undo_arate
audio playback rate
lives_presence_t lives_checkstatus_t
void open_fw_device(void)
char * xdg_session_desktop
void do_autolives_needs_clips_error(void)
LiVESList * get_set_list(const char *dir, boolean utf8)
void do_mt_audchan_error(int warn_mask)
void defer_sigint(int signum)
void get_player_size(int *opwidth, int *opheight)
size_t get_read_buff_size(int sztype)
const char * get_cache_stats(void)
weed_leaf_delete_f _weed_leaf_delete
lives_img_type_t img_type
boolean do_foundclips_query(void)
void get_basename(char *filename)
boolean no_proc_write_errors
skip write error dialogs in processing
void do_jack_noopen_warn2(void)
boolean all_expose(LiVESWidget *, lives_painter_t *, livespointer psurf)
boolean check_backend_return(lives_clip_t *sfile)
void backup_file(int clip, int start, int end, const char *filename)
boolean lives_make_writeable_dir(const char *newdir)
@ CANCEL_VID_END
video playback completed
uint32_t signed_endian
bitfield
void reset_message_area(void)
size_t lives_fread_string(char *buff, size_t stlen, const char *fname)
@ CLIP_TYPE_FILE
unimported video, not or partially broken in frames
void do_upgrade_error_dialog(void)
resample_event * resample_events
for block resampler
int lives_mv(const char *from, const char *to)
void(* SignalHandlerPointer)(int)
void maybe_add_mt_idlefunc(void)
lives_checkstatus_t has_xdg_screensaver
weed_leaf_get_f _weed_leaf_get
void add_to_recent(const char *filename, double start, int frames, const char *file_open_params)
frames_t * frame_index
index of frames for CLIP_TYPE_FILE >0 means corresponding frame within original clip -1 means corresp...
@ CANCEL_NO_MORE_PREVIEW
ran out of preview frames
void d_print_file_error_failed(void)
boolean ratio_fps
framerate of the clip
boolean save_frame_inner(int clip, int frame, const char *file_name, int width, int height, boolean from_osc)
boolean d_print_overlay(double timeout_seconds, const char *fmt,...)
ulong deduce_file(const char *filename, double start_time, int end)
lives_clip_t * create_cfile(int new_file, const char *handle, boolean is_loaded)
set default values for a clip (in memory)
void cached_list_free(LiVESList **list)
void reset_clipmenu(void)
int lives_rmglob(const char *files)
@ LIVES_DIRECTION_BACKWARD
void response_ok(LiVESButton *button, livespointer user_data)
void save_frame(LiVESMenuItem *menuitem, livespointer user_data)
void do_encoder_acodec_error(void)
void switch_aud_to_none(boolean set_pref)
boolean do_layout_alter_frames_warning(void)
void calc_minspect(int rwidth, int rheight, int *cwidth, int *cheight)
@ CLIP_DETAILS_RESERVED13
void d_print_failed(void)
char * lives_fgets(char *s, int size, FILE *stream)
lives_checkstatus_t has_mplayer
lives_clip_t * clip_forensic(int clipno)
boolean set_palette_colours(boolean force_reload)
@ LIVES_INTERLACE_TOP_FIRST
void get_location(const char *exe, char *val, int maxlen)
void do_jack_lost_conn_error(void)
off_t lives_buffered_offset(int fd)
boolean do_please_install_either(const char *exec, const char *exec2)
ssize_t lives_write_le(int fd, livesconstpointer buf, ssize_t count, boolean allow_fail)
@ CANCEL_PREVIEW_FINISHED
effect processing finished during preview
const char * image_ext_to_lives_image_type(const char *img_ext)
lives_cancel_t
cancel reason
boolean save_clip_value(int which, lives_clip_details_t, void *val)
void do_mt_undo_buf_error(void)
boolean can_read_from_config
boolean check_for_lock_file(const char *set_name, int type)
check for set lock file do this via the back-end (smogrify) this allows for the locking scheme to be ...
lives_checkstatus_t has_file
boolean switch_aud_to_jack(boolean set_pref)
weed_plant_t * get_nth_info_message(int n)
char * remove_trailing_zeroes(double val)
boolean switch_audio_clip(int new_file, boolean activate)
weed_plant_new_f _weed_plant_new
ulong restore_file(const char *filename)
weed_leaf_set_f _weed_leaf_set
char * xdg_current_desktop
LiVESXWindow * root_window
void do_dvgrab_error(void)
lives_checkstatus_t has_pip
int lives_close_buffered(int fd)
void add_to_recovery_file(const char *handle)
void do_messages_window(boolean is_startup)
_palette * palette
interface colour settings
@ CLIP_DETAILS_RESERVED11
double freeze_fps
pb_fps for paused / frozen clips
LiVESResponseType do_abort_ok_dialog(const char *text)
int lives_killpg(lives_pgid_t pgrp, int sig)
boolean open_ascrap_file(void)
LiVESList * lives_list_copy_strings(LiVESList *list)
boolean read_file_details(const char *file_name, boolean only_check_for_audio, boolean open_image)
boolean check_for_executable(lives_checkstatus_t *cap, const char *exec)
frames_t * frame_index_back
for undo
LiVESPixbuf * pull_lives_pixbuf_at_size(int clip, int frame, const char *image_ext, ticks_t tc, int width, int height, LiVESInterpType interp, boolean fordisp)
void save_file(int clip, int start, int end, const char *filename)
void load_end_image(int frame)
@ CLIP_DETAILS_RESERVED27
void close_scrap_file(boolean remove)
int close_temp_handle(int new_clip)
close cfile and switch to new clip (may be -1)
void do_layout_scrap_file_error(void)
LiVESResponseType do_system_failed_error(const char *com, int retval, const char *addinfo, boolean can_retry, boolean try_sudo)
char * ds_critical_msg(const char *dir, char **mountpoint, uint64_t dsval)
warn about disk space
int calc_frame_from_time4(int filenum, double time)
nearest frame, no maximum
void get_filename(char *filename, boolean strip_dir)
lives_checkstatus_t has_dvgrab
@ CLIP_DETAILS_DECODER_NAME
void init_track_decoders(void)
void play_start_timer(int type)
@ CLIP_DETAILS_RESERVED23
void do_lb_convert_error(void)
@ LIVES_INTERLACE_BOTTOM_FIRST
LiVESResponseType do_error_dialog_with_check(const char *text, uint64_t warn_mask_number)
int arps
audio physical sample rate (i.e the "normal" sample rate of the clip when played at 1,...
void do_nojack_rec_error(void)
void get_total_time(lives_clip_t *file)
calculate laudio, raudio and video time (may be deprecated and replaced with macros)
boolean do_abort_check(void)
LiVESList * lives_list_append_unique(LiVESList *xlist, const char *add)
char * subst(const char *string, const char *from, const char *to)
@ CLIP_DETAILS_RESERVED17
weed_leaf_get_flags_f _weed_leaf_get_flags
void set_redoable(const char *what, boolean sensitive)
int lives_rmdir(const char *dir, boolean force)
@ CLIP_TYPE_LIVES2LIVES
type for LiVES to LiVES streaming
boolean get_screen_usable_size(int *w, int *h)
void reset_playback_clock(void)
LiVESPixbuf * pull_lives_pixbuf(int clip, int frame, const char *image_ext, ticks_t tc)
boolean switch_aud_to_pulse(boolean set_pref)
frames_t tcache_dubious_from
height for thumbnail cache (width is fixed, but if this changes, invalidate)
boolean ask_permission_dialog(int what)
boolean deinterlace
auto deinterlace
int lives_create_buffered(const char *pathname, int mode)
weed_plant_t weed_layer_t
uint64_t unique_id
this and the handle can be used to uniquely id a file
void lives_list_free_all(LiVESList **)
char * ensure_extension(const char *fname, const char *ext) WARN_UNUSED
boolean can_write_to_workdir
@ CANCEL_KEEP_LOOPING
special cancel for TV toy
uint64_t get_version_hash(const char *exe, const char *sep, int piece)
int hsize
frame width (horizontal) in pixels (NOT macropixels !)
boolean read_headers(int clipno, const char *dir, const char *file_name)
boolean needs_silent_update
needs internal update, we shouldn't concern the user
void minimise_aspect_delta(double allowed_aspect, int hblock, int vblock, int hsize, int vsize, int *width, int *height)
@ CLIP_TYPE_NULL_VIDEO
generates blank video frames
void calc_midspect(int rwidth, int rheight, int *cwidth, int *cheight)
ssize_t lives_read(int fd, void *buf, ssize_t count, boolean allow_less)
LiVESResponseType do_memory_error_dialog(char *op, size_t bytes)
LiVESWidget * create_message_dialog(lives_dialog_t diat, const char *text, int warn_mask_number)
@ CANCEL_GENERATOR_END
generator was stopped
boolean do_close_changed_warn(void)
boolean do_yesno_dialogf(const char *fmt,...)
float vol
relative volume level / gain; sizeof array will be equal to achans
@ UNDO_ATOMIC_RESAMPLE_RESIZE
resample/resize and resample audio for encoding
frames_t last_vframe_played
void switch_to_file(int old_file, int new_file)
boolean do_warning_dialog_with_check(const char *text, uint64_t warn_mask_number)
boolean do_encoder_restrict_dialog(int width, int height, double fps, int fps_num, int fps_denom, int arate, int asigned, boolean swap_endian, boolean anr, boolean save_all)
boolean startup_message_nonfatal(const char *msg)
LiVESResponseType do_read_failed_error_s_with_retry(const char *fname, const char *errtext) WARN_UNUSED
void load_preview_image(boolean update_always)
int hextodec(const char *string)
double get_ratio_fps(const char *string)
float LEFloat_to_BEFloat(float f) GNU_CONST
void show_manual_section(const char *lang, const char *section)
frames_t fx_frame_pump
rfx frame pump for virtual clips (CLIP_TYPE_FILE)
ssize_t lives_popen(const char *com, boolean allow_error, char *buff, ssize_t buflen)
char * wm_type
window manager type, e.g. x11
@ CANCEL_AUDIO_ERROR
cancelled because of soundcard error
boolean save_file_comments(int fileno)
LiVESList * buff_to_list(const char *buffer, const char *delim, boolean allow_blanks, boolean strip)
weed_leaf_element_size_f _weed_leaf_element_size
boolean lazy_startup_checks(void *data)
@ CANCEL_CAPTURE_ERROR
image could not be captured
ticks_t lives_alarm_check(lives_alarm_t alarm_handle)
void break_me(const char *dtl)
int save_event_frames(void)
uint8_t * buffer
read point in buffer
frames_t old_frames
for deordering, etc.
void d_print_cancelled(void)
@ CANCEL_RETRY
an error occurred, retry the operation
int lives_ln(const char *from, const char *to)
@ CLIP_TYPE_YUV4MPEG
yuv4mpeg stream
void wait_for_bg_audio_sync(int fileno)
struct _lives_clip_t lives_clip_t
void lives_list_free_strings(LiVESList *)
lives_checkstatus_t has_xwininfo
lives_checkstatus_t has_mplayer2
void do_jack_noopen_warn4(void)
ssize_t lives_read_le_buffered(int fd, void *buf, ssize_t count, boolean allow_less)
void startup_message_fatal(char *msg) GNU_NORETURN
lives_checkstatus_t has_md5sum
uint32_t undo_signed_endian
size_t lives_buffered_orig_size(int fd)
boolean nopreview
don't show preview/pause buttons on processing
void do_mt_backup_space_error(lives_mt *, int memreq_mb)
void do_no_decoder_error(const char *fname)
char * filename_from_fd(char *val, int fd)
: return filename from an open fd, freeing val first
boolean can_write_to_config_new
boolean do_set_locked_warning(const char *setname)
char * make_image_file_name(lives_clip_t *clip, frames_t frame, const char *img_ext)
lives_image_type can be a string, lives_img_type_t is an enumeration
int add_messages_to_list(const char *text)
frames_t frame
list of entries in clip thumbnail cache (for multitrack timeline)
@ CLIP_DETAILS_GAMMA_TYPE
LiVESList * tcache
set by clip alterations, frames from here onwards should be freed
int lives_kill(lives_pid_t pid, int sig)
@ CLIP_DETAILS_RESERVED14
boolean pull_frame(weed_layer_t *layer, const char *image_ext, ticks_t tc)
LiVESResponseType do_file_notfound_dialog(const char *detail, const char *dirname)
void do_mt_no_audchan_error(void)
void do_jack_noopen_warn3(void)
void zero_spinbuttons(void)
boolean smog_version_correct
off_t lives_lseek_buffered_rdonly(int fd, off_t offset)
int lives_rmdir_with_parents(const char *dir)
lives_checkstatus_t has_jackd
lives_checkstatus_t has_sox_sox
ulong open_file(const char *filename)
void lives_suspend_resume_process(const char *dirname, boolean suspend)
void do_dev_busy_error(const char *devstr)
char * wm_name
window manager name, may be different from wm_caps.wwm_name
capability * get_capabilities(void)
void do_no_loadfile_error(const char *fname)
boolean weed_layer_create_from_file_progressive(weed_layer_t *layer, const char *fname, int width, int height, int tpalette, const char *img_ext)
void buffer_lmap_error(lives_lmap_error_t lerror, const char *name, livespointer user_data, int clipno, int frameno, double atime, boolean affects_current)
boolean lives_pixbuf_save(LiVESPixbuf *pixbuf, char *fname, lives_img_type_t imgtype, int quality, int width, int height, LiVESError **gerrorptr)
Save a pixbuf to a file using the specified imgtype and the specified quality/compression value.
void set_drawing_area_from_pixbuf(LiVESWidget *darea, LiVESPixbuf *pixbuf, lives_painter_surface_t *)
const char * get_image_ext_for_type(lives_img_type_t imgtype)
boolean all_config(LiVESWidget *, LiVESXEventConfigure *, livespointer ppsurf)
genric func. to create surfaces
void perf_mem_warning(void)
off_t lives_lseek_buffered_writer(int fd, off_t offset)
void set_preview_box_colours(void)
void do_read_failed_error_s(const char *filename, const char *addinfo)
void do_shutdown_msg(void)
LiVESResponseType do_resize_dlg(int cwidth, int cheight, int fwidth, int fheight)
boolean check_storage_space(int clipno, boolean is_processing)
void do_lb_composite_error(void)
@ CLIP_DETAILS_RESERVED19
int lives_chdir(const char *path, boolean no_error_dlg)
void d_print_enough(int frames)
@ CLIP_DETAILS_RESERVED22
int lives_fputs(const char *s, FILE *stream)
void reload_subs(int fileno)
off_t offset
ptr to data (ptr - buffer + bytes) gives the read size
LiVESResponseType handle_backend_errors(boolean can_retry)
boolean do_yesno_dialog_with_check(const char *text, uint64_t warn_mask_number)
void do_decoder_palette_error(void)
void unblock_expose(void)
void do_bad_theme_error(const char *themefile)
void threaded_dialog_spin(double fraction)
void do_layout_ascrap_file_error(void)
LiVESPixbuf * lives_pixbuf_new_blank(int width, int height, int palette)
LiVESResponseType do_abort_retry_dialog(const char *text)
int lives_utf8_strcmp(const char *s1, const char *s2)
ssize_t lives_buffered_write_printf(int fd, boolean allow_fail, const char *fmt,...)
double pb_fps
current playback rate, may vary from fps, can be 0. or negative
@ CANCEL_INTERNAL_ERROR
software error: e.g set mainw->current_file directly during pb instead of mainw->new_clip
char * get_extension(const char *filename)
void lives_kill_subprocesses(const char *dirname, boolean kill_parent)
void frame_size_update(void)
void set_main_title(const char *filename, int or_untitled_number)
int free_n_msgs(int frval)
boolean do_comments_dialog(int fileno, char *filename)
ssize_t lives_write_buffered(int fd, const char *buf, ssize_t count, boolean allow_fail)
@ CANCEL_KEEP
user pressed 'Keep'
LiVESList * lives_list_move_to_first(LiVESList *list, LiVESList *item) WARN_UNUSED
int lives_system(const char *com, boolean allow_error)
boolean keep_without_preview
allow keep, even when nopreview is set - TODO use only nopreview and nokeep
boolean do_std_checks(const char *type_name, const char *type, size_t maxlen, const char *nreject)
char * get_untitled_name(int number)
void disable_record(void)
@ CANCEL_EVENT_LIST_END
event_list completed
weed_leaf_seed_type_f _weed_leaf_seed_type
LiVESResponseType do_imgfmts_error(lives_img_type_t imgtype)
lives_checkstatus_t has_sox_play
void init_clipboard(void)
boolean do_gamma_import_warn(uint64_t fv, int gamma_type)
LiVESResponseType do_info_dialogf(const char *fmt,...)
int vsize
frame height (vertical) in pixels
@ CANCEL_EXTERNAL_ENDED
external process ended (e.g. autolives uncheck)
uint64_t get_near2pow(uint64_t val) GNU_CONST
lives_painter_surface_t * raudio_drawable
int calc_frame_from_time3(int filenum, double time)
nearest frame rounded down, [1, frames+1]
void close_current_file(int file_to_switch_to)
close current file, and try to switch to file_to_switch_to
@ CLIP_DETAILS_RESERVED29
void do_no_mplayer_sox_error(void)
void threaded_dialog_push(void)
LiVESList * lives_list_delete_string(LiVESList *, const char *string) WARN_UNUSED
int lives_create_buffered_nosync(const char *pathname, int mode)
void load_theme_images(void)
void get_play_times(void)
recalculate video / audio lengths and draw the timer bars
corresponds to one clip in the GUI
@ CANCEL_SOFT
just cancel in GUI (for keep, etc)
lives_checkstatus_t has_gdb
char * insert_newlines(const char *text, int maxwidth)
@ CLIP_DETAILS_RESERVED28
void do_invalid_subs_error(void)
void do_after_invalid_warning(void)
void clear_lmap_errors(void)
ssize_t lives_write(int fd, livesconstpointer buf, ssize_t count, boolean allow_fail)
void activate_url(LiVESAboutDialog *about, const char *link, livespointer data)
lives_checkstatus_t has_convert
int process_one(boolean visible)
boolean do_clipboard_fps_warning(void)
boolean opening_only_audio
boolean switch_aud_to_sox(boolean set_pref)
LiVESResponseType do_abort_cancel_retry_dialog(const char *text) WARN_UNUSED
double stored_layout_audio
frames_t stored_layout_frame
experimental for player
lives_checkstatus_t has_youtube_dlc
LiVESResponseType do_dir_notfound_dialog(const char *detail, const char *dirname)
void do_abort_dialog(const char *text)
@ CANCEL_AUD_END
video playback completed
lives_checkstatus_t has_perl
void do_bad_theme_import_error(const char *theme_file)
ulong open_file_sel(const char *file_name, double start_time, int frames)
LiVESResponseType do_error_dialog(const char *text)
lives_checkstatus_t has_gzip
lives_time_source_t
timebase sources
void too_many_files(void)
@ CANCEL_NO_PROPOGATE
cancel but keep opening
lives_file_buffer_t * find_in_file_buffers(int fd)
boolean startup_message_nonfatal_dismissable(const char *msg, uint64_t warning_mask)
LiVESWindow * get_transient_full()
lives_checkstatus_t has_cdda2wav
void do_mt_undo_mem_error(void)
int asampsize
audio sample size in bits (8 or 16)
LiVESResponseType do_write_failed_error_s_with_retry(const char *fname, const char *errtext) WARN_UNUSED
@ CLIP_DETAILS_RESERVED20
void workdir_warning(void)
char * repl_workdir(const char *entry, boolean fwd)
boolean do_sub_type_warning(const char *ext, const char *type_ext)
@ CLIP_DETAILS_RESERVED24
void do_vpp_palette_error(void)
boolean get_handle_from_info_file(int index)
this struct is used only when physically resampling frames on the disk we create an array of these an...
boolean do_set_duplicate_warning(const char *new_set)
boolean is_loaded
should we continue loading if we come back to this clip
void do_firstever_dialog(void)
boolean save_clip_values(int which_file)
void end_threaded_dialog(void)
boolean do_event_list_warning(void)
int arate
current audio playback rate (varies if the clip rate is changed)
void add_warn_check(LiVESBox *box, int warn_mask_number)
LiVESList * cache_file_contents(const char *filename)
boolean can_write_to_config_backup
@ CLIP_DETAILS_RESERVED18
lives_undo_t undo_action
undo
boolean nokeep
don't show the 'keep' button - e.g. for operations which resize frames
LiVESResponseType do_info_dialog(const char *text)
LiVESResponseType do_header_missing_detail_error(int clip, lives_clip_details_t detail) WARN_UNUSED
boolean do_auto_dialog(const char *text, int type)
void calc_maxspect(int rwidth, int rheight, int *cwidth, int *cheight)
boolean check_file(const char *file_name, boolean check_exists)
check if file exists
void do_text_window(const char *title, const char *text)
lives_direction_t adirection
audio play direction during playback, FORWARD or REVERSE.
int last_play_sequence
updated only when FINISHING playing a clip (either by switching or ending playback,...
lives_checkstatus_t has_python
boolean pull_frame_at_size(weed_layer_t *layer, const char *image_ext, ticks_t tc, int width, int height, int target_palette)
lives_alarm_t lives_alarm_set(ticks_t ticks)
set alarm for now + delta ticks (10 nanosec) param ticks (10 nanoseconds) is the offset when we want ...
void resize_widgets_for_monitor(boolean get_play_times)
void replace_with_delegates(void)
void start_playback_async(int type)
void print_cache(LiVESList *cache)
boolean dirs_equal(const char *dira, const char *dirb)
void remove_layout_files(LiVESList *lmap)
const char * get_deinterlace_string(void)
lives_checkstatus_t has_wget
lives_checkstatus_t has_snap
int lives_rm(const char *file)
void do_pulse_lost_conn_error(void)
uint64_t binfmt_end
marks the end of anything "interesring" we may want to save via binfmt extension
@ CLIP_DETAILS_RESERVED25
@ CLIP_DETAILS_RESERVED16
int achans
number of audio channels (0, 1 or 2)
void load_start_image(int frame)
void do_vpp_fps_error(void)
void unbuffer_lmap_errors(boolean add)
boolean get_temp_handle(int index)
get a temp "handle" from disk.
uint32_t get_signed_endian(boolean is_signed, boolean little_endian)
produce bitmapped value
size_t lives_fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
boolean check_layer_ready(weed_layer_t *layer)
block until layer pixel_data is ready.
boolean do_erase_subs_warning(void)
boolean is_legal_set_name(const char *set_name, boolean allow_dupes, boolean leeway)
@ CLIP_DETAILS_CACHE_OBJECTS
void get_monitors(boolean reset)
boolean do_progress_dialog(boolean visible, boolean cancellable, const char *text)
LiVESResponseType do_retry_cancel_dialog(const char *text)
boolean get_new_handle(int index, const char *name)