Audacity 3.2.0
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
RealtimeEffectPanel Class Reference

UI Panel that displays realtime effects from the effect stack of an individual track, provides controls for accessing effect settings, stack manipulation (reorder, add, remove) More...

#include <RealtimeEffectPanel.h>

Inheritance diagram for RealtimeEffectPanel:
[legend]
Collaboration diagram for RealtimeEffectPanel:
[legend]

Classes

struct  PrefsListenerHelper
 

Public Member Functions

 RealtimeEffectPanel (AudacityProject &project, wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
 
 ~RealtimeEffectPanel () override
 
void ShowPanel (SampleTrack *track, bool focus)
 
void HidePanel ()
 
void SetTrack (const std::shared_ptr< SampleTrack > &track)
 Shows effects from the effect stack of the track. More...
 
void ResetTrack ()
 
bool IsTopNavigationDomain (NavigationKind) const override
 
void SetFocus () override
 

Static Public Member Functions

static RealtimeEffectPanelGet (AudacityProject &project)
 
static const RealtimeEffectPanelGet (const AudacityProject &project)
 

Private Member Functions

void MakeTrackEffectPane ()
 
void MakeMasterEffectPane ()
 
void OnCharHook (wxKeyEvent &evt)
 

Private Attributes

AButtonmToggleTrackEffects {nullptr}
 
AButtonmToggleMasterEffects {nullptr}
 
wxStaticText * mTrackTitle {nullptr}
 
wxWindow * mTrackEffectsPanel {nullptr}
 
wxWindow * mProjectEffectsPanel {nullptr}
 
RealtimeEffectListWindowmTrackEffectList {nullptr}
 
RealtimeEffectListWindowmMasterEffectList {nullptr}
 
wxWindow * mTrackEffectsHeader {nullptr}
 
AudacityProjectmProject
 
std::weak_ptr< SampleTrackmCurrentTrack
 
Observer::Subscription mTrackListChanged
 
Observer::Subscription mUndoSubscription
 
Observer::Subscription mFocusChangeSubscription
 
std::vector< std::shared_ptr< SampleTrack > > mPotentiallyRemovedTracks
 
std::unique_ptr< PrefsListenerHelpermPrefsListenerHelper
 

Detailed Description

UI Panel that displays realtime effects from the effect stack of an individual track, provides controls for accessing effect settings, stack manipulation (reorder, add, remove)

Definition at line 35 of file RealtimeEffectPanel.h.

Constructor & Destructor Documentation

◆ RealtimeEffectPanel()

RealtimeEffectPanel::RealtimeEffectPanel ( AudacityProject project,
wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = 0,
const wxString &  name = wxPanelNameStr 
)

Definition at line 1158 of file RealtimeEffectPanel.cpp.

1162 : wxSplitterWindow(parent, id, pos, size, style, name)
1163 , mProject(project)
1164 , mPrefsListenerHelper(std::make_unique<PrefsListenerHelper>(project))
1165{
1166 SetSashInvisible();//Use custom sash
1167
1168 SetSashGravity(1.0);
1171 {
1176 std::make_shared<ProjectEffectListDelegate>(mProject)
1177 );
1178 }
1179 SetMinimumPaneSize(mTrackEffectsPanel->GetSizer()->CalcMin().y);
1180 SplitHorizontally(mTrackEffectsPanel, mProjectEffectsPanel, -267);
1181
1182 Bind(wxEVT_CHAR_HOOK, &RealtimeEffectPanel::OnCharHook, this);
1185 auto track = evt.mpTrack.lock();
1186 auto waveTrack = std::dynamic_pointer_cast<WaveTrack>(track);
1187
1188 if (waveTrack == nullptr)
1189 return;
1190
1191 switch (evt.mType)
1192 {
1194 if (mCurrentTrack.lock() == waveTrack)
1195 mTrackTitle->SetLabel(track->GetName());
1196 UpdateRealtimeEffectUIData(*waveTrack);
1197 break;
1199 if (evt.mExtra == 0)
1200 mPotentiallyRemovedTracks.push_back(waveTrack);
1201 break;
1203 // Addition can be fired as a part of "replace" event.
1204 // Calling UpdateRealtimeEffectUIData is mostly no-op,
1205 // it will just create a new State and Access for it.
1206 UpdateRealtimeEffectUIData(*waveTrack);
1207 break;
1208 default:
1209 break;
1210 }
1211 });
1212
1214 [this](UndoRedoMessage message)
1215 {
1216 if (
1217 message.type == UndoRedoMessage::Type::Purge ||
1218 message.type == UndoRedoMessage::Type::BeginPurge ||
1219 message.type == UndoRedoMessage::Type::EndPurge)
1220 return;
1221
1222 auto& trackList = TrackList::Get(mProject);
1223
1224 // Realtime effect UI is only updated on Undo or Redo
1225 auto waveTracks = trackList.Any<WaveTrack>();
1226
1227 if (
1228 message.type == UndoRedoMessage::Type::UndoOrRedo ||
1229 message.type == UndoRedoMessage::Type::Reset)
1230 {
1231 for (auto waveTrack : waveTracks)
1232 UpdateRealtimeEffectUIData(*waveTrack);
1233 }
1234
1235 // But mPotentiallyRemovedTracks processing happens as fast as possible.
1236 // This event is fired right after the track is deleted, so we do not
1237 // hold the strong reference to the track much longer than need.
1238 if (mPotentiallyRemovedTracks.empty())
1239 return;
1240
1241 // Collect RealtimeEffectUIs that are currently shown
1242 // for the potentially removed tracks
1243 std::vector<RealtimeEffectStateUI*> shownUIs;
1244
1245 for (auto track : mPotentiallyRemovedTracks)
1246 {
1247 // By construction, track cannot be null
1248 assert(track != nullptr);
1249
1251 *track,
1252 [&shownUIs](auto& ui)
1253 {
1254 if (ui.IsShown())
1255 shownUIs.push_back(&ui);
1256 });
1257 }
1258
1259 // For every UI shown - check if the corresponding state
1260 // is reachable from the current track list.
1261 for (auto effectUI : shownUIs)
1262 {
1263 bool reachable = false;
1264
1265 for (auto track : waveTracks)
1266 {
1268 *track,
1269 [effectUI, &reachable](auto& ui)
1270 {
1271 if (effectUI == &ui)
1272 reachable = true;
1273 });
1274
1275 if (reachable)
1276 break;
1277 }
1278
1279 if (!reachable)
1280 // Don't need to autosave for an unreachable state
1281 effectUI->Hide();
1282 }
1283
1285 });
1286
1288 .Subscribe([this](const TrackFocusChangeMessage& msg) {
1289 if (IsShown())
1290 {
1291 auto& trackFocus = TrackFocus::Get(mProject);
1292 ShowPanel(dynamic_cast<SampleTrack *>(trackFocus.Get()), false);
1293 }
1294 });
1295
1296 Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent&) {
1297 HidePanel(); });
1298}
for(int ii=0, nn=names.size();ii< nn;++ii)
wxString name
Definition: TagsEditor.cpp:166
const auto project
void PushDown()
Definition: AButton.cpp:664
void PopUp()
Definition: AButton.cpp:672
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
Definition: Observer.h:199
static PendingTracks & Get(AudacityProject &project)
static RealtimeEffectList & Get(AudacityProject &project)
bool IsActive() const
Non-blocking atomic boolean load.
void SetDelegate(AudacityProject &project, const std::shared_ptr< EffectListUIDelegate > &delegate)
Observer::Subscription mUndoSubscription
wxStaticText * mTrackTitle
void ShowPanel(SampleTrack *track, bool focus)
void OnCharHook(wxKeyEvent &evt)
std::weak_ptr< SampleTrack > mCurrentTrack
std::unique_ptr< PrefsListenerHelper > mPrefsListenerHelper
RealtimeEffectListWindow * mMasterEffectList
std::vector< std::shared_ptr< SampleTrack > > mPotentiallyRemovedTracks
Observer::Subscription mFocusChangeSubscription
AudacityProject & mProject
Observer::Subscription mTrackListChanged
Track * Get()
Definition: TrackFocus.cpp:156
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:950
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:314
static UndoManager & Get(AudacityProject &project)
Definition: UndoManager.cpp:71
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
void UpdateRealtimeEffectUIData(const AudacityProject &project)
void VisitRealtimeEffectStateUIs(const Track &track, Visitor &&visitor)
Notification of changes in individual tracks of TrackList, or of TrackList's composition.
Definition: Track.h:803
const int mExtra
Definition: Track.h:839
const std::weak_ptr< Track > mpTrack
Definition: Track.h:838
const Type mType
Definition: Track.h:837
@ DELETION
Posted when a track has been deleted from a tracklist. Also posted when one track replaces another.
Definition: Track.h:825
@ ADDITION
Posted when a track has been added to a tracklist. Also posted when one track replaces another.
Definition: Track.h:819
@ TRACK_DATA_CHANGE
Posted when certain fields of a track change.
Definition: Track.h:809
Type of message published by UndoManager.
Definition: UndoManager.h:55
enum UndoRedoMessage::Type type

