Audacity 3.2.0
Public Member Functions | Static Public Member Functions | List of all members
TrackActions::Handler Struct Reference
Inheritance diagram for TrackActions::Handler:
[legend]
Collaboration diagram for TrackActions::Handler:
[legend]

Public Member Functions

void OnStereoToMono (const CommandContext &context)
 
void OnMixAndRender (const CommandContext &context)
 
void OnMixAndRenderToNewTrack (const CommandContext &context)
 
void OnResample (const CommandContext &context)
 
void OnRemoveTracks (const CommandContext &context)
 
void OnMuteAllTracks (const CommandContext &context)
 
void OnUnmuteAllTracks (const CommandContext &context)
 
void OnMuteSelectedTracks (const CommandContext &context)
 
void OnUnmuteSelectedTracks (const CommandContext &context)
 
void OnPanLeft (const CommandContext &context)
 
void OnPanRight (const CommandContext &context)
 
void OnPanCenter (const CommandContext &context)
 
void OnAlignNoSync (const CommandContext &context)
 
void OnAlign (const CommandContext &context)
 
void OnMoveSelectionWithTracks (const CommandContext &WXUNUSED(context))
 
void OnSortTime (const CommandContext &context)
 
void OnSortName (const CommandContext &context)
 
void OnSyncLock (const CommandContext &context)
 
void OnTrackPan (const CommandContext &context)
 
void OnTrackPanLeft (const CommandContext &context)
 
void OnTrackPanRight (const CommandContext &context)
 
void OnTrackGain (const CommandContext &context)
 
void OnTrackGainInc (const CommandContext &context)
 
void OnTrackGainDec (const CommandContext &context)
 
void OnTrackMenu (const CommandContext &context)
 
void OnTrackMute (const CommandContext &context)
 
void OnTrackSolo (const CommandContext &context)
 
void OnTrackClose (const CommandContext &context)
 
void OnTrackMoveUp (const CommandContext &context)
 
void OnTrackMoveDown (const CommandContext &context)
 
void OnTrackMoveTop (const CommandContext &context)
 
void OnTrackMoveBottom (const CommandContext &context)
 

Static Public Member Functions

static void MuteTracks (const CommandContext &context, bool mute, bool selected)
 

Detailed Description

Definition at line 611 of file TrackMenus.cpp.

Member Function Documentation

◆ MuteTracks()

static void TrackActions::Handler::MuteTracks ( const CommandContext context,
bool  mute,
bool  selected 
)
inlinestatic

Definition at line 745 of file TrackMenus.cpp.

746{
747 auto &project = context.project;
748 const auto &settings = ProjectSettings::Get( project );
749 auto &tracks = TrackList::Get( project );
750 auto &window = ProjectWindow::Get( project );
751
752 auto soloSimple = settings.IsSoloSimple();
753 auto soloNone = settings.IsSoloNone();
754
755 auto iter = selected ? tracks.Selected<PlayableTrack>() : tracks.Any<PlayableTrack>();
756 for (auto pt : iter)
757 {
758 pt->SetMute(mute);
759 if (soloSimple || soloNone)
760 pt->SetSolo(false);
761 }
762
763 ProjectHistory::Get( project ).ModifyState(true);
764}
static Settings & settings()
Definition: TrackInfo.cpp:87
AudacityProject & project
AudioTrack subclass that can also be audibly replayed by the program.
Definition: Track.h:916
void SetMute(bool m)
Definition: Track.cpp:338
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)
static ProjectSettings & Get(AudacityProject &project)
static ProjectWindow & Get(AudacityProject &project)
bool Any() const
Definition: Track.cpp:399
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:486

References Track::Any(), ProjectHistory::Get(), TrackList::Get(), ProjectSettings::Get(), ProjectWindow::Get(), ProjectHistory::ModifyState(), CommandContext::project, PlayableTrack::SetMute(), and settings().

Referenced by OnMuteAllTracks(), OnMuteSelectedTracks(), OnUnmuteAllTracks(), and OnUnmuteSelectedTracks().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnAlign()

void TrackActions::Handler::OnAlign ( const CommandContext context)
inline

Definition at line 812 of file TrackMenus.cpp.

