15#include <wx/splitter.h>
16#include <wx/statbmp.h>
17#include <wx/stattext.h>
19#include <wx/wupdlock.h>
20#include <wx/hyperlink.h>
22#include <wx/dcbuffer.h>
53#if wxUSE_ACCESSIBILITY
62 wxMenu* mMenuPtr {
nullptr };
63 int mMenuItemIdCounter { wxID_HIGHEST };
65 int mMenuLevelCounter { 0 };
70 if (mMenuLevelCounter != 0)
72 auto submenu = std::make_unique<wxMenu>();
73 mMenuPtr->AppendSubMenu(submenu.get(), menuItem.
GetTitle().Translation());
74 mMenuPtr = submenu.release();
81 mIndexedPluginList.push_back(commandItem.
name);
87 if (mMenuLevelCounter != 0)
89 assert(mMenuPtr->GetParent() !=
nullptr);
90 mMenuPtr = mMenuPtr->GetParent();
95 mMenuPtr->AppendSeparator();
97 , mMenu(menu), mMenuPtr(&mMenu)
102 assert(menuIndex >= wxID_HIGHEST && menuIndex < (wxID_HIGHEST + mIndexedPluginList.size()));
103 return mIndexedPluginList[menuIndex - wxID_HIGHEST];
107 template <
typename Visitor>
112 [visitor](
auto& effectState,
bool)
122 track, [&](
auto& ui) { ui.UpdateTrackData(track); });
139 class RealtimeEffectControl;
146 const wxPoint& pos = wxDefaultPosition,
147 const wxSize&
size = wxDefaultSize)
148 : wxWindow(parent,
id, pos,
size, wxNO_BORDER, wxEmptyString)
150 wxWindow::SetBackgroundStyle(wxBG_STYLE_PAINT);
151 Bind(wxEVT_PAINT, &DropHintLine::OnPaint,
this);
159 wxBufferedPaintDC dc(
this);
160 const auto rect = wxRect(GetSize());
162 dc.SetPen(*wxTRANSPARENT_PEN);
163 dc.SetBrush(GetBackgroundColour());
164 dc.DrawRectangle(rect);
173 const wxString&
label,
175 const wxPoint& pos = wxDefaultPosition,
176 const wxSize&
size = wxDefaultSize,
177 long style = wxHL_DEFAULT_STYLE,
178 const wxString&
name = wxHyperlinkCtrlNameStr)
185 const wxString&
label,
187 const wxPoint& pos = wxDefaultPosition,
188 const wxSize&
size = wxDefaultSize,
189 long style = wxHL_DEFAULT_STYLE,
190 const wxString&
name = wxHyperlinkCtrlNameStr)
193 Bind(wxEVT_PAINT, &HyperLinkCtrlWrapper::OnPaint,
this);
199 dc.SetFont(GetFont());
200 dc.SetTextForeground(GetForegroundColour());
201 dc.SetTextBackground(GetBackgroundColour());
203 auto labelRect = GetLabelRect();
205 dc.DrawText(GetLabel(), labelRect.GetTopLeft());
211#if wxUSE_ACCESSIBILITY
212 class RealtimeEffectControlAx :
public wxAccessible
215 RealtimeEffectControlAx(wxWindow* win =
nullptr) : wxAccessible(win) { }
217 wxAccStatus GetName(
int childId, wxString*
name)
override
219 if(childId != wxACC_SELF)
220 return wxACC_NOT_IMPLEMENTED;
224 *
name = wxString::Format(
_(
"Effect %d"), movable->FindIndexInParent() + 1);
228 wxAccStatus GetChildCount(
int* childCount)
override
230 const auto window = GetWindow();
231 *childCount = window->GetChildren().size();
235 wxAccStatus GetChild(
int childId, wxAccessible** child)
override
237 if(childId == wxACC_SELF)
241 const auto window = GetWindow();
242 const auto& children = window->GetChildren();
243 const auto childIndex = childId - 1;
244 if(childIndex < children.size())
245 *child = children[childIndex]->GetAccessible();
252 wxAccStatus GetRole(
int childId, wxAccRole* role)
override
254 if(childId != wxACC_SELF)
255 return wxACC_NOT_IMPLEMENTED;
257 *role = wxROLE_SYSTEM_PANE;
261 wxAccStatus GetState(
int childId,
long* state)
override
263 if(childId != wxACC_SELF)
264 return wxACC_NOT_IMPLEMENTED;
266 const auto window = GetWindow();
267 if(!window->IsEnabled())
268 *state = wxACC_STATE_SYSTEM_UNAVAILABLE;
271 *state = wxACC_STATE_SYSTEM_FOCUSABLE;
272 if(window->HasFocus())
273 *state |= wxACC_STATE_SYSTEM_FOCUSED;
283 virtual std::optional<wxString>
PickEffect(wxWindow* parent,
const wxString& selectedEffectID) = 0;
308 const wxPoint& pos = wxDefaultPosition,
309 const wxSize&
size = wxDefaultSize)
311 Create(parent, effectPicker, winid, pos,
size);
317 const wxPoint& pos = wxDefaultPosition,
318 const wxSize&
size = wxDefaultSize)
320 mEffectPicker = effectPicker;
323 MovableControl::SetBackgroundStyle(wxBG_STYLE_PAINT);
326 Bind(wxEVT_PAINT, &RealtimeEffectControl::OnPaint,
this);
327 Bind(wxEVT_SET_FOCUS, &RealtimeEffectControl::OnFocusChange,
this);
328 Bind(wxEVT_KILL_FOCUS, &RealtimeEffectControl::OnFocusChange,
this);
330 auto sizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
334 enableButton->SetTranslatableLabel(
XO(
"Power"));
335 enableButton->SetImageIndices(0, bmpEffectOff, bmpEffectOff, bmpEffectOn, bmpEffectOn, bmpEffectOff);
336 enableButton->SetButtonToggles(
true);
337 enableButton->SetBackgroundColorIndex(clrEffectListItemBackground);
338 mEnableButton = enableButton;
340 enableButton->Bind(wxEVT_BUTTON, [
this](wxCommandEvent&) {
342 mEffectState->SetActive(mEnableButton->IsDown());
349 optionsButton->SetImageIndices(0,
355 optionsButton->SetBackgroundColorIndex(clrEffectListItemBackground);
356 optionsButton->SetForegroundColorIndex(clrTrackPanelText);
358 optionsButton->Bind(wxEVT_BUTTON, &RealtimeEffectControl::OnOptionsClicked,
this);
362 changeButton->SetImageIndices(0, bmpMoreNormal, bmpMoreHover, bmpMoreDown, bmpMoreHover, bmpMoreDisabled);
363 changeButton->SetBackgroundColorIndex(clrEffectListItemBackground);
364 changeButton->SetTranslatableLabel(
XO(
"Replace effect"));
365 changeButton->Bind(wxEVT_BUTTON, &RealtimeEffectControl::OnChangeButtonClicked,
this);
369 sizer->Add(dragArea, 0, wxLEFT | wxCENTER, 5);
370 sizer->Add(enableButton, 0, wxLEFT | wxCENTER, 5);
371 sizer->Add(optionsButton, 1, wxLEFT | wxCENTER, 5);
372 sizer->Add(changeButton, 0, wxLEFT | wxRIGHT | wxCENTER, 5);
373 mChangeButton = changeButton;
374 mOptionsButton = optionsButton;
376 auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
377 vSizer->Add(sizer.release(), 0, wxUP | wxDOWN | wxEXPAND, 10);
379 SetSizer(vSizer.release());
381#if wxUSE_ACCESSIBILITY
382 SetAccessible(
safenew RealtimeEffectControlAx(
this));
394 const auto &ID = mEffectState->GetID();
395 const auto desc = GetPlugin(ID);
397 ?
desc->GetSymbol().Msgid()
403 const std::shared_ptr<SampleTrack>& track,
404 const std::shared_ptr<RealtimeEffectState> &pState)
408 mEffectState = pState;
412 ? mEnableButton->PushDown()
413 : mEnableButton->PopUp();
421 label = GetEffectName();
422 mSettingsAccess = pState->GetAccess();
425 mSettingsAccess.reset();
427 mSettingsAccess && mSettingsAccess->Get().extra.GetActive()
428 ? mEnableButton->PushDown()
429 : mEnableButton->PopUp();
432 mOptionsButton->SetTranslatableLabel(
label);
433 mOptionsButton->SetEnabled(pState && GetPlugin(pState->GetID()));
439 if(mProject ==
nullptr || mEffectState ==
nullptr)
446 auto effectName = GetEffectName();
449 auto trackName = mTrack->GetName();
457 XO(
"Removed %s from %s").
Format(effectName, trackName),
466 if(mProject ==
nullptr || mEffectState ==
nullptr)
469 const auto ID = mEffectState->GetID();
472 if(effectPlugin ==
nullptr)
480 effectStateUI.UpdateTrackData(*mTrack);
481 effectStateUI.Toggle( *mProject );
486 if(!mTrack || mProject ==
nullptr)
488 if(mEffectState ==
nullptr)
491 const auto effectID = mEffectPicker->PickEffect(mChangeButton, mEffectState->GetID());
495 if(effectID->empty())
502 auto oIndex = em.FindState(&*mTrack, mEffectState);
506 auto oldName = GetEffectName();
508 auto trackName = mTrack->GetName();
510 ->ReplaceState(
project, &*mTrack, *oIndex, *effectID)
514 auto effect = state->GetEffect();
520 XO(
"Replaced %s with %s")
521 .
Format(oldName, effect->GetName()),
530 wxBufferedPaintDC dc(
this);
531 const auto rect = wxRect(GetSize());
533 dc.SetPen(*wxTRANSPARENT_PEN);
534 dc.SetBrush(GetBackgroundColour());
535 dc.DrawRectangle(rect);
539 dc.DrawLine(rect.GetBottomLeft(), rect.GetBottomRight());
555 return XO(
"Unknown").Translation();
562 :
public wxScrolledWindow
563 ,
public RealtimeEffectPicker
580 wxWindowID winid = wxID_ANY,
581 const wxPoint& pos = wxDefaultPosition,
582 const wxSize&
size = wxDefaultSize,
583 long style = wxScrolledWindowStyle,
584 const wxString&
name = wxPanelNameStr)
590 wxScrolledWindow::SetDoubleBuffered(
true);
592 auto rootSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
595 effectListContainer->SetBackgroundColorIndex(clrMedium);
596 effectListContainer->SetSizer(
safenew wxBoxSizer(wxVERTICAL));
597 effectListContainer->SetDoubleBuffered(
true);
598 effectListContainer->Hide();
602 addEffect->SetImageIndices(0,
608 addEffect->SetTranslatableLabel(
XO(
"Add effect"));
610 addEffect->SetBackgroundColorIndex(clrMedium);
611 addEffect->SetForegroundColorIndex(clrTrackPanelText);
617 addEffectHint->SetForegroundColorIndex(clrTrackPanelText);
621 this, wxID_ANY,
_(
"Watch video"),
622 "https://www.audacityteam.org/realtime-video", wxDefaultPosition,
623 wxDefaultSize, wxHL_ALIGN_LEFT | wxHL_CONTEXTMENU);
626 addEffectTutorialLink->SetTranslatableLabel(
XO(
"Watch video"));
627#if wxUSE_ACCESSIBILITY
631 addEffectTutorialLink->Bind(
632 wxEVT_HYPERLINK, [](wxHyperlinkEvent& event)
639 dropHintLine->SetBackgroundColorIndex(clrDropHintHighlight);
640 dropHintLine->Hide();
643 rootSizer->Add(addEffect, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 20);
644 rootSizer->Add(addEffectHint, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 20);
645 rootSizer->Add(addEffectTutorialLink, 0, wxLEFT | wxRIGHT | wxEXPAND, 20);
647 SetSizer(rootSizer.release());
652 if(
auto window =
dynamic_cast<wxWindow*
>(event.GetEventObject()))
655 Bind(EVT_MOVABLE_CONTROL_DRAG_POSITION, [
this, dropHintLine](
const MovableControlEvent& event)
657 constexpr auto DropHintLineHeight { 3 };
660 assert(sizer !=
nullptr);
662 if(event.GetSourceIndex() == event.GetTargetIndex())
665 dropHintLine->Hide();
669 if(!dropHintLine->IsShown())
671 dropHintLine->Show();
672 dropHintLine->Raise();
673 if(
auto window =
dynamic_cast<wxWindow*
>(event.GetEventObject()))
677 auto item = sizer->GetItem(event.GetTargetIndex());
678 dropHintLine->SetSize(item->GetSize().x, DropHintLineHeight);
680 if(event.GetTargetIndex() > event.GetSourceIndex())
681 dropHintLine->SetPosition(item->GetRect().GetBottomLeft() - wxPoint(0, DropHintLineHeight));
683 dropHintLine->SetPosition(item->GetRect().GetTopLeft());
685 Bind(EVT_MOVABLE_CONTROL_DRAG_FINISHED, [
this, dropHintLine](
const MovableControlEvent& event)
687 dropHintLine->Hide();
693 const auto from =
event.GetSourceIndex();
694 const auto to =
event.GetTargetIndex();
698 effectList.GetStateAt(from)->GetEffect()->GetName();
699 bool up = (to < from);
700 effectList.MoveEffect(from, to);
707 ?
XO(
"Moved %s up in %s")
712 :
XO(
"Moved %s down in %s"))
718 wxWindowUpdateLocker freeze(
this);
722 SetScrollRate(0, 20);
737 std::optional<wxString>
PickEffect(wxWindow* parent,
const wxString& selectedEffectID)
override
743 if(!selectedEffectID.empty())
746 menu.Append(wxID_REMOVE,
_(
"No Effect"));
747 menu.AppendSeparator();
750 RealtimeEffectsMenuVisitor visitor { menu };
754 int commandId = wxID_NONE;
756 menu.AppendSeparator();
757 menu.Append(wxID_MORE,
_(
"Get more effects..."));
759 menu.Bind(wxEVT_MENU, [&](wxCommandEvent evt) { commandId = evt.GetId(); });
761 if(parent->PopupMenu(&menu, parent->GetClientRect().GetLeftBottom()) && commandId != wxID_NONE)
763 if(commandId == wxID_REMOVE)
765 else if(commandId == wxID_MORE)
768 return visitor.GetPluginID(commandId).GET();
781 return desc.IsEffectRealtime();
788 static_cast<MenuItem*
>(analyzeSection->begin()->get());
792 {}, groupby,
nullptr,
793 realtimeEffectPredicate
796 if(!submenu->empty())
798 root->push_back(move(analyzeSection));
804 {}, groupby,
nullptr,
805 realtimeEffectPredicate
820 mAddEffectHint->SetLabel(
_(
"Realtime effects are non-destructive and can be changed at any time."));
821 mAddEffectHint->Wrap(GetClientSize().x - sizerItem->GetBorder() * 2);
830 const auto insertItem = [
this, &msg](){
836 const auto removeItem = [&](){
842 auto window = sizer->GetItem(msg.
srcIndex)->GetWindow();
844 wxTheApp->CallAfter([ref = wxWeakRef { window }] {
845 if(ref) ref->Destroy();
859 wxWindowUpdateLocker freeze(
this);
864 const auto movedItem = sizer->GetItem(msg.
srcIndex);
866 const auto proportion = movedItem->GetProportion();
867 const auto flag = movedItem->GetFlag();
868 const auto border = movedItem->GetBorder();
869 const auto window = movedItem->GetWindow();
872 window->MoveAfterInTabOrder(sizer->GetItem(msg.
dstIndex)->GetWindow());
874 window->MoveBeforeInTabOrder(sizer->GetItem(msg.
dstIndex)->GetWindow());
877 sizer->Insert(msg.
dstIndex, window, proportion,
flag, border);
895 SendSizeEventToParent();
908 const std::shared_ptr<SampleTrack>& track)
937 wxWindowUpdateLocker freeze(
this);
952 isEmpty = effects.GetStatesCount() == 0;
953 for(
size_t i = 0, count = effects.GetStatesCount(); i < count; ++i)
963 SendSizeEventToParent();
971 const auto effectID =
PickEffect(
dynamic_cast<wxWindow*
>(event.GetEventObject()), {});
973 if(!effectID || effectID->empty())
982 XO(
"This plugin could not be loaded.\nIt may have been deleted."),
984 .Caption(
XO(
"Plugin Error")));
991 auto effect = state->GetEffect();
993 const auto effectName = effect->GetName();
1006 const std::shared_ptr<RealtimeEffectState> &pState)
1016 row->SetBackgroundColorIndex(clrEffectListItemBackground);
1034 for (
auto waveTrack : trackList.Any<
WaveTrack>())
1040AttachedWindows::RegisteredFactory
sKey{
1042 constexpr auto EffectsPanelMinWidth { 255 };
1046 project, pProjectWindow->GetContainerWindow(), wxID_ANY);
1047 effectsPanel->SetMinSize({EffectsPanelMinWidth, -1});
1048 effectsPanel->SetName(
_(
"Realtime effects"));
1049 effectsPanel->SetBackgroundColorIndex(clrMedium);
1050 effectsPanel->Hide();
1051 return effectsPanel;
1075 auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
1078#if wxUSE_ACCESSIBILITY
1081 header->SetBackgroundColorIndex(clrMedium);
1083 auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
1085 toggleEffects->SetImageIndices(0, bmpEffectOff, bmpEffectOff, bmpEffectOn, bmpEffectOn, bmpEffectOff);
1086 toggleEffects->SetButtonToggles(
true);
1087 toggleEffects->SetTranslatableLabel(
XO(
"Power"));
1088 toggleEffects->SetBackgroundColorIndex(clrMedium);
1091 toggleEffects->Bind(wxEVT_BUTTON, [
this](wxCommandEvent&) {
1101 hSizer->Add(toggleEffects, 0, wxSTRETCH_NOT | wxALIGN_CENTER | wxLEFT, 5);
1103 auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
1106 headerText->SetFont(wxFont(wxFontInfo().Bold()));
1107 headerText->SetTranslatableLabel(
XO(
"Realtime Effects"));
1108 headerText->SetForegroundColorIndex(clrTrackPanelText);
1111 trackTitle->SetForegroundColorIndex(clrTrackPanelText);
1114 vSizer->Add(headerText);
1115 vSizer->Add(trackTitle);
1117 hSizer->Add(vSizer.release(), 1, wxEXPAND | wxALL, 10);
1120 close->SetTranslatableLabel(
XO(
"Close"));
1121 close->SetImageIndices(0, bmpCloseNormal, bmpCloseHover, bmpCloseDown, bmpCloseHover, bmpCloseDisabled);
1122 close->SetBackgroundColorIndex(clrMedium);
1124 close->Bind(wxEVT_BUTTON, [
this](wxCommandEvent&) { Close(); });
1126 hSizer->Add(close, 0, wxSTRETCH_NOT | wxALIGN_CENTER | wxRIGHT, 5);
1128 header->SetSizer(hSizer.release());
1130 vSizer->Add(header, 0, wxEXPAND);
1133 effectList->SetBackgroundColorIndex(clrMedium);
1134 vSizer->Add(effectList, 1, wxEXPAND);
1139 SetSizerAndFit(vSizer.release());
1144 auto track = evt.
mpTrack.lock();
1145 auto waveTrack = std::dynamic_pointer_cast<WaveTrack>(track);
1147 if (waveTrack ==
nullptr)
1176 message.
type == UndoRedoMessage::Type::Purge ||
1177 message.
type == UndoRedoMessage::Type::BeginPurge ||
1178 message.
type == UndoRedoMessage::Type::EndPurge)
1187 message.
type == UndoRedoMessage::Type::UndoOrRedo ||
1188 message.
type == UndoRedoMessage::Type::Reset)
1190 for (auto waveTrack : waveTracks)
1191 UpdateRealtimeEffectUIData(*waveTrack);
1202 std::vector<RealtimeEffectStateUI*> shownUIs;
1207 assert(track !=
nullptr);
1211 [&shownUIs](
auto& ui)
1214 shownUIs.push_back(&ui);
1220 for (
auto effectUI : shownUIs)
1222 bool reachable =
false;
1224 for (
auto track : waveTracks)
1228 [effectUI, &reachable](
auto& ui)
1230 if (effectUI == &ui)
1255 Bind(wxEVT_CLOSE_WINDOW, [
this](wxCloseEvent&) {
1265 if(track ==
nullptr)
1271 wxWindowUpdateLocker freeze(
this);
1276 const auto pContainerWindow = projectWindow.GetContainerWindow();
1277 if (pContainerWindow->GetWindow1() !=
this)
1280 pContainerWindow->SplitVertically(
1282 projectWindow.GetTrackListWindow(),
1283 this->GetSize().GetWidth());
1287 projectWindow.Layout();
1292 wxWindowUpdateLocker freeze(
this);
1295 const auto pContainerWindow = projectWindow.GetContainerWindow();
1296 const auto pTrackListWindow = projectWindow.GetTrackListWindow();
1297 if (pContainerWindow->GetWindow2() ==
nullptr)
1300 pContainerWindow->SplitVertically(
this, pTrackListWindow);
1302 pContainerWindow->Unsplit(
this);
1303 pTrackListWindow->SetFocus();
1304 projectWindow.Layout();
1310 if(track &&
dynamic_cast<WaveTrack*
>(&*track) !=
nullptr)
1321 mHeader->SetName(wxString::Format(
_(
"Realtime effects for %s"), track->GetName()));
1333 mHeader->SetName(wxEmptyString);
1343 if(evt.GetKeyCode() == WXK_ESCAPE && IsShown() && IsDescendant(
FindFocus()))
Toolkit-neutral facade for basic user interface services.
const TranslatableString name
ChoiceSetting RealtimeEffectsGroupBy
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
accessors for certain important windows associated with each project
RealtimeEffectStateChange
for(int ii=0, nn=names.size();ii< nn;++ii)
static void DrawFocus(wxDC &dc, wxRect &r)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
void RemoveState(AudacityProject &project, ChannelGroup *pGroup, std::shared_ptr< RealtimeEffectState > pState)
Forwards to RealtimeEffectManager::RemoveState with proper init scope.
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
EffectPlugin * GetEffect(const PluginID &ID)
static EffectManager & Get()
An explicitly nonlocalized string, not meant for the user to see.
Changes default arrow navigation to behave more list- or table-like. Instead of searching focusable i...
void Create(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
A move-only handle representing a connection to a Publisher.
void Reset() noexcept
Breaks the connection (constant time)
static PendingTracks & Get(AudacityProject &project)
const wxString & GetVendor() const
static Identifier GetEffectNameFromID(const PluginID &ID)
static bool IsPluginAvailable(const PluginDescriptor &plug)
const PluginDescriptor * GetPlugin(const PluginID &ID) const
static PluginManager & Get()
A listener notified of changes in preferences.
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)
static ProjectWindow & Get(AudacityProject &project)
static RealtimeEffectList & Get(AudacityProject &project)
size_t GetStatesCount() const noexcept
bool IsActive() const
Non-blocking atomic boolean load.
void SetActive(bool value)
Done by main thread only, under a lock guard.
void OnEffectListItemChange(const RealtimeEffectListMessage &msg)
void UpdatePrefs() override
RealtimeEffectListWindow(wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxScrolledWindowStyle, const wxString &name=wxPanelNameStr)
void OnAddEffectClicked(const wxCommandEvent &event)
wxStaticText * mAddEffectHint
void EnableEffects(bool enable)
void OnSizeChanged(wxSizeEvent &event)
wxWindow * mEffectListContainer
std::unique_ptr< MenuRegistry::MenuItem > mEffectMenuRoot
void UpdateEffectMenuItems()
std::shared_ptr< SampleTrack > mTrack
std::optional< wxString > PickEffect(wxWindow *parent, const wxString &selectedEffectID) override
void SetTrack(AudacityProject &project, const std::shared_ptr< SampleTrack > &track)
Observer::Subscription mEffectListItemMovedSubscription
void InsertEffectRow(size_t index, const std::shared_ptr< RealtimeEffectState > &pState)
Observer::Subscription mPluginsChangedSubscription
wxWindow * mAddEffectTutorialLink
wxWeakRef< AudacityProject > mProject
static RealtimeEffectManager & Get(AudacityProject &project)
UI Panel that displays realtime effects from the effect stack of an individual track,...
Observer::Subscription mUndoSubscription
wxStaticText * mTrackTitle
void ShowPanel(SampleTrack *track, bool focus)
RealtimeEffectListWindow * mEffectList
void OnCharHook(wxKeyEvent &evt)
std::weak_ptr< SampleTrack > mCurrentTrack
static RealtimeEffectPanel & Get(AudacityProject &project)
~RealtimeEffectPanel() override
std::vector< std::shared_ptr< SampleTrack > > mPotentiallyRemovedTracks
RealtimeEffectPanel(AudacityProject &project, wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
Observer::Subscription mFocusChangeSubscription
AudacityProject & mProject
Observer::Subscription mTrackListChanged
void SetTrack(const std::shared_ptr< SampleTrack > &track)
Shows effects from the effect stack of the track.
static RealtimeEffectStateUI & Get(RealtimeEffectState &state)
wxColour & Colour(int iIndex)
wxBitmap & Bitmap(int iIndex)
std::shared_ptr< Subclass > SharedPointer()
auto Any() -> TrackIterRange< TrackType >
static TrackList & Get(AudacityProject &project)
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
static UndoManager & Get(AudacityProject &project)
A Track that contains audio waveform data.
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
DropHintLine(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
bool AcceptsFocus() const override
void OnPaint(wxPaintEvent &)
void Create(wxWindow *parent, wxWindowID id, const wxString &label, const wxString &url, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHL_DEFAULT_STYLE, const wxString &name=wxHyperlinkCtrlNameStr)
void OnPaint(wxPaintEvent &evt)
HyperLinkCtrlWrapper(wxWindow *parent, wxWindowID id, const wxString &label, const wxString &url, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHL_DEFAULT_STYLE, const wxString &name=wxHyperlinkCtrlNameStr)
RealtimeEffectControl()=default
std::shared_ptr< EffectSettingsAccess > mSettingsAccess
void OnOptionsClicked(wxCommandEvent &event)
Observer::Subscription mSubscription
std::shared_ptr< RealtimeEffectState > mEffectState
void OnFocusChange(wxFocusEvent &evt)
static const PluginDescriptor * GetPlugin(const PluginID &ID)
void Create(wxWindow *parent, RealtimeEffectPicker *effectPicker, wxWindowID winid, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
void OnPaint(wxPaintEvent &)
void SetEffect(AudacityProject &project, const std::shared_ptr< SampleTrack > &track, const std::shared_ptr< RealtimeEffectState > &pState)
void OnChangeButtonClicked(wxCommandEvent &event)
wxWeakRef< AudacityProject > mProject
TranslatableString GetEffectName() const
RealtimeEffectControl(wxWindow *parent, RealtimeEffectPicker *effectPicker, wxWindowID winid, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
std::shared_ptr< SampleTrack > mTrack
virtual std::optional< wxString > PickEffect(wxWindow *parent, const wxString &selectedEffectID)=0
bool OpenInDefaultBrowser(const wxString &url)
Open an URL in default browser.
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
void VisitWithFunctions(const VisitorFunctions< RegistryTraits > &visitors, const GroupItem< RegistryTraits > *pTopItem, const GroupItem< RegistryTraits > *pRegistry={}, typename RegistryTraits::ComputedItemContextType &computedItemContext=RegistryTraits::ComputedItemContextType::Instance)
const TranslatableString desc
AttachedWindows::RegisteredFactory sKey
void VisitRealtimeEffectStateUIs(SampleTrack &track, Visitor &&visitor)
static wxString GetSafeVendor(const PluginDescriptor &descriptor)
void UpdateRealtimeEffectUIData(SampleTrack &track)
void ReopenRealtimeEffectUIData(AudacityProject &project, SampleTrack &track)
const TranslatableString label_in
@ Remove
Effect item was removed from the list at srcIndex position. affectedState is removed state.
@ DidReplace
Effect item was replaced with a new item at srcIndex position. affectedState is an old state.
@ Move
Item position has changed, from srcIndex to dstIndex. affectedState is the moved state.
@ Insert
New effect item was added to the list at srcIndex position. affectedState is a new state.
@ WillReplace
Effect item will be replaced with a new item at srcIndex position. affectedState is the state to be r...
std::shared_ptr< RealtimeEffectState > affectedState
void UpdatePrefs() override
PrefsListenerHelper(AudacityProject &project)
AudacityProject & mProject
Notification of changes in individual tracks of TrackList, or of TrackList's composition.
const std::weak_ptr< Track > mpTrack
@ DELETION
Posted when a track has been deleted from a tracklist. Also posted when one track replaces another.
@ ADDITION
Posted when a track has been added to a tracklist. Also posted when one track replaces another.
@ TRACK_DATA_CHANGE
Posted when certain fields of a track change.
Type of message published by UndoManager.
enum UndoRedoMessage::Type type