References TrackListEvent::ADDITION, TrackList::Any(), TrackListEvent::DELETION, for(), TrackFocus::Get(), UndoManager::Get(), RealtimeEffectList::Get(), PendingTracks::Get(), TrackList::Get(), HidePanel(), RealtimeEffectList::IsActive(), MakeMasterEffectPane(), MakeTrackEffectPane(), mCurrentTrack, TrackListEvent::mExtra, mFocusChangeSubscription, mMasterEffectList, mPotentiallyRemovedTracks, mProject, mProjectEffectsPanel, TrackListEvent::mpTrack, mToggleMasterEffects, mTrackEffectsPanel, mTrackListChanged, mTrackTitle, TrackListEvent::mType, mUndoSubscription, OnCharHook(), AButton::PopUp(), project, AButton::PushDown(), RealtimeEffectListWindow::SetDelegate(), ShowPanel(), Observer::Publisher< Message, NotifyAll >::Subscribe(), TrackListEvent::TRACK_DATA_CHANGE, UndoRedoMessage::type, anonymous_namespace{RealtimeEffectPanel.cpp}::UpdateRealtimeEffectUIData(), and anonymous_namespace{RealtimeEffectPanel.cpp}::VisitRealtimeEffectStateUIs().

Here is the call graph for this function:

