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 void Tracks::shuffle_edits(double start, double end)
125 // This doesn't affect automation or effects
126 // Labels follow the first track.
128 for(Track *current_track = first;
130 current_track = current_track->next)
132 if(current_track->record)
134 current_track->shuffle_edits(start, end, first_track);
141 void Tracks::reverse_edits(double start, double end)
143 // This doesn't affect automation or effects
144 // Labels follow the first track.
146 for(Track *current_track = first;
148 current_track = current_track->next)
150 if(current_track->record)
152 current_track->reverse_edits(start, end, first_track);
158 void Tracks::align_edits(double start, double end)
160 // This doesn't affect automation or effects
161 ArrayList<double> times;
163 for(Track *current_track = first;
165 current_track = current_track->next)
167 if(current_track->record)
169 current_track->align_edits(start, end, ×);
174 void Tracks::set_edit_length(double start, double end, double length)
177 for(Track *current_track = first;
179 current_track = current_track->next)
181 if(current_track->record)
183 #define USE_FLOATING_LENGTHS
185 #ifdef USE_FLOATING_LENGTHS
188 // The first edit anchors the length offsets.
189 // Round edits up & down so they end where they would if they all had floating point lengths.
190 //int first_edit = 1;
191 int64_t start_units = current_track->to_units(start, 0);
192 int64_t end_units = current_track->to_units(end, 0);
193 // Total time of edits accumulated, in track units
194 int64_t total_units = 0;
195 // Number of length offsets added so far
196 int total_lengths = 0;
198 for(Edit *current_edit = current_track->edits->last;
200 current_edit = current_edit->previous)
202 if(current_edit->startproject >= start_units &&
203 current_edit->startproject + current_edit->length <= end_units)
205 // Calculate true length based on number of length offsets & total time
206 double end_time = (1 + total_lengths) * length;
207 int64_t length_units = current_track->to_units(end_time, 0) -
209 if(length_units < 1) length_units = 1;
210 //printf("Tracks::set_edit_length %d %f %f\n", __LINE__,
211 // end_time, current_track->from_units(total_units));
212 total_units += length_units;
214 // Go in using the edit handle interface
215 int64_t starting_length = current_edit->length;
217 current_edit->shift_end(MOVE_RIPPLE,
218 current_edit->startproject + length_units,
219 current_edit->startproject + current_edit->length,
221 edl->session->autos_follow_edits,
222 edl->session->plugins_follow_edits,
225 int64_t ending_length = current_edit->length;
227 if(edl->session->labels_follow_edits && first_track)
229 // printf("Tracks::set_edit_length %d %f %f\n",
231 // current_track->from_units(current_edit->startproject + starting_length),
232 // current_track->from_units(current_edit->startproject + ending_length));
233 edl->labels->modify_handles(
234 current_track->from_units(current_edit->startproject + starting_length),
235 current_track->from_units(current_edit->startproject + ending_length),
247 #else // USE_FLOATING_LENGTHS
249 // The first edit anchors the length offsets.
250 // The idea was to round edits up & down so they end where they should
251 // if they all had floating point lengths. It's easier just to make sure the framerate
252 // is divisible by the required length.
253 // int first_edit = 1;
254 int64_t start_units = current_track->to_units(start, 0);
255 int64_t end_units = current_track->to_units(end, 0);
256 int64_t length_units = current_track->to_units(length, 1);
257 // Starting time of the length offsets in seconds
258 // double start_time = 0;
259 // Number of length offsets added so far
260 // int total_lengths = 0;
262 for(Edit *current_edit = current_track->edits->last;
264 current_edit = current_edit->previous)
266 if(current_edit->startproject >= start_units &&
267 current_edit->startproject + current_edit->length <= end_units)
269 // Calculate starting time of length offsets
272 // start_time = current_track->from_units(current_edit->startproject);
275 // Calculate true length based on number of length offsets
276 // double end_time = start_time + (1 + total_lengths) * length;
277 // int64_t length_units = current_track->to_units(end_time, 0) -
278 // current_edit->startproject;
279 // if(length_units < 1) length_units = 1;
281 // Go in using the edit handle interface
282 int64_t starting_length = current_edit->length;
284 current_edit->shift_end(MOVE_RIPPLE,
285 current_edit->startproject + length_units,
286 current_edit->startproject + current_edit->length,
288 edl->session->autos_follow_edits,
289 edl->session->plugins_follow_edits,
292 int64_t ending_length = current_edit->length;
294 if(edl->session->labels_follow_edits && first_track) {
295 // printf("Tracks::set_edit_length %d %f %f\n", __LINE__,
296 // current_track->from_units(current_edit->startproject + starting_length),
297 // current_track->from_units(current_edit->startproject + ending_length));
298 edl->labels->modify_handles(
299 current_track->from_units(current_edit->startproject + starting_length),
300 current_track->from_units(current_edit->startproject + ending_length),
309 #endif // !USE_FLOATING_LENGTHS
316 void Tracks::set_transition_length(double start, double end, double length)
318 for(Track *current_track = first;
320 current_track = current_track->next)
322 if(current_track->record)
324 int64_t start_units = current_track->to_units(start, 0);
325 int64_t end_units = current_track->to_units(end, 0);
327 for(Edit *current_edit = current_track->edits->first;
329 current_edit = current_edit->next)
331 if(current_edit->startproject >= start_units &&
332 current_edit->startproject < end_units &&
333 current_edit->transition)
335 current_edit->transition->length =
336 current_track->to_units(length, 1);
337 if( current_edit == current_track->edits->last &&
338 current_edit->silence() ) {
339 current_edit->length = current_edit->transition->length;
347 void Tracks::set_transition_length(Transition *transition, double length)
349 // Must verify existence of transition
351 if(!transition) return;
352 for(Track *current_track = first;
353 current_track && !done;
354 current_track = current_track->next)
356 for(Edit *current_edit = current_track->edits->first;
357 current_edit && !done;
358 current_edit = current_edit->next)
360 if(current_edit->transition == transition)
362 transition->length = current_track->to_units(length, 1);
363 if( current_edit == current_track->edits->last &&
364 current_edit->silence() ) {
365 current_edit->length = current_edit->transition->length;
373 void Tracks::paste_transitions(double start, double end, int track_type, char* title)
376 for( Track *track=first; track; track=track->next ) {
377 if( !track->record || track->data_type != track_type ) continue;
378 for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
379 if( !edit->is_selected ) continue;
380 edit->insert_transition(title);
385 clear_selected_edits();
389 for( Track *track=first; track; track=track->next ) {
390 if( !track->record || track->data_type != track_type ) continue;
391 int64_t start_units = track->to_units(start, 0);
392 int64_t end_units = track->to_units(end, 0);
393 if( start_units == end_units ) {
394 for( Edit *edit = track->edits->first; edit; edit = edit->next) {
395 int64_t edit_start = edit->startproject;
396 int64_t edit_end = edit_start + edit->length;
397 if( edit_start > start_units ) continue;
398 if( start_units == track->edits->length() ) {
399 double length = edl->session->default_transition_length;
400 int64_t units = track->to_units(length, 1);
401 edit = track->edits->
402 create_silence(start_units, start_units+units);
404 else if( start_units >= edit_end ) continue;
405 edit->insert_transition(title);
409 for( Edit *edit=track->edits->first; edit; edit=edit->next) {
410 int64_t edit_start = edit->startproject;
411 if( !edit_start ) continue;
412 if( edit_start >= start_units && edit_start < end_units ) {
413 edit->insert_transition(title);
420 void Tracks::set_automation_mode(double selectionstart,
424 Track* current_track;
426 for(current_track = first; current_track; current_track = current_track->next)
428 if(current_track->record)
430 current_track->set_automation_mode(selectionstart,
437 int Tracks::clear_default_keyframe()
439 for(Track *current = first; current; current = NEXT)
442 current->clear_automation(0, 0, 0, 1);
447 int Tracks::clear_handle(double start,
449 double &longest_distance,
454 Track* current_track;
457 for(current_track = first; current_track; current_track = current_track->next)
459 if(current_track->record)
461 current_track->clear_handle(start,
467 if(distance > longest_distance) longest_distance = distance;
474 int Tracks::copy_automation(double selectionstart,
480 // called by MWindow::copy_automation for copying automation alone
481 Track* current_track;
483 file->tag.set_title("AUTO_CLIPBOARD");
484 file->tag.set_property("LENGTH", selectionend - selectionstart);
485 file->tag.set_property("FRAMERATE", edl->session->frame_rate);
486 file->tag.set_property("SAMPLERATE", edl->session->sample_rate);
488 file->append_newline();
489 file->append_newline();
491 for(current_track = first;
493 current_track = current_track->next)
495 if(current_track->record)
497 current_track->copy_automation(selectionstart,
505 file->tag.set_title("/AUTO_CLIPBOARD");
507 file->append_newline();
508 file->terminate_string();
512 // int Tracks::copy_default_keyframe(FileXML *file)
514 // copy_automation(0, 0, file, 1, 0);
518 int Tracks::delete_tracks()
520 int total_deleted = 0;
526 Track *next_track = 0;
527 for (Track* current = first; current && done; current = next_track)
529 next_track = current->next;
532 delete_track(current);
540 return total_deleted;
543 void Tracks::move_edits(ArrayList<Edit*> *in_edits, Track *track, double position,
544 int edit_labels, int edit_plugins, int edit_autos, int mode)
546 // have to make a copy, optimize kills edits
547 ArrayList<Edit*> edits;
548 for( int i=0; i<in_edits->size(); ++i ) {
549 Edit *edit = in_edits->get(i);
550 Edit *new_edit = new Edit(edit->edl, edit->track);
551 new_edit->copy_from(edit);
552 edits.append(new_edit);
555 int current_aedit = 0, current_vedit = 0;
556 //printf("Tracks::move_edits 1\n");
557 for( Track *dest_track=track; dest_track; dest_track=dest_track->next ) {
558 if( !dest_track->record ) continue;
559 // Need a local copy of the source edit since the original source edit may
560 // change in the editing operation.
562 Edit *source_edit = 0;
563 Track *clip_track = 0;
564 switch( dest_track->data_type ) {
566 while( current_aedit < edits.size() ) {
567 Edit *edit = edits[current_aedit++];
568 if( edit->track->data_type == TRACK_AUDIO ) {
570 ATrack *atrack = new ATrack(dest_track->edl, 0);
571 atrack->create_objects();
578 while( current_vedit < edits.size() ) {
579 Edit *edit = edits[current_vedit++];
580 if( edit->track->data_type == TRACK_VIDEO ) {
582 VTrack *vtrack = new VTrack(dest_track->edl, 0);
583 vtrack->create_objects();
590 if( !source_edit ) continue;
592 Track *source_track = source_edit->track;
593 int64_t start = source_edit->startproject;
594 int64_t length = source_edit->length, end = start + length;
595 double source_start = source_track->from_units(start);
596 double source_end = source_track->from_units(start+length);
597 double len = source_end - source_start;
598 double dest_start = position;
599 double dest_end = dest_start + len;
601 if( edit_labels && dest_track == track ) {
603 Labels labels(0, "LABELS");
604 source_edit->edl->labels->copy(source_start, source_end, &label_xml);
605 source_edit->edl->labels->clear(source_start, source_end, mode);
606 if( !label_xml.read_tag() )
607 labels.load(&label_xml, LOAD_ALL);
608 double pos = dest_start;
609 if( mode && source_start < dest_start ) pos -= len;
610 edl->labels->insert_labels(&labels, pos, len, mode);
615 source_track->copy(source_start, source_end, &track_xml, "");
616 if( !track_xml.read_tag() )
617 clip_track->load(&track_xml, 0, LOAD_ALL);
619 if( !mode ) { // mute and overwrite
620 source_track->clear(start, end, 1, 0,
621 edit_plugins, edit_autos, 0);
622 source_track->edits->paste_silence(start, end);
624 source_track->shift_keyframes(start, length);
626 int n = source_track->plugin_set.size();
627 if( n > 0 ) dest_track->expand_view = 1;
628 for( int k=0; k<n; ++k )
629 source_track->plugin_set[k]->paste_silence(start, end, 1);
631 dest_track->clear(dest_start, dest_end, 1, 0,
632 edit_plugins, edit_autos, 0);
633 dest_track->insert_track(clip_track, dest_start, 0,
634 edit_plugins, edit_autos, len);
636 else { // cut and paste
637 dest_track->insert_track(clip_track, dest_start, 0,
638 edit_plugins, edit_autos, len);
639 if( source_track == dest_track && dest_start < source_start ) {
640 source_start += len; source_end += len;
642 source_track->clear(source_start, source_end, 1, 0,
643 edit_plugins, edit_autos, 0);
647 dest_track->optimize();
650 edits.remove_all_objects();
653 void Tracks::move_effect(Plugin *plugin, Track *track, int64_t position)
655 Track *source_track = plugin->track;
657 // Create a new plugin set
658 double start = track->from_units(position);
659 double length = track->from_units(plugin->length);
661 result = track->insert_effect("", &plugin->shared_location, 0, 0,
662 start, length, plugin->plugin_type);
663 result->copy_from(plugin);
664 result->shift(position - plugin->startproject);
666 // Clear new plugin from old set
667 plugin->plugin_set->clear(plugin->startproject,
668 plugin->startproject + plugin->length,
669 edl->session->autos_follow_edits);
671 source_track->optimize();
674 void Tracks::move_effect(Plugin *plugin, PluginSet *plugin_set, int64_t position)
676 // src/dest track must be the same
677 // replace plugin in source plugin_set with silence
678 PluginSet *src_plugin_set = plugin->plugin_set;
679 Plugin *silent = new Plugin(edl, src_plugin_set, "");
680 silent->startproject = plugin->startproject;
681 silent->length = plugin->length;
682 src_plugin_set->insert_after(plugin, silent);
683 src_plugin_set->remove_pointer(plugin);
684 // truncate previous plugin
685 Plugin *dest = (Plugin *)plugin_set->editof(position, PLAY_FORWARD, 0);
686 // add plugin after dest
687 plugin_set->insert_after(dest, plugin);
689 dest->length = position - dest->startproject;
690 if( dest->length < 0 ) dest->length = 0;
692 // update plugin position
693 plugin->startproject = position;
694 plugin->plugin_set = plugin_set;
695 plugin->edits = plugin_set;
696 src_plugin_set->track->optimize();
699 int Tracks::concatenate_tracks(int edit_plugins, int edit_autos)
701 Track *output_track, *first_output_track, *input_track;
702 int i, data_type = TRACK_AUDIO;
707 for(i = 0; i < 2; i++)
709 // Get first output track
710 for(output_track = first;
712 output_track = output_track->next)
713 if(output_track->data_type == data_type &&
714 output_track->record) break;
716 first_output_track = output_track;
718 // Get first input track
719 for(input_track = first;
721 input_track = input_track->next)
723 if(input_track->data_type == data_type &&
725 !input_track->record) break;
729 if(output_track && input_track)
731 // Transfer input track to end of output track one at a time
734 output_start = output_track->get_length();
735 output_track->insert_track(input_track,
742 // Get next source and destination
743 for(input_track = input_track->next;
745 input_track = input_track->next)
748 if(input_track->data_type == data_type &&
749 !input_track->record &&
750 input_track->play) break;
753 for(output_track = output_track->next;
755 output_track = output_track->next)
757 if(output_track->data_type == data_type &&
758 output_track->record) break;
763 output_track = first_output_track;
769 if(data_type == TRACK_AUDIO) data_type = TRACK_VIDEO;
775 int Tracks::delete_all_tracks()
777 while(last) delete last;
782 void Tracks::change_modules(int old_location, int new_location, int do_swap)
784 for(Track* current = first ; current; current = current->next)
786 current->change_modules(old_location, new_location, do_swap);
790 void Tracks::change_plugins(SharedLocation &old_location, SharedLocation &new_location, int do_swap)
792 for(Track* current = first ; current; current = current->next)
794 current->change_plugins(old_location, new_location, do_swap);
800 // =========================================== EDL editing
803 int Tracks::copy(double start,
807 const char *output_path)
810 if(start == end && !all) return 1;
818 if(current->record || all)
820 current->copy(start, end, file,output_path);
829 int Tracks::move_track_up(Track *track)
831 Track *next_track = track->previous;
832 if(!next_track) next_track = last;
834 change_modules(number_of(track), number_of(next_track), 1);
836 // printf("Tracks::move_track_up 1 %p %p\n", track, next_track);
838 // for(Track *current = first; current && count < 5; current = NEXT, count++)
839 // printf("Tracks::move_track_up %p %p %p\n", current->previous, current, current->next);
840 // printf("Tracks::move_track_up 2\n");
842 swap(track, next_track);
845 // for(Track *current = first; current && count < 5; current = NEXT, count++)
846 // printf("Tracks::move_track_up %p %p %p\n", current->previous, current, current->next);
847 // printf("Tracks::move_track_up 3\n");
852 int Tracks::move_track_down(Track *track)
854 Track *next_track = track->next;
855 if(!next_track) next_track = first;
857 change_modules(number_of(track), number_of(next_track), 1);
858 swap(track, next_track);
863 int Tracks::move_tracks_up()
865 Track *track, *next_track;
872 next_track = track->next;
878 change_modules(number_of(track->previous), number_of(track), 1);
880 swap(track->previous, track);
889 int Tracks::move_tracks_down()
891 Track *track, *previous_track;
896 track = previous_track)
898 previous_track = track->previous;
904 change_modules(number_of(track), number_of(track->next), 1);
906 swap(track, track->next);
917 void Tracks::paste_audio_transition(PluginServer *server)
919 for(Track *current = first; current; current = NEXT)
921 if(current->data_type == TRACK_AUDIO &&
924 int64_t position = current->to_units(
925 edl->local_session->get_selectionstart(), 0);
926 Edit *current_edit = current->edits->editof(position,
929 if( !current_edit && position == current->edits->length() ) {
930 double length = edl->session->default_transition_length;
931 int64_t units = current->to_units(length, 1);
932 current_edit = current->edits->create_silence(position, position+units);
936 paste_transition(server, current_edit);
942 void Tracks::paste_automation(double selectionstart,
948 Track* current_track = 0;
949 Track* current_atrack = 0;
950 Track* current_vtrack = 0;
951 Track* dst_track = 0;
955 double frame_rate = edl->session->frame_rate;
956 int64_t sample_rate = edl->session->sample_rate;
957 char string[BCTEXTLEN];
962 result = file->read_tag();
964 !file->tag.title_is("AUTO_CLIPBOARD"));
968 length = file->tag.get_property("LENGTH", 0);
969 frame_rate = file->tag.get_property("FRAMERATE", frame_rate);
970 sample_rate = file->tag.get_property("SAMPLERATE", sample_rate);
975 result = file->read_tag();
979 if(file->tag.title_is("/AUTO_CLIPBOARD"))
984 if(file->tag.title_is("TRACK"))
986 file->tag.get_property("TYPE", string);
987 if(!strcmp(string, "AUDIO"))
989 src_type = TRACK_AUDIO;
993 src_type = TRACK_VIDEO;
996 // paste to any media type
999 if(!current_track) current_track = first;
1000 while(current_track && !current_track->record)
1001 current_track = current_track->next;
1002 dst_track = current_track;
1005 if(!strcmp(string, "AUDIO"))
1007 // Get next audio track
1009 current_atrack = first;
1011 current_atrack = current_atrack->next;
1013 while(current_atrack &&
1014 (current_atrack->data_type != TRACK_AUDIO ||
1015 !current_atrack->record))
1016 current_atrack = current_atrack->next;
1017 dst_track = current_atrack;
1021 // Get next video track
1023 current_vtrack = first;
1025 current_vtrack = current_vtrack->next;
1027 while(current_vtrack &&
1028 (current_vtrack->data_type != TRACK_VIDEO ||
1029 !current_vtrack->record))
1030 current_vtrack = current_vtrack->next;
1032 dst_track = current_vtrack;
1037 double frame_rate2 = frame_rate;
1038 double sample_rate2 = sample_rate;
1040 if(src_type != dst_track->data_type)
1042 frame_rate2 = sample_rate;
1043 sample_rate2 = frame_rate;
1046 dst_track->paste_automation(selectionstart,
1060 // int Tracks::paste_default_keyframe(FileXML *file)
1062 // paste_automation(0, file, 1, 0);
1066 void Tracks::paste_transition(PluginServer *server, Edit *dest_edit)
1068 dest_edit->insert_transition(server->title);
1071 void Tracks::paste_video_transition(PluginServer *server, int first_track)
1073 for(Track *current = first; current; current = NEXT)
1075 if(current->data_type == TRACK_VIDEO &&
1078 int64_t position = current->to_units(
1079 edl->local_session->get_selectionstart(), 0);
1080 Edit *current_edit = current->edits->editof(position,
1083 if( !current_edit && position == current->edits->length() ) {
1084 double length = edl->session->default_transition_length;
1085 int64_t units = current->to_units(length, 1);
1086 current_edit = current->edits->create_silence(position, position+units);
1090 paste_transition(server, current_edit);
1092 if(first_track) break;
1098 int Tracks::paste_silence(double start,
1103 Track* current_track;
1105 for(current_track = first;
1107 current_track = current_track->next)
1109 if(current_track->record)
1111 current_track->paste_silence(start,
1122 int Tracks::select_auto(int cursor_x, int cursor_y)
1125 for(Track* current = first; current && !result; current = NEXT) { result = current->select_auto(&auto_conf, cursor_x, cursor_y); }
1129 int Tracks::move_auto(int cursor_x, int cursor_y, int shift_down)
1133 for(Track* current = first; current && !result; current = NEXT)
1135 result = current->move_auto(&auto_conf, cursor_x, cursor_y, shift_down);
1140 int Tracks::modify_edithandles(double &oldposition, double &newposition,
1141 int currentend, int handle_mode, int edit_labels,
1142 int edit_plugins, int edit_autos, int group_id)
1144 for( Track *track=first; track; track=track->next ) {
1145 if( !track->record ) continue;
1146 track->modify_edithandles(oldposition, newposition,
1147 currentend, handle_mode, edit_labels,
1148 edit_plugins, edit_autos, group_id);
1149 // labels follow first armed track
1155 int Tracks::modify_pluginhandles(double &oldposition, double &newposition,
1156 int currentend, int handle_mode, int edit_labels,
1157 int edit_autos, Edits *trim_edits)
1159 for( Track *track=first; track; track=track->next ) {
1160 if( !track->record ) continue;
1161 track->modify_pluginhandles(oldposition, newposition,
1162 currentend, handle_mode, edit_labels,
1163 edit_autos, trim_edits);
1169 int Tracks::purge_asset(Asset *asset)
1171 Track *current_track;
1174 for(current_track = first; current_track; current_track = current_track->next)
1176 result += current_track->purge_asset(asset);
1181 int Tracks::asset_used(Asset *asset)
1183 Track *current_track;
1186 for(current_track = first; current_track; current_track = current_track->next)
1188 result += current_track->asset_used(asset);
1193 int Tracks::scale_time(float rate_scale, int ignore_record, int scale_edits, int scale_autos, int64_t start, int64_t end)
1195 Track *current_track;
1197 for(current_track = first;
1199 current_track = current_track->next)
1201 if((current_track->record || ignore_record) &&
1202 current_track->data_type == TRACK_VIDEO)
1204 current_track->scale_time(rate_scale, scale_edits, scale_autos, start, end);