mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-22 06:22:58 +02:00
Paul L's new SelectedRegion class replacing use of t0 and t1. Also LabelTrack.h no longer in TrackPanel.h includes.
This change is believed to be a direct refactoring that does not change functionality. It paves the way for more complex kinds of selection, such as selections involving frequency as well as time. It also reduces risk of left and right edges being swapped in future code using SelectedRegion, as the default is to swap on assignment if needed.
This commit is contained in:
@@ -84,8 +84,16 @@ bool SelectCommand::Apply(CommandExecutionContext context)
|
||||
Error(wxT("End time is after end of track!"));
|
||||
return false;
|
||||
}
|
||||
context.proj->mViewInfo.sel0 = t0;
|
||||
context.proj->mViewInfo.sel1 = t1;
|
||||
|
||||
// PRL: to do: only setting time boundaries of current selection.
|
||||
// Should other fields be left alone, or rather
|
||||
// defaulted, as in the second branch?
|
||||
// Or should this command take more parameters?
|
||||
#if 1
|
||||
context.proj->mViewInfo.selectedRegion.setTimes(t0, t1);
|
||||
#else
|
||||
context.proj->mViewInfo.selectedRegion = SelectedRegion(t0, t1);
|
||||
#endif
|
||||
|
||||
// select specified tracks
|
||||
long firstTrack = GetLong(wxT("FirstTrack"));
|
||||
|
Reference in New Issue
Block a user