◆ ~RealtimeEffectPanel()

RealtimeEffectPanel::~RealtimeEffectPanel ( )
override

Definition at line 1300 of file RealtimeEffectPanel.cpp.

1301{
1302}

Member Function Documentation

◆ Get() [1/2]

RealtimeEffectPanel & RealtimeEffectPanel::Get ( AudacityProject project)
static

Definition at line 1147 of file RealtimeEffectPanel.cpp.

1148{
1150}
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:318
UI Panel that displays realtime effects from the effect stack of an individual track,...

References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), GetAttachedWindows(), project, and anonymous_namespace{RealtimeEffectPanel.cpp}::sKey.

Referenced by EffectsButtonHandle::CommitChanges(), anonymous_namespace{PluginMenus.cpp}::DoManageRealtimeEffectsSidePanel(), Get(), and anonymous_namespace{NavigationMenus.cpp}::NextOrPrevFrame().

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

◆ Get() [2/2]

const RealtimeEffectPanel & RealtimeEffectPanel::Get ( const AudacityProject project)
static

Definition at line 1153 of file RealtimeEffectPanel.cpp.

1154{
1155 return Get(const_cast<AudacityProject &>(project));
1156}
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static RealtimeEffectPanel & Get(AudacityProject &project)

References Get(), and project.

Here is the call graph for this function:

◆ HidePanel()

void RealtimeEffectPanel::HidePanel ( )

Definition at line 1331 of file RealtimeEffectPanel.cpp.

1332{
1333 wxWindowUpdateLocker freeze(this);
1334
1335 auto &projectWindow = ProjectWindow::Get(mProject);
1336 const auto pContainerWindow = projectWindow.GetContainerWindow();
1337 const auto pTrackListWindow = projectWindow.GetTrackListWindow();
1338 if (pContainerWindow->GetWindow2() == nullptr)
1339 //only effects panel is present, restore split positions before removing effects panel
1340 //Workaround: ::Replace and ::Initialize do not work here...
1341 pContainerWindow->SplitVertically(this, pTrackListWindow);
1342
1343 pContainerWindow->Unsplit(this);
1344 pTrackListWindow->SetFocus();
1345 projectWindow.Layout();
1346}
static ProjectWindow & Get(AudacityProject &project)

References ProjectWindow::Get(), and mProject.

Referenced by RealtimeEffectPanel().

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

◆ IsTopNavigationDomain()

bool RealtimeEffectPanel::IsTopNavigationDomain ( NavigationKind  ) const
inlineoverride

Definition at line 84 of file RealtimeEffectPanel.h.

84{ return true; }

◆ MakeMasterEffectPane()

void RealtimeEffectPanel::MakeMasterEffectPane ( )
private