813{
814 auto &project = context.project;
815
816 bool bMoveWith;
817 gPrefs->Read(wxT("/GUI/MoveSelectionWithTracks"), &bMoveWith, false);
818 DoAlign(project, context.index, bMoveWith);
819}
wxT("CloseDown"))
FileConfig * gPrefs
Definition: Prefs.cpp:71
void DoAlign(AudacityProject &project, int index, bool moveSel)
Definition: TrackMenus.cpp:199

References anonymous_namespace{TrackMenus.cpp}::DoAlign(), gPrefs, CommandContext::index, CommandContext::project, and wxT().

Here is the call graph for this function:

◆ OnAlignNoSync()

void TrackActions::Handler::OnAlignNoSync ( const CommandContext context)
inline

Definition at line 804 of file TrackMenus.cpp.

805{
806 auto &project = context.project;
807
808 DoAlign(project,
809 context.index + kAlignLabelsCount(), false);
810}

References anonymous_namespace{TrackMenus.cpp}::DoAlign(), CommandContext::index, anonymous_namespace{TrackMenus.cpp}::kAlignLabelsCount(), and CommandContext::project.

Here is the call graph for this function:

◆ OnMixAndRender()

void TrackActions::Handler::OnMixAndRender ( const CommandContext context)
inline

Definition at line 621 of file TrackMenus.cpp.

622{
623 auto &project = context.project;
624 DoMixAndRender(project, false);
625}
void DoMixAndRender(AudacityProject &project, bool toNewTrack)
Definition: TrackMenus.cpp:48

References anonymous_namespace{TrackMenus.cpp}::DoMixAndRender(), and CommandContext::project.

Here is the call graph for this function:

◆ OnMixAndRenderToNewTrack()

void TrackActions::Handler::OnMixAndRenderToNewTrack ( const CommandContext context)
inline

Definition at line 627 of file TrackMenus.cpp.

628{
629 auto &project = context.project;
630 DoMixAndRender(project, true);
631}

References anonymous_namespace{TrackMenus.cpp}::DoMixAndRender(), and CommandContext::project.

Here is the call graph for this function:

◆ OnMoveSelectionWithTracks()

void TrackActions::Handler::OnMoveSelectionWithTracks ( const CommandContext WXUNUSEDcontext)
inline

Definition at line 829 of file TrackMenus.cpp.

830{
831 bool bMoveWith;
832 gPrefs->Read(wxT("/GUI/MoveSelectionWithTracks"), &bMoveWith, false);
833 gPrefs->Write(wxT("/GUI/MoveSelectionWithTracks"), !bMoveWith);
834 gPrefs->Flush();
835
836}
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143

References FileConfig::Flush(), gPrefs, and wxT().

Here is the call graph for this function:

◆ OnMuteAllTracks()

void TrackActions::Handler::OnMuteAllTracks ( const CommandContext context)
inline

Definition at line 766 of file TrackMenus.cpp.

767{
768 MuteTracks(context, true, false);
769}
static void MuteTracks(const CommandContext &context, bool mute, bool selected)
Definition: TrackMenus.cpp:745

References MuteTracks().

Here is the call graph for this function:

◆ OnMuteSelectedTracks()

void TrackActions::Handler::OnMuteSelectedTracks ( const CommandContext context)
inline

Definition at line 776 of file TrackMenus.cpp.

777{
778 MuteTracks(context, true, true);
779}

References MuteTracks().

Here is the call graph for this function:

◆ OnPanCenter()

void TrackActions::Handler::OnPanCenter ( const CommandContext context)
inline

Definition at line 798 of file TrackMenus.cpp.

799{
800 auto &project = context.project;
801 DoPanTracks( project, 0.0);
802}
void DoPanTracks(AudacityProject &project, float PanValue)
Definition: TrackMenus.cpp:155

References anonymous_namespace{TrackMenus.cpp}::DoPanTracks(), and CommandContext::project.

Here is the call graph for this function:

◆ OnPanLeft()

void TrackActions::Handler::OnPanLeft ( const CommandContext context)
inline

Definition at line 786 of file TrackMenus.cpp.

787{
788 auto &project = context.project;
789 DoPanTracks( project, -1.0);
790}

References anonymous_namespace{TrackMenus.cpp}::DoPanTracks(), and CommandContext::project.

Here is the call graph for this function:

◆ OnPanRight()

void TrackActions::Handler::OnPanRight ( const CommandContext context)
inline

Definition at line 792 of file TrackMenus.cpp.

793{
794 auto &project = context.project;
795 DoPanTracks( project, 1.0);
796}

