X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fplayabletracks.C;h=4f53d22accca413ad7b463ffc93ade3597c2b01f;hp=80e655248476ec2b320e1935005ef17959884c8a;hb=HEAD;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/cinelerra/playabletracks.C b/cinelerra-5.1/cinelerra/playabletracks.C index 80e65524..4f53d22a 100644 --- a/cinelerra-5.1/cinelerra/playabletracks.C +++ b/cinelerra-5.1/cinelerra/playabletracks.C @@ -22,6 +22,7 @@ #include "automation.h" #include "edl.h" #include "edlsession.h" +#include "localsession.h" #include "mwindow.h" #include "patchbay.h" #include "playabletracks.h" @@ -33,35 +34,16 @@ #include "transportque.h" -PlayableTracks::PlayableTracks(EDL *edl, - int64_t current_position, - int direction, - int data_type, - int use_nudge) +PlayableTracks::PlayableTracks(EDL *edl, int64_t current_position, + int direction, int data_type, int use_nudge) : ArrayList() { this->data_type = data_type; - for(Track *current_track = edl->tracks->first; - current_track; - current_track = current_track->next) - { - if(is_playable(current_track, current_position, direction, use_nudge)) - { -// printf("PlayableTracks::PlayableTracks %d this=%p current_track=%p total=%d current_position=%jd\n", -// __LINE__, -// this, -// current_track, -// total, -// current_position); - append(current_track); - } + for( Track *track=edl->tracks->first; track; track=track->next ) { + if( is_playable(track, current_position, direction, use_nudge) ) + append(track); } -// printf("PlayableTracks::PlayableTracks %d data_type=%d total=%d current_position=%jd\n", -// __LINE__, -// data_type, -// total, -// current_position); } PlayableTracks::~PlayableTracks() @@ -69,31 +51,40 @@ PlayableTracks::~PlayableTracks() } -int PlayableTracks::is_playable(Track *current_track, - int64_t position, - int direction, - int use_nudge) +int PlayableTracks::is_playable(Track *current_track, int64_t position, + int direction, int use_nudge) { int result = 1; if(use_nudge) position += current_track->nudge; if(current_track->data_type != data_type) result = 0; // Track is off screen and not bounced to other modules - if(result) - { - if(!current_track->plugin_used(position, direction) && - !current_track->is_playable(position, direction)) + if( result && + !current_track->plugin_used(position, direction) && + !current_track->is_playable(position, direction) ) result = 0; - } - // Test play patch - if(!current_track->play) - { - result = 0; + if( result && + !current_track->plays() ) + result = 0; + if( result ) { + EDL *edl = current_track->edl; + int solo_track_id = edl->local_session->solo_track_id; + if( solo_track_id >= 0 ) { + int visible = 0; + int current_id = current_track->get_id(); + Track *track = edl->tracks->first; + while( track ) { + int id = track->get_id(); + if( id == solo_track_id ) { visible = 1; break; } + if( id == current_id ) { visible = 0; break; } + track = track->next; + } + if( !track ) visible = 1; + result = visible; + } } - - if(result) - { + if( result ) { // Test for playable edit if(!current_track->playable_edit(position, direction)) {