Definition at line 1577 of file RealtimeEffectPanel.cpp.

1578{
1579 mProjectEffectsPanel = safenew wxPanel(this);
1580
1581 auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
1582
1583 const auto sash = safenew ThemedWindowWrapper<SashLine>(mProjectEffectsPanel, wxID_ANY);
1584 sash->SetMinSize(wxSize{-1, 3});
1585 sash->SetSplitterWindow(this);
1586 sash->SetBackgroundColorIndex(clrMedium);
1587 sash->SetForegroundColorIndex(clrDark);
1588 vSizer->Add(sash, 0, wxEXPAND);
1589
1591#if wxUSE_ACCESSIBILITY
1592 safenew WindowAccessible(header);
1593#endif
1594 header->SetBackgroundColorIndex(clrMedium);
1595 {
1596 auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
1597 auto toggleEffects = safenew ThemedAButtonWrapper<AButton>(header);
1598 toggleEffects->SetImageIndices(0, bmpEffectOff, bmpEffectOff, bmpEffectOn, bmpEffectOn, bmpEffectOff);
1599 toggleEffects->SetButtonToggles(true);
1600 toggleEffects->SetTranslatableLabel(XO("Power"));
1601 toggleEffects->SetBackgroundColorIndex(clrMedium);
1602 mToggleMasterEffects = toggleEffects;
1603
1604 toggleEffects->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
1606 {
1608
1611 }
1612 });
1613
1614 hSizer->Add(toggleEffects, 0, wxSTRETCH_NOT | wxALIGN_CENTER | wxLEFT, 5);
1615 {
1616 auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
1617
1618 auto headerText = safenew ThemedWindowWrapper<wxStaticText>(header, wxID_ANY, wxEmptyString);
1619 headerText->SetFont(wxFont(wxFontInfo().Bold()));
1620 headerText->SetTranslatableLabel(XO("Master Effects"));
1621 headerText->SetForegroundColorIndex(clrTrackPanelText);
1622 header->SetName(headerText->GetLabel());
1623
1624 auto desc = safenew ThemedWindowWrapper<wxStaticText>(header, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
1625 desc->SetForegroundColorIndex(clrTrackPanelText);
1626 desc->SetTranslatableLabel(XO("Applies to all tracks"));
1627
1628 vSizer->Add(headerText);
1629 vSizer->Add(desc);
1630
1631 hSizer->Add(vSizer.release(), 1, wxEXPAND | wxALL, 10);
1632 }
1633
1634 header->SetSizer(hSizer.release());
1635 }
1636 vSizer->Add(header, 0, wxEXPAND | wxTOP, 5);
1637
1639 effectList->SetBackgroundColorIndex(clrMedium);
1640 vSizer->Add(effectList, 1, wxEXPAND);
1641
1642 mMasterEffectList = effectList;
1643
1644 mProjectEffectsPanel->SetSizer(vSizer.release());
1645}
XO("Cut/Copy/Paste")
#define safenew
Definition: MemoryX.h:10
bool IsDown()
Definition: AButton.h:227
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)
void MarkUnsaved()
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
const TranslatableString desc
Definition: ExportPCM.cpp:51

References anonymous_namespace{ExportPCM.cpp}::desc, RealtimeEffectListWindow::EnableEffects(), ProjectHistory::Get(), UndoManager::Get(), AButton::IsDown(), UndoManager::MarkUnsaved(), mMasterEffectList, ProjectHistory::ModifyState(), mProject, mProjectEffectsPanel, mToggleMasterEffects, safenew, and XO().

Referenced by RealtimeEffectPanel().

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

◆ MakeTrackEffectPane()

void RealtimeEffectPanel::MakeTrackEffectPane ( )
private

Definition at line 1385 of file RealtimeEffectPanel.cpp.

