mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-03 22:19:07 +02:00
Bug 2010 - Scriptables: SelectTracks and Select incorrect for stereo tracks
This commit is contained in:
parent
7e5a716e65
commit
15a3ea7763
@ -230,19 +230,18 @@ bool SelectTracksCommand::Apply(const CommandContext &context)
|
|||||||
// Add 0.01 so we are free of rounding errors in comparisons.
|
// Add 0.01 so we are free of rounding errors in comparisons.
|
||||||
constexpr double fudge = 0.01;
|
constexpr double fudge = 0.01;
|
||||||
for (auto channel : channels) {
|
for (auto channel : channels) {
|
||||||
(void)channel;// compiler food
|
|
||||||
double track = index + fudge + term;
|
double track = index + fudge + term;
|
||||||
bool sel = first <= track && track <= last;
|
bool sel = first <= track && track <= last;
|
||||||
if( mMode == 0 ){ // Set
|
if( mMode == 0 ){ // Set
|
||||||
t->SetSelected(sel);
|
channel->SetSelected(sel);
|
||||||
}
|
}
|
||||||
else if( mMode == 1 && sel ){ // Add
|
else if( mMode == 1 && sel ){ // Add
|
||||||
t->SetSelected(sel);
|
channel->SetSelected(sel);
|
||||||
}
|
}
|
||||||
else if( mMode == 2 && sel ){ // Remove
|
else if( mMode == 2 && sel ){ // Remove
|
||||||
t->SetSelected(!sel);
|
channel->SetSelected(!sel);
|
||||||
}
|
}
|
||||||
term += (1.0 - fudge) / channels.size();
|
term += 1.0 / channels.size();
|
||||||
}
|
}
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user