X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ftracks.C;h=4df744922f1d50941a8081c007f6333c596df37f;hb=ccd23c15fae578be22d48b1a1e8b09cb43d593ae;hp=e2abde91f9cf6b94362bb28ba28c0dd389f73e27;hpb=e13e0a987ad66b8274fcbaddc71eac583ea80bea;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/tracks.C b/cinelerra-5.1/cinelerra/tracks.C index e2abde91..4df74492 100644 --- a/cinelerra-5.1/cinelerra/tracks.C +++ b/cinelerra-5.1/cinelerra/tracks.C @@ -287,83 +287,39 @@ Track* Tracks::add_audio_track(int above, Track *dst_track) Track* Tracks::add_video_track(int above, Track *dst_track) { -const int debug = 0; -if(debug) printf("Tracks::add_video_track %d\n", __LINE__); VTrack* new_track = new VTrack(edl, this); -if(debug) printf("Tracks::add_video_track %d\n", __LINE__); if(!dst_track) dst_track = (above ? first : last); - -if(debug) printf("Tracks::add_video_track %d\n", __LINE__); if(above) - { insert_before(dst_track, (Track*)new_track); - } else - { insert_after(dst_track, (Track*)new_track); - } -if(debug) printf("Tracks::add_video_track %d\n", __LINE__); - - -// Shift effects referenced below the new track - for(Track *track = last; - track && track != new_track; - track = track->previous) - { + for(Track *track = last; track && track != new_track; track = track->previous) change_modules(number_of(track) - 1, number_of(track), 0); - } - -if(debug) printf("Tracks::add_video_track %d\n", __LINE__); - new_track->create_objects(); -if(debug) printf("Tracks::add_video_track %d\n", __LINE__); new_track->set_default_title(); -if(debug) printf("Tracks::add_video_track %d\n", __LINE__); return new_track; } Track* Tracks::add_subttl_track(int above, Track *dst_track) { -const int debug = 0; -if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__); STrack* new_track = new STrack(edl, this); -if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__); if(!dst_track) dst_track = (above ? first : last); -if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__); if(above) - { insert_before(dst_track, (Track*)new_track); - } else - { insert_after(dst_track, (Track*)new_track); - } -if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__); - - -// Shift effects referenced below the new track - for(Track *track = last; - track && track != new_track; - track = track->previous) - { + for(Track *track = last; track && track != new_track; track = track->previous) change_modules(number_of(track) - 1, number_of(track), 0); - } - -if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__); - new_track->create_objects(); -if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__); new_track->set_default_title(); -if(debug) printf("Tracks::add_subttl_track %d\n", __LINE__); - // new_track->paste_silence(0,total_length(),0); return new_track; } @@ -406,7 +362,8 @@ int Tracks::total_of(int type) for(Track *current = first; current; current = NEXT) { long unit_start = current->to_units(edl->local_session->get_selectionstart(1), 0); - Auto *mute_keyframe = current->automation->autos[AUTOMATION_MUTE]-> + Auto *mute_keyframe = 0; + current->automation->autos[AUTOMATION_MUTE]-> get_prev_auto(unit_start, PLAY_FORWARD, mute_keyframe); IntAuto *mute_auto = (IntAuto *)mute_keyframe; @@ -490,15 +447,18 @@ double Tracks::total_playable_length() double total = 0; for(Track *current = first; current; current = NEXT) { - double length = current->get_length(); - if(length > total) total = length; + if( current->play ) + { + double length = current->get_length(); + if(length > total) total = length; + } } return total; } double Tracks::total_recordable_length() { - double total = 0; + double total = -1; for(Track *current = first; current; current = NEXT) { if(current->record) @@ -515,7 +475,8 @@ double Tracks::total_length() double total = 0; for(Track *current = first; current; current = NEXT) { - if(current->get_length() > total) total = current->get_length(); + double length = current->get_length(); + if(length > total) total = length; } return total; }