1386{
1387 mTrackEffectsPanel = safenew wxPanel(this);
1388
1389 auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
1390
1392#if wxUSE_ACCESSIBILITY
1393 safenew WindowAccessible(header);
1394#endif
1395 header->SetBackgroundColorIndex(clrMedium);
1396 {
1397 auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
1398 auto toggleEffects = safenew ThemedAButtonWrapper<AButton>(header);
1399 toggleEffects->SetImageIndices(0, bmpEffectOff, bmpEffectOff, bmpEffectOn, bmpEffectOn, bmpEffectOff);
1400 toggleEffects->SetButtonToggles(true);
1401 toggleEffects->SetTranslatableLabel(XO("Power"));
1402 toggleEffects->SetBackgroundColorIndex(clrMedium);
1403 mToggleTrackEffects = toggleEffects;
1404
1405 toggleEffects->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
1406 if (mTrackEffectList)
1407 {
1409
1412 }
1413 });
1414
1415 hSizer->Add(toggleEffects, 0, wxSTRETCH_NOT | wxALIGN_CENTER | wxLEFT, 5);
1416 {
1417 auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
1418
1419 auto headerText = safenew ThemedWindowWrapper<wxStaticText>(header, wxID_ANY, wxEmptyString);
1420 headerText->SetFont(wxFont(wxFontInfo().Bold()));
1421 headerText->SetTranslatableLabel(XO("Realtime Effects"));
1422 headerText->SetForegroundColorIndex(clrTrackPanelText);
1423
1424 auto trackTitle = safenew ThemedWindowWrapper<wxStaticText>(header, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
1425 trackTitle->SetForegroundColorIndex(clrTrackPanelText);
1426 mTrackTitle = trackTitle;
1427
1428 vSizer->Add(headerText);
1429 vSizer->Add(trackTitle);
1430
1431 hSizer->Add(vSizer.release(), 1, wxEXPAND | wxALL, 10);
1432 }
1433 auto close = safenew ThemedAButtonWrapper<AButton>(header);
1434 close->SetTranslatableLabel(XO("Close"));
1435 close->SetImageIndices(0, bmpCloseNormal, bmpCloseHover, bmpCloseDown, bmpCloseHover, bmpCloseDisabled);
1436 close->SetBackgroundColorIndex(clrMedium);
1437
1438 close->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { Close(); });
1439
1440 hSizer->Add(close, 0, wxSTRETCH_NOT | wxALIGN_CENTER | wxRIGHT, 5);
1441
1442 header->SetSizer(hSizer.release());
1443 }
1444 vSizer->Add(header, 0, wxEXPAND);
1445
1447 effectList->SetBackgroundColorIndex(clrMedium);
1448 {
1449 auto footer = safenew ThemedWindowWrapper<wxPanel>(effectList, wxID_ANY);
1450 footer->SetBackgroundColorIndex(clrMedium);
1451
1452 auto addEffectHint = safenew ThemedWindowWrapper<wxStaticText>(footer, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
1453 //Workaround: text is set in the OnSizeChange
1454 addEffectHint->SetForegroundColorIndex(clrTrackPanelText);
1455
1456 auto addEffectTutorialLink = safenew ThemedWindowWrapper<wxHyperlinkCtrl>(
1457 footer, wxID_ANY, _("Watch video"),
1458 "https://www.audacityteam.org/realtime-video", wxDefaultPosition,
1459 wxDefaultSize, wxHL_ALIGN_LEFT | wxHL_CONTEXTMENU);
1460
1461 addEffectTutorialLink->Bind(
1462 wxEVT_HYPERLINK, [](wxHyperlinkEvent& event)
1463 { BasicUI::OpenInDefaultBrowser(event.GetURL()); });
1464
1465 auto footerSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
1466 footerSizer->Add(addEffectHint, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 20);
1467 footerSizer->Add(addEffectTutorialLink, 0, wxLEFT | wxRIGHT | wxEXPAND, 20);
1468 footer->SetSizer(footerSizer.release());
1469
1470 footer->Bind(wxEVT_SIZE, [=](wxSizeEvent& event)
1471 {
1472 if(auto sizerItem = footer->GetSizer()->GetItem(addEffectHint))
1473 {
1474 //We need to wrap the text whenever panel width changes and adjust widget height
1475 //so that text is fully visible, but there is no height-for-width layout algorithm
1476 //in wxWidgets yet, so for now we just do it manually
1477
1478 //Restore original text, because 'Wrap' will replace it with wrapped one
1479 addEffectHint->SetLabel(_("Realtime effects are non-destructive and can be changed at any time."));
1480 addEffectHint->Wrap(mTrackEffectsPanel->GetClientSize().x - sizerItem->GetBorder() * 2);
1481 addEffectHint->InvalidateBestSize();
1482 }
1483 event.Skip();
1484 });
1485
1486 effectList->SetFooter(footer);
1487 }
1488 vSizer->Add(effectList, 1, wxEXPAND);
1489
1490 mTrackEffectsHeader = header;
1491 mTrackEffectList = effectList;
1492
1493 mTrackEffectsPanel->SetSizer(vSizer.release());
1494}
#define _(s)
Definition: Internat.h:73
RealtimeEffectListWindow * mTrackEffectList
bool OpenInDefaultBrowser(const wxString &url)
Open an URL in default browser.
Definition: BasicUI.cpp:246