References anonymous_namespace{TrackMenus.cpp}::DoPanTracks(), and CommandContext::project.

Here is the call graph for this function:

◆ OnRemoveTracks()

void TrackActions::Handler::OnRemoveTracks ( const CommandContext context)
inline

Definition at line 740 of file TrackMenus.cpp.

741{
743}
void DoRemoveTracks(AudacityProject &project)

References TrackUtilities::DoRemoveTracks(), and CommandContext::project.

Here is the call graph for this function:

◆ OnResample()

void TrackActions::Handler::OnResample ( const CommandContext context)
inline

Definition at line 633 of file TrackMenus.cpp.

634{
635 auto &project = context.project;
636 auto projectRate = ProjectRate::Get(project).GetRate();
637 auto &tracks = TrackList::Get( project );
638 auto &undoManager = UndoManager::Get( project );
639 auto &window = ProjectWindow::Get( project );
640
641 int newRate;
642
643 while (true)
644 {
645 wxDialogWrapper dlg(&window, wxID_ANY, XO("Resample"));
646 ShuttleGui S(&dlg, eIsCreating);
647 wxString rate;
648 wxComboBox *cb;
649
650 rate.Printf(wxT("%ld"), lrint(projectRate));
651
652 wxArrayStringEx rates{
653 wxT("8000") ,
654 wxT("11025") ,
655 wxT("16000") ,
656 wxT("22050") ,
657 wxT("32000") ,
658 wxT("44100") ,
659 wxT("48000") ,
660 wxT("88200") ,
661 wxT("96000") ,
662 wxT("176400") ,
663 wxT("192000") ,
664 wxT("352800") ,
665 wxT("384000") ,
666 };
667
668 S.StartVerticalLay(true);
669 {
670 S.AddSpace(-1, 15);
671
672 S.StartHorizontalLay(wxCENTER, false);
673 {
674 cb = S.AddCombo(XXO("New sample rate (Hz):"),
675 rate,
676 rates);
677 }
678 S.EndHorizontalLay();
679
680 S.AddSpace(-1, 15);
681
682 S.AddStandardButtons();
683 }
684 S.EndVerticalLay();
685
686 dlg.Layout();
687 dlg.Fit();
688 dlg.Center();
689
690 if (dlg.ShowModal() != wxID_OK)
691 {
692 return; // user cancelled dialog
693 }
694
695 long lrate;
696 if (cb->GetValue().ToLong(&lrate) && lrate >= 1 && lrate <= 1000000)
697 {
698 newRate = (int)lrate;
699 break;
700 }
701
703 XO("The entered value is invalid"),
704 XO("Error"),
705 wxICON_ERROR,
706 &window);
707 }
708
709 int ndx = 0;
710 auto flags = UndoPush::NONE;
711 for (auto wt : tracks.Selected< WaveTrack >())
712 {
713 auto msg = XO("Resampling track %d").Format( ++ndx );
714
715 using namespace BasicUI;
716 auto progress = MakeProgress(XO("Resample"), msg);
717
718 // The resampling of a track may be stopped by the user. This might
719 // leave a track with multiple clips in a partially resampled state.
720 // But the thrown exception will cause rollback in the application
721 // level handler.
722
723 wt->Resample(newRate, progress.get());
724
725 // Each time a track is successfully, completely resampled,
726 // commit that to the undo stack. The second and later times,
727 // consolidate.
728
730 XO("Resampled audio track(s)"), XO("Resample Track"), flags);
731 flags = flags | UndoPush::CONSOLIDATE;
732 }
733
734 undoManager.StopConsolidating();
735
736 // Need to reset
737 window.FinishAutoScroll();
738}
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
#define XXO(s)
Definition: Internat.h:44
#define XO(s)
Definition: Internat.h:31
@ eIsCreating
Definition: ShuttleGui.h:39
#define S(N)
Definition: ToChars.cpp:64
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
static ProjectRate & Get(AudacityProject &project)
Definition: ProjectRate.cpp:28
double GetRate() const
Definition: ProjectRate.cpp:53
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:628
static UndoManager & Get(AudacityProject &project)
Definition: UndoManager.cpp:67
A Track that contains audio waveform data.
Definition: WaveTrack.h:57
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
#define lrint(dbl)
Definition: float_cast.h:169
std::unique_ptr< ProgressDialog > MakeProgress(const TranslatableString &title, const TranslatableString &message, unsigned flags=(ProgressShowStop|ProgressShowCancel), const TranslatableString &remainingLabelText={})
Create and display a progress dialog.
Definition: BasicUI.h:284

