3 * Copyright (C) 2010 Adam Williams <broadcast at earthling dot net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "automation.h"
25 #include "bcsignals.h"
29 #include "edlsession.h"
34 #include "localsession.h"
37 #include "mainsession.h"
38 #include "pluginserver.h"
39 #include "pluginset.h"
42 #include "trackcanvas.h"
44 #include "trackscroll.h"
45 #include "transition.h"
46 #include "transportque.h"
50 int Tracks::blade(double position)
52 for( Track *track=first; track!=0; track=track->next ) {
53 if( !track->record ) continue;
54 track->blade(position);
59 int Tracks::clear(double start, double end, int clear_plugins, int edit_autos)
63 for(current_track = first;
65 current_track = current_track->next)
67 if(current_track->record)
69 current_track->clear(start,
73 clear_plugins, // edit_plugins
81 void Tracks::clear_automation(double selectionstart, double selectionend)
85 for(current_track = first; current_track; current_track = current_track->next)
87 if(current_track->record)
89 current_track->clear_automation(selectionstart,
97 void Tracks::clear_transitions(double start, double end)
99 for(Track *current_track = first;
101 current_track = current_track->next)
103 if(current_track->record)
105 int64_t start_units = current_track->to_units(start, 0);
106 int64_t end_units = current_track->to_units(end, 0);
108 for(Edit *current_edit = current_track->edits->first;
110 current_edit = current_edit->next)
112 if(current_edit->startproject >= start_units &&
113 current_edit->startproject < end_units &&
114 current_edit->transition)
116 current_edit->detach_transition();
123 int Tracks::clear_hard_edges(double start, double end)
125 for( Track *track=first; track; track=track->next ) {
126 if( !track->record ) continue;
127 int64_t start_units = track->to_units(start, 0);
128 int64_t end_units = track->to_units(end, 0);
130 for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
131 int64_t pos = edit->startproject;
132 if( pos > end_units ) break;
133 if( pos >= start_units ) {
136 edit->previous->hard_right = 0;
139 if( pos > end_units ) break;
140 if( pos >= start_units ) {
141 edit->hard_right = 0;
143 edit->next->hard_left = 0;
150 void Tracks::shuffle_edits(double start, double end)
152 // This doesn't affect automation or effects
153 // Labels follow the first track.
155 for(Track *current_track = first;
157 current_track = current_track->next)
159 if(current_track->record)
161 current_track->shuffle_edits(start, end, first_track);
168 void Tracks::reverse_edits(double start, double end)
170 // This doesn't affect automation or effects
171 // Labels follow the first track.
173 for(Track *current_track = first;
175 current_track = current_track->next)
177 if(current_track->record)
179 current_track->reverse_edits(start, end, first_track);
185 void Tracks::align_edits(double start, double end)
187 // This doesn't affect automation or effects
188 ArrayList<double> times;
190 for(Track *current_track = first;
192 current_track = current_track->next)
194 if(current_track->record)
196 current_track->align_edits(start, end, ×);
201 void Tracks::set_edit_length(double start, double end, double length)
204 for(Track *current_track = first;
206 current_track = current_track->next)
208 if(current_track->record)
210 #define USE_FLOATING_LENGTHS
212 #ifdef USE_FLOATING_LENGTHS
215 // The first edit anchors the length offsets.
216 // Round edits up & down so they end where they would if they all had floating point lengths.
217 //int first_edit = 1;
218 int64_t start_units = current_track->to_units(start, 0);
219 int64_t end_units = current_track->to_units(end, 0);
220 // Total time of edits accumulated, in track units
221 int64_t total_units = 0;
222 // Number of length offsets added so far
223 int total_lengths = 0;
225 for(Edit *current_edit = current_track->edits->last;
227 current_edit = current_edit->previous)
229 if(current_edit->startproject >= start_units &&
230 current_edit->startproject + current_edit->length <= end_units)
232 // Calculate true length based on number of length offsets & total time
233 double end_time = (1 + total_lengths) * length;
234 int64_t length_units = current_track->to_units(end_time, 0) -
236 if(length_units < 1) length_units = 1;
237 //printf("Tracks::set_edit_length %d %f %f\n", __LINE__,
238 // end_time, current_track->from_units(total_units));
239 total_units += length_units;
241 // Go in using the edit handle interface
242 int64_t starting_length = current_edit->length;
244 current_edit->shift_end(MOVE_RIPPLE,
245 current_edit->startproject + length_units,
246 current_edit->startproject + current_edit->length,
248 edl->session->autos_follow_edits,
249 edl->session->plugins_follow_edits,
252 int64_t ending_length = current_edit->length;
254 if(edl->session->labels_follow_edits && first_track)
256 // printf("Tracks::set_edit_length %d %f %f\n",
258 // current_track->from_units(current_edit->startproject + starting_length),
259 // current_track->from_units(current_edit->startproject + ending_length));
260 edl->labels->modify_handles(
261 current_track->from_units(current_edit->startproject + starting_length),
262 current_track->from_units(current_edit->startproject + ending_length),
274 #else // USE_FLOATING_LENGTHS
276 // The first edit anchors the length offsets.
277 // The idea was to round edits up & down so they end where they should
278 // if they all had floating point lengths. It's easier just to make sure the framerate
279 // is divisible by the required length.
280 // int first_edit = 1;
281 int64_t start_units = current_track->to_units(start, 0);
282 int64_t end_units = current_track->to_units(end, 0);
283 int64_t length_units = current_track->to_units(length, 1);
284 // Starting time of the length offsets in seconds
285 // double start_time = 0;
286 // Number of length offsets added so far
287 // int total_lengths = 0;
289 for(Edit *current_edit = current_track->edits->last;
291 current_edit = current_edit->previous)
293 if(current_edit->startproject >= start_units &&
294 current_edit->startproject + current_edit->length <= end_units)
296 // Calculate starting time of length offsets
299 // start_time = current_track->from_units(current_edit->startproject);
302 // Calculate true length based on number of length offsets
303 // double end_time = start_time + (1 + total_lengths) * length;
304 // int64_t length_units = current_track->to_units(end_time, 0) -
305 // current_edit->startproject;
306 // if(length_units < 1) length_units = 1;
308 // Go in using the edit handle interface
309 int64_t starting_length = current_edit->length;
311 current_edit->shift_end(MOVE_RIPPLE,
312 current_edit->startproject + length_units,
313 current_edit->startproject + current_edit->length,
315 edl->session->autos_follow_edits,
316 edl->session->plugins_follow_edits,
319 int64_t ending_length = current_edit->length;
321 if(edl->session->labels_follow_edits && first_track) {
322 // printf("Tracks::set_edit_length %d %f %f\n", __LINE__,
323 // current_track->from_units(current_edit->startproject + starting_length),
324 // current_track->from_units(current_edit->startproject + ending_length));
325 edl->labels->modify_handles(
326 current_track->from_units(current_edit->startproject + starting_length),
327 current_track->from_units(current_edit->startproject + ending_length),
336 #endif // !USE_FLOATING_LENGTHS
343 void Tracks::set_transition_length(double start, double end, double length)
345 for(Track *current_track = first;
347 current_track = current_track->next)
349 if(current_track->record)
351 int64_t start_units = current_track->to_units(start, 0);
352 int64_t end_units = current_track->to_units(end, 0);
354 for(Edit *current_edit = current_track->edits->first;
356 current_edit = current_edit->next)
358 if(current_edit->startproject >= start_units &&
359 current_edit->startproject < end_units &&
360 current_edit->transition)
362 current_edit->transition->length =
363 current_track->to_units(length, 1);
364 if( current_edit == current_track->edits->last &&
365 current_edit->silence() ) {
366 current_edit->length = current_edit->transition->length;
374 void Tracks::set_transition_length(Transition *transition, double length)
376 // Must verify existence of transition
378 if(!transition) return;
379 for(Track *current_track = first;
380 current_track && !done;
381 current_track = current_track->next)
383 for(Edit *current_edit = current_track->edits->first;
384 current_edit && !done;
385 current_edit = current_edit->next)
387 if(current_edit->transition == transition)
389 transition->length = current_track->to_units(length, 1);
390 if( current_edit == current_track->edits->last &&
391 current_edit->silence() ) {
392 current_edit->length = current_edit->transition->length;
400 void Tracks::paste_transitions(double start, double end, int track_type, char* title)
403 for( Track *track=first; track; track=track->next ) {
404 if( !track->record || track->data_type != track_type ) continue;
405 for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
406 if( !edit->is_selected ) continue;
407 edit->insert_transition(title);
412 clear_selected_edits();
416 for( Track *track=first; track; track=track->next ) {
417 if( !track->record || track->data_type != track_type ) continue;
418 int64_t start_units = track->to_units(start, 0);
419 int64_t end_units = track->to_units(end, 0);
420 if( start_units == end_units ) {
421 for( Edit *edit = track->edits->first; edit; edit = edit->next) {
422 int64_t edit_start = edit->startproject;
423 int64_t edit_end = edit_start + edit->length;
424 if( edit_start > start_units ) continue;
425 if( start_units == track->edits->length() ) {
426 double length = edl->session->default_transition_length;
427 int64_t units = track->to_units(length, 1);
428 edit = track->edits->
429 create_silence(start_units, start_units+units);
431 else if( start_units >= edit_end ) continue;
432 edit->insert_transition(title);
436 for( Edit *edit=track->edits->first; edit; edit=edit->next) {
437 int64_t edit_start = edit->startproject;
438 if( !edit_start ) continue;
439 if( edit_start >= start_units && edit_start < end_units ) {
440 edit->insert_transition(title);
447 void Tracks::set_automation_mode(double selectionstart,
451 Track* current_track;
453 for(current_track = first; current_track; current_track = current_track->next)
455 if(current_track->record)
457 current_track->set_automation_mode(selectionstart,
464 int Tracks::clear_default_keyframe()
466 for(Track *current = first; current; current = NEXT)
469 current->clear_automation(0, 0, 0, 1);
474 int Tracks::clear_handle(double start,
476 double &longest_distance,
481 Track* current_track;
484 for(current_track = first; current_track; current_track = current_track->next)
486 if(current_track->record)
488 current_track->clear_handle(start,
494 if(distance > longest_distance) longest_distance = distance;
501 int Tracks::copy_automation(double selectionstart,
507 // called by MWindow::copy_automation for copying automation alone
508 Track* current_track;
510 file->tag.set_title("AUTO_CLIPBOARD");
511 file->tag.set_property("LENGTH", selectionend - selectionstart);
512 file->tag.set_property("FRAMERATE", edl->session->frame_rate);
513 file->tag.set_property("SAMPLERATE", edl->session->sample_rate);
515 file->append_newline();
516 file->append_newline();
518 for(current_track = first;
520 current_track = current_track->next)
522 if(current_track->record)
524 current_track->copy_automation(selectionstart,
532 file->tag.set_title("/AUTO_CLIPBOARD");
534 file->append_newline();
535 file->terminate_string();
539 // int Tracks::copy_default_keyframe(FileXML *file)
541 // copy_automation(0, 0, file, 1, 0);
545 int Tracks::delete_tracks()
547 int total_deleted = 0;
553 Track *next_track = 0;
554 for (Track* current = first; current && done; current = next_track)
556 next_track = current->next;
559 delete_track(current);
567 return total_deleted;
570 void Tracks::move_edits(ArrayList<Edit*> *in_edits, Track *track, double position,
571 int edit_labels, int edit_plugins, int edit_autos, int mode)
573 // have to make a copy, optimize kills edits
574 ArrayList<Edit*> edits;
575 for( int i=0; i<in_edits->size(); ++i ) {
576 Edit *edit = in_edits->get(i);
577 Edit *new_edit = new Edit(edit->edl, edit->track);
578 new_edit->copy_from(edit);
579 edits.append(new_edit);
582 int current_aedit = 0, current_vedit = 0;
583 //printf("Tracks::move_edits 1\n");
584 for( Track *dest_track=track; dest_track; dest_track=dest_track->next ) {
585 if( !dest_track->record ) continue;
586 // Need a local copy of the source edit since the original source edit may
587 // change in the editing operation.
589 Edit *source_edit = 0;
590 Track *clip_track = 0;
591 switch( dest_track->data_type ) {
593 while( current_aedit < edits.size() ) {
594 Edit *edit = edits[current_aedit++];
595 if( edit->track->data_type == TRACK_AUDIO ) {
597 ATrack *atrack = new ATrack(dest_track->edl, 0);
598 atrack->create_objects();
605 while( current_vedit < edits.size() ) {
606 Edit *edit = edits[current_vedit++];
607 if( edit->track->data_type == TRACK_VIDEO ) {
609 VTrack *vtrack = new VTrack(dest_track->edl, 0);
610 vtrack->create_objects();
617 if( !source_edit ) continue;
619 Track *source_track = source_edit->track;
620 int64_t start = source_edit->startproject;
621 int64_t length = source_edit->length, end = start + length;
622 double source_start = source_track->from_units(start);
623 double source_end = source_track->from_units(start+length);
624 double len = source_end - source_start;
625 double dest_start = position;
626 double dest_end = dest_start + len;
628 if( edit_labels && dest_track == track ) {
630 Labels labels(0, "LABELS");
631 source_edit->edl->labels->copy(source_start, source_end, &label_xml);
632 source_edit->edl->labels->clear(source_start, source_end, mode);
633 if( !label_xml.read_tag() )
634 labels.load(&label_xml, LOAD_ALL);
635 double pos = dest_start;
636 if( mode && source_start < dest_start ) pos -= len;
637 edl->labels->insert_labels(&labels, pos, len, mode);
642 source_track->copy(COPY_TRACKS, source_start, source_end, &track_xml, "");
643 if( !track_xml.read_tag() )
644 clip_track->load(&track_xml, 0, LOAD_ALL);
646 if( !mode ) { // mute and overwrite
647 source_track->clear(start, end, 1, 0,
648 edit_plugins, edit_autos, 0);
649 source_track->edits->paste_silence(start, end);
651 source_track->shift_keyframes(start, length);
653 int n = source_track->plugin_set.size();
654 if( n > 0 ) dest_track->expand_view = 1;
655 for( int k=0; k<n; ++k )
656 source_track->plugin_set[k]->paste_silence(start, end, 1);
658 dest_track->clear(dest_start, dest_end, 1, 0,
659 edit_plugins, edit_autos, 0);
660 dest_track->insert_track(clip_track, dest_start, 0,
661 edit_plugins, edit_autos, len);
663 else { // cut and paste
664 dest_track->insert_track(clip_track, dest_start, 0,
665 edit_plugins, edit_autos, len);
666 if( source_track == dest_track && dest_start < source_start ) {
667 source_start += len; source_end += len;
669 source_track->clear(source_start, source_end, 1, 0,
670 edit_plugins, edit_autos, 0);
674 dest_track->optimize();
677 edits.remove_all_objects();
680 void Tracks::move_effect(Plugin *plugin, Track *track, int64_t position)
682 Track *source_track = plugin->track;
684 // Create a new plugin set
685 double start = track->from_units(position);
686 double length = track->from_units(plugin->length);
688 result = track->insert_effect("", &plugin->shared_location, 0, 0,
689 start, length, plugin->plugin_type);
690 result->copy_from(plugin);
691 result->shift(position - plugin->startproject);
693 // Clear new plugin from old set
694 plugin->plugin_set->clear(plugin->startproject,
695 plugin->startproject + plugin->length,
696 edl->session->autos_follow_edits);
698 source_track->optimize();
701 void Tracks::move_effect(Plugin *plugin, PluginSet *plugin_set, int64_t position)
703 // src/dest track must be the same
704 // replace plugin in source plugin_set with silence
705 PluginSet *src_plugin_set = plugin->plugin_set;
706 Plugin *silent = new Plugin(edl, src_plugin_set, "");
707 silent->startproject = plugin->startproject;
708 silent->length = plugin->length;
709 src_plugin_set->insert_after(plugin, silent);
710 src_plugin_set->remove_pointer(plugin);
711 // truncate previous plugin
712 Plugin *dest = (Plugin *)plugin_set->editof(position, PLAY_FORWARD, 0);
713 // add plugin after dest
714 plugin_set->insert_after(dest, plugin);
716 dest->length = position - dest->startproject;
717 if( dest->length < 0 ) dest->length = 0;
719 // update plugin position
720 plugin->startproject = position;
721 plugin->plugin_set = plugin_set;
722 plugin->edits = plugin_set;
723 src_plugin_set->track->optimize();
726 int Tracks::concatenate_tracks(int edit_plugins, int edit_autos)
728 Track *output_track, *first_output_track, *input_track;
729 int i, data_type = TRACK_AUDIO;
734 for(i = 0; i < 2; i++)
736 // Get first output track
737 for(output_track = first;
739 output_track = output_track->next)
740 if(output_track->data_type == data_type &&
741 output_track->record) break;
743 first_output_track = output_track;
745 // Get first input track
746 for(input_track = first;
748 input_track = input_track->next)
750 if(input_track->data_type == data_type &&
752 !input_track->record) break;
756 if(output_track && input_track)
758 // Transfer input track to end of output track one at a time
761 output_start = output_track->get_length();
762 output_track->insert_track(input_track,
769 // Get next source and destination
770 for(input_track = input_track->next;
772 input_track = input_track->next)
775 if(input_track->data_type == data_type &&
776 !input_track->record &&
777 input_track->play) break;
780 for(output_track = output_track->next;
782 output_track = output_track->next)
784 if(output_track->data_type == data_type &&
785 output_track->record) break;
790 output_track = first_output_track;
796 if(data_type == TRACK_AUDIO) data_type = TRACK_VIDEO;
802 int Tracks::delete_all_tracks()
804 while(last) delete last;
809 void Tracks::change_modules(int old_location, int new_location, int do_swap)
811 for(Track* current = first ; current; current = current->next)
813 current->change_modules(old_location, new_location, do_swap);
817 void Tracks::change_plugins(SharedLocation &old_location, SharedLocation &new_location, int do_swap)
819 for(Track* current = first ; current; current = current->next)
821 current->change_plugins(old_location, new_location, do_swap);
827 // =========================================== EDL editing
830 int Tracks::copy(int copy_flags, double start, double end,
831 FileXML *file, const char *output_path)
833 int all = (copy_flags & COPY_ALL) ? 1 : 0;
834 // if nothing selected
835 if( start == end && !all ) return 1;
836 for( Track *track=first; track; track=track->next ) {
837 if( track->record || all )
838 track->copy(copy_flags, start, end, file, output_path);
845 int Tracks::move_track_up(Track *track)
847 Track *next_track = track->previous;
848 if(!next_track) next_track = last;
850 change_modules(number_of(track), number_of(next_track), 1);
852 // printf("Tracks::move_track_up 1 %p %p\n", track, next_track);
854 // for(Track *current = first; current && count < 5; current = NEXT, count++)
855 // printf("Tracks::move_track_up %p %p %p\n", current->previous, current, current->next);
856 // printf("Tracks::move_track_up 2\n");
858 swap(track, next_track);
861 // for(Track *current = first; current && count < 5; current = NEXT, count++)
862 // printf("Tracks::move_track_up %p %p %p\n", current->previous, current, current->next);
863 // printf("Tracks::move_track_up 3\n");
868 int Tracks::move_track_down(Track *track)
870 Track *next_track = track->next;
871 if(!next_track) next_track = first;
873 change_modules(number_of(track), number_of(next_track), 1);
874 swap(track, next_track);
879 int Tracks::move_tracks_up()
884 Track *track = next; next = track->next;
885 if( !track->record ) continue;
886 if( track->previous ) {
887 change_modules(number_of(track->previous), number_of(track), 1);
888 swap(track->previous, track);
896 int Tracks::move_tracks_down()
901 Track *track = prev; prev = track->previous;
902 if( !track->record ) continue;
904 change_modules(number_of(track), number_of(track->next), 1);
905 swap(track, track->next);
914 void Tracks::paste_audio_transition(PluginServer *server)
916 for(Track *current = first; current; current = NEXT)
918 if(current->data_type == TRACK_AUDIO &&
921 int64_t position = current->to_units(
922 edl->local_session->get_selectionstart(), 0);
923 Edit *current_edit = current->edits->editof(position,
926 if( !current_edit && position == current->edits->length() ) {
927 double length = edl->session->default_transition_length;
928 int64_t units = current->to_units(length, 1);
929 current_edit = current->edits->create_silence(position, position+units);
933 paste_transition(server, current_edit);
939 void Tracks::paste_automation(double selectionstart,
945 Track* current_track = 0;
946 Track* current_atrack = 0;
947 Track* current_vtrack = 0;
948 Track* dst_track = 0;
952 double frame_rate = edl->session->frame_rate;
953 int64_t sample_rate = edl->session->sample_rate;
954 char string[BCTEXTLEN];
959 result = file->read_tag();
961 !file->tag.title_is("AUTO_CLIPBOARD"));
965 length = file->tag.get_property("LENGTH", 0);
966 frame_rate = file->tag.get_property("FRAMERATE", frame_rate);
967 sample_rate = file->tag.get_property("SAMPLERATE", sample_rate);
972 result = file->read_tag();
976 if(file->tag.title_is("/AUTO_CLIPBOARD"))
981 if(file->tag.title_is("TRACK"))
983 file->tag.get_property("TYPE", string);
984 if(!strcmp(string, "AUDIO"))
986 src_type = TRACK_AUDIO;
990 src_type = TRACK_VIDEO;
993 // paste to any media type
996 if(!current_track) current_track = first;
997 while(current_track && !current_track->record)
998 current_track = current_track->next;
999 dst_track = current_track;
1002 if(!strcmp(string, "AUDIO"))
1004 // Get next audio track
1006 current_atrack = first;
1008 current_atrack = current_atrack->next;
1010 while(current_atrack &&
1011 (current_atrack->data_type != TRACK_AUDIO ||
1012 !current_atrack->record))
1013 current_atrack = current_atrack->next;
1014 dst_track = current_atrack;
1018 // Get next video track
1020 current_vtrack = first;
1022 current_vtrack = current_vtrack->next;
1024 while(current_vtrack &&
1025 (current_vtrack->data_type != TRACK_VIDEO ||
1026 !current_vtrack->record))
1027 current_vtrack = current_vtrack->next;
1029 dst_track = current_vtrack;
1034 double frame_rate2 = frame_rate;
1035 double sample_rate2 = sample_rate;
1037 if(src_type != dst_track->data_type)
1039 frame_rate2 = sample_rate;
1040 sample_rate2 = frame_rate;
1043 dst_track->paste_automation(selectionstart,
1057 // int Tracks::paste_default_keyframe(FileXML *file)
1059 // paste_automation(0, file, 1, 0);
1063 void Tracks::paste_transition(PluginServer *server, Edit *dest_edit)
1065 dest_edit->insert_transition(server->title);
1068 void Tracks::paste_video_transition(PluginServer *server, int first_track)
1070 for(Track *current = first; current; current = NEXT)
1072 if(current->data_type == TRACK_VIDEO &&
1075 int64_t position = current->to_units(
1076 edl->local_session->get_selectionstart(), 0);
1077 Edit *current_edit = current->edits->editof(position,
1080 if( !current_edit && position == current->edits->length() ) {
1081 double length = edl->session->default_transition_length;
1082 int64_t units = current->to_units(length, 1);
1083 current_edit = current->edits->create_silence(position, position+units);
1087 paste_transition(server, current_edit);
1089 if(first_track) break;
1095 int Tracks::paste_silence(double start,
1100 Track* current_track;
1102 for(current_track = first;
1104 current_track = current_track->next)
1106 if(current_track->record)
1108 current_track->paste_silence(start,
1119 int Tracks::select_auto(int cursor_x, int cursor_y)
1122 for(Track* current = first; current && !result; current = NEXT) { result = current->select_auto(&auto_conf, cursor_x, cursor_y); }
1126 int Tracks::move_auto(int cursor_x, int cursor_y, int shift_down)
1130 for(Track* current = first; current && !result; current = NEXT)
1132 result = current->move_auto(&auto_conf, cursor_x, cursor_y, shift_down);
1137 int Tracks::modify_edithandles(double &oldposition, double &newposition,
1138 int currentend, int handle_mode, int edit_labels,
1139 int edit_plugins, int edit_autos, int group_id)
1141 for( Track *track=first; track; track=track->next ) {
1142 if( !track->record ) continue;
1143 track->modify_edithandles(oldposition, newposition,
1144 currentend, handle_mode, edit_labels,
1145 edit_plugins, edit_autos, group_id);
1146 // labels follow first armed track
1152 int Tracks::modify_pluginhandles(double &oldposition, double &newposition,
1153 int currentend, int handle_mode, int edit_labels,
1154 int edit_autos, Edits *trim_edits)
1156 for( Track *track=first; track; track=track->next ) {
1157 if( !track->record ) continue;
1158 track->modify_pluginhandles(oldposition, newposition,
1159 currentend, handle_mode, edit_labels,
1160 edit_autos, trim_edits);
1166 int Tracks::purge_asset(Asset *asset)
1168 Track *current_track;
1171 for(current_track = first; current_track; current_track = current_track->next)
1173 result += current_track->purge_asset(asset);
1178 int Tracks::asset_used(Asset *asset)
1180 Track *current_track;
1183 for(current_track = first; current_track; current_track = current_track->next)
1185 result += current_track->asset_used(asset);
1190 int Tracks::scale_time(float rate_scale, int ignore_record, int scale_edits, int scale_autos, int64_t start, int64_t end)
1192 Track *current_track;
1194 for(current_track = first;
1196 current_track = current_track->next)
1198 if((current_track->record || ignore_record) &&
1199 current_track->data_type == TRACK_VIDEO)
1201 current_track->scale_time(rate_scale, scale_edits, scale_autos, start, end);