References _, RealtimeEffectListWindow::EnableEffects(), ProjectHistory::Get(), UndoManager::Get(), AButton::IsDown(), UndoManager::MarkUnsaved(), ProjectHistory::ModifyState(), mProject, mToggleTrackEffects, mTrackEffectList, mTrackEffectsHeader, mTrackEffectsPanel, mTrackTitle, BasicUI::OpenInDefaultBrowser(), safenew, and XO().

Referenced by RealtimeEffectPanel().

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

◆ OnCharHook()

void RealtimeEffectPanel::OnCharHook ( wxKeyEvent &  evt)
private

Definition at line 1647 of file RealtimeEffectPanel.cpp.

1648{
1649 if(evt.GetKeyCode() == WXK_ESCAPE && IsShown() && IsDescendant(FindFocus()))
1650 Close();
1651 else
1652 evt.Skip();
1653}
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
Definition: BasicUI.h:383

References BasicUI::FindFocus().

Referenced by RealtimeEffectPanel().

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

◆ ResetTrack()

void RealtimeEffectPanel::ResetTrack ( )

Definition at line 1371 of file RealtimeEffectPanel.cpp.

1372{
1373 mTrackTitle->SetLabel(wxEmptyString);
1376 mCurrentTrack.reset();
1377 mTrackEffectsHeader->SetName(wxEmptyString);
1378}
void Disable()
Definition: AButton.cpp:647

References AButton::Disable(), mCurrentTrack, mToggleTrackEffects, mTrackEffectList, mTrackEffectsHeader, mTrackTitle, and RealtimeEffectListWindow::ResetDelegate().

Referenced by SetTrack(), and ShowPanel().

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

◆ SetFocus()

void RealtimeEffectPanel::SetFocus ( )
override

Definition at line 1380 of file RealtimeEffectPanel.cpp.

1381{
1382 mTrackEffectsHeader->SetFocus();
1383}

References mTrackEffectsHeader.

Referenced by ShowPanel().

Here is the caller graph for this function:

◆ SetTrack()

void RealtimeEffectPanel::SetTrack ( const std::shared_ptr< SampleTrack > &  track)

Shows effects from the effect stack of the track.

Parameters
trackPointer to the existing track, or null

Definition at line 1348 of file RealtimeEffectPanel.cpp.

1349{
1350 //Avoid creation-on-demand of a useless, empty list in case the track is of non-wave type.
1351 if(track && dynamic_cast<WaveTrack*>(&*track) != nullptr)
1352 {
1353 mTrackTitle->SetLabel(track->GetName());
1355 track && RealtimeEffectList::Get(*track).IsActive()
1359 mProject,
1360 std::make_shared<TrackEffectListUIDelegate>(track)
1361 );
1362
1363 mCurrentTrack = track;
1364 //i18n-hint: argument - track name
1365 mTrackEffectsHeader->SetName(wxString::Format(_("Realtime effects for %s"), track->GetName()));
1366 }
1367 else
1368 ResetTrack();
1369}
void Enable()
Definition: AButton.cpp:638

References _, AButton::Enable(), RealtimeEffectList::Get(), RealtimeEffectList::IsActive(), mCurrentTrack, mProject, mToggleTrackEffects, mTrackEffectList, mTrackEffectsHeader, mTrackTitle, AButton::PopUp(), AButton::PushDown(), ResetTrack(), and RealtimeEffectListWindow::SetDelegate().

Referenced by ShowPanel().

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

◆ ShowPanel()

void RealtimeEffectPanel::ShowPanel ( SampleTrack track,
bool  focus 
)

Definition at line 1304 of file RealtimeEffectPanel.cpp.