References AudacityMessageBox(), CONSOLIDATE, eIsCreating, ProjectHistory::Get(), UndoManager::Get(), ProjectRate::Get(), TrackList::Get(), ProjectWindow::Get(), ProjectRate::GetRate(), lrint, BasicUI::MakeProgress(), NONE, CommandContext::project, ProjectHistory::PushState(), S, wxT(), XO, and XXO.

Here is the call graph for this function:

◆ OnSortName()

void TrackActions::Handler::OnSortName ( const CommandContext context)
inline

Definition at line 973 of file TrackMenus.cpp.

974{
975 auto &project = context.project;
977
978 ProjectHistory::Get( project )
979 .PushState(XO("Tracks sorted by name"), XO("Sort by Name"));
980}
void DoSortTracks(AudacityProject &project, int flags)
Definition: TrackMenus.cpp:500

References anonymous_namespace{TrackMenus.cpp}::DoSortTracks(), ProjectHistory::Get(), anonymous_namespace{TrackMenus.cpp}::kAudacitySortByName, CommandContext::project, ProjectHistory::PushState(), and XO.

Here is the call graph for this function:

◆ OnSortTime()

void TrackActions::Handler::OnSortTime ( const CommandContext context)
inline

Definition at line 964 of file TrackMenus.cpp.

965{
966 auto &project = context.project;
968
969 ProjectHistory::Get( project )
970 .PushState(XO("Tracks sorted by time"), XO("Sort by Time"));
971}

References anonymous_namespace{TrackMenus.cpp}::DoSortTracks(), ProjectHistory::Get(), anonymous_namespace{TrackMenus.cpp}::kAudacitySortByTime, CommandContext::project, ProjectHistory::PushState(), and XO.

Here is the call graph for this function:

◆ OnStereoToMono()

void TrackActions::Handler::OnStereoToMono ( const CommandContext context)
inline

Definition at line 613 of file TrackMenus.cpp.

614{
616 EffectManager::Get().GetEffectByIdentifier(wxT("StereoToMono")),
617 context,
619}
static EffectManager & Get()
AUDACITY_DLL_API bool DoEffect(const PluginID &ID, const CommandContext &context, unsigned flags)
'Repeat Last Effect'.
Definition: EffectUI.cpp:1240

References EffectUI::DoEffect(), EffectManager::Get(), EffectManager::kConfigured, and wxT().

Here is the call graph for this function:

◆ OnSyncLock()

void TrackActions::Handler::OnSyncLock ( const CommandContext context)
inline

Definition at line 982 of file TrackMenus.cpp.

983{
984 auto &project = context.project;
985 auto &trackPanel = TrackPanel::Get( project );
986
987 bool bSyncLockTracks;
988 gPrefs->Read(wxT("/GUI/SyncLockTracks"), &bSyncLockTracks, false);
989 gPrefs->Write(wxT("/GUI/SyncLockTracks"), !bSyncLockTracks);
990 gPrefs->Flush();
991
992 // Toolbar, project sync-lock handled within
994
995 trackPanel.Refresh(false);
996}
static void ModifyAllProjectToolbarMenus()
Definition: Menus.cpp:592
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:230

References FileConfig::Flush(), TrackPanel::Get(), gPrefs, MenuManager::ModifyAllProjectToolbarMenus(), CommandContext::project, and wxT().

Here is the call graph for this function:

◆ OnTrackClose()

void TrackActions::Handler::OnTrackClose ( const CommandContext context)
inline

Definition at line 1111 of file TrackMenus.cpp.

1112{
1113 auto &project = context.project;
1114 auto &trackPanel = TrackPanel::Get( project );
1115
1116 const auto t = TrackFocus::Get( project ).Get();
1117 if (!t)
1118 return;
1119
1120 auto isAudioActive = ProjectAudioIO::Get( project ).IsAudioActive();
1121
1122 if (isAudioActive)
1123 {
1124 ProjectStatus::Get( project ).Set(
1125 XO("Can't delete track with active audio"));
1126 wxBell();
1127 return;
1128 }
1129
1131
1132 trackPanel.UpdateViewIfNoTracks();
1133 trackPanel.Refresh(false);
1134}
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:309
bool IsAudioActive() const
static ProjectAudioIO & Get(AudacityProject &project)
static ProjectStatus & Get(AudacityProject &project)
void Set(const TranslatableString &msg, StatusBarField field=mainStatusBarField)
Track * Get()
void DoRemoveTrack(AudacityProject &project, Track *toRemove)

