17 static int reorder_width = 0;
18 static int reorder_height = 0;
19 static boolean reorder_leave_back =
FALSE;
43 if (in > 0.)
return ((
ticks_t)((
double)in * (
double)fps + (
double).5) / (
double)fps) *
45 if (in < 0.)
return ((
ticks_t)((double)in * (
double)fps - (double).5) / (double)fps) *
53 size_t samps = (seek <= 0. || arate <= 0) ? 0 : (
size_t)(seek * (double)arate + .99999);
59 if (arate <= 0)
return 0.;
62 return (
double)samps / (double)arate;
68 return samps * (size_t)(achans * asampsize);
74 if (resampled_fps < orig_fps)
return ((res_frames = (
int)((
double)in_frames / orig_fps * resampled_fps)) < 1) ? 1 : res_frames;
75 else return ((res_frames = (
int)((
double)in_frames / orig_fps * resampled_fps + .49999)) < 1) ? 1 : res_frames;
81 int asigned,
boolean swap_endian) {
87 boolean audio_resampled =
FALSE;
88 boolean video_resampled =
FALSE;
89 boolean video_resized =
FALSE;
90 boolean bad_header =
FALSE;
92 int frames =
cfile->frames;
94 reorder_leave_back =
FALSE;
96 if (asigned != 0 || (arate > 0 && arate !=
cfile->arate) || swap_endian) {
97 cfile->undo1_int = arate;
112 audio_resampled =
TRUE;
124 fps = (fps_num * 1.) / (fps_denom * 1.);
126 if (fps > 0. && fps !=
cfile->fps) {
128 if ((width !=
cfile->hsize || height !=
cfile->vsize) && width * height > 0) {
131 if (fps >
cfile->fps) {
138 int iwidth =
cfile->hsize, iheight =
cfile->vsize;
147 cfile->hsize = width;
148 cfile->vsize = height;
154 cfile->undo1_dbl = fps;
155 cfile->undo_start = 1;
156 cfile->undo_end = frames;
161 reorder_leave_back =
TRUE;
163 reorder_width = width;
164 reorder_height = height;
169 reorder_leave_back =
FALSE;
176 video_resized =
TRUE;
177 video_resampled =
TRUE;
183 cfile->undo1_dbl = fps;
186 reorder_width = width;
187 reorder_height = height;
193 reorder_width = reorder_height = 0;
195 cfile->hsize = width;
196 cfile->vsize = height;
206 video_resampled =
TRUE;
207 video_resized =
TRUE;
211 cfile->undo1_dbl = fps;
212 cfile->undo_start = 1;
215 reorder_width = width;
216 reorder_height = height;
220 reorder_width = reorder_height = 0;
221 reorder_leave_back =
FALSE;
229 video_resampled =
TRUE;
233 if ((width !=
cfile->hsize || height !=
cfile->vsize) && width * height > 0) {
235 cfile->undo_start = 1;
238 int iwidth =
cfile->hsize, iheight =
cfile->vsize;
247 cfile->hsize = width;
248 cfile->vsize = height;
259 video_resized =
TRUE;
270 if (!video_resized) {
274 if (!video_resampled) {
277 cfile->undo_start = 1;
278 cfile->undo_end = frames;
286 static weed_plant_t *copy_with_check(weed_plant_t *event, weed_plant_t *out_list, weed_timecode_t tc,
char *what,
size_t bytes,
287 weed_plant_t **ret_event) {
288 LiVESResponseType response;
289 weed_plant_t *new_list;
291 response = LIVES_RESPONSE_OK;
292 if (ret_event) *ret_event = NULL;
296 }
while (response == LIVES_RESPONSE_RETRY);
297 if (response == LIVES_RESPONSE_CANCEL)
return NULL;
302 #define READJ_MIN 0.1
304 #define SMTH_FRAME_LIM 8
305 #define SMTH_TC_LIM (0.5 * TICKS_PER_SECOND_DBL)
315 int pclip = 0, ppclip = 0;
316 int pframe = 0, ppframe = 0;
317 weed_timecode_t stc = 0, etc, tc, ptc = 0, pptc = 0;
332 if (pframev && ppframev && pclip == clip && ppclip == clip) {
334 double del1 = (double)(ptc - pptc);
335 double del2 = (double)(tc - ptc);
336 if (del1 * del2 >= 3.5) {
337 pframe = (
frames_t)(((
double)ppframe * del2 + (double)frame * del1) / (del1 + del2) + .5);
342 pptc = ptc; ptc = tc;
343 ppframe = pframe; pframe = frame;
344 ppclip = pclip; pclip = clip;
345 ppframev = pframev; pframev = event;
353 if (ntracks > 1)
break;
368 if (ntracks > 1)
break;
370 if (ststate[0].vel != 0. && (enstate[0].vel != 0. || ev_api >= 122) && enstate[0].afile == ststate[0].afile) {
373 if (dtime <= READJ_MAX && dtime >=
READJ_MIN) {
375 double tpos = ststate[0].
seek + ststate[0].
vel * dtime;
376 double ratio = fabs(enstate[0].seek - ststate[0].seek) / fabs(tpos - ststate[0].seek);
378 weed_timecode_t otc = 0, ntc = 0;
381 for (xevent = last; xevent != event; xevent =
get_next_event(xevent)) {
456 weed_plant_t *
quantise_events(weed_plant_t *in_list,
double qfps,
boolean allow_gap) {
457 weed_timecode_t out_tc = 0, offset_tc = 0, in_tc, laud_tc = 0, nx_tc;
458 weed_timecode_t end_tc;
460 weed_plant_t *out_list, *xout_list;
465 weed_event_t *init_event, *filter_map = NULL, *deinit_event;
467 weed_timecode_t recst_tc = 0;
469 LiVESResponseType response;
470 LiVESList *init_events = NULL, *deinit_events = NULL, *list;
473 double *xaseeks = NULL, *naseeks = NULL, *naccels = NULL;
477 boolean interpolate =
TRUE;
478 int *clips = NULL, *naclips = NULL, *nclips = NULL;
479 int64_t *frames = NULL, *nframes = NULL;
482 int tracks, ntracks = 0, natracks = 0, xatracks = 0;
487 register int i, j, k;
489 if (!in_list)
return NULL;
490 if (qfps < 1.)
return NULL;
492 old_fps = weed_get_double_value(in_list, WEED_LEAF_FPS, NULL);
493 if (old_fps == qfps)
return in_list;
496 what = (
_(
"quantising the event list"));
499 response = LIVES_RESPONSE_OK;
501 out_list = weed_plant_copy(in_list);
505 }
while (response == LIVES_RESPONSE_RETRY);
506 if (response == LIVES_RESPONSE_CANCEL) {
523 weed_set_double_value(out_list, WEED_LEAF_FPS, qfps);
526 if (!event)
goto q_done;
529 if (!last_frame_event)
goto q_done;
534 end_tc =
q_gint64(end_tc + tl, qfps);
537 for (; out_tc < end_tc || event; out_tc =
q_gint64(out_tc + tl + (tl >> 2), qfps)) {
538 weed_timecode_t stop_tc = out_tc + offset_tc;
539 if (out_tc > end_tc) out_tc = end_tc;
557 if (event && (is_final == 2 || (in_tc <= stop_tc && is_final != 1))) {
563 case WEED_EVENT_TYPE_MARKER: {
573 xatracks = natracks = 0;
574 lives_list_free(init_events);
575 lives_list_free(deinit_events);
576 init_events = deinit_events = NULL;
583 if (!(xout_list = copy_with_check(event, out_list, out_tc, what, 0, NULL))) {
588 out_list = xout_list;
592 case WEED_EVENT_TYPE_FRAME:
595 if (!nframe_event) is_final = 1;
613 for (i = 0; i < natracks; i += 2) {
614 double vel = naseeks[i + 1];
615 if (naseeks[i + 1] != 0.) {
616 naseeks[i] += vel * dt;
627 for (i = 0; i < atracks; i += 2) {
628 for (j = 0; j < natracks; j += 2) {
629 if (naclips[j] == aclips[i]) {
631 naclips[j + 1] = aclips[i + 1];
632 naseeks[j] = aseeks[i];
633 naseeks[j + 1] = aseeks[i + 1];
644 naclips[natracks - 2] = aclips[j];
645 naclips[natracks - 1] = aclips[j + 1];
646 naseeks[natracks - 2] = aseeks[j];
647 naseeks[natracks - 1] = aseeks[j + 1];
648 naccels[(natracks >> 1) - 1] = 0.;
653 if (naudio_event == event) naudio_event = NULL;
658 if (event == nframe_event) nframe_event = NULL;
660 case WEED_EVENT_TYPE_FILTER_INIT:
663 init_events = lives_list_prepend(init_events, event);
665 case WEED_EVENT_TYPE_FILTER_DEINIT:
668 for (list = init_events; list; list = list->next) {
669 if (list->data == init_event) {
670 if (list->prev) list->prev->next = list->next;
671 else init_events = list->next;
672 if (list->next) list->next->prev = list->prev;
673 list->next = list->prev = NULL;
674 lives_list_free(list);
681 weed_leaf_dup(out_event, init_event, WEED_LEAF_IN_PARAMETERS);
682 if (!is_final) deinit_events = lives_list_prepend(deinit_events, event);
685 if (!(xout_list = copy_with_check(event, out_list, out_tc, what, 0, NULL))) {
690 out_list = xout_list;
694 case WEED_EVENT_TYPE_PARAM_CHANGE:
698 for (list = init_events; list; list = list->next) {
699 if (list->data == init_event)
break;
703 weed_event_t *pch_event, *init_event, *pchange, *npchange;
705 if (!(xout_list = copy_with_check(event, out_list, in_tc - offset_tc, what, 0, &pch_event))) {
715 out_list = xout_list;
718 pchanges = weed_get_voidptr_array_counted(init_event, WEED_LEAF_IN_PARAMETERS, &nchanges);
720 for (i = 0; i < nchanges; i++) {
736 case WEED_EVENT_TYPE_FILTER_MAP:
746 weed_timecode_t frame_tc;
753 for (list = init_events; list; list = list->next) {
756 if (!(xout_list = copy_with_check(init_event, out_list, out_tc, what, 0, &xinit_event))) {
759 lives_list_free(init_events);
762 out_list = xout_list;
764 pchanges = weed_get_voidptr_array_counted(init_event, WEED_LEAF_IN_PARAMETERS, &nchanges);
765 init_event = xinit_event;
766 for (i = 0; i < nchanges; i++) {
768 if (!(xout_list = copy_with_check(pchange, out_list, out_tc, what, 0, (
weed_event_t **)&pchanges[i]))) {
771 lives_list_free(init_events);
775 out_list = xout_list;
777 weed_set_voidptr_array(init_event, WEED_LEAF_IN_PARAMETERS, nchanges, pchanges);
779 lives_list_free(init_events);
784 if (filter_map && !deinit_events) {
786 if (!(xout_list = copy_with_check(filter_map, out_list, out_tc, what, 0, NULL))) {
791 out_list = xout_list;
806 if (nx_tc - (out_tc + offset_tc) < out_tc + offset_tc - frame_tc) {
808 frame_event = nframe_event;
818 double ratio = (double)(out_tc - frame_tc) / (double)(nx_tc - frame_tc);
819 for (i = 0; i < tracks; i++) {
820 if (i >= ntracks)
break;
821 if (clips[i] == nclips[i]) {
822 frames[i] = (int64_t)((
double)frames[i] + (double)(nframes[i] - frames[i]) * ratio);
838 if (response == LIVES_RESPONSE_CANCEL) {
854 for (i = 0; i < natracks; i += 2) {
855 if (naseeks[i + 1] == 0.) {
856 for (j = 0; j < xatracks; j += 2) {
857 if (xaclips[j] == naclips[i] && xaseeks[j + 1] != 0.)
break;
866 for (k = i; k < natracks; k += 2) {
867 naclips[k] = naclips[k + 2];
868 naclips[k + 1] = naclips[k + 3];
869 naseeks[k] = naseeks[k + 2];
870 naseeks[k + 1] = naseeks[k + 3];
871 naccels[k >> 1] = naccels[(k >> 1) + 1];
884 for (i = 0; i < natracks; i += 2) {
885 double vel = naseeks[i + 1];
886 if (naseeks[i + 1] != 0.) {
888 naseeks[i] += vel * dt;
902 double amicro_lim = 4. / qfps;
906 for (i = 0; i < natracks; i += 2) {
908 boolean gottrack =
FALSE;
910 if (naseeks[i + 1] == 0. && ev_api < 122)
continue;
911 for (k = 0; k < xatracks; k += 2) {
912 if (xaclips[k] == naclips[i]) {
916 if (xaclips[k + 1] == naclips[i + 1]) gottrack =
TRUE;
920 if (!gottrack)
continue;
923 xprev_aframe = prev_aframe;
930 if (ptc < recst_tc)
break;
934 for (j = 0; j < patracks; j += 2) {
935 if (paclips[j] == naclips[i]) {
936 if (paclips[j + 1] == naclips[i + 1]) {
937 if (paseeks[j + 1] != 0.) {
947 double nvel = (naseeks[i] - paseeks[j]) / dt, seek;
949 if (nvel * paseeks[j + 1] < 0.)
break;
951 if (nvel > paseeks[j + 1]) {
960 seek = paseeks[j] + nvel * dt;
962 if (naseeks[i] > seek) {
981 for (i = 0; i < natracks; i += 2) {
982 for (j = 0; j < xatracks; j += 2) {
983 if (naclips[i] == xaclips[j]) {
984 xaclips[j + 1] = naclips[i + 1];
985 xaseeks[j] = naseeks[i];
986 xaseeks[j + 1] = naseeks[i + 1];
994 xaclips[xatracks - 2] = naclips[i];
995 xaclips[xatracks - 1] = naclips[i + 1];
996 xaseeks[xatracks - 2] = naseeks[i];
997 xaseeks[xatracks - 1] = naseeks[i + 1];
1011 if (deinit_events) {
1013 for (list = deinit_events; list; list = list->next) {
1016 if (!(xout_list = copy_with_check(deinit_event, out_list, out_tc, what, 0, NULL))) {
1021 out_list = xout_list;
1023 lives_list_free(deinit_events);
1024 deinit_events = NULL;
1029 if (!(xout_list = copy_with_check(filter_map, out_list, out_tc, what, 0, NULL))) {
1034 out_list = xout_list;
1037 if (is_final == 1) {
1047 if (!(xout_list = copy_with_check(filter_map, out_list, end_tc, what, 0, NULL))) {
1052 out_list = xout_list;
1059 response = LIVES_RESPONSE_OK;
1066 }
while (response == LIVES_RESPONSE_RETRY);
1067 if (response == LIVES_RESPONSE_CANCEL) {
1080 lives_list_free(init_events);
1081 lives_list_free(deinit_events);
1090 static void on_reorder_activate(
int rwidth,
int rheight) {
1123 cfile->event_list = NULL;
1124 cfile->next_event = NULL;
1162 int arate, achans, asampsize, arps;
1163 int asigned = 1, aendian = 1;
1164 int cur_signed, cur_endian;
1191 arate = arps =
cfile->undo1_int;
1192 achans =
cfile->undo2_int;
1193 asampsize =
cfile->undo3_int;
1213 if (!(arate ==
cfile->arate && arps ==
cfile->arps && achans ==
cfile->achans && asampsize ==
cfile->asampsize &&
1214 asigned == cur_signed && aendian == cur_endian)) {
1216 double audio_stretch = (double)
cfile->arps / (
double)
cfile->arate;
1221 cfile->achans,
cfile->asampsize, cur_signed, cur_endian, arps,
cfile->achans,
cfile->asampsize,
1222 cur_signed, cur_endian, audio_stretch);
1235 cfile->achans,
cfile->asampsize, cur_signed, cur_endian, arps, achans, asampsize,
1252 if (
cfile->audio_waveform) {
1258 cfile->arate = arate;
1259 cfile->achans = achans;
1260 cfile->asampsize = asampsize;
1269 if (
cfile->afilesize == 0l) {
1271 do_error_dialog(
_(
"LiVES was unable to resample the audio as requested.\n"));
1287 d_print(
_(
"Audio was resampled to %d Hz, %d channels, %d bit"), arate, achans, asampsize);
1289 if (cur_signed != asigned) {
1296 if (cur_endian != aendian) {
1314 static void on_resaudw_achans_changed(LiVESWidget * widg, livespointer user_data) {
1380 weed_plant_t *real_back_list = NULL;
1381 weed_plant_t *new_event_list = NULL;
1382 double oundo1_dbl =
cfile->undo1_dbl;
1383 LiVESResponseType response;
1385 double old_fps =
cfile->fps;
1389 boolean bad_header =
FALSE;
1391 int ostart =
cfile->start;
1392 int oend =
cfile->end;
1407 real_back_list =
cfile->event_list;
1408 what = (
_(
"creating the event list for resampling"));
1410 if (!
cfile->event_list) {
1413 for (int64_t i64 = 1; i64 <= (int64_t)
cfile->frames; i64++) {
1415 response = LIVES_RESPONSE_OK;
1417 if (!new_event_list) {
1420 }
while (response == LIVES_RESPONSE_RETRY);
1421 if (response == LIVES_RESPONSE_CANCEL) {
1427 cfile->event_list = new_event_list;
1436 cfile->event_list = new_event_list;
1439 cfile->event_list_back = NULL;
1441 if (!
cfile->event_list) {
1442 cfile->event_list = real_back_list;
1443 cfile->undo1_dbl = oundo1_dbl;
1465 old_frames =
cfile->frames;
1474 on_reorder_activate(reorder_width, reorder_height);
1478 cfile->event_list = real_back_list;
1480 cfile->event_list_back = NULL;
1481 cfile->frames = old_frames;
1482 cfile->start = ostart;
1486 cfile->undo1_dbl = oundo1_dbl;
1496 cfile->event_list_back = real_back_list;
1498 cfile->ratio_fps = ratio_fps;
1500 cfile->old_frames = old_frames;
1505 double dfps = (double)cdata->
fps;
1534 LiVESWidget *dialog_vbox = NULL;
1537 LiVESWidget *combo_entry2;
1538 LiVESWidget *combo_entry3;
1539 LiVESWidget *combo_entry1;
1540 LiVESWidget *vseparator;
1541 LiVESWidget *radiobutton_u1;
1542 LiVESWidget *radiobutton_s1;
1544 LiVESWidget *radiobutton_b1;
1545 LiVESWidget *radiobutton_l1;
1546 LiVESWidget *combo4;
1547 LiVESWidget *combo5;
1548 LiVESWidget *combo6;
1549 LiVESWidget *cancelbutton;
1550 LiVESWidget *okbutton;
1552 LiVESWidget *hseparator;
1553 LiVESWidget *radiobutton;
1557 LiVESAccelGroup *accel_group = NULL;
1559 LiVESSList *s1_group = NULL;
1560 LiVESSList *e1_group = NULL;
1561 LiVESSList *s2_group = NULL;
1562 LiVESSList *e2_group = NULL;
1563 LiVESSList *rbgroup = NULL;
1565 LiVESList *channels = NULL;
1566 LiVESList *sampsize = NULL;
1567 LiVESList *rate = NULL;
1573 int hours = 0, mins = 0;
1576 boolean chans_fixed =
FALSE;
1592 channels = lives_list_append(channels, (livespointer)
"1");
1593 channels = lives_list_append(channels, (livespointer)
"2");
1595 sampsize = lives_list_append(sampsize, (livespointer)
"8");
1596 sampsize = lives_list_append(sampsize, (livespointer)
"16");
1598 rate = lives_list_append(rate, (livespointer)
"5512");
1599 rate = lives_list_append(rate, (livespointer)
"8000");
1600 rate = lives_list_append(rate, (livespointer)
"11025");
1601 rate = lives_list_append(rate, (livespointer)
"22050");
1602 rate = lives_list_append(rate, (livespointer)
"32000");
1603 rate = lives_list_append(rate, (livespointer)
"44100");
1604 rate = lives_list_append(rate, (livespointer)
"48000");
1605 rate = lives_list_append(rate, (livespointer)
"88200");
1606 rate = lives_list_append(rate, (livespointer)
"96000");
1607 rate = lives_list_append(rate, (livespointer)
"128000");
1609 if (type < 3 || type > 4) {
1613 title = (
_(
"Resample Audio"));
1614 }
else if (type == 2) {
1615 title = (
_(
"Insert Silence"));
1616 }
else if (type == 5 || type == 11 || type == 6 || type == 7) {
1617 title = (
_(
"New Clip Audio"));
1618 }
else if (type == 9 || type == 8) {
1619 title = (
_(
"External Clip Settings"));
1634 }
else vboxx = top_vbox;
1722 if (type < 9 || type == 11) {
1723 if (type >= 3 && type != 11) tmp = (
_(
"Audio"));
1724 else if (type == 2) tmp = (
_(
"New Audio Details"));
1725 else tmp = (
_(
"New"));
1736 if (type > 2 && type < 5 && !chans_fixed) {
1778 lives_signal_sync_connect(LIVES_GUI_OBJECT(combo4), LIVES_WIDGET_CHANGED_SIGNAL,
1783 channels, LIVES_BOX(hbox), NULL);
1805 lives_signal_sync_connect(LIVES_GUI_OBJECT(combo5), LIVES_WIDGET_CHANGED_SIGNAL,
1810 sampsize, LIVES_BOX(hbox), NULL);
1825 if (!strcmp(tmp,
"8")) is_8bit =
TRUE;
1826 else is_8bit =
FALSE;
1831 lives_signal_sync_connect(LIVES_GUI_OBJECT(combo6), LIVES_WIDGET_CHANGED_SIGNAL,
1853 if (type < 3 || (type > 4 && type < 8) || type == 11) aendian =
mainw->
fx4_val;
1865 lives_signal_sync_connect(LIVES_GUI_OBJECT(
resaudw->
rb_signed), LIVES_WIDGET_TOGGLED_SIGNAL,
1867 lives_signal_sync_connect(LIVES_GUI_OBJECT(
resaudw->
rb_unsigned), LIVES_WIDGET_TOGGLED_SIGNAL,
1899 lives_signal_sync_connect(LIVES_GUI_OBJECT(
resaudw->
entry_asamps), LIVES_WIDGET_CHANGED_SIGNAL,
1904 lives_signal_sync_connect(LIVES_GUI_OBJECT(
resaudw->
rb_littleend), LIVES_WIDGET_TOGGLED_SIGNAL,
1906 lives_signal_sync_connect(LIVES_GUI_OBJECT(
resaudw->
rb_bigend), LIVES_WIDGET_TOGGLED_SIGNAL,
1910 if (type > 7 && type != 11) {
1922 if (type > 4 && type != 11) {
1928 if (type != 6 && type != 7) {
1932 0., hours > 23 ? hours : 23, 1., 1., 0, LIVES_BOX(hbox), NULL);
1935 0., 59., 1., 10., 0, LIVES_BOX(hbox), NULL);
1938 0., 59., 1., 10., 0, LIVES_BOX(hbox), NULL);
1945 lives_signal_sync_connect(LIVES_GUI_OBJECT(radiobutton), LIVES_WIDGET_TOGGLED_SIGNAL,
1953 if (type < 8 || type == 11) {
1963 if (type < 3 || type > 4) {
1965 LIVES_RESPONSE_CANCEL);
1968 LIVES_KEY_Escape, (LiVESXModifierType)0, (LiVESAccelFlags)0);
1976 if (type < 8 || type == 11) {
1977 lives_signal_sync_connect(LIVES_GUI_OBJECT(cancelbutton), LIVES_WIDGET_CLICKED_SIGNAL,
1981 lives_signal_sync_connect(LIVES_GUI_OBJECT(okbutton), LIVES_WIDGET_CLICKED_SIGNAL,
1983 }
else if (type == 2 || type == 11) {
1984 lives_signal_sync_connect(LIVES_GUI_OBJECT(okbutton), LIVES_WIDGET_CLICKED_SIGNAL,
1986 }
else if (type == 5) {
1987 lives_signal_sync_connect(LIVES_GUI_OBJECT(okbutton), LIVES_WIDGET_CLICKED_SIGNAL,
1989 LIVES_INT_TO_POINTER(0));
1990 }
else if (type == 6 || type == 7) {
1991 lives_signal_sync_connect(LIVES_GUI_OBJECT(okbutton), LIVES_WIDGET_CLICKED_SIGNAL,
1993 LIVES_INT_TO_POINTER(1));
2002 LIVES_GUI_CALLBACK(on_resaudw_achans_changed), (livespointer)
resaudw);
2009 lives_list_free(channels);
2010 lives_list_free(sampsize);
2011 lives_list_free(rate);
2028 boolean bad_header =
FALSE;
2042 char *tmp = (
_(
"Changing the clip fps"));
2053 if (button == NULL) {
2071 cfile->arate = (int)(arate *
cfile->fps + .5);
2084 double dfps = (double)cdata->
fps;
2107 int new_frames =
cfile->old_frames;
2108 int cur_frames =
cfile->frames;
2114 reorder_leave_back,
cfile->frames);
2120 int iwidth =
cfile->hsize, iheight =
cfile->vsize;
2123 if (iwidth ==
cfile->hsize && iheight ==
cfile->vsize) {
2141 reorder_leave_back,
cfile->frames, iwidth, iheight);
2147 cfile->progress_start = 1;
2150 if (
cfile->progress_end == -1)
return -cur_frames;
2152 if (cur_frames >
cfile->progress_end)
cfile->progress_end = cur_frames;
2154 cfile->next_event = NULL;
2155 if (
cfile->event_list) {
2158 cfile->event_list = NULL;
2164 if (
THREADVAR(com_failed))
return -cur_frames;
2192 new_frames = -new_frames;
2194 array = lives_strsplit(
mainw->
msg,
"|", 2);
2196 new_frames = atoi(array[1]);
2197 lives_strfreev(array);
2199 if (
cfile->frames > new_frames) {
2200 new_frames =
cfile->frames;
2211 int perf_start, perf_end;
2216 cfile->event_list_back = NULL;
2218 if (
cfile->event_list == NULL) {
2220 perf_end = old_frames;
2227 perf_start,
cfile->frames, perf_end,
2239 if (
cfile->frame_index_back) {
2240 int current_frames =
cfile->frames;
2241 cfile->frames = old_frames;
2243 cfile->frames = current_frames;
2284 cfile->progress_start = 1;
2285 cfile->progress_end = new_frames;
2290 cfile->frames = new_frames;
2294 cfile->undo1_dbl = old_fps;
2295 d_print(
_(
"Clipboard was resampled to %d frames.\n"),
cfile->frames);
2305 cfile->progress_start = old_frames + 1;