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);
186 void Tracks::align_edits(double start, double end)
188 // This doesn't affect automation or effects
189 Track *master_track = 0;
190 for( Track *track=first; track; track=track->next ) {
191 if( !track->record ) continue;
193 master_track = track;
195 track->align_edits(start, end, master_track);
199 void Tracks::set_edit_length(double start, double end, double length)
202 for(Track *current_track = first;
204 current_track = current_track->next)
206 if(current_track->record)
208 #define USE_FLOATING_LENGTHS
210 #ifdef USE_FLOATING_LENGTHS
213 // The first edit anchors the length offsets.
214 // Round edits up & down so they end where they would if they all had floating point lengths.
215 //int first_edit = 1;
216 int64_t start_units = current_track->to_units(start, 0);
217 int64_t end_units = current_track->to_units(end, 0);
218 // Total time of edits accumulated, in track units
219 int64_t total_units = 0;
220 // Number of length offsets added so far
221 int total_lengths = 0;
223 for(Edit *current_edit = current_track->edits->last;
225 current_edit = current_edit->previous)
227 if(current_edit->startproject >= start_units &&
228 current_edit->startproject + current_edit->length <= end_units)
230 // Calculate true length based on number of length offsets & total time
231 double end_time = (1 + total_lengths) * length;
232 int64_t length_units = current_track->to_units(end_time, 0) -
234 if(length_units < 1) length_units = 1;
235 //printf("Tracks::set_edit_length %d %f %f\n", __LINE__,
236 // end_time, current_track->from_units(total_units));
237 total_units += length_units;
239 // Go in using the edit handle interface
240 int64_t starting_length = current_edit->length;
242 current_edit->shift_end(MOVE_RIPPLE,
243 current_edit->startproject + length_units,
244 current_edit->startproject + current_edit->length,
246 edl->session->autos_follow_edits,
247 edl->session->plugins_follow_edits,
250 int64_t ending_length = current_edit->length;
252 if(edl->session->labels_follow_edits && first_track)
254 // printf("Tracks::set_edit_length %d %f %f\n",
256 // current_track->from_units(current_edit->startproject + starting_length),
257 // current_track->from_units(current_edit->startproject + ending_length));
258 edl->labels->modify_handles(
259 current_track->from_units(current_edit->startproject + starting_length),
260 current_track->from_units(current_edit->startproject + ending_length),
272 #else // USE_FLOATING_LENGTHS
274 // The first edit anchors the length offsets.
275 // The idea was to round edits up & down so they end where they should
276 // if they all had floating point lengths. It's easier just to make sure the framerate
277 // is divisible by the required length.
278 // int first_edit = 1;
279 int64_t start_units = current_track->to_units(start, 0);
280 int64_t end_units = current_track->to_units(end, 0);
281 int64_t length_units = current_track->to_units(length, 1);
282 // Starting time of the length offsets in seconds
283 // double start_time = 0;
284 // Number of length offsets added so far
285 // int total_lengths = 0;
287 for(Edit *current_edit = current_track->edits->last;
289 current_edit = current_edit->previous)
291 if(current_edit->startproject >= start_units &&
292 current_edit->startproject + current_edit->length <= end_units)
294 // Calculate starting time of length offsets
297 // start_time = current_track->from_units(current_edit->startproject);
300 // Calculate true length based on number of length offsets
301 // double end_time = start_time + (1 + total_lengths) * length;
302 // int64_t length_units = current_track->to_units(end_time, 0) -
303 // current_edit->startproject;
304 // if(length_units < 1) length_units = 1;
306 // Go in using the edit handle interface
307 int64_t starting_length = current_edit->length;
309 current_edit->shift_end(MOVE_RIPPLE,
310 current_edit->startproject + length_units,
311 current_edit->startproject + current_edit->length,
313 edl->session->autos_follow_edits,
314 edl->session->plugins_follow_edits,
317 int64_t ending_length = current_edit->length;
319 if(edl->session->labels_follow_edits && first_track) {
320 // printf("Tracks::set_edit_length %d %f %f\n", __LINE__,
321 // current_track->from_units(current_edit->startproject + starting_length),
322 // current_track->from_units(current_edit->startproject + ending_length));
323 edl->labels->modify_handles(
324 current_track->from_units(current_edit->startproject + starting_length),
325 current_track->from_units(current_edit->startproject + ending_length),
334 #endif // !USE_FLOATING_LENGTHS
341 void Tracks::set_transition_length(double start, double end, double length)
343 for(Track *current_track = first;
345 current_track = current_track->next)
347 if(current_track->record)
349 int64_t start_units = current_track->to_units(start, 0);
350 int64_t end_units = current_track->to_units(end, 0);
352 for(Edit *current_edit = current_track->edits->first;
354 current_edit = current_edit->next)
356 if(current_edit->startproject >= start_units &&
357 current_edit->startproject < end_units &&
358 current_edit->transition)
360 current_edit->transition->length =
361 current_track->to_units(length, 1);
362 if( current_edit == current_track->edits->last &&
363 current_edit->silence() ) {
364 current_edit->length = current_edit->transition->length;
372 void Tracks::set_transition_length(Transition *transition, double length)
374 // Must verify existence of transition
376 if(!transition) return;
377 for(Track *current_track = first;
378 current_track && !done;
379 current_track = current_track->next)
381 for(Edit *current_edit = current_track->edits->first;
382 current_edit && !done;
383 current_edit = current_edit->next)
385 if(current_edit->transition == transition)
387 transition->length = current_track->to_units(length, 1);
388 if( current_edit == current_track->edits->last &&
389 current_edit->silence() ) {
390 current_edit->length = current_edit->transition->length;
398 void Tracks::paste_transitions(double start, double end, int track_type, char* title)
401 for( Track *track=first; track; track=track->next ) {
402 if( !track->record || track->data_type != track_type ) continue;
403 for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
404 if( !edit->is_selected ) continue;
405 edit->insert_transition(title);
410 clear_selected_edits();
414 for( Track *track=first; track; track=track->next ) {
415 if( !track->record || track->data_type != track_type ) continue;
416 int64_t start_units = track->to_units(start, 0);
417 int64_t end_units = track->to_units(end, 0);
418 if( start_units == end_units ) {
419 for( Edit *edit = track->edits->first; edit; edit = edit->next) {
420 int64_t edit_start = edit->startproject;
421 int64_t edit_end = edit_start + edit->length;
422 if( edit_start > start_units ) continue;
423 if( start_units == track->edits->length() ) {
424 double length = edl->session->default_transition_length;
425 int64_t units = track->to_units(length, 1);
426 edit = track->edits->
427 create_silence(start_units, start_units+units);
429 else if( start_units >= edit_end ) continue;
430 edit->insert_transition(title);
434 for( Edit *edit=track->edits->first; edit; edit=edit->next) {
435 int64_t edit_start = edit->startproject;
436 if( !edit_start ) continue;
437 if( edit_start >= start_units && edit_start < end_units ) {
438 edit->insert_transition(title);
445 void Tracks::set_automation_mode(double selectionstart,
449 Track* current_track;
451 for(current_track = first; current_track; current_track = current_track->next)
453 if(current_track->record)
455 current_track->set_automation_mode(selectionstart,
462 int Tracks::clear_default_keyframe()
464 for(Track *current = first; current; current = NEXT)
467 current->clear_automation(0, 0, 0, 1);
472 int Tracks::clear_handle(double start,
474 double &longest_distance,
479 Track* current_track;
482 for(current_track = first; current_track; current_track = current_track->next)
484 if(current_track->record)
486 current_track->clear_handle(start,
492 if(distance > longest_distance) longest_distance = distance;
499 int Tracks::copy_automation(double selectionstart,
505 // called by MWindow::copy_automation for copying automation alone
506 Track* current_track;
508 file->tag.set_title("AUTO_CLIPBOARD");
509 file->tag.set_property("LENGTH", selectionend - selectionstart);
510 file->tag.set_property("FRAMERATE", edl->session->frame_rate);
511 file->tag.set_property("SAMPLERATE", edl->session->sample_rate);
513 file->append_newline();
514 file->append_newline();
516 for(current_track = first;
518 current_track = current_track->next)
520 if(current_track->record)
522 current_track->copy_automation(selectionstart,
530 file->tag.set_title("/AUTO_CLIPBOARD");
532 file->append_newline();
533 file->terminate_string();
537 // int Tracks::copy_default_keyframe(FileXML *file)
539 // copy_automation(0, 0, file, 1, 0);
543 int Tracks::delete_tracks()
545 int total_deleted = 0;
551 Track *next_track = 0;
552 for (Track* current = first; current && done; current = next_track)
554 next_track = current->next;
557 delete_track(current);
565 return total_deleted;
568 void Tracks::move_edits(ArrayList<Edit*> *in_edits, Track *track, double position,
569 int edit_labels, int edit_plugins, int edit_autos, int mode)
571 // have to make a copy, optimize kills edits
572 ArrayList<Edit*> edits;
573 for( int i=0; i<in_edits->size(); ++i ) {
574 Edit *edit = in_edits->get(i);
575 Edit *new_edit = new Edit(edit->edl, edit->track);
576 new_edit->copy_from(edit);
577 edits.append(new_edit);
580 int current_aedit = 0, current_vedit = 0;
581 //printf("Tracks::move_edits 1\n");
582 for( Track *dest_track=track; dest_track; dest_track=dest_track->next ) {
583 if( !dest_track->record ) continue;
584 // Need a local copy of the source edit since the original source edit may
585 // change in the editing operation.
587 Edit *source_edit = 0;
588 Track *clip_track = 0;
589 switch( dest_track->data_type ) {
591 while( current_aedit < edits.size() ) {
592 Edit *edit = edits[current_aedit++];
593 if( edit->track->data_type == TRACK_AUDIO ) {
595 ATrack *atrack = new ATrack(dest_track->edl, 0);
596 atrack->create_objects();
603 while( current_vedit < edits.size() ) {
604 Edit *edit = edits[current_vedit++];
605 if( edit->track->data_type == TRACK_VIDEO ) {
607 VTrack *vtrack = new VTrack(dest_track->edl, 0);
608 vtrack->create_objects();
615 if( !source_edit ) continue;
617 Track *source_track = source_edit->track;
618 int64_t start = source_edit->startproject;
619 int64_t length = source_edit->length, end = start + length;
620 double source_start = source_track->from_units(start);
621 double source_end = source_track->from_units(start+length);
622 double len = source_end - source_start;
623 double dest_start = position;
624 double dest_end = dest_start + len;
626 if( edit_labels && dest_track == track ) {
628 Labels labels(0, "LABELS");
629 source_edit->edl->labels->copy(source_start, source_end, &label_xml);
630 source_edit->edl->labels->clear(source_start, source_end, mode);
631 if( !label_xml.read_tag() )
632 labels.load(&label_xml, LOAD_ALL);
633 double pos = dest_start;
634 if( mode && source_start < dest_start ) pos -= len;
635 edl->labels->insert_labels(&labels, pos, len, mode);
640 source_track->copy(COPY_TRACKS, source_start, source_end, &track_xml, "");
641 if( !track_xml.read_tag() )
642 clip_track->load(&track_xml, 0, LOAD_ALL);
644 if( !mode ) { // mute and overwrite
645 source_track->clear(start, end, 1, 0,
646 edit_plugins, edit_autos, 0);
647 source_track->edits->paste_silence(start, end);
649 source_track->shift_keyframes(start, length);
651 int n = source_track->plugin_set.size();
652 if( n > 0 ) dest_track->expand_view = 1;
653 for( int k=0; k<n; ++k )
654 source_track->plugin_set[k]->paste_silence(start, end, 1);
656 dest_track->clear(dest_start, dest_end, 1, 0,
657 edit_plugins, edit_autos, 0);
658 dest_track->insert_track(clip_track, dest_start, 0,
659 edit_plugins, edit_autos, len);
661 else { // cut and paste
662 dest_track->insert_track(clip_track, dest_start, 0,
663 edit_plugins, edit_autos, len);
664 if( source_track == dest_track && dest_start < source_start ) {
665 source_start += len; source_end += len;
667 source_track->clear(source_start, source_end, 1, 0,
668 edit_plugins, edit_autos, 0);
672 dest_track->optimize();
675 edits.remove_all_objects();
678 void Tracks::move_effect(Plugin *plugin, Track *track, int64_t position)
680 Track *source_track = plugin->track;
682 // Create a new plugin set
683 double start = track->from_units(position);
684 double length = track->from_units(plugin->length);
686 result = track->insert_effect("", &plugin->shared_location, 0, 0,
687 start, length, plugin->plugin_type);
688 result->copy_from(plugin);
689 result->shift(position - plugin->startproject);
691 // Clear new plugin from old set
692 plugin->plugin_set->clear(plugin->startproject,
693 plugin->startproject + plugin->length,
694 edl->session->autos_follow_edits);
696 source_track->optimize();
699 void Tracks::move_effect(Plugin *plugin, PluginSet *plugin_set, int64_t position)
701 // src/dest track must be the same
702 // replace plugin in source plugin_set with silence
703 PluginSet *src_plugin_set = plugin->plugin_set;
704 Plugin *silent = new Plugin(edl, src_plugin_set, "");
705 silent->startproject = plugin->startproject;
706 silent->length = plugin->length;
707 src_plugin_set->insert_after(plugin, silent);
708 src_plugin_set->remove_pointer(plugin);
709 // truncate previous plugin
710 Plugin *dest = (Plugin *)plugin_set->editof(position, PLAY_FORWARD, 0);
711 // add plugin after dest
712 plugin_set->insert_after(dest, plugin);
714 dest->length = position - dest->startproject;
715 if( dest->length < 0 ) dest->length = 0;
717 // update plugin position
718 plugin->startproject = position;
719 plugin->plugin_set = plugin_set;
720 plugin->edits = plugin_set;
721 src_plugin_set->track->optimize();
724 int Tracks::concatenate_tracks(int edit_plugins, int edit_autos)
726 Track *output_track, *first_output_track, *input_track;
727 int i, data_type = TRACK_AUDIO;
732 for(i = 0; i < 2; i++)
734 // Get first output track
735 for(output_track = first;
737 output_track = output_track->next)
738 if(output_track->data_type == data_type &&
739 output_track->record) break;
741 first_output_track = output_track;
743 // Get first input track
744 for(input_track = first;
746 input_track = input_track->next)
748 if(input_track->data_type == data_type &&
750 !input_track->record) break;
754 if(output_track && input_track)
756 // Transfer input track to end of output track one at a time
759 output_start = output_track->get_length();
760 output_track->insert_track(input_track,
767 // Get next source and destination
768 for(input_track = input_track->next;
770 input_track = input_track->next)
773 if(input_track->data_type == data_type &&
774 !input_track->record &&
775 input_track->play) break;
778 for(output_track = output_track->next;
780 output_track = output_track->next)
782 if(output_track->data_type == data_type &&
783 output_track->record) break;
788 output_track = first_output_track;
794 if(data_type == TRACK_AUDIO) data_type = TRACK_VIDEO;
800 int Tracks::delete_all_tracks()
802 while(last) delete last;
807 void Tracks::change_modules(int old_location, int new_location, int do_swap)
809 for(Track* current = first ; current; current = current->next)
811 current->change_modules(old_location, new_location, do_swap);
815 void Tracks::change_plugins(SharedLocation &old_location, SharedLocation &new_location, int do_swap)
817 for(Track* current = first ; current; current = current->next)
819 current->change_plugins(old_location, new_location, do_swap);
825 // =========================================== EDL editing
828 int Tracks::copy(int copy_flags, double start, double end,
829 FileXML *file, const char *output_path)
831 int all = (copy_flags & COPY_ALL) ? 1 : 0;
832 // if nothing selected
833 if( start == end && !all ) return 1;
834 for( Track *track=first; track; track=track->next ) {
835 if( track->record || all )
836 track->copy(copy_flags, start, end, file, output_path);
843 int Tracks::move_track_up(Track *track)
845 Track *next_track = track->previous;
846 if(!next_track) next_track = last;
848 change_modules(number_of(track), number_of(next_track), 1);
850 // printf("Tracks::move_track_up 1 %p %p\n", track, next_track);
852 // for(Track *current = first; current && count < 5; current = NEXT, count++)
853 // printf("Tracks::move_track_up %p %p %p\n", current->previous, current, current->next);
854 // printf("Tracks::move_track_up 2\n");
856 swap(track, next_track);
859 // for(Track *current = first; current && count < 5; current = NEXT, count++)
860 // printf("Tracks::move_track_up %p %p %p\n", current->previous, current, current->next);
861 // printf("Tracks::move_track_up 3\n");
866 int Tracks::move_track_down(Track *track)
868 Track *next_track = track->next;
869 if(!next_track) next_track = first;
871 change_modules(number_of(track), number_of(next_track), 1);
872 swap(track, next_track);
877 int Tracks::move_tracks_up()
882 Track *track = next; next = track->next;
883 if( !track->record ) continue;
884 if( track->previous ) {
885 change_modules(number_of(track->previous), number_of(track), 1);
886 swap(track->previous, track);
894 int Tracks::move_tracks_down()
899 Track *track = prev; prev = track->previous;
900 if( !track->record ) continue;
902 change_modules(number_of(track), number_of(track->next), 1);
903 swap(track, track->next);
912 void Tracks::paste_audio_transition(PluginServer *server)
914 for(Track *current = first; current; current = NEXT)
916 if(current->data_type == TRACK_AUDIO &&
919 int64_t position = current->to_units(
920 edl->local_session->get_selectionstart(), 0);
921 Edit *current_edit = current->edits->editof(position,
924 if( !current_edit && position == current->edits->length() ) {
925 double length = edl->session->default_transition_length;
926 int64_t units = current->to_units(length, 1);
927 current_edit = current->edits->create_silence(position, position+units);
931 paste_transition(server, current_edit);
937 void Tracks::paste_automation(double selectionstart,
943 Track* current_track = 0;
944 Track* current_atrack = 0;
945 Track* current_vtrack = 0;
946 Track* dst_track = 0;
950 double frame_rate = edl->session->frame_rate;
951 int64_t sample_rate = edl->session->sample_rate;
952 char string[BCTEXTLEN];
957 result = file->read_tag();
959 !file->tag.title_is("AUTO_CLIPBOARD"));
963 length = file->tag.get_property("LENGTH", 0);
964 frame_rate = file->tag.get_property("FRAMERATE", frame_rate);
965 sample_rate = file->tag.get_property("SAMPLERATE", sample_rate);
970 result = file->read_tag();
974 if(file->tag.title_is("/AUTO_CLIPBOARD"))
979 if(file->tag.title_is("TRACK"))
981 file->tag.get_property("TYPE", string);
982 if(!strcmp(string, "AUDIO"))
984 src_type = TRACK_AUDIO;
988 src_type = TRACK_VIDEO;
991 // paste to any media type
994 if(!current_track) current_track = first;
995 while(current_track && !current_track->record)
996 current_track = current_track->next;
997 dst_track = current_track;
1000 if(!strcmp(string, "AUDIO"))
1002 // Get next audio track
1004 current_atrack = first;
1006 current_atrack = current_atrack->next;
1008 while(current_atrack &&
1009 (current_atrack->data_type != TRACK_AUDIO ||
1010 !current_atrack->record))
1011 current_atrack = current_atrack->next;
1012 dst_track = current_atrack;
1016 // Get next video track
1018 current_vtrack = first;
1020 current_vtrack = current_vtrack->next;
1022 while(current_vtrack &&
1023 (current_vtrack->data_type != TRACK_VIDEO ||
1024 !current_vtrack->record))
1025 current_vtrack = current_vtrack->next;
1027 dst_track = current_vtrack;
1032 double frame_rate2 = frame_rate;
1033 double sample_rate2 = sample_rate;
1035 if(src_type != dst_track->data_type)
1037 frame_rate2 = sample_rate;
1038 sample_rate2 = frame_rate;
1041 dst_track->paste_automation(selectionstart,
1055 // int Tracks::paste_default_keyframe(FileXML *file)
1057 // paste_automation(0, file, 1, 0);
1061 void Tracks::paste_transition(PluginServer *server, Edit *dest_edit)
1063 dest_edit->insert_transition(server->title);
1066 void Tracks::paste_video_transition(PluginServer *server, int first_track)
1068 for(Track *current = first; current; current = NEXT)
1070 if(current->data_type == TRACK_VIDEO &&
1073 int64_t position = current->to_units(
1074 edl->local_session->get_selectionstart(), 0);
1075 Edit *current_edit = current->edits->editof(position,
1078 if( !current_edit && position == current->edits->length() ) {
1079 double length = edl->session->default_transition_length;
1080 int64_t units = current->to_units(length, 1);
1081 current_edit = current->edits->create_silence(position, position+units);
1085 paste_transition(server, current_edit);
1087 if(first_track) break;
1093 int Tracks::paste_silence(double start,
1098 Track* current_track;
1100 for(current_track = first;
1102 current_track = current_track->next)
1104 if(current_track->record)
1106 current_track->paste_silence(start,
1117 int Tracks::select_auto(int cursor_x, int cursor_y)
1120 for(Track* current = first; current && !result; current = NEXT) { result = current->select_auto(&auto_conf, cursor_x, cursor_y); }
1124 int Tracks::move_auto(int cursor_x, int cursor_y, int shift_down)
1128 for(Track* current = first; current && !result; current = NEXT)
1130 result = current->move_auto(&auto_conf, cursor_x, cursor_y, shift_down);
1135 int Tracks::modify_edithandles(double &oldposition, double &newposition,
1136 int currentend, int handle_mode, int edit_labels,
1137 int edit_plugins, int edit_autos, int group_id)
1139 for( Track *track=first; track; track=track->next ) {
1140 if( !track->record ) continue;
1141 track->modify_edithandles(oldposition, newposition,
1142 currentend, handle_mode, edit_labels,
1143 edit_plugins, edit_autos, group_id);
1144 // labels follow first armed track
1150 int Tracks::modify_pluginhandles(double &oldposition, double &newposition,
1151 int currentend, int handle_mode, int edit_labels,
1152 int edit_autos, Edits *trim_edits)
1154 for( Track *track=first; track; track=track->next ) {
1155 if( !track->record ) continue;
1156 track->modify_pluginhandles(oldposition, newposition,
1157 currentend, handle_mode, edit_labels,
1158 edit_autos, trim_edits);
1164 int Tracks::purge_asset(Asset *asset)
1166 Track *current_track;
1169 for(current_track = first; current_track; current_track = current_track->next)
1171 result += current_track->purge_asset(asset);
1176 int Tracks::asset_used(Asset *asset)
1178 Track *current_track;
1181 for(current_track = first; current_track; current_track = current_track->next)
1183 result += current_track->asset_used(asset);
1188 int Tracks::scale_time(float rate_scale, int ignore_record, int scale_edits, int scale_autos, int64_t start, int64_t end)
1190 Track *current_track;
1192 for(current_track = first;
1194 current_track = current_track->next)
1196 if((current_track->record || ignore_record) &&
1197 current_track->data_type == TRACK_VIDEO)
1199 current_track->scale_time(rate_scale, scale_edits, scale_autos, start, end);