References TrackUtilities::DoRemoveTrack(), TrackFocus::Get(), ProjectStatus::Get(), ProjectAudioIO::Get(), TrackPanel::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), ProjectAudioIO::IsAudioActive(), CommandContext::project, ProjectStatus::Set(), and XO.

Here is the call graph for this function:

◆ OnTrackGain()

void TrackActions::Handler::OnTrackGain ( const CommandContext context)
inline

This will pop up the track gain dialog for specified track

Definition at line 1039 of file TrackMenus.cpp.

1040{
1041 auto &project = context.project;
1042 auto &trackPanel = TrackPanel::Get( project );
1043
1045 const auto track = TrackFocus::Get( project ).Get();
1046 if (track) track->TypeSwitch( [&](WaveTrack *wt) {
1047 LWSlider *slider = WaveTrackControls::GainSlider( trackPanel, *wt );
1048 if (slider->ShowDialog())
1049 SetTrackGain(project, wt, slider);
1050 });
1051}
Lightweight version of ASlider. In other words it does not have a window permanently associated with ...
Definition: ASlider.h:64
bool ShowDialog()
Definition: ASlider.cpp:1127
static LWSlider * GainSlider(CellularPanel &panel, const WaveTrack &wt)
void SetTrackGain(AudacityProject &project, WaveTrack *wt, LWSlider *slider)
Definition: TrackMenus.cpp:577

References WaveTrackControls::GainSlider(), TrackFocus::Get(), TrackPanel::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), CommandContext::project, anonymous_namespace{TrackMenus.cpp}::SetTrackGain(), and LWSlider::ShowDialog().

Here is the call graph for this function:

◆ OnTrackGainDec()

void TrackActions::Handler::OnTrackGainDec ( const CommandContext context)
inline

Definition at line 1066 of file TrackMenus.cpp.

1067{
1068 auto &project = context.project;
1069 auto &trackPanel = TrackPanel::Get( project );
1070
1071 const auto track = TrackFocus::Get( project ).Get();
1072 if (track) track->TypeSwitch( [&](WaveTrack *wt) {
1073 LWSlider *slider = WaveTrackControls::GainSlider( trackPanel, *wt );
1074 slider->Decrease(1);
1075 SetTrackGain(project, wt, slider);
1076 });
1077}
void Decrease(float steps)
Definition: ASlider.cpp:1608

References LWSlider::Decrease(), WaveTrackControls::GainSlider(), TrackFocus::Get(), TrackPanel::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), CommandContext::project, and anonymous_namespace{TrackMenus.cpp}::SetTrackGain().

Here is the call graph for this function:

◆ OnTrackGainInc()

void TrackActions::Handler::OnTrackGainInc ( const CommandContext context)
inline

Definition at line 1053 of file TrackMenus.cpp.

1054{
1055 auto &project = context.project;
1056 auto &trackPanel = TrackPanel::Get( project );
1057
1058 const auto track = TrackFocus::Get( project ).Get();
1059 if (track) track->TypeSwitch( [&](WaveTrack *wt) {
1060 LWSlider *slider = WaveTrackControls::GainSlider( trackPanel, *wt );
1061 slider->Increase(1);
1062 SetTrackGain(project, wt, slider);
1063 });
1064}
void Increase(float steps)
Definition: ASlider.cpp:1585

References WaveTrackControls::GainSlider(), TrackFocus::Get(), TrackPanel::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), LWSlider::Increase(), CommandContext::project, and anonymous_namespace{TrackMenus.cpp}::SetTrackGain().

Here is the call graph for this function:

◆ OnTrackMenu()

void TrackActions::Handler::OnTrackMenu ( const CommandContext context)
inline

Definition at line 1079 of file TrackMenus.cpp.

1080{
1081 auto &project = context.project;
1082 auto &trackPanel = TrackPanel::Get( project );
1083
1084 trackPanel.OnTrackMenu();
1085}

References TrackPanel::Get(), and CommandContext::project.

Here is the call graph for this function:

◆ OnTrackMoveBottom()

