23 auto range =
tracks.Selected();
24 using Iter =
decltype(range.begin());
27 std::optional<Iter> focus;
29 auto iter =
tracks.Find(*range.begin());
31 focus.emplace(--iter);
34 while (!range.empty())
35 tracks.Remove(**range.first++);
37 if (!(focus.has_value() && **focus))
39 focus.emplace(
tracks.end().advance(-1));
44 if (
const auto nextF = * ++ *focus)
56 trackPanel.UpdateViewIfNoTracks();
67 bool chosen = (&track == playable);
68 playable->SetMute(chosen);
69 playable->SetSolo(
false);
79 pt->SetMute(!wasMute);
89 auto nPlayableTracks = range.
size();
91 for (
auto track : range)
92 track->SetSolo((nPlaying == 1) &&
93 (nPlayableTracks > 1) && !track->GetMute());
112 bool bSoloMultiple = !simple ^ exclusive;
120 pt->SetSolo(!bWasSolo);
125 bool chosen = (&track == playable);
127 playable->SetSolo(!bWasSolo);
129 playable->SetMute(
false);
132 playable->SetSolo(
false);
134 playable->SetMute(!bWasSolo);
148 const auto iter =
tracks.Find(&toRemove);
153 bool toRemoveWasFocused = trackFocus.Get() == *iter;
154 std::optional<
decltype(iter)> newFocus{};
155 if (toRemoveWasFocused) {
156 auto iterNext = iter,
158 newFocus.emplace(++iterNext);
160 newFocus.emplace(--iterPrev);
167 if (toRemoveWasFocused)
168 trackFocus.Set(**newFocus);
186 longDesc =
XO(
"Moved '%s' to Top");
187 shortDesc =
XO(
"Move Track to Top");
191 while (
tracks.CanMoveUp(target))
192 tracks.Move(target,
true);
197 longDesc =
XO(
"Moved '%s' to Bottom");
198 shortDesc =
XO(
"Move Track to Bottom");
202 while (
tracks.CanMoveDown(target))
203 tracks.Move(target,
false);
212 bUp?
XO(
"Moved '%s' Up")
213 :
XO(
"Moved '%s' Down");
216 bUp?
XO(
"Move Track Up")
217 :
XO(
"Move Track Down");
EnumSetting< SoloBehavior > TracksBehaviorsSolo
Extends Track with notions of mute and solo setting.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
size_t size() const
How many attachment pointers are in the Site.
AudioTrack subclass that can also be audibly replayed by the program.
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)
Abstract base class for an object holding data associated with points on a time axis.
const wxString & GetName() const
Name is always the same for all channels of a group.
static TrackList & Get(AudacityProject &project)
static TrackPanel & Get(AudacityProject &project)
Holds a msgid for the translation catalog; may also bind format arguments.
TranslatableString & Format(Args &&...args) &
Capture variadic format arguments (by copy) when there is no plural.
void ShowTrack(const Track &track)
static Viewport & Get(AudacityProject &project)
AUDACITY_DLL_API void DoMoveTrack(AudacityProject &project, Track &target, MoveChoice choice)
Move a track up, down, to top or to bottom.
AUDACITY_DLL_API void DoRemoveTrack(AudacityProject &project, Track &toRemove)
AUDACITY_DLL_API void DoTrackSolo(AudacityProject &project, Track &track, bool exclusive)
AUDACITY_DLL_API void DoTrackMute(AudacityProject &project, Track &track, bool exclusive)
"exclusive" mute means mute the chosen track and unmute all others.
AUDACITY_DLL_API void DoRemoveTracks(AudacityProject &)