1305{
1306 if(track == nullptr)
1307 {
1308 ResetTrack();
1309 return;
1310 }
1311
1312 wxWindowUpdateLocker freeze(this);
1313
1315
1316 auto &projectWindow = ProjectWindow::Get(mProject);
1317 const auto pContainerWindow = projectWindow.GetContainerWindow();
1318 if (pContainerWindow->GetWindow1() != this)
1319 {
1320 //Restore previous effects window size
1321 pContainerWindow->SplitVertically(
1322 this,
1323 projectWindow.GetTrackListWindow(),
1324 this->GetSize().GetWidth());
1325 }
1326 if(focus)
1327 SetFocus();
1328 projectWindow.Layout();
1329}
void SetTrack(const std::shared_ptr< SampleTrack > &track)
Shows effects from the effect stack of the track.
std::shared_ptr< Subclass > SharedPointer()
Definition: Track.h:146

References ProjectWindow::Get(), mProject, ResetTrack(), SetFocus(), SetTrack(), and Track::SharedPointer().

Referenced by EffectsButtonHandle::CommitChanges(), and RealtimeEffectPanel().

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

Member Data Documentation

◆ mCurrentTrack

std::weak_ptr<SampleTrack> RealtimeEffectPanel::mCurrentTrack
private

Definition at line 47 of file RealtimeEffectPanel.h.

Referenced by RealtimeEffectPanel(), ResetTrack(), and SetTrack().

◆ mFocusChangeSubscription

Observer::Subscription RealtimeEffectPanel::mFocusChangeSubscription
private

Definition at line 51 of file RealtimeEffectPanel.h.

Referenced by RealtimeEffectPanel().

◆ mMasterEffectList

RealtimeEffectListWindow* RealtimeEffectPanel::mMasterEffectList {nullptr}
private

Definition at line 43 of file RealtimeEffectPanel.h.

Referenced by MakeMasterEffectPane(), and RealtimeEffectPanel().

◆ mPotentiallyRemovedTracks

std::vector<std::shared_ptr<SampleTrack> > RealtimeEffectPanel::mPotentiallyRemovedTracks
private

Definition at line 53 of file RealtimeEffectPanel.h.

Referenced by RealtimeEffectPanel().

◆ mPrefsListenerHelper

std::unique_ptr<PrefsListenerHelper> RealtimeEffectPanel::mPrefsListenerHelper
private

Definition at line 58 of file RealtimeEffectPanel.h.

◆ mProject

AudacityProject& RealtimeEffectPanel::mProject
private

◆ mProjectEffectsPanel

wxWindow* RealtimeEffectPanel::mProjectEffectsPanel {nullptr}
private

Definition at line 41 of file RealtimeEffectPanel.h.

Referenced by MakeMasterEffectPane(), and RealtimeEffectPanel().

◆ mToggleMasterEffects

AButton* RealtimeEffectPanel::mToggleMasterEffects {nullptr}
private

Definition at line 38 of file RealtimeEffectPanel.h.

Referenced by MakeMasterEffectPane(), and RealtimeEffectPanel().

◆ mToggleTrackEffects

AButton* RealtimeEffectPanel::mToggleTrackEffects {nullptr}
private

Definition at line 37 of file RealtimeEffectPanel.h.

Referenced by MakeTrackEffectPane(), ResetTrack(), and SetTrack().

◆ mTrackEffectList

RealtimeEffectListWindow* RealtimeEffectPanel::mTrackEffectList {nullptr}
private

Definition at line 42 of file RealtimeEffectPanel.h.

Referenced by MakeTrackEffectPane(), ResetTrack(), and SetTrack().

◆ mTrackEffectsHeader

wxWindow* RealtimeEffectPanel::mTrackEffectsHeader {nullptr}
private

Definition at line 44 of file RealtimeEffectPanel.h.

Referenced by MakeTrackEffectPane(), ResetTrack(), SetFocus(), and SetTrack().

◆ mTrackEffectsPanel

wxWindow* RealtimeEffectPanel::mTrackEffectsPanel {nullptr}
private

Definition at line 40 of file RealtimeEffectPanel.h.

Referenced by MakeTrackEffectPane(), and RealtimeEffectPanel().

◆ mTrackListChanged

Observer::Subscription RealtimeEffectPanel::mTrackListChanged
private

Definition at line 49 of file RealtimeEffectPanel.h.

Referenced by RealtimeEffectPanel().

◆ mTrackTitle

wxStaticText* RealtimeEffectPanel::mTrackTitle {nullptr}
private

◆ mUndoSubscription

Observer::Subscription RealtimeEffectPanel::mUndoSubscription
private

Definition at line 50 of file RealtimeEffectPanel.h.

Referenced by RealtimeEffectPanel().


The documentation for this class was generated from the following files: