mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 14:02:57 +02:00
Fix SetTrack for stereo tracks.
Stereo tracks have selection on both channels. Both must be set or cleared. We also need to explicitly remove focus, if it was set. Code was only setting it.
This commit is contained in:
@@ -216,14 +216,20 @@ bool SetTrackCommand::Apply(const CommandContext & context)
|
||||
case kHalfWave: wt->SetDisplayBounds(0,1); break;
|
||||
}
|
||||
}
|
||||
// These ones don't make sense on the second channel of a stereo track.
|
||||
if( !bIsSecondChannel ){
|
||||
|
||||
// In stereo tracks, both channels need selecting/deselecting.
|
||||
if( bHasSelected )
|
||||
t->SetSelected(bSelected);
|
||||
if( bHasFocused && bFocused)
|
||||
|
||||
// These ones don't make sense on the second channel of a stereo track.
|
||||
if( !bIsSecondChannel ){
|
||||
if( bHasFocused )
|
||||
{
|
||||
TrackPanel *panel = context.GetProject()->GetTrackPanel();
|
||||
if( bFocused)
|
||||
panel->SetFocusedTrack( t );
|
||||
else if( t== panel->GetFocusedTrack() )
|
||||
panel->SetFocusedTrack( nullptr );
|
||||
}
|
||||
if( pt && bHasSolo )
|
||||
pt->SetSolo(bSolo);
|
||||
|
Reference in New Issue
Block a user