void TrackActions::Handler::OnTrackMoveBottom ( const CommandContext context)
inline

Definition at line 1175 of file TrackMenus.cpp.

1176{
1177 auto &project = context.project;
1178 auto &trackPanel = TrackPanel::Get( project );
1179 auto &tracks = TrackList::Get( project );
1180
1181 const auto focusedTrack = TrackFocus::Get( project ).Get();
1182 if (tracks.CanMoveDown(focusedTrack)) {
1183 DoMoveTrack(project, focusedTrack, TrackUtilities::OnMoveBottomID);
1184 trackPanel.Refresh(false);
1185 }
1186}
void DoMoveTrack(AudacityProject &project, Track *target, MoveChoice choice)
Move a track up, down, to top or to bottom.

References TrackUtilities::DoMoveTrack(), TrackFocus::Get(), TrackList::Get(), TrackPanel::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), TrackUtilities::OnMoveBottomID, and CommandContext::project.

Here is the call graph for this function:

◆ OnTrackMoveDown()

void TrackActions::Handler::OnTrackMoveDown ( const CommandContext context)
inline

Definition at line 1149 of file TrackMenus.cpp.

1150{
1151 auto &project = context.project;
1152 auto &trackPanel = TrackPanel::Get( project );
1153 auto &tracks = TrackList::Get( project );
1154
1155 const auto focusedTrack = TrackFocus::Get( project ).Get();
1156 if (tracks.CanMoveDown(focusedTrack)) {
1157 DoMoveTrack(project, focusedTrack, TrackUtilities::OnMoveDownID);
1158 trackPanel.Refresh(false);
1159 }
1160}

References TrackUtilities::DoMoveTrack(), TrackFocus::Get(), TrackList::Get(), TrackPanel::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), TrackUtilities::OnMoveDownID, and CommandContext::project.

Here is the call graph for this function:

◆ OnTrackMoveTop()

void TrackActions::Handler::OnTrackMoveTop ( const CommandContext context)
inline

Definition at line 1162 of file TrackMenus.cpp.

1163{
1164 auto &project = context.project;
1165 auto &trackPanel = TrackPanel::Get( project );
1166 auto &tracks = TrackList::Get( project );
1167
1168 const auto focusedTrack = TrackFocus::Get( project ).Get();
1169 if (tracks.CanMoveUp(focusedTrack)) {
1170 DoMoveTrack(project, focusedTrack, TrackUtilities::OnMoveTopID);
1171 trackPanel.Refresh(false);
1172 }
1173}

References TrackUtilities::DoMoveTrack(), TrackFocus::Get(), TrackList::Get(), TrackPanel::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), TrackUtilities::OnMoveTopID, and CommandContext::project.

Here is the call graph for this function:

◆ OnTrackMoveUp()

void TrackActions::Handler::OnTrackMoveUp ( const CommandContext context)
inline

Definition at line 1136 of file TrackMenus.cpp.

1137{
1138 auto &project = context.project;
1139 auto &trackPanel = TrackPanel::Get( project );
1140 auto &tracks = TrackList::Get( project );
1141
1142 const auto focusedTrack = TrackFocus::Get( project ).Get();
1143 if (tracks.CanMoveUp(focusedTrack)) {
1144 DoMoveTrack(project, focusedTrack, TrackUtilities::OnMoveUpID);
1145 trackPanel.Refresh(false);
1146 }
1147}

References TrackUtilities::DoMoveTrack(), TrackFocus::Get(), TrackList::Get(), TrackPanel::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), TrackUtilities::OnMoveUpID, and CommandContext::project.

Here is the call graph for this function:

◆ OnTrackMute()

void TrackActions::Handler::OnTrackMute ( const CommandContext context)
inline

Definition at line 1087 of file TrackMenus.cpp.

1088{
1089 auto &project = context.project;
1090
1091 // Use the temporary selection if it is specified, else the track focus
1092 auto track = context.temporarySelection.pTrack;
1093 if (!track)
1094 track = TrackFocus::Get( project ).Get();
1095
1096 if (track) track->TypeSwitch( [&](PlayableTrack *t) {
1097 TrackUtilities::DoTrackMute(project, t, false);
1098 });
1099}
TemporarySelection temporarySelection
void DoTrackMute(AudacityProject &project, Track *t, bool exclusive)

References TrackUtilities::DoTrackMute(), TrackFocus::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), CommandContext::project, TemporarySelection::pTrack, and CommandContext::temporarySelection.

