Go to the documentation of this file.
20 int new_file, old_file;
21 int play_type = LIVES_POINTER_TO_INT(data);
24 case 8:
case 6:
case 0:
105 char *lives_header_new;
106 boolean all_ok =
FALSE;
126 if (retval == LIVES_RESPONSE_CANCEL) {
140 double dfps = (double)cdata->
fps;
186 lives_cp(lives_header_new, lives_header);
193 }
while (retval == LIVES_RESPONSE_RETRY);
201 if (retval == LIVES_RESPONSE_CANCEL)
return FALSE;
216 (tmp = lives_filename_from_utf8(file_name, -1, NULL, NULL, NULL)),
218 is_audio ? 2 : is_img ? 4 : 0);
232 if (
USE_MPV)
return "--deinterlace=yes";
245 if (lives_strrstr(file_name,
"://") && strncmp(file_name,
"dvd://", 6)) {
250 lives_snprintf(short_file_name,
PATH_MAX,
"%s", file_name);
267 static boolean rip_audio_cancelled(
int old_file, weed_plant_t *mt_pb_start_event,
268 boolean mt_has_audio_file) {
294 cfile->undo1_dbl = 0.;
297 cfile->undo_signed_endian =
cfile->signed_endian;
301 d_print(
_(
"Auto padding with %.4f seconds of silence at start..."),
cfile->undo2_dbl);
307 #define AUDIO_FRAMES_TO_READ 100
310 LiVESResponseType response;
313 char *isubfname = NULL;
314 char *fname = lives_strdup(file_name), *msgstr;
319 int new_file = old_file;
321 int achans, arate, arps, asampsize;
323 int extra_frames = 0;
324 int probed_achans = 0;
326 boolean mt_has_audio_file =
TRUE;
330 weed_plant_t *mt_pb_start_event = NULL;
332 if (!lives_file_test(fname, LIVES_FILE_TEST_EXISTS)) {
353 com =
lives_strdup_printf(
_(
"Opening %s start time %.2f sec. frames %d"), file_name, start, frames);
386 if (
cfile->frames == 0) {
403 char *cwd = lives_get_current_dir();
418 if (
cfile->ext_src) {
437 lives_snprintf(
cfile->author, 1024,
"%s", cdata->
author);
439 lives_snprintf(
cfile->title, 1024,
"%s", cdata->
title);
440 if (!*
cfile->comment)
441 lives_snprintf(
cfile->comment, 1024,
"%s", cdata->
comment);
443 if (frames > 0 &&
cfile->frames > frames) {
444 cfile->frames = frames;
451 what = (
_(
"creating the frame index for the clip"));
454 response = LIVES_RESPONSE_OK;
456 frames == 0 ?
cfile->frames : frames);
457 if (!
cfile->frame_index) {
460 }
while (response == LIVES_RESPONSE_RETRY);
462 if (response == LIVES_RESPONSE_CANCEL) {
465 probed_achans =
cfile->achans;
476 int64_t stframe =
cfile->fps * start + .5;
477 int64_t maxframe = (stframe + (frames == 0)) ?
cfile->frames : frames;
494 if (stframe + nframes > maxframe) nframes = maxframe - stframe;
495 if (nframes <= 0)
break;
506 if (!rip_audio_cancelled(old_file, mt_pb_start_event, mt_has_audio_file)) {
522 if (
cfile->achans == 0 && probed_achans > 0 && withsound == 1) {
537 (tmp = lives_filename_from_utf8(file_name, -1, NULL, NULL, NULL)), -1,
558 cfile->opening_frames = -1;
601 cfile->video_time += st_extra_frames /
cfile->fps;
602 extra_frames -= st_extra_frames;
608 if ((
cfile->frames + extra_frames) /
cfile->fps >
cfile->laudio_time) {
617 if (xextra_frames > extra_frames) extra_frames = xextra_frames;
620 cfile->video_time += extra_frames /
cfile->fps;
625 cfile->undo1_dbl = 0.;
627 d_print(
_(
"Auto trimming %.4f seconds of audio at start..."),
cfile->undo2_dbl);
636 d_print(
_(
"Auto trimming %.4f seconds of audio at end..."),
cfile->laudio_time -
cfile->video_time);
652 cfile->undo_signed_endian =
cfile->signed_endian;
656 d_print(
_(
"Auto padding with %.4f seconds of silence at end..."),
cfile->undo2_dbl);
669 if (
cfile->ext_src) {
686 _(
"\nLiVES cannot Instant Open this file, it may take some time to load.\n"
687 "Are you sure you wish to continue ?"),
701 d_print(
_(
" - please be patient."));
706 g_print(
"open_file: dpd in\n");
712 cfile->undo_start = 1;
715 if (
cfile->achans > 0) {
720 achans =
cfile->achans;
721 arate =
cfile->arate;
723 asampsize =
cfile->asampsize;
734 cfile->achans = achans;
735 cfile->arate = arate;
737 cfile->asampsize = asampsize;
740 if (
cfile->frames <= 0) {
754 if (!
cfile->ext_src) {
767 (tmp = lives_filename_from_utf8(file_name, -1, NULL, NULL, NULL)), withsound,
801 cfile->progress_start =
cfile->progress_end = 0;
854 rename(afile, ofile);
860 cfile->opening_frames = -1;
864 g_print(
"Out of dpd\n");
882 if (
cfile->opening_loc) {
891 lives_snprintf(filename, 512,
"%s", file_name);
894 if (lives_file_test(isubfname, LIVES_FILE_TEST_EXISTS)) {
900 if (lives_file_test(isubfname, LIVES_FILE_TEST_EXISTS)) {
920 if (
cfile->frames <= 0) {
921 if (
cfile->afilesize == 0l) {
923 lives_snprintf(msg, 256,
"%s",
_
924 (
"\n\nLiVES was unable to extract either video or audio.\n"
925 "Please check the terminal window for more details.\n"));
928 lives_strappend(msg, 256,
_(
"\n\nYou may need to install mplayer, mplayer2 or mpv to open this file.\n"));
939 lives_strappend(msg, 256,
_(
"\n\nPlease check the setting of Video Open Command in\nTools|Preferences|Decoding\n"));
958 if (!
cfile->ext_src) {
959 extra_frames =
cfile->frames;
961 extra_frames -=
cfile->frames;
966 if (
cfile->f_size == 0) {
968 if (fsize < 0) fsize = 0;
969 cfile->f_size = (size_t)fsize;
973 if (!
cfile->ext_src) {
978 d_print(
_(
"Auto trimming %.2f seconds of audio at end..."),
cfile->laudio_time -
cfile->video_time);
987 cfile->video_time += extra_frames /
cfile->fps;
998 cfile->undo_signed_endian =
cfile->signed_endian;
1002 d_print(
_(
"Auto padding with %.2f seconds of silence at end..."),
cfile->undo2_dbl);
1011 d_print(
_(
"Loaded subtitle file: %s\n"), isubfname);
1019 g_print(
"md5sum is %s\n",
get_md5sum(file_name));
1033 !strcmp(
cfile->type,
"Audio")) {
1044 cfile->opening_frames = -1;
1123 return cfile->unique_id;
1127 static void save_subs_to_file(
lives_clip_t *sfile,
char *fname) {
1131 if (!sfile->
subt)
return;
1147 (
double)(sfile->
start - 1) / sfile->
fps, fname);
1152 (
double)(sfile->
start - 1) / sfile->
fps, fname);
1171 if (!strncmp(
mainw->
msg,
"error|", 6)) {
1186 void save_frame(LiVESMenuItem * menuitem, livespointer user_data) {
1191 char *filename, *defname;
1196 frame = LIVES_POINTER_TO_INT(user_data);
1202 ttl = (
_(
"Save Frame"));
1207 filt, LIVES_FILE_CHOOSER_ACTION_SAVE, ttl, NULL);
1211 if (!filename)
return;
1231 static void save_log_file(
const char *prefix) {
1237 if ((logfd = creat(logfile, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) != -1) {
1240 if ((logfd = creat(logfile, S_IRUSR | S_IWUSR)) != -1) {
1253 lives_snprintf(sfile->
comment, 1024,
"Created with LiVES version %s.\nSee: %s\n%s",
1260 void save_file(
int clip,
int start,
int end,
const char *filename) {
1263 double aud_start = 0., aud_end = 0.;
1265 char *n_file_name = NULL;
1267 char *extra_params = NULL;
1269 char *new_stderr_name = NULL;
1270 char *mesg, *bit, *tmp;
1272 char *full_file_name = NULL;
1273 char *enc_exec_name = NULL;
1277 boolean recheck_name =
FALSE;
1279 int new_stderr = -1;
1289 GError *gerr = NULL;
1292 struct stat filestat;
1300 boolean not_cancelled =
FALSE;
1301 boolean output_exists =
FALSE;
1302 boolean save_all =
FALSE;
1303 boolean debug_mode =
FALSE;
1310 if (start == 1 && end == sfile->
frames) save_all =
TRUE;
1328 if (response == LIVES_RESPONSE_CANCEL) {
1339 if (enc_exec_name)
lives_free(enc_exec_name);
1346 if (strcmp(
mainw->
msg,
"initialised\n")) {
1351 (
_(
"\n\nUnable to find the 'init' method in the %s plugin.\n"
1352 "The plugin may be broken or not installed correctly."),
prefs->
encoder.
name);
1380 char *ttl = (
_(
"Save Clip"));
1385 }
while (!*n_file_name);
1392 }
else n_file_name = lives_strdup(filename);
1404 recheck_name =
TRUE;
1408 if (!full_file_name) {
1409 full_file_name = lives_strdup(n_file_name);
1412 if (!filename && recheck_name) {
1413 if (!
check_file(full_file_name, strcmp(full_file_name, n_file_name))) {
1461 arate = sfile->
arate;
1474 fprintf(stderr,
"Running command: %s\n", com);
1482 if (!extra_params) {
1492 if (!save_all && !safe_symlinks) {
1509 cfile->progress_start = 1;
1527 nfile->vsize = sfile->
vsize;
1528 cfile->progress_start = nfile->start = 1;
1529 cfile->progress_end = nfile->frames = nfile->end = end - start + 1;
1530 nfile->fps = sfile->
fps;
1531 nfile->arps = sfile->
arps;
1532 nfile->arate = sfile->
arate;
1533 nfile->achans = sfile->
achans;
1539 start, end, aud_start, aud_end, nfile->arate, nfile->achans, nfile->asampsize,
1597 nfile->arps = sfile->
arps;
1598 nfile->arate = sfile->
arate;
1599 nfile->achans = sfile->
achans;
1613 if (!save_all && !safe_symlinks) {
1634 if (!save_all && safe_symlinks) {
1635 int xarps, xarate, xachans, xasamps, xasigned_endian;
1642 cfile->progress_start = 1;
1666 xarps = sfile->
arps;
1667 xarate = sfile->
arate;
1703 sfile->
arps = xarps;
1704 sfile->
arate = xarate;
1719 char *msg = (
_(
"Pulling frames from clip..."));
1734 bit = (
_(
" (with no sound)\n"));
1736 bit = lives_strdup(
"\n");
1740 mesg =
lives_strdup_printf(
_(
"Saving frames %d to %d%s as \"%s\" : encoder = %s : format = %s..."),
1744 mesg =
lives_strdup_printf(
_(
"Saving frames 1 to %d%s as \"%s\" : encoder %s : format = %s..."),
1761 new_stderr =
lives_open3(new_stderr_name, O_CREAT | O_RDONLY | O_TRUNC | O_SYNC, S_IRUSR | S_IWUSR);
1762 if (new_stderr < 0) {
1764 if (retval == LIVES_RESPONSE_CANCEL) redir = lives_strdup(
"1>&2");
1770 mainw->
iochan = g_io_channel_win32_new_fd(new_stderr);
1775 mainw->
iochan = g_io_channel_unix_new(new_stderr);
1782 mainw->
iochan->open(new_stderr, QIODevice::ReadOnly);
1786 g_io_channel_set_encoding(
mainw->
iochan, NULL, NULL);
1788 g_io_channel_set_flags(
mainw->
iochan, G_IO_FLAG_NONBLOCK, &gerr);
1789 if (gerr) lives_error_free(gerr);
1794 }
while (retval == LIVES_RESPONSE_RETRY);
1797 redir = lives_strdup(
"1>&2");
1800 if (lives_file_test((tmp = lives_filename_from_utf8(full_file_name, -1, NULL, NULL, NULL)), LIVES_FILE_TEST_EXISTS)) {
1807 if (arate != 0) arate =
cfile->arate;
1809 if (!
cfile->ratio_fps) {
1822 enc_exec_name, fps_string, (tmp = lives_filename_from_utf8(full_file_name, -1, NULL, NULL, NULL)),
1824 asigned | aendian, aud_start, aud_end, (extra_params == NULL) ?
"" : extra_params, redir);
1828 enc_exec_name, fps_string, (tmp = lives_filename_from_utf8(full_file_name, -1, NULL, NULL, NULL)),
1830 asigned | aendian, aud_start, aud_end, (extra_params == NULL) ?
"" : extra_params, redir);
1846 fprintf(stderr,
"Running command: %s\n", com);
1860 cfile->progress_start = 1;
1874 if (gerr) lives_error_free(gerr);
1899 if (gerr) lives_error_free(gerr);
1912 cwd = lives_get_current_dir();
1921 fprintf(stderr,
"Running command: %s\n", com);
1937 if (!save_all && !safe_symlinks) {
1947 }
else if (!save_all && safe_symlinks) {
1960 if (lives_file_test((tmp = lives_filename_from_utf8(full_file_name, -1, NULL, NULL, NULL)), LIVES_FILE_TEST_EXISTS)) {
1962 stat((tmp = lives_filename_from_utf8(full_file_name, -1, NULL, NULL, NULL)), &filestat);
1963 if (filestat.st_size > 0) output_exists =
TRUE;
1965 if (!output_exists) {
1972 if (!save_all && !safe_symlinks) {
1982 }
else if (!save_all && safe_symlinks) {
1991 retval =
do_error_dialog(
_(
"\n\nEncoder error - output file was not created !\n"));
1993 if (retval == LIVES_RESPONSE_SHOW_DETAILS) {
1999 save_log_file(
"failed_encoder_log");
2015 int iwidth = sfile->
ohsize;
2016 int iheight = sfile->
ovsize;
2017 boolean bad_header =
FALSE;
2035 sfile->
hsize = iwidth;
2036 sfile->
vsize = iheight;
2051 if (fsize < 0) fsize = 0;
2052 cfile->f_size = (size_t)fsize;
2067 if (!safe_symlinks) {
2092 save_log_file(
"encoder_log");
2097 if (not_cancelled) {
2109 d_print(
_(
"File size was %s\n"), fsize_ds);
2121 (tmp = lives_filename_from_utf8(full_file_name, -1, NULL, NULL, NULL)))));
2125 lives_rm((tmp = lives_filename_from_utf8(full_file_name, -1, NULL, NULL, NULL)));
2134 char *stfile = NULL;
2135 char *stopcom = NULL, *com;
2139 if (
cfile->achans > 0) {
2143 (
cfile->asampsize / 8);
2144 if (apos >
cfile->aseek_pos)
cfile->aseek_pos = apos;
2156 #ifdef HAVE_PULSE_AUDIO
2168 stfile = lives_build_filename(
prefs->
workdir,
cfile->handle,
".stoploop", NULL);
2178 if (
cfile->achans > 0) {
2181 stopcom = lives_strconcat(com3, com2, NULL);
2199 arate,
cfile->achans,
cfile->asampsize, asigned, aendian);
2204 arate,
cfile->achans,
cfile->asampsize, asigned, aendian);
2214 LiVESWidgetClosure *freeze_closure, *bg_freeze_closure;
2215 LiVESList *cliplist;
2216 weed_plant_t *pb_start_event = NULL;
2218 #ifdef GDK_WINDOWING_X11
2219 uint64_t awinid = -1;
2222 char *com, *com2 = lives_strdup(
" "), *com3 = lives_strdup(
" ");
2223 char *stopcom = NULL;
2225 #ifdef GDK_WINDOWING_X11
2229 double fps_med = 0.;
2230 double pointer_time =
cfile->pointer_time;
2231 double real_pointer_time =
cfile->real_pointer_time;
2236 boolean needsadone =
FALSE;
2239 boolean exact_preview =
FALSE;
2241 boolean has_audio_buffers =
FALSE;
2262 #ifdef ENABLE_JACK_TRANSPORT
2265 jack_pb_start(
cfile->achans > 0 ?
cfile->real_pointer_time :
cfile->pointer_time);
2282 (LiVESXModifierType)LIVES_CONTROL_MASK,
2283 (LiVESAccelFlags)0, (freeze_closure = lives_cclosure_new(LIVES_GUI_CALLBACK(
freeze_callback),
2286 (LiVESXModifierType)(LIVES_CONTROL_MASK | LIVES_ALT_MASK),
2287 (LiVESAccelFlags)0, (bg_freeze_closure = lives_cclosure_new(LIVES_GUI_CALLBACK(
freeze_callback),
2307 d_print(
_(
"recording aborted by preview.\n"));
2310 d_print(
_(
"recording aborted by clipboard playback.\n"));
2312 d_print(
_(
"Recording performance..."));
2333 #ifdef ENABLE_JACK_TRANSPORT
2338 cfile->pointer_time =
cfile->real_pointer_time = sttime;
2341 if (
cfile->pointer_time >
cfile->video_time)
cfile->pointer_time = 0.;
2349 if (
cfile->achans > 0) {
2401 && (
cfile->frames > 0 ||
2412 arate =
cfile->arate;
2418 if (
mainw->
mute && !
cfile->opening_only_audio) arate = arate ? -arate : -1;
2463 else if (!
cfile->opening) {
2559 #ifdef GDK_WINDOWING_X11
2566 com2 = lives_strdup(
"xset s off 2>/dev/null; xset -dpms 2>/dev/null ;");
2569 char *xnew = lives_strdup(
" gconftool-2 --set --type bool /apps/gnome-screensaver/idle_activation_enabled "
2570 "false 2>/dev/null ;");
2581 com2 = lives_strdup(
"gconftool-2 --set --type bool /apps/gnome-screensaver/idle_activation_enabled false 2>/dev/null ;");
2582 }
else com2 = lives_strdup(
"");
2584 if (!com2) com2 = lives_strdup(
"");
2591 com = lives_strconcat(com2, com3, NULL);
2599 com3 = lives_strdup(
" ");
2675 #ifdef HAVE_PULSE_AUDIO
2713 has_audio_buffers =
TRUE;
2716 #ifdef HAVE_PULSE_AUDIO
2723 has_audio_buffers =
TRUE;
2741 if (has_audio_buffers) {
2769 #ifdef HAVE_PULSE_AUDIO
2822 #ifdef HAVE_PULSE_AUDIO
2835 if (!has_audio_buffers) {
2854 #ifdef HAVE_PULSE_AUDIO
2866 cfile->next_event = NULL;
2922 cfile->pointer_time = pointer_time;
2923 cfile->real_pointer_time = real_pointer_time;
2951 jack_message.data = NULL;
2952 jack_message.next = NULL;
2964 #ifdef HAVE_PULSE_AUDIO
2988 pulse_message.data = NULL;
2989 pulse_message.next = NULL;
3017 #ifdef HAVE_PULSE_AUDIO
3038 #ifdef HAVE_PULSE_AUDIO
3057 #ifdef GDK_WINDOWING_X11
3058 com = lives_strdup(
"xset s on 2>/dev/null; xset +dpms 2>/dev/null ;");
3061 char *xnew = lives_strdup(
" gconftool-2 --set --type bool /apps/gnome-screensaver/idle_activation_enabled "
3062 "true 2>/dev/null ;");
3063 tmp = lives_strconcat(com, xnew, NULL);
3070 tmp = lives_strconcat(com, xnew, NULL);
3077 com = lives_strdup(
"gconftool-2 --set --type bool /apps/gnome-screensaver/idle_activation_enabled true 2>/dev/null ;");
3078 }
else com = lives_strdup(
"");
3101 if (
cfile->achans > 0 && com2) {
3257 int i = LIVES_POINTER_TO_INT(cliplist->data);
3261 cliplist = cliplist->next;
3297 _(
"\n\nSome frames in the clip\n%s\nare wrongly sized.\nYou should "
3298 "click on Tools--->Resize All\n"
3299 "and resize all frames to the current size.\n"),
3341 if (has_audio_buffers) {
3347 #ifdef HAVE_PULSE_AUDIO
3360 if (has_audio_buffers) {
3499 char *com, *permitname;
3534 static int get_next_free_file(
void) {
3572 boolean is_unique, create =
FALSE;
3575 break_me(
"temp clip in temp clip !!");
3593 get_next_free_file();
3610 if (lives_file_test(setclipdir, LIVES_FILE_TEST_IS_DIR)) is_unique =
FALSE;
3613 }
while (!is_unique);
3660 if (new_file == -1) {
3663 if (new_file == -1) {
3669 get_next_free_file();
3686 if (!sfile)
return NULL;
3687 lives_snprintf(sfile->
handle, 256,
"%s", handle);
3693 cfile->is_loaded = is_loaded;
3698 cfile->binfmt_bytes.size = (size_t)((
void *)&
cfile->binfmt_end - (
void *)
cfile);
3699 cfile->menuentry = NULL;
3702 lives_snprintf(
cfile->type, 40,
"%s",
_(
"Unknown"));
3707 cfile->afilesize = 0l;
3708 cfile->asampsize = 0;
3716 cfile->resample_events = NULL;
3722 cfile->pointer_time = 0.;
3723 cfile->real_pointer_time = 0.;
3726 cfile->freeze_fps = 0.;
3727 cfile->last_vframe_played = 0;
3729 cfile->progress_start =
cfile->progress_end = 0;
3732 cfile->ext_src = NULL;
3736 cfile->aseek_pos = 0;
3738 cfile->layout_map = NULL;
3739 cfile->frame_index =
cfile->frame_index_back = NULL;
3740 cfile->fx_frame_pump = 0;
3741 cfile->pumper = NULL;
3742 cfile->stored_layout_frame = 0;
3743 cfile->stored_layout_audio = 0.;
3744 cfile->stored_layout_fps = 0.;
3745 cfile->stored_layout_idx = -1;
3752 cfile->audio_waveform = NULL;
3753 cfile->md5sum[0] = 0;
3754 cfile->gamma_type = WEED_GAMMA_SRGB;
3755 cfile->last_play_sequence = 0;
3756 cfile->tcache_dubious_from = 0;
3757 cfile->tcache_height = 0;
3758 cfile->tcache = NULL;
3771 cfile->event_list =
cfile->event_list_back = NULL;
3772 cfile->next_event = NULL;
3786 lives_snprintf(
cfile->undo_text, 32,
"%s",
_(
"_Undo"));
3787 lives_snprintf(
cfile->redo_text, 32,
"%s",
_(
"_Redo"));
3852 get_next_free_file();
3855 if (!name || !*name) {
3858 }
else xname = lives_strdup(name);
3876 char *test_fps_string1;
3877 char *test_fps_string2;
3881 cfile->afilesize = 0l;
3885 if (!strcmp(
mainw->
msg,
"killed")) {
3889 if (!
cfile->ext_src) {
3891 if (
cfile->frames > 1) {
3916 if (
cfile->laudio_time >
cfile->video_time) {
3917 d_print(
_(
"Auto trimming %.2f seconds of audio at end..."),
cfile->laudio_time -
cfile->video_time);
3926 if (npieces < 2)
return FALSE;
3928 array = lives_strsplit(
mainw->
msg,
"|", npieces);
3930 if (!strcmp(array[0],
"error")) {
3934 }
else mesg = (
_(
"\nAn error occurred opening the file\n"));
3939 lives_strfreev(array);
3945 if (strcmp(check_handle, array[1])) {
3947 mesg =
lives_strdup_printf(
_(
"\nError getting file info for clip %s.\nBad things may happen with this clip.\n"),
3953 lives_strfreev(array);
3958 cfile->achans = atoi(array[10]);
3959 cfile->asampsize = atoi(array[11]);
3961 cfile->afilesize = strtol(array[14], NULL, 10);
3963 lives_strfreev(array);
3967 cfile->frames = atoi(array[2]);
3969 lives_strfreev(array);
3972 lives_snprintf(
cfile->type, 40,
"%s", array[3]);
3973 cfile->hsize = atoi(array[4]);
3974 cfile->vsize = atoi(array[5]);
3975 cfile->bpp = atoi(array[6]);
3976 cfile->pb_fps =
cfile->fps = lives_strtod(array[7], NULL);
3977 cfile->f_size = strtol(array[8], NULL, 10);
3979 if (npieces > 15 && array[15]) {
3981 if (!strcmp(array[15],
"bt709"))
cfile->gamma_type = WEED_GAMMA_BT709;
3985 if (!*
cfile->title && npieces > 16 && array[16]) {
3986 lives_snprintf(
cfile->title, 1024,
"%s", lives_strstrip(array[16]));
3988 if (!*
cfile->author && npieces > 17 && array[17]) {
3989 lives_snprintf(
cfile->author, 1024,
"%s", lives_strstrip(array[17]));
3991 if (!*
cfile->comment && npieces > 18 && array[18]) {
3992 lives_snprintf(
cfile->comment, 1024,
"%s", lives_strstrip(array[18]));
3995 lives_strfreev(array);
3999 cfile->video_time = 0;
4004 if (strcmp(test_fps_string1, test_fps_string2)) {
4014 cfile->afilesize = 0l;
4017 if (
cfile->frames <= 0) {
4018 if (
cfile->afilesize == 0l &&
cfile->is_loaded) {
4039 if (
cfile->frames != 1) {
4040 d_print(
_(
"\nPlayback speed not found or invalid ! Using default fps of %.3f fps. \n"
4041 "Default can be set in Tools | Preferences | Misc.\n"),
4051 d_print(
_(
"Playback speed was adjusted to %.3f frames per second to fit audio.\n"),
cfile->fps);
4060 mesg = (
_(
"Image format detected"));
4066 if (
cfile->bpp == 256) {
4075 if (
cfile->achans == 0) {
4086 if (*
cfile->author) {
4089 if (*
cfile->title) {
4092 if (*
cfile->comment) {
4111 comment_fd = creat(comment_file, S_IRUSR | S_IWUSR);
4112 if (comment_fd < 0) {
4129 }
while (retval == LIVES_RESPONSE_RETRY);
4144 # define SECOND_STOP_TIME 0.1
4145 # define STOP_GIVE_UP_TIME 1.0
4147 double time_waited = 0.;
4148 boolean sent_second_stop =
FALSE;
4151 while (!(infofile = fopen(
cfile->info_file,
"r"))) {
4157 sent_second_stop =
TRUE;
4166 if (infofile) fclose(infofile);
4170 boolean save_frame_inner(
int clip,
int frame,
const char *file_name,
int width,
int height,
boolean from_osc) {
4173 LiVESResponseType resp;
4178 boolean allow_over =
FALSE;
4180 if (!from_osc && strrchr(file_name,
'.') == NULL) {
4181 lives_snprintf(full_file_name,
PATH_MAX,
"%s.%s", file_name,
4184 lives_snprintf(full_file_name,
PATH_MAX,
"%s", file_name);
4185 if (!allow_over) allow_over =
TRUE;
4189 if (from_osc && lives_file_test(full_file_name, LIVES_FILE_TEST_EXISTS))
return FALSE;
4191 tmp = lives_filename_from_utf8(full_file_name, -1, NULL, NULL, NULL);
4194 d_print(
_(
"Saving frame %d as %s..."), frame, full_file_name);
4205 resp = LIVES_RESPONSE_NONE;
4208 frame, tmp, width, height);
4216 if (resp == LIVES_RESPONSE_CANCEL) {
4226 }
while (resp == LIVES_RESPONSE_RETRY);
4229 LiVESError *gerr = NULL;
4230 LiVESPixbuf *pixbuf;
4236 weed_set_int_value(
mainw->
frame_layer, WEED_LEAF_GAMMA_TYPE, WEED_GAMMA_SRGB);
4250 lives_error_free(gerr);
4253 }
while (retval == LIVES_RESPONSE_RETRY);
4264 void backup_file(
int clip,
int start,
int end,
const char *file_name) {
4273 boolean with_perf =
FALSE;
4274 boolean retval, allow_over;
4279 if (strrchr(file_name,
'.') == NULL) {
4283 lives_snprintf(full_file_name,
PATH_MAX,
"%s", file_name);
4288 if (!
check_file(full_file_name, allow_over))
return;
4294 if (!retval)
return;
4298 d_print(
_(
"Backing up %s to %s"), title, full_file_name);
4307 cfile->progress_start = 1;
4312 char *msg = (
_(
"Pulling frames from clip..."));
4323 start, end, (tmp = lives_filename_from_utf8(full_file_name, -1, NULL, NULL, NULL)));
4371 d_print(
_(
"performance data was backed up..."));
4374 array = lives_strsplit(
mainw->
msg,
"|", 3);
4375 sfile->
f_size = strtol(array[1], NULL, 10);
4376 lives_strfreev(array);
4407 header_fd = creat(hdrfile, S_IRUSR | S_IWUSR);
4408 if (header_fd < 0) {
4429 }
while (retval == LIVES_RESPONSE_RETRY);
4433 if (retval != LIVES_RESPONSE_CANCEL) {
4439 header_fd = creat(hdrfile, S_IRUSR | S_IWUSR);
4441 if (header_fd < 0) {
4452 }
while (retval == LIVES_RESPONSE_RETRY);
4457 if (retval == LIVES_RESPONSE_CANCEL) {
4472 char *old_hdrfile, *lives_header = NULL;
4479 int asigned = 0, aendian = LIVES_LITTLE_ENDIAN;
4483 boolean retval, retvala;
4484 boolean is_ascrap =
FALSE;
4488 time_t old_time = 0, new_time = 1;
4504 if (!lives_file_test(lives_header, LIVES_FILE_TEST_EXISTS)) {
4506 lives_header = NULL;
4509 if (!lives_header) lives_header = lives_build_filename(dir,
LIVES_CLIP_HEADER, NULL);
4514 if (lives_file_test(lives_header, LIVES_FILE_TEST_EXISTS)) {
4516 retval2 = LIVES_RESPONSE_OK;
4521 }
while (retval2 == LIVES_RESPONSE_RETRY);
4523 if (retval2 == LIVES_RESPONSE_CANCEL) {
4540 if (lives_file_test(old_hdrfile, LIVES_FILE_TEST_EXISTS)) {
4552 }
while (retval2 == LIVES_RESPONSE_RETRY);
4554 if (retval2 == LIVES_RESPONSE_CANCEL)
goto rhd_failed;
4556 if (is_ascrap)
goto get_avals;
4617 if (!retvala) sfile->
achans = 0;
4621 else retvala =
TRUE;
4623 if (retval && retvala) {
4631 if (retvala && retval) {
4639 if (retvala && retval) {
4643 if (retvala && retval) {
4650 if (retvala && retval) {
4681 }
while (retval2 == LIVES_RESPONSE_RETRY);
4687 if (lives_file_test(old_hdrfile, LIVES_FILE_TEST_EXISTS)) {
4689 if (!stat(old_hdrfile, &mystat)) old_time = mystat.st_mtime;
4690 if (!stat(lives_header, &mystat)) new_time = mystat.st_mtime;
4694 lives_header = NULL;
4698 retval2 = LIVES_RESPONSE_OK;
4709 (tmp = lives_filename_from_utf8(file_name, -1, NULL, NULL, NULL)));
4725 array = lives_strsplit(buff,
"|", pieces);
4726 sfile->
f_size = strtol(array[1], NULL, 10);
4727 sfile->
afilesize = strtol(array[2], NULL, 10);
4732 lives_strfreev(array);
4735 }
else goto rhd_failed;
4743 retval = LIVES_RESPONSE_OK;
4750 if (header_fd < 0) {
4759 if (header_size < sizhead) {
4784 if (header_size > sizhead) {
4785 if (header_size - sizhead > 31) {
4792 version[header_size - sizhead] =
'\0';
4802 if (retval == LIVES_RESPONSE_CANCEL)
goto rhd_failed;
4804 }
while (retval == LIVES_RESPONSE_RETRY);
4808 if (retval == LIVES_RESPONSE_CANCEL)
goto rhd_failed;
4812 if (version_hash < 7001) {
4818 (tmp = lives_filename_from_utf8(file_name, -1, NULL, NULL, NULL)),
4819 !strcmp(file_name,
"."));
4831 array = lives_strsplit(buff,
"|", pieces);
4832 sfile->
f_size = strtol(array[1], NULL, 10);
4833 sfile->
afilesize = strtol(array[2], NULL, 10);
4840 sfile->
frames = atoi(array[4]);
4844 if (pieces > 4 && array[5]) {
4845 lives_snprintf(sfile->
title, 1024,
"%s", lives_strstrip(array[4]));
4847 if (pieces > 5 && array[6]) {
4848 lives_snprintf(sfile->
author, 1024,
"%s", lives_strstrip(array[5]));
4850 if (pieces > 6 && array[7]) {
4851 lives_snprintf(sfile->
comment, 1024,
"%s", lives_strstrip(array[6]));
4854 lives_strfreev(array);
4912 if ((set_fd =
lives_open2(setfile, O_RDONLY)) > -1) {
4915 cfile->pb_fps = pb_fps / 1000.;
4921 }
while (retval == LIVES_RESPONSE_RETRY);
4933 if (strlen(name) > strlen(remove)) name[strlen(name) - strlen(remove)] = 0;
4950 if (lives_file_test(subfname, LIVES_FILE_TEST_EXISTS)) {
4956 if (lives_file_test(subfname, LIVES_FILE_TEST_EXISTS)) {
4965 char *com = lives_strdup(
"dummy");
4966 char *mesg, *mesg1, *tmp;
4967 boolean is_OK =
TRUE;
4968 char *fname = lives_strdup(file_name);
4973 boolean not_cancelled;
4980 d_print(
_(
"Restoring %s..."), file_name);
4993 (tmp = lives_filename_from_utf8(file_name, -1, NULL, NULL, NULL)));
5026 mesg =
lives_strdup_printf(
_(
"\n\nThe file %s is corrupt.\nLiVES was unable to restore it.\n"),
5038 if (
cfile->afilesize == 0) {
5055 if (
cfile->frames > 0) {
5070 lives_snprintf(
cfile->type, 40,
"Frames");
5074 if (
cfile->afilesize == 0l) {
5097 if (
cfile->pointer_time >
cfile->video_time)
cfile->pointer_time = 0.;
5099 if (
cfile->achans) {
5100 cfile->aseek_pos = (off64_t)((
double)(
cfile->real_pointer_time *
cfile->arate) *
cfile->achans *
5101 (
cfile->asampsize / 8));
5117 return cfile->unique_id;
5129 int header_fd, i = 0;
5131 int perf_start, perf_end;
5134 if (!
cfile->event_list) {
5144 if (
cfile->frame_index) {
5145 LiVESResponseType response;
5146 int xframes =
cfile->frames;
5147 char *what = (
_(
"creating the frame index for resampling "));
5150 cfile->frame_index_back =
cfile->frame_index;
5151 cfile->frame_index = NULL;
5154 response = LIVES_RESPONSE_OK;
5156 if (!
cfile->frame_index) {
5159 }
while (response == LIVES_RESPONSE_RETRY);
5161 if (response == LIVES_RESPONSE_CANCEL) {
5162 cfile->frame_index =
cfile->frame_index_back;
5163 cfile->frame_index_back = NULL;
5167 for (i = 0; i < nevents; i++) {
5168 cfile->frame_index[i] =
cfile->frame_index_back[(
cfile->resample_events + i)->value - 1];
5171 cfile->frames = nevents;
5173 cfile->frames = xframes;
5178 header_fd = creat(hdrfile, S_IRUSR | S_IWUSR);
5179 if (header_fd < 0) {
5188 if (
cfile->resample_events) {
5189 for (i = 0; i <= perf_end - perf_start; i++) {
5202 }
while (retval == LIVES_RESPONSE_RETRY);
5204 if (retval == LIVES_RESPONSE_CANCEL) {
5222 static double ascrap_mb;
5223 static uint64_t free_mb;
5226 ascrap_mb += bytes / 1000000.;
5234 char *handle, *scrap_handle;
5256 lives_snprintf(
cfile->type, 40,
"scrap");
5282 char *handle, *ascrap_handle;
5303 lives_snprintf(
cfile->type, 40,
"ascrap");
5309 cfile->asampsize = 16;
5310 cfile->signed_endian = 0;
5312 #ifdef HAVE_PULSE_AUDIO
5378 if (fd < 0)
return FALSE;
5379 #ifdef HAVE_POSIX_FADVISE
5380 posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
5382 scrapfile->
ext_src = LIVES_INT_TO_POINTER(fd);
5384 }
else fd = LIVES_POINTER_TO_INT(scrapfile->
ext_src);
5386 if (frame < 0 || !layer)
return TRUE;
5396 static void ds_warn(
boolean freelow, uint64_t bytes) {
5397 char *reason, *aorb;
5400 reason = (
_(
"FREE DISK SPACE"));
5401 aorb = (
_(
"BELOW"));
5403 reason = (
_(
"DISK SPACE USED"));
5404 aorb = (
_(
"ABOVE"));
5406 d_print(
_(
"\nRECORDING was PAUSED because %s in %s IS %s %s !\n"
5407 "Diskspace limits can be set in Preferences / Misc.\n"),
5419 static int64_t free_ds = -1;
5420 static double xscrap_mb = -1., xascrap_mb = -1.;
5421 static double xxscrap_mb = -1., xxascrap_mb = -1.;
5422 static int64_t ds_used = -1;
5423 static boolean wrtable =
FALSE;
5425 double scrap_mb = 0.;
5429 if (fullcheck) ds_used = -1;
5436 int64_t xds_used = -1;
5440 xxscrap_mb = scrap_mb;
5441 xxascrap_mb = ascrap_mb;
5443 if (xxscrap_mb == -1. || xxscrap_mb > scrap_mb) xxscrap_mb = scrap_mb;
5444 if (xxascrap_mb == -1. || xxascrap_mb > ascrap_mb) xxascrap_mb = ascrap_mb;
5445 if (ds_used > -1) xds_used = ds_used
5446 + (int64_t)(scrap_mb + ascrap_mb - xxscrap_mb - xxascrap_mb)
5449 if (xds_used > -1) {
5453 ds_warn(
FALSE, (uint64_t)ds_used);
5463 if (fullcheck || free_ds == -1 || xscrap_mb == -1 || xascrap_mb == -1
5464 || scrap_mb < xscrap_mb || ascrap_mb < xascrap_mb) {
5466 xscrap_mb = scrap_mb;
5467 xascrap_mb = ascrap_mb;
5469 else wrtable =
TRUE;
5472 double free_mb = (double)free_ds / (
double)
ONE_MILLION;
5473 double freesp = free_mb - (scrap_mb + ascrap_mb - xscrap_mb - xascrap_mb);
5496 boolean writeable =
TRUE;
5521 scrapfile->
ext_src = LIVES_INT_TO_POINTER(fd);
5524 #ifdef HAVE_POSIX_FADVISE
5525 posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
5527 }
else fd = LIVES_POINTER_TO_INT(scrapfile->
ext_src);
5534 scrapfile->
f_size += pdata_size;
5537 if ((scrapfile->
frames & 0xFF) == 0) {
5546 double scrap_mb = (double)scrapfile->
f_size / 1000000.;
5547 if ((scrap_mb + ascrap_mb) < (double)free_mb * .75) {
5557 framecount = (
_(
"rec ?? MB"));
5573 if (!layer)
return scrapfile->
frames;
5575 if (scrap_file_procthrd) {
5580 return scrapfile->
frames;
5588 if (scrap_file_procthrd) {
5590 scrap_file_procthrd = NULL;
5596 cfile->ext_src = NULL;
5634 LiVESList *omlist, *mlist, *lmap_node, *lmap_node_next, *lmap_entry_list, *lmap_entry_list_next;
5650 for (i = 1; i <= numclips; i++) {
5652 if (!sfile)
continue;
5655 lmap_node_next = lmap_node->next;
5657 check_handle = lives_strdup(sfile->
handle);
5659 if (strstr(lmap_entry->
handle,
"/") == NULL) {
5661 check_handle = lives_path_get_basename(sfile->
handle);
5669 lmap_entry_list = lmap_entry->
list;
5670 while (lmap_entry_list) {
5671 lmap_entry_list_next = lmap_entry_list->next;
5672 array = lives_strsplit((
char *)lmap_entry_list->data,
"|", -1);
5673 if (!lives_file_test(array[0], LIVES_FILE_TEST_EXISTS)) {
5676 if (lmap_entry_list->prev) lmap_entry_list->prev->next = lmap_entry_list_next;
5677 else lmap_entry->
list = lmap_entry_list_next;
5678 if (lmap_entry_list_next) lmap_entry_list_next->prev = lmap_entry_list->prev;
5679 lives_free((livespointer)lmap_entry_list->data);
5680 lives_list_free(lmap_entry_list);
5682 lives_strfreev(array);
5683 lmap_entry_list = lmap_entry_list_next;
5689 if (lmap_node->prev) lmap_node->prev->next = lmap_node_next;
5690 else omlist = mlist = lmap_node_next;
5691 if (lmap_node_next) lmap_node_next->prev = lmap_node->prev;
5692 lmap_node->prev = lmap_node->next = NULL;
5693 lives_list_free(lmap_node);
5718 lmap_node = lmap_node_next;
5728 lmap_node = lmap_node->next;
5730 if (omlist) lives_list_free(omlist);
5738 LiVESList *odeclist;
5744 double orig_fps = sfile->
fps;
5747 char *orig_filename = lives_strdup(sfile->
file_name);
5748 char *cwd = lives_get_current_dir();
5751 LiVESResponseType response;
5764 if (retb && *decoder_name) {
5775 fake_cdata->
fps = sfile->
fps;
5776 fake_cdata->
nframes = maxframe;
5778 response = LIVES_RESPONSE_NONE;
5784 if (response == LIVES_RESPONSE_RETRY) {
5788 if (response == LIVES_RESPONSE_BROWSE) {
5791 LiVESWidget *chooser;
5793 lives_snprintf(dirname,
PATH_MAX,
"%s", orig_filename);
5794 lives_snprintf(fname,
PATH_MAX,
"%s", orig_filename);
5805 if (resp == LIVES_RESPONSE_ACCEPT) {
5809 if (newname && *newname) {
5811 lives_snprintf(sfile->
file_name,
PATH_MAX,
"%s", (tmp = lives_filename_to_utf8(newname, -1, NULL, NULL, NULL)));
5833 if (was_renamed)
goto manual_locate;
5841 if (!sfile->
checked && cdata) {
5866 sfile->
fps = orig_fps;
5878 for (i = 0; i < 4; i++) {
5884 lives_snprintf(file,
PATH_MAX,
"%s", tmp);
5915 boolean bad_header =
FALSE;
5916 boolean correct =
TRUE;
5928 if (dpsys && *dpsys->
name && strcmp(dpsys->
name, decoder_name)) {
5945 #define _RELOAD(field) sfile->field = loaded->field
5946 #define _RELOAD_STRING(field, len) lives_snprintf(sfile->field, len, "%s", loaded->field)
5948 #define DSIZE_MAX 100000
5950 static lives_clip_t *_restore_binfmt(
int clipno,
boolean forensic) {
5954 if (lives_file_test(fname, LIVES_FILE_TEST_EXISTS)) {
5956 size_t cursize = (size_t)((
char *)&sfile->
binfmt_end - (
char *)sfile), dsize;
5958 boolean badsize =
FALSE;
5962 if (fsize < cursize) badsize =
TRUE;
5968 if (bytes < 16) badsize =
TRUE;
5971 if (dsize < cursize) badsize =
TRUE;
5973 if (dsize > cursize && dsize <
DSIZE_MAX) {
5976 }
else dsize = cursize;
5978 if (bytes < dsize) badsize =
TRUE;
6001 if (forensic)
return loaded;
6020 #undef _RELOAD_STRING
6024 if (!recov)
return FALSE;
6030 return _restore_binfmt(clipno,
TRUE);
6036 char buff[256], *buffptr;
6039 LiVESResponseType resp;
6043 int last_good_file = -1, ngoodclips;
6045 boolean is_scrap, is_ascrap;
6046 boolean did_set_check =
FALSE;
6048 boolean mt_needs_idlefunc =
FALSE;
6049 boolean retb =
TRUE, retval;
6050 boolean load_from_set =
TRUE;
6051 boolean rec_cleanup =
FALSE;
6064 mt_needs_idlefunc =
TRUE;
6071 if (!auto_recover) {
6077 (
_(
"\nFiles from a previous run of LiVES were found.\nDo you want to attempt to recover them ?\n"))) {
6083 if (recovery_file) {
6085 resp = LIVES_RESPONSE_NONE;
6086 rfile = fopen(recovery_file,
"r");
6089 if (resp == LIVES_RESPONSE_CANCEL) {
6094 }
while (resp == LIVES_RESPONSE_RETRY);
6098 d_print(
_(
"\nRecovering files..."));
6114 if (recovery_file) {
6138 if (buff[strlen(buff) - 1] ==
'*') {
6140 LiVESResponseType resp;
6144 resp = LIVES_RESPONSE_OK;
6147 " or Cancel to continue without reloading the set.\n"));
6149 }
while (resp == LIVES_RESPONSE_RETRY);
6150 if (resp == LIVES_RESPONSE_CANCEL)
continue;
6168 if (!strncmp(buff,
"scrap|", 6)) {
6171 }
else if (!strncmp(buff,
"ascrap|", 7)) {
6175 if (!strncmp(buff,
"ascrap", 6) || !strncmp(buff,
"scrap", 5)) {
6182 clipdir = lives_build_filename(
prefs->
workdir, buffptr, NULL);
6184 if (!lives_file_test(clipdir, LIVES_FILE_TEST_IS_DIR)) {
6193 if (!load_from_set)
continue;
6197 lives_strfreev(array);
6201 load_from_set =
FALSE;
6205 did_set_check =
TRUE;
6218 if (is_scrap || is_ascrap) {
6227 lives_snprintf(
cfile->type, 40,
"scrap");
6237 lives_snprintf(
cfile->type, 40,
"ascrap");
6259 if (!*
cfile->file_name)
continue;
6264 if (fvirt < cfile->frames) {
6274 boolean is_ok =
TRUE;
6275 if (!
cfile->checked) {
6282 if (
cfile->afilesize == 0) {
6291 if (!recovery_file && !
cfile->checked) {
6324 if (
cfile->needs_update ||
cfile->needs_silent_update) {
6375 if (
cfile->pointer_time >
cfile->video_time)
cfile->pointer_time = 0.;
6377 if (
cfile->achans) {
6378 cfile->aseek_pos = (off64_t)((
double)(
cfile->real_pointer_time *
cfile->arate) *
cfile->achans *
6379 (
cfile->asampsize / 8));
6396 d_print(
_(
"No clips were recovered.\n"));
6398 d_print(
P_(
"%d clip was recovered ",
"%d clips were recovered ", ngoodclips), ngoodclips);
6400 d_print(
_(
"from the previous session.\n"));
6402 d_print(
_(
"from previous sessions.\n"));
6417 for (start_file =
MAX_FILES; start_file > 0; start_file--) {
6434 if (recovery_file) fclose(rfile);
6477 char *recovery_entry;
6478 char *temp_recovery_file;
6480 boolean opened =
FALSE;
6481 boolean wrote_set_entry =
FALSE;
6483 int recovery_fd = -1;
6484 LiVESResponseType retval;
6494 retval = LIVES_RESPONSE_NONE;
6499 for (; clist; clist = clist->next) {
6500 int i = LIVES_POINTER_TO_INT(clist->data);
6509 if (!wrote_set_entry) {
6510 recovery_entry = lives_build_filename(
mainw->
set_name,
"*\n", NULL);
6511 wrote_set_entry =
TRUE;
6516 if (!opened) recovery_fd = creat(temp_recovery_file, S_IRUSR | S_IWUSR);
6520 lives_write(recovery_fd, recovery_entry, strlen(recovery_entry),
TRUE);
6527 }
while (retval == LIVES_RESPONSE_RETRY);
6530 else if (recovery_fd >= 0) {
6532 retval = LIVES_RESPONSE_INVALID;
6538 }
while (retval == LIVES_RESPONSE_RETRY);
6551 uint32_t recpid = 0;
6553 char *recovery_file, *recovery_numbering_file, *recording_file, *recording_numbering_file, *xfile;
6556 boolean retval =
FALSE;
6557 boolean found =
FALSE, found_recording =
FALSE;
6577 if (recpid == 0)
return FALSE;
6580 lgid, recpid)), auto_recover);
6595 #if !GTK_CHECK_VERSION(3, 0, 0)
6620 if (!lives_file_test(recovery_file, LIVES_FILE_TEST_EXISTS)) {
6623 if (lives_file_test(recovery_file, LIVES_FILE_TEST_EXISTS)) {
6630 if (!lives_file_test(recovery_numbering_file, LIVES_FILE_TEST_EXISTS)) {
6635 if (
prefs->
rr_crash && lives_file_test(recording_file, LIVES_FILE_TEST_EXISTS)) {
6636 if (lives_file_test(recording_numbering_file, LIVES_FILE_TEST_EXISTS)) {
6637 found_recording =
TRUE;
6642 lives_mv(recording_numbering_file, xfile);
6654 lives_mv(recovery_numbering_file, xfile);
6659 if (!found && !found_recording) {
6689 lives_mv(xfile, recovery_numbering_file);
6704 lives_mv(xfile, recording_numbering_file);
char * lives_format_storage_space_string(uint64_t space)
boolean lives_freep(void **ptr)
#define LIVES_GLOBAL_INLINE
void * jackd
jack audio player / transport
boolean is_writeable_dir(const char *dir)
LiVESList * layout_frame_is_affected(int clipno, int start, int end, LiVESList *xlays)
void clear_mainw_msg(void)
void fade_background(void)
boolean create_frame_index(int fileno, boolean init, frames_t start_offset, frames_t nframes)
boolean save_file_comments(int fileno)
weed_plant_t * rte_textparm
send keyboard input to this paramter (usually NULL)
char save_file_name[PATH_MAX]
@ CLIP_DETAILS_HEADER_VERSION
void backup_file(int clip, int start, int end, const char *file_name)
const char * name
plugin name
boolean write_backup_layout_numbering(lives_mt *mt)
#define EFFORT_RANGE_MAX
if set to TRUE during playback then a new frame (or possibly the current one) will be displayed ASAP
lives_img_type_t lives_image_type_to_img_type(const char *lives_image_type)
int create_nullvideo_clip(const char *handle)
#define LIVES_CLIP_HEADER_OLD
LiVESList * cliplist
hash table of clips in menu order
LiVESWidget * m_mutebutton
int swapped_clip
maintains the current cliplist postion even if we swap fg and bg clips
void do_write_failed_error_s(const char *s, const char *addinfo)
LiVESIOChannel * iochan
encoder text output
double lives_ce_update_timeline(int frame, double x)
pointer position in timeline
LiVESWidget * recent[N_RECENT_FILES]
LiVESList * prefs_cache
file caches
LiVESWidgetColor normal_back
void close_scrap_file(boolean remove)
char file_name[PATH_MAX]
input file
LiVESWidget * m_stopbutton
weed_plant_t * weed_plant_deserialise(int fd, unsigned char **mem, weed_plant_t *plant)
double period
timing variables
LIVES_GLOBAL_INLINE char * get_untitled_name(int number)
LiVESWidget * preview_controls
LIVES_GLOBAL_INLINE void do_after_invalid_warning(void)
const lives_clip_data_t * get_decoder_cdata(int fileno, LiVESList *disabled, const lives_clip_data_t *fake_cdata)
LiVESResponseType do_file_notfound_dialog(const char *detail, const char *filename)
lives_interlace_t interlace
interlace type (if known - none, topfirst, bottomfirst or : see plugins.h)
char * choose_file(const char *dir, const char *fname, char **const filt, LiVESFileChooserAction act, const char *title, LiVESWidget *extra_widget)
char * get_worktmp(const char *prefix)
boolean check_for_disk_space(boolean fullcheck)
weed_plant_t * audio_event
#define EXEC_MIDISTOP
shipped
_vid_playback_plugin * open_vid_playback_plugin(const char *name, boolean in_use)
boolean do_progress_dialog(boolean visible, boolean cancellable, const char *text)
void mt_desensitise(lives_mt *mt)
void break_me(const char *brkstr)
@ CANCEL_USER_PAUSED
cancelled and paused
ssize_t lives_read_le(int fd, void *buf, ssize_t count, boolean allow_less)
pthread_mutex_t abuf_mutex
mutices
void save_file(int clip, int start, int end, const char *filename)
LiVESList * xlays
immediately (to be) affected layout maps
void play_file(void)
play the current clip from 'mainw->play_start' to 'mainw->play_end'
char workdir[PATH_MAX]
kept in locale encoding
LIVES_GLOBAL_INLINE void start_playback_async(int type)
const char * version(void)
char * URI
the URI of this cdata
#define LIVES_FILE_EXT_SCRAP
#define IS_VALID_CLIP(clip)
boolean ignore_screen_size
applied during frame reconfig events
boolean crash_recovery
TRUE==maintain mainw->recovery file.
int lives_cp(const char *from, const char *to)
size_t weed_plant_serialise(int fd, weed_plant_t *plant, unsigned char **mem)
LiVESWidget * m_rewindbutton
_vid_playback_plugin * vpp
video plugin
LiVESResponseType do_file_perm_error(const char *file_name, boolean allow_cancel)
int size_warn
warn the user that incorrectly sized frames were found (threshold count)
void * ext_src
points to opaque source for non-disk types
#define WARN_MASK_LAYOUT_DELETE_AUDIO
#define ASERVER_CMD_FILE_CLOSE
@ CANCEL_APP_QUIT
application quit
boolean lives_fsync(int fd)
LIVES_GLOBAL_INLINE boolean do_set_locked_warning(const char *setname)
void update_play_times(void)
like get_play_times, but will force redraw of audio waveforms
void get_dirname(char *filename)
int new_clip
clip we should switch to during playback; switch will happen at the designated SWITCH POINT
int calc_frame_from_time(int filenum, double time)
nearest frame [1, frames]
int bpp
bits per pixel of the image frames, 24 or 32
boolean do_warning_dialog_with_check(const char *text, uint64_t warn_mask_number)
void add_suffix_check(LiVESBox *box, const char *ext)
LiVESWidgetColor normal_fore
boolean clip_switched
for recording - did we switch clips ?
frames_t frames
number of video frames
void pump_io_chan(LiVESIOChannel *iochan)
lives_clip_type_t clip_type
boolean lives_string_ends_with(const char *string, const char *fmt,...)
LiVESWidget * play_window
boolean reload_set(const char *set_name)
boolean d_print_urgency(double timeout_seconds, const char *fmt,...)
char backend[PATH_MAX *4]
frames_t virtual_to_images(int sfileno, frames_t sframe, frames_t eframe, boolean update_progress, LiVESPixbuf **pbr)
#define LIVES_ACLIP_HEADER_NEW
void polymorph(lives_mt *mt, lives_mt_poly_state_t poly)
volatile boolean video_seek_ready
LIVES_GLOBAL_INLINE void set_default_comment(lives_clip_t *sfile, const char *extrat)
boolean decoders_loaded
decoders
boolean record_starting
start recording at next frame
int lives_open2(const char *pathname, int flags)
void pad_init_silence(void)
lives_funcptr_t abort_hook_func
can be set to point to a function to be run before abort, for critical functions
boolean check_clip_integrity(int fileno, const lives_clip_data_t *cdata, frames_t maxframe)
#define LIVES_FILE_EXT_JPG
char * recovery_file
the filename of our recover file
weed_plant_t * frame_layer
void * struct_from_template(lives_struct_type st_type)
LiVESWidget * raudio_draw
int verhash(char *version)
lives_checkstatus_t has_mktemp
LiVESResponseType do_read_failed_error_s_with_retry(const char *fname, const char *errtext)
int lives_open3(const char *pathname, int flags, mode_t mode)
LiVESWidget * framecounter
weed_plantptr_t lives_proc_thread_t
lives proc_threads API
#define LIVES_FILE_EXT_SUB
@ LIVES_DIRECTION_FORWARD
LIVES_GLOBAL_INLINE void do_after_crash_warning(void)
#define WARN_MASK_LAYOUT_DELETE_FRAMES
boolean do_comments_dialog(int fileno, char *filename)
#define SEPWIN_TYPE_STICKY
boolean noswitch
value set automatically to prevent 'inopportune' clip switching
boolean btgamma
allows clips to be stored with bt709 gamma - CAUTION not backwards compatible, untested
#define USE_MPV
some shared structures
boolean add_lmap_error(lives_lmap_error_t lerror, const char *name, livespointer user_data, int clipno, int frameno, double atime, boolean affects_current)
boolean lives_alarm_clear(lives_alarm_t alarm_handle)
char backend_sync[PATH_MAX *4]
#define TICKS_PER_SECOND_DBL
actually microseconds / 100.
void free_jack_audio_buffers(void)
#define LIVES_OSC_NOTIFY_PLAYBACK_STARTED
sent when a/v playback starts or clip is switched
@ CANCEL_KILL
normal - kill background processes working on current clip
void mt_init_clips(lives_mt *mt, int orig_file, boolean add)
int osc_auto
bypass user choices automatically
frames_t actual_frame
actual / last frame being displayed
#define LIVES_OSC_NOTIFY_PLAYBACK_STOPPED
sent when a/v playback ends
ulong deduce_file(const char *file_name, double start, int end)
size_t get_token_count(const char *string, int delim)
@ CLIP_TYPE_GENERATOR
frames from generator plugin
double pointer_time
pointer time in timeline, + the playback start posn for clipeditor (unless playing the selection)
void add_to_clipmenu(void)
void set_main_title(const char *file, int untitled)
LiVESWidget * ext_audio_mon
@ CANCEL_USER
user pressed stop
boolean check_storage_space(int clipno, boolean is_processing)
boolean save_clip_values(int which)
lives_clip_t * clip_forensic(int clipno)
double calc_time_from_frame(int clip, int frame)
void load_preview_image(boolean update_always)
void(* rip_audio_cleanup)(const lives_clip_data_t *cdata)
boolean has_binfmt
DO NOT remove or alter any fields before this ^^^^^.
volatile boolean agen_needs_reinit
boolean get_clip_value(int which, lives_clip_details_t, void *retval, size_t maxlen)
boolean check_if_non_virtual(int fileno, frames_t start, frames_t end)
void set_poly_tab(lives_mt *mt, uint32_t tab)
#define LIVES_DEFAULT_TIMEOUT
boolean do_auto_dialog(const char *text, int type)
lives_img_type_t lives_image_ext_to_img_type(const char *img_ext)
@ LIVES_STRUCT_CLIP_DATA_T
#define VPP_LOCAL_DISPLAY
weed_event_t * event_list
current event_list, for recording
int lives_open_buffered_rdonly(const char *pathname)
int lives_touch(const char *tfile)
void multitrack_play_sel(LiVESMenuItem *menuitem, livespointer user_data)
uint64_t make_version_hash(const char *ver)
volatile int rec_aclip
recording values - to be inserted at the following video frame
LIVES_GLOBAL_INLINE weed_plant_t * get_first_event(weed_plant_t *event_list)
LiVESWidget * preview_spinbutton
#define LIVES_PREVIEW_TYPE_VIDEO_ONLY
#define AUDIO_FRAMES_TO_READ
#define JACK_OPTS_TIMEBASE_CLIENT
full timebase client
_encoder encoder
from main.h
LIVES_GLOBAL_INLINE LiVESResponseType do_error_dialog(const char *text)
boolean get_temp_handle(int index)
get a temp "handle" from disk.
void init_pulse_audio_buffers(int achans, int arate, boolean exact)
boolean do_header_write_error(int clip)
#define URGENCY_MSG_TIMEOUT
boolean reverse_pb
used in osc.c
boolean on_ins_silence_activate(LiVESMenuItem *menuitem, livespointer user_data)
void end_threaded_dialog(void)
void make_play_window(void)
actually in gui.c
void threaded_dialog_spin(double fraction)
lives_img_type_t img_type
char * get_md5sum(const char *filename)
@ UNDO_RENDER
resample/reorder/resize/apply effects
int pheight
playback height
@ CLIP_TYPE_TEMP
temp type, for internal use only
#define SCREEN_AREA_BACKGROUND
#define SYNC_HINT_VIDEO_PAD_END
@ CLIP_TYPE_DISK
imported video, broken into frames
double real_pointer_time
pointer time in timeline, can extend beyond video, for audio
float volume
audio volume level (for jack and pulse)
LiVESTextView * create_output_textview(void)
void free_pulse_audio_buffers(void)
const char * get_deinterlace_string(void)
LIVES_GLOBAL_INLINE void do_no_loadfile_error(const char *fname)
void close_ascrap_file(boolean remove)
ssize_t lives_read_buffered(int fd, void *buf, ssize_t count, boolean allow_less)
lives_checkstatus_t has_mpv
frames_t realize_all_frames(int clipno, const char *msg, boolean enough)
LiVESList * recovery_list
crash recovery system
void init_track_decoders(void)
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
LIVES_GLOBAL_INLINE boolean do_gamma_import_warn(uint64_t fv, int gamma_type)
volatile boolean loop_cont
boolean checked
thumbnail cache, list of lives_tcache_entry_t
volatile lives_cancel_t cancelled
boolean enc_letterbox
encode with letterbox
volatile uint32_t audio_opts
#define is_realtime_aplayer(ptype)
boolean get_new_handle(int index, const char *name)
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)
weed_plant_t * afilter_map
#define MAX_ACHANS
max number of player channels
int count_events(weed_plant_t *event_list, boolean all_events, weed_timecode_t start_tc, weed_timecode_t end_tc)
boolean chill_decoder_plugin(int fileno)
@ CANCEL_ERROR
cancelled because of error
@ CLIP_DETAILS_PB_FRAMENO
ulong restore_file(const char *file_name)
boolean show_desktop_panel
char def_author[1024]
TODO - add to prefs windo.
#define LIVES_STATUS_FILE_NAME
#define WARN_MASK_CLEAN_INVALID
#define CLIP_TOTAL_TIME(clip)
lives_proc_thread_t lives_proc_thread_create(lives_thread_attr_t attr, lives_funcptr_t func, int return_type, const char *args_fmt,...)
create the specific plant which defines a background task to be run
void workdir_warning(void)
char * choose_file_bg(const char *dir, const char *fname, char **const filt, LiVESFileChooserAction act, const char *title, LiVESWidget *extra_widget)
boolean preview_rendering
boolean recoverable_layout
void d_print(const char *fmt,...)
char name[CLIP_NAME_MAXLEN]
the display name
LiVESList * disabled_decoders
void on_playsel_activate(LiVESMenuItem *menuitem, livespointer user_data)
void weed_reinit_all(void)
void close_current_file(int file_to_switch_to)
close current file, and try to switch to file_to_switch_to
int blend_file
background clip details
void switch_to_file(int old_file, int new_file)
volatile double rec_aseek
void deinit_render_effects(void)
switch off effects after render preview during rendering/render preview, we use the "keys" FX_KEYS_MA...
void on_quit_activate(LiVESMenuItem *menuitem, livespointer user_data)
boolean get_handle_from_info_file(int index)
int pre_src_audio_file
audio file we were playing before any ext input started
off_t reget_afilesize_inner(int fileno)
LiVESWidget * preview_box
char * plugin_run_param_window(const char *scrap_text, LiVESVBox *vbox, lives_rfx_t **ret_rfx)
create an interface window for a plugin; possibly run it, and return the parameters
void on_details_button_clicked(void)
int frame_width
frame is the surrounding part, including any black border (>=width)
LiVESResponseType do_header_missing_detail_error(int clip, lives_clip_details_t detail)
LiVESTextView * optextview
void get_basename(char *filename)
LIVES_GLOBAL_INLINE void do_program_not_found_error(const char *progname)
void procw_desensitize(void)
#define JACK_OPTS_TIMEBASE_START
jack sets play start position
LiVESWidget * choose_file_with_preview(const char *dir, const char *title, char **const filt, int filesel_type)
int save_to_scrap_file(weed_layer_t *layer)
uint32_t signed_endian
bitfield
char video_open_command[PATH_MAX *2]
LiVESWidget * spinbutton_end
@ CLIP_TYPE_FILE
unimported video, not or partially broken in frames
int pre_src_file
video file we were playing before any ext input started
int lives_mv(const char *from, const char *to)
void(* SignalHandlerPointer)(int)
lives_clip_t * create_cfile(int new_file, const char *handle, boolean is_loaded)
set default values for a clip (in memory)
ticks_t origsecs
playback start seconds - subtracted from all other ticks to keep numbers smaller
lives_checkstatus_t has_xdg_screensaver
LiVESWidget * message_box
boolean playing_sel
list of set names in current workdir, mau be NULL
LiVESWidget * spinbutton_start
void add_to_recent(const char *filename, double start, int frames, const char *file_open_params)
#define LAYOUT_NUMBERING_FILENAME
frames_t * frame_index
index of frames for CLIP_TYPE_FILE >0 means corresponding frame within original clip -1 means corresp...
boolean freeze_callback(LiVESAccelGroup *group, LiVESWidgetObject *obj, uint32_t keyval, LiVESXModifierType mod, livespointer user_data)
void d_print_file_error_failed(void)
volatile int blend_palette
here we can store the details of the blend file at the insertion point, if nothing changes we can tar...
boolean cs_permitted
set to TRUE to allow overriding of noswitch in limited circumstances
boolean ratio_fps
framerate of the clip
int scrap_file
we throw odd sized frames here when recording in real time; used if a source is a generator or stream
boolean decoder_plugin_move_to_first(const char *name)
off_t get_file_size(int fd)
void cached_list_free(LiVESList **list)
void reset_clipmenu(void)
char info_file[PATH_MAX]
used for asynch communication with externals
boolean restore_clip_binfmt(int clipno)
volatile int abufs_to_fill
LiVESXWindow * foreign_window
LiVESResponseType do_memory_error_dialog(char *op, size_t bytes)
#define CURRENT_CLIP_HAS_VIDEO
void d_print_failed(void)
char * lives_fgets(char *s, int size, FILE *stream)
lives_checkstatus_t has_mplayer
#define LIVES_OSC_NOTIFY_SUCCESS
for OSC only (not for C++)
int playing_file
which number file we are playing (or -1) [generally mainw->current_file]
#define P_(String, StringPlural, n)
@ LIVES_INTERLACE_TOP_FIRST
void get_location(const char *exe, char *val, int maxlen)
void fill_abuffer_from(lives_audio_buf_t *abuf, weed_plant_t *event_list, weed_plant_t *st_event, boolean exact)
boolean save_frame_index(int fileno)
void end_fs_preview(void)
frames_t load_frame_index(int fileno)
ssize_t lives_write_le(int fd, livesconstpointer buf, ssize_t count, boolean allow_fail)
LiVESWidget * m_loopbutton
lives_clip_t * files[MAX_FILES+1]
+1 for the clipboard
boolean save_clip_value(int which, lives_clip_details_t, void *val)
volatile float volume
audio volume level (for jack and pulse)
void mt_show_current_frame(lives_mt *mt, boolean return_layer)
preview the current frame
volatile boolean audio_seek_ready
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 ...
frames_t fps_measure
show fps stats after playback
void init_jack_audio_buffers(int achans, int arate, boolean exact)
boolean read_headers(int fileno, const char *dir, const char *file_name)
void add_to_recovery_file(const char *handle)
#define PREF_MASTER_VOLUME
void * pulsed
pulseaudio player
#define SYNC_HINT_VIDEO_PAD_START
int lives_close_buffered(int fd)
void wait_for_stop(const char *stop_command)
#define SEPWIN_TYPE_NON_STICKY
LiVESAccelGroup * accel_group
#define DEFAULT_AUDIO_RATE
defaults for when not specifed
_palette * palette
interface colour settings
LIVES_GLOBAL_INLINE void too_many_files(void)
#define LIVES_CLIP_HEADER_NEW
#define LIVES_CLIP_HEADER
void make_preview_box(void)
off_t sget_file_size(const char *name)
void event_list_free(weed_plant_t *event_list)
boolean recording_recovered
void mt_swap_play_pause(lives_mt *mt, boolean put_pause)
LIVES_GLOBAL_INLINE void do_no_decoder_error(const char *fname)
void weed_generator_end(weed_plant_t *inst)
boolean check_for_executable(lives_checkstatus_t *cap, const char *exec)
weed_event_t * stored_event_list
stored mt -> clip editor
boolean show_desktop_panel(void)
boolean check_layer_ready(weed_layer_t *layer)
block until layer pixel_data is ready.
LiVESWidget * m_playbutton
LIVES_GLOBAL_INLINE void do_clip_divergence_error(int fileno)
boolean recover_files(char *recovery_file, boolean auto_recover)
int play_sequence
currticks when last display was shown (used for fixed fps)
#define LIVES_CLIP_HEADER_VERSION
int save_event_frames(void)
void get_filename(char *filename, boolean strip_dir)
@ CLIP_DETAILS_DECODER_NAME
boolean rewrite_recovery_file(void)
void resize_play_window(void)
frames_t count_virtual_frames(frames_t *findex, frames_t start, frames_t end)
count virtual frames between start and end (inclusive)
#define MIN_MSGBAR_HEIGHT
boolean show_player_stats
void do_threaded_dialog(const char *trans_text, boolean has_cancel)
int arps
audio physical sample rate (i.e the "normal" sample rate of the clip when played at 1,...
void get_total_time(lives_clip_t *file)
calculate laudio, raudio and video time (may be deprecated and replaced with macros)
char * subst(const char *string, const char *from, const char *to)
void catch_sigint(int signum)
void fullscreen_internal(void)
int lives_rmdir(const char *dir, boolean force)
#define lives_strdup_printf(fmt,...)
#define GUI_SCREEN_HEIGHT
boolean osc_block
TODO - make this a mutex and more finely grained : things we need to block are (clip switches,...
#define _RELOAD_STRING(field, len)
void set_drawing_area_from_pixbuf(LiVESWidget *widget, LiVESPixbuf *pixbuf, lives_painter_surface_t *surface)
boolean convert_layer_palette(weed_layer_t *layer, int outpl, int op_clamping)
boolean deinterlace
auto deinterlace
#define LIVES_IMAGE_TYPE_JPEG
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 **)
void audio_free_fnames(void)
@ CANCEL_KEEP_LOOPING
special cancel for TV toy
int hsize
frame width (horizontal) in pixels (NOT macropixels !)
uint64_t get_ds_free(const char *dir)
void popup_lmap_errors(LiVESMenuItem *menuitem, livespointer user_data)
boolean needs_silent_update
needs internal update, we shouldn't concern the user
#define LIVES_MAIN_WINDOW_WIDGET
lives_audio_buf_t * audio_cache_init(void)
@ CLIP_TYPE_NULL_VIDEO
generates blank video frames
boolean checked_for_old_header
LIVES_GLOBAL_INLINE lives_cancel_t handle_audio_timeout(void)
ssize_t lives_read(int fd, void *buf, ssize_t count, boolean allow_less)
#define LIVES_THRDATTR_NONE
const lives_decoder_sys_t * decoder
boolean weed_playback_gen_start(void)
boolean _start_playback(livespointer data)
void save_frame(LiVESMenuItem *menuitem, livespointer user_data)
#define CLIP_BINFMT_CHECK
int ascrap_file
scrap file for recording audio scraps
#define LIVES_EXT_SRC_FILE_BUFF
pthread_mutex_t clip_list_mutex
prevent adding/removing to cliplist while another thread could be reading it
void add_to_ascrap_mb(uint64_t bytes)
LIVES_GLOBAL_INLINE void unref_struct(lives_struct_def_t *lsd)
int img_concat_clip
when opening multiple, image files can get concatenated here (prefs->concat_images)
#define ENCODER_NON_NATIVE
weed_layer_t * weed_layer_copy(weed_layer_t *dlayer, weed_layer_t *slayer)
copy source layer slayer to dest layer dlayer
double event_list_get_start_secs(weed_plant_t *event_list)
int write_abuf
audio buffer number to write to (for multitrack)
#define SCREEN_AREA_FOREGROUND
boolean save_srt_subtitles(lives_clip_t *sfile, double start_time, double end_time, double offset_time, const char *filename)
LIVES_GLOBAL_INLINE size_t lives_strlen(const char *s)
_future_prefs * future_prefs
LiVESWidget * laudio_draw
ssize_t lives_popen(const char *com, boolean allow_error, char *buff, ssize_t buflen)
LIVES_GLOBAL_INLINE int lives_strappend(const char *string, int len, const char *xnew)
#define CURRENT_CLIP_IS_NORMAL
void recover_layout_map(int numclips)
@ CANCEL_AUDIO_ERROR
cancelled because of soundcard error
LiVESList * hdrs_cache
cache of a file header (e.g. header.lives)
int def_width
default sizes for when no file is loaded
LiVESList * load_layout_map(void)
render_details * create_render_details(int type)
char * subt_save_file
name of file to save subtitles to
LIVES_GLOBAL_INLINE int lives_getuid(void)
lives_mt * multitrack
holds a pointer to the entire multitrack environment; NULL in Clip Edit mode
boolean on_del_audio_activate(LiVESMenuItem *menuitem, livespointer user_data)
#define CURRENT_CLIP_IS_VALID
ticks_t lives_alarm_check(lives_alarm_t alarm_handle)
void d_print_cancelled(void)
#define LIVES_IMAGE_TYPE_PNG
char * prep_audio_player(char *com2, char *com3, frames_t audio_end, int arate, int asigned, int aendian)
boolean suppress_dprint
tidy up, e.g. by blocking "switched to file..." and "closed file..." messages
int aud_rec_fd
fd of file we are recording audio to
volatile boolean record_paused
pause during recording
void wait_for_bg_audio_sync(int fileno)
boolean save_sub_subtitles(lives_clip_t *sfile, double start_time, double end_time, double offset_time, const char *filename)
ulong open_file_sel(const char *file_name, double start, int frames)
#define EXEC_MIDISTART
shipped
lives_checkstatus_t has_mplayer2
lives_audio_track_state_t * get_audio_and_effects_state_at(weed_plant_t *event_list, weed_plant_t *st_event, weed_timecode_t fill_tc, int what_to_get, boolean exact)
get audio (and optionally video) state at timecode tc OR before event st_event
LiVESResponseType do_write_failed_error_s_with_retry(const char *fname, const char *errtext)
int last_dprint_file
message output settings
void mt_clip_select(lives_mt *mt, boolean scroll)
size_t lives_buffered_orig_size(int fd)
LiVESResponseType do_header_read_error_with_retry(int clip)
#define SYNC_HINT_AUDIO_TRIM_START
boolean on_mouse_scroll(LiVESWidget *widget, LiVESXEventScroll *event, livespointer user_data)
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
@ CLIP_DETAILS_GAMMA_TYPE
LIVES_GLOBAL_INLINE void free_track_decoders(void)
#define MAX_FILES
max files is actually 1 more than this, since file 0 is the clipboard
LIVES_GLOBAL_INLINE boolean start_playback(int type)
#define LIVES_FILE_EXT_TMP
boolean open_scrap_file(void)
void kill_play_window(void)
void lives_notify(int msgnumber, const char *msgstring)
void play_window_set_title(void)
void set_signal_handlers(SignalHandlerPointer sigfunc)
boolean ext_playback
using external video playback plugin
char * file_open_params
extra parameters for opening special files
const char * get_image_ext_for_type(lives_img_type_t imgtype)
lives_subtitle_type_t type
LiVESList * load_decoders(void)
void vid_playback_plugin_exit(void)
int pre_play_file
the current file before playback started
int lives_chdir(const char *path, boolean no_error_dlg)
void d_print_enough(int frames)
#define LIVES_EXT_SRC_NONE
int64_t(* rip_audio)(const lives_clip_data_t *, const char *fname, int64_t stframe, int64_t nframes, unsigned char **abuff)
lives_painter_surface_t * play_surface
#define LIVES_OSC_NOTIFY_CLIP_OPENED
sent after a clip is opened
boolean open_ascrap_file(void)
int lives_utf8_strcmp(const char *s1, const char *s2)
boolean resize_layer(weed_layer_t *layer, int width, int height, LiVESInterpType interp, int opal_hint, int oclamp_hint)
resize a layer
LiVESWidget * loop_continue
double pb_fps
current playback rate, may vary from fps, can be 0. or negative
char * get_extension(const char *filename)
void lives_kill_subprocesses(const char *dirname, boolean kill_parent)
weed_plant_t * frame_layer_preload
predictive caching apparatus
#define LIVES_FILE_EXT_LAYOUT
void unlock_loop_lock(void)
@ CANCEL_KEEP
user pressed 'Keep'
#define SYNC_HINT_AUDIO_PAD_END
boolean add_file_info(const char *check_handle, boolean aud_only)
void insert_blank_frames(int sfileno, frames_t nframes, frames_t after, int palette)
int lives_system(const char *com, boolean allow_error)
LIVES_GLOBAL_INLINE weed_layer_t * weed_layer_free(weed_layer_t *layer)
frees pixel_data for a layer, then the layer itself
void reget_afilesize(int fileno)
@ CANCEL_EVENT_LIST_END
event_list completed
LIVES_GLOBAL_INLINE char * lives_chomp(char *buff)
LiVESResponseType get_utf8_pref(const char *key, char *val, int maxlen)
@ LMAP_ERROR_DELETE_FRAMES
uint64_t gen_unique_id(void)
boolean check_for_recovery_files(boolean auto_recover)
void weed_bg_generator_end(weed_plant_t *inst)
void *(* lives_funcptr_t)(void *)
boolean do_yesno_dialog(const char *text)
double audio_stretch
for fixed fps modes, the value is used to speed up / slow down audio
int vsize
frame height (vertical) in pixels
#define LIVES_FILE_EXT_SRT
void resize(double scale)
LiVESWidget * spinbutton_pb_fps
void redraw_timeline(int clipno)
void mt_sensitise(lives_mt *mt)
LIVES_GLOBAL_INLINE void init_conversions(int intent)
void on_record_perf_activate(LiVESMenuItem *menuitem, livespointer user_data)
char * get_menu_name(lives_clip_t *sfile, boolean add_setname)
void do_read_failed_error_s(const char *s, const char *addinfo)
ulong open_file(const char *file_name)
int lives_create_buffered_nosync(const char *pathname, int mode)
boolean check_encoder_restrictions(boolean get_extension, boolean user_audio, boolean save_all)
char vid_save_dir[PATH_MAX]
void get_play_times(void)
recalculate video / audio lengths and draw the timer bars
@ CANCEL_SOFT
just cancel in GUI (for keep, etc)
corresponds to one clip in the GUI
#define CURRENT_CLIP_IS_TEMP
#define LIVES_FILE_EXT_BACKUP
int64_t disk_monitor_check_result(const char *dir)
boolean is_processing
states
void defer_sigint(int signum)
boolean render_choice_idle(livespointer data)
boolean load_from_scrap_file(weed_layer_t *layer, int frame)
LiVESList * layout_audio_is_affected(int clipno, double stime, double etime, LiVESList *xlays)
ssize_t lives_write(int fd, livesconstpointer buf, ssize_t count, boolean allow_fail)
void reset_message_area(void)
boolean on_trim_audio_activate(LiVESMenuItem *menuitem, livespointer user_data)
#define LIVES_ENC_DEBUG_FILE_NAME
LIVES_GLOBAL_INLINE LiVESResponseType do_abort_cancel_retry_dialog(const char *text)
LiVESResponseType handle_backend_errors(boolean can_retry)
boolean read_file_details(const char *file_name, boolean is_audio, boolean is_img)
double event_list_get_end_secs(weed_plant_t *event_list)
int close_temp_handle(int new_clip)
close cfile and switch to new clip (may be -1)
#define FPS_MAX
maximum fps we will allow (double)
boolean save_frame_inner(int clip, int frame, const char *file_name, int width, int height, boolean from_osc)
volatile ticks_t currticks
wall clock time, updated whenever lives_get_*_ticks is called
weed_plant_t * filter_map
boolean resize_message_area(livespointer data)
@ CANCEL_NO_PROPOGATE
cancel but keep opening
lives_cancel_type_t cancel_type
void disable_record(void)
boolean show_rdet
show render details (frame size, encoder type) before saving to file
#define LIVES_FILE_SELECTION_VIDEO_AUDIO
int asampsize
audio sample size in bits (8 or 16)
char configfile[PATH_MAX]
kept in locale encoding (config settings) [default ~/.local/config/lives)
boolean opening_loc
opening location (streaming)
boolean write_headers(lives_clip_t *file)
LiVESWidget * record_perf
boolean subtitles_init(lives_clip_t *sfile, char *fname, lives_subtitle_type_t subtype)
volatile int agen_key
which fx key is generating audio [1 based] (or 0 for none)
#define WARN_MASK_CLEAN_AFTER_CRASH
void get_mime_type(char *text, int maxlen, const lives_clip_data_t *cdata)
LIVES_GLOBAL_INLINE int lives_getgid(void)
LIVES_GLOBAL_INLINE void lives_proc_thread_join(lives_proc_thread_t tinfo)
#define SYNC_HINT_AUDIO_PAD_START
LiVESPixbuf * layer_to_pixbuf(weed_layer_t *layer, boolean realpalette, boolean fordisplay)
#define DEF_FILE_PERMS
non-executable, is modified by the umask
int arate
current audio playback rate (varies if the clip rate is changed)
boolean lazy_startup_checks(void *data)
LiVESList * cache_file_contents(const char *filename)
void play_all(boolean from_menu)
void reload_subs(int fileno)
boolean perm_audio_reader
#define DEFAULT_AUDIO_CHANS
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
@ LMAP_ERROR_DELETE_AUDIO
lives_direction_t adirection
audio play direction during playback, FORWARD or REVERSE.
void audio_cache_end(void)
void open_set_file(int clipnum)
uint32_t mt_idle_add(lives_mt *mt)
LIVES_GLOBAL_INLINE char * get_audio_file_name(int fnum, boolean opening)
#define LIVES_CLIP_HEADER_OLD2
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 ...
#define IS_NORMAL_CLIP(clip)
#define STYLE_1
turn on theming if set
#define PREF_VID_SAVE_DIR
#define SYNC_HINT_AUDIO_TRIM_END
int lives_rm(const char *file)
void on_toy_activate(LiVESMenuItem *menuitem, livespointer user_data)
boolean event_list_to_block(weed_plant_t *event_list, int num_events)
uint64_t binfmt_end
marks the end of anything "interesring" we may want to save via binfmt extension
ticks_t orignsecs
usecs at start of playback - ditto
boolean reload_clip(int fileno, int maxframe)
LIVES_GLOBAL_INLINE char * lives_concat(char *st, char *x)
void unfade_background(void)
int achans
number of audio channels (0, 1 or 2)
#define LIVES_ACLIP_HEADER
LIVES_GLOBAL_INLINE ticks_t lives_get_relative_ticks(ticks_t origsecs, ticks_t orignsecs)
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.
boolean pref_factory_float(const char *prefidx, float newval, boolean permanent)
uint32_t get_signed_endian(boolean is_signed, boolean little_endian)
produce bitmapped value
void add_to_playframe(void)
#define MAINW_MSG_SIZE
mainw->msg bytesize
boolean foreign
for external window capture
void load_end_image(int frame)
boolean is_legal_set_name(const char *set_name, boolean allow_dupes, boolean leeway)
#define STOP_GIVE_UP_TIME
#define AV_TRACK_MIN_DIFF
ignore track time differences < this (seconds)
int set_utf8_pref(const char *key, const char *value)
LiVESWidget * m_playselbutton
void deinit_easing_effects(void)
switch off effects in easing out state after playback ends during playback, some effects don't deinit...