Here is the call graph for this function:

◆ OnTrackPan()

void TrackActions::Handler::OnTrackPan ( const CommandContext context)
inline

The following methods operate controls on specified tracks, This will pop up the track panning dialog for specified track

Definition at line 1000 of file TrackMenus.cpp.

1001{
1002 auto &project = context.project;
1003 auto &trackPanel = TrackPanel::Get( project );
1004
1005 const auto track = TrackFocus::Get( project ).Get();
1006 if (track) track->TypeSwitch( [&](WaveTrack *wt) {
1007 LWSlider *slider = WaveTrackControls::PanSlider( trackPanel, *wt );
1008 if (slider->ShowDialog())
1009 SetTrackPan(project, wt, slider);
1010 });
1011}
static LWSlider * PanSlider(CellularPanel &panel, const WaveTrack &wt)
void SetTrackPan(AudacityProject &project, WaveTrack *wt, LWSlider *slider)
Definition: TrackMenus.cpp:591

References TrackFocus::Get(), TrackPanel::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), WaveTrackControls::PanSlider(), CommandContext::project, anonymous_namespace{TrackMenus.cpp}::SetTrackPan(), and LWSlider::ShowDialog().

Here is the call graph for this function:

◆ OnTrackPanLeft()

void TrackActions::Handler::OnTrackPanLeft ( const CommandContext context)
inline

Definition at line 1013 of file TrackMenus.cpp.

1014{
1015 auto &project = context.project;
1016 auto &trackPanel = TrackPanel::Get( project );
1017
1018 const auto track = TrackFocus::Get( project ).Get();
1019 if (track) track->TypeSwitch( [&](WaveTrack *wt) {
1020 LWSlider *slider = WaveTrackControls::PanSlider( trackPanel, *wt );
1021 slider->Decrease(1);
1022 SetTrackPan(project, wt, slider);
1023 });
1024}

References LWSlider::Decrease(), TrackFocus::Get(), TrackPanel::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), WaveTrackControls::PanSlider(), CommandContext::project, and anonymous_namespace{TrackMenus.cpp}::SetTrackPan().

Here is the call graph for this function:

◆ OnTrackPanRight()

void TrackActions::Handler::OnTrackPanRight ( const CommandContext context)
inline

Definition at line 1026 of file TrackMenus.cpp.

1027{
1028 auto &project = context.project;
1029 auto &trackPanel = TrackPanel::Get( project );
1030
1031 const auto track = TrackFocus::Get( project ).Get();
1032 if (track) track->TypeSwitch( [&](WaveTrack *wt) {
1033 LWSlider *slider = WaveTrackControls::PanSlider( trackPanel, *wt );
1034 slider->Increase(1);
1035 SetTrackPan(project, wt, slider);
1036 });
1037}

References TrackFocus::Get(), TrackPanel::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), LWSlider::Increase(), WaveTrackControls::PanSlider(), CommandContext::project, and anonymous_namespace{TrackMenus.cpp}::SetTrackPan().

Here is the call graph for this function:

◆ OnTrackSolo()

void TrackActions::Handler::OnTrackSolo ( const CommandContext context)
inline

Definition at line 1101 of file TrackMenus.cpp.

1102{
1103 auto &project = context.project;
1104
1105 const auto track = TrackFocus::Get( project ).Get();
1106 if (track) track->TypeSwitch( [&](PlayableTrack *t) {
1107 TrackUtilities::DoTrackSolo(project, t, false);
1108 });
1109}
void DoTrackSolo(AudacityProject &project, Track *t, bool exclusive)

References TrackUtilities::DoTrackSolo(), TrackFocus::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), and CommandContext::project.

Here is the call graph for this function:

◆ OnUnmuteAllTracks()

void TrackActions::Handler::OnUnmuteAllTracks ( const CommandContext context)
inline

Definition at line 771 of file TrackMenus.cpp.

772{
773 MuteTracks(context, false, false);
774}

References MuteTracks().

Here is the call graph for this function:

◆ OnUnmuteSelectedTracks()

void TrackActions::Handler::OnUnmuteSelectedTracks ( const CommandContext context)
inline

Definition at line 781 of file TrackMenus.cpp.

782{
783 MuteTracks(context, false, true);
784}

References MuteTracks().

Here is the call graph for this function:

The documentation for this struct was generated from the following file: