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>
54#if wxUSE_ACCESSIBILITY
64 wxMenu* mMenuPtr {
nullptr };
65 int mMenuItemIdCounter { wxID_HIGHEST };
67 int mMenuLevelCounter { 0 };
71 : mMenu(menu), mMenuPtr(&mMenu) { }
78 if(mMenuLevelCounter != 0 && !menuItem->Transparent())
80 auto submenu = std::make_unique<wxMenu>();
81 mMenuPtr->AppendSubMenu(submenu.get(), menuItem->title.Translation());
82 mMenuPtr = submenu.release();
93 if(mMenuLevelCounter != 0 && !menuItem->Transparent())
95 assert(mMenuPtr->GetParent() !=
nullptr);
96 mMenuPtr = mMenuPtr->GetParent();
105 mMenuPtr->Append(mMenuItemIdCounter, commandItem->label_in.Translation());
106 mIndexedPluginList.push_back(commandItem->name);
107 ++mMenuItemIdCounter;
113 mMenuPtr->AppendSeparator();
118 assert(menuIndex >= wxID_HIGHEST && menuIndex < (wxID_HIGHEST + mIndexedPluginList.size()));
119 return mIndexedPluginList[menuIndex - wxID_HIGHEST];
124 template <
typename Visitor>
129 [visitor](
auto& effectState,
bool)
139 track, [&](
auto& ui) { ui.UpdateTrackData(track); });
156 class RealtimeEffectControl;
163 const wxPoint& pos = wxDefaultPosition,
164 const wxSize&
size = wxDefaultSize)
165 : wxWindow(parent,
id, pos,
size, wxNO_BORDER, wxEmptyString)
167 wxWindow::SetBackgroundStyle(wxBG_STYLE_PAINT);
168 Bind(wxEVT_PAINT, &DropHintLine::OnPaint,
this);
176 wxBufferedPaintDC dc(
this);
177 const auto rect = wxRect(GetSize());
179 dc.SetPen(*wxTRANSPARENT_PEN);
180 dc.SetBrush(GetBackgroundColour());
181 dc.DrawRectangle(rect);
190 const wxString&
label,
192 const wxPoint& pos = wxDefaultPosition,
193 const wxSize&
size = wxDefaultSize,
194 long style = wxHL_DEFAULT_STYLE,
195 const wxString&
name = wxHyperlinkCtrlNameStr)
202 const wxString&
label,
204 const wxPoint& pos = wxDefaultPosition,
205 const wxSize&
size = wxDefaultSize,
206 long style = wxHL_DEFAULT_STYLE,
207 const wxString&
name = wxHyperlinkCtrlNameStr)
210 Bind(wxEVT_PAINT, &HyperLinkCtrlWrapper::OnPaint,
this);
216 dc.SetFont(GetFont());
217 dc.SetTextForeground(GetForegroundColour());
218 dc.SetTextBackground(GetBackgroundColour());
220 auto labelRect = GetLabelRect();
222 dc.DrawText(GetLabel(), labelRect.GetTopLeft());
228#if wxUSE_ACCESSIBILITY
229 class RealtimeEffectControlAx :
public wxAccessible
232 RealtimeEffectControlAx(wxWindow* win =
nullptr) : wxAccessible(win) { }
234 wxAccStatus GetName(
int childId, wxString*
name)
override
236 if(childId != wxACC_SELF)
237 return wxACC_NOT_IMPLEMENTED;
241 *
name = wxString::Format(
_(
"Effect %d"), movable->FindIndexInParent() + 1);
245 wxAccStatus GetChildCount(
int* childCount)
override
247 const auto window = GetWindow();
248 *childCount = window->GetChildren().size();
252 wxAccStatus GetChild(
int childId, wxAccessible** child)
override
254 if(childId == wxACC_SELF)
258 const auto window = GetWindow();
259 const auto& children = window->GetChildren();
260 const auto childIndex = childId - 1;
261 if(childIndex < children.size())
262 *child = children[childIndex]->GetAccessible();
269 wxAccStatus GetRole(
int childId, wxAccRole* role)
override
271 if(childId != wxACC_SELF)
272 return wxACC_NOT_IMPLEMENTED;
274 *role = wxROLE_SYSTEM_PANE;
278 wxAccStatus GetState(
int childId,
long* state)
override
280 if(childId != wxACC_SELF)
281 return wxACC_NOT_IMPLEMENTED;
283 const auto window = GetWindow();
284 if(!window->IsEnabled())
285 *state = wxACC_STATE_SYSTEM_UNAVAILABLE;
288 *state = wxACC_STATE_SYSTEM_FOCUSABLE;
289 if(window->HasFocus())
290 *state |= wxACC_STATE_SYSTEM_FOCUSED;
300 virtual std::optional<wxString>
PickEffect(wxWindow* parent,
const wxString& selectedEffectID) = 0;
325 const wxPoint& pos = wxDefaultPosition,
326 const wxSize&
size = wxDefaultSize)
328 Create(parent, effectPicker, winid, pos,
size);
334 const wxPoint& pos = wxDefaultPosition,
335 const wxSize&
size = wxDefaultSize)
337 mEffectPicker = effectPicker;
340 MovableControl::SetBackgroundStyle(wxBG_STYLE_PAINT);
343 Bind(wxEVT_PAINT, &RealtimeEffectControl::OnPaint,
this);
344 Bind(wxEVT_SET_FOCUS, &RealtimeEffectControl::OnFocusChange,
this);
345 Bind(wxEVT_KILL_FOCUS, &RealtimeEffectControl::OnFocusChange,
this);
347 auto sizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
351 enableButton->SetTranslatableLabel(
XO(
"Power"));
352 enableButton->SetImageIndices(0, bmpEffectOff, bmpEffectOff, bmpEffectOn, bmpEffectOn, bmpEffectOff);
353 enableButton->SetButtonToggles(
true);
354 enableButton->SetBackgroundColorIndex(clrEffectListItemBackground);
355 mEnableButton = enableButton;
357 enableButton->Bind(wxEVT_BUTTON, [
this](wxCommandEvent&) {
359 mEffectState->SetActive(mEnableButton->IsDown());
364 optionsButton->SetImageIndices(0,
370 optionsButton->SetBackgroundColorIndex(clrEffectListItemBackground);
371 optionsButton->SetForegroundColorIndex(clrTrackPanelText);
373 optionsButton->Bind(wxEVT_BUTTON, &RealtimeEffectControl::OnOptionsClicked,
this);
377 changeButton->SetImageIndices(0, bmpMoreNormal, bmpMoreHover, bmpMoreDown, bmpMoreHover, bmpMoreDisabled);
378 changeButton->SetBackgroundColorIndex(clrEffectListItemBackground);
379 changeButton->SetTranslatableLabel(
XO(
"Replace effect"));
380 changeButton->Bind(wxEVT_BUTTON, &RealtimeEffectControl::OnChangeButtonClicked,
this);
384 sizer->Add(dragArea, 0, wxLEFT | wxCENTER, 5);
385 sizer->Add(enableButton, 0, wxLEFT | wxCENTER, 5);
386 sizer->Add(optionsButton, 1, wxLEFT | wxCENTER, 5);
387 sizer->Add(changeButton, 0, wxLEFT | wxRIGHT | wxCENTER, 5);
388 mChangeButton = changeButton;
389 mOptionsButton = optionsButton;
391 auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
392 vSizer->Add(sizer.release(), 0, wxUP | wxDOWN | wxEXPAND, 10);
394 SetSizer(vSizer.release());
396#if wxUSE_ACCESSIBILITY
397 SetAccessible(
safenew RealtimeEffectControlAx(
this));
409 const auto &ID = mEffectState->GetID();
410 const auto desc = GetPlugin(ID);
412 ?
desc->GetSymbol().Msgid()
418 const std::shared_ptr<Track>& track,
419 const std::shared_ptr<RealtimeEffectState> &pState)
423 mEffectState = pState;
427 ? mEnableButton->PushDown()
428 : mEnableButton->PopUp();
436 label = GetEffectName();
437 mSettingsAccess = pState->GetAccess();
440 mSettingsAccess.reset();
442 mSettingsAccess && mSettingsAccess->Get().extra.GetActive()
443 ? mEnableButton->PushDown()
444 : mEnableButton->PopUp();
447 mOptionsButton->SetTranslatableLabel(
label);
448 mOptionsButton->SetEnabled(pState && GetPlugin(pState->GetID()));
454 if(mProject ==
nullptr || mEffectState ==
nullptr)
461 auto effectName = GetEffectName();
463 auto project = mProject.get();
464 auto trackName = mTrack->GetName();
472 XO(
"Removed %s from %s").
Format(effectName, trackName),
481 if(mProject ==
nullptr || mEffectState ==
nullptr)
484 const auto ID = mEffectState->GetID();
487 if(effectPlugin ==
nullptr)
495 effectStateUI.UpdateTrackData(*mTrack);
496 effectStateUI.Toggle( *mProject );
501 if(!mTrack || mProject ==
nullptr)
503 if(mEffectState ==
nullptr)
506 const auto effectID = mEffectPicker->PickEffect(mChangeButton, mEffectState->GetID());
510 if(effectID->empty())
517 auto oIndex = em.FindState(&*mTrack, mEffectState);
521 auto oldName = GetEffectName();
522 auto &project = *mProject;
523 auto trackName = mTrack->GetName();
525 ->ReplaceState(project, &*mTrack, *oIndex, *effectID)
529 auto effect = state->GetEffect();
535 XO(
"Replaced %s with %s")
536 .
Format(oldName, effect->GetName()),
545 wxBufferedPaintDC dc(
this);
546 const auto rect = wxRect(GetSize());
548 dc.SetPen(*wxTRANSPARENT_PEN);
549 dc.SetBrush(GetBackgroundColour());
550 dc.DrawRectangle(rect);
554 dc.DrawLine(rect.GetBottomLeft(), rect.GetBottomRight());
570 return XO(
"Unknown").Translation();
577 :
public wxScrolledWindow
578 ,
public RealtimeEffectPicker
595 wxWindowID winid = wxID_ANY,
596 const wxPoint& pos = wxDefaultPosition,
597 const wxSize&
size = wxDefaultSize,
598 long style = wxScrolledWindowStyle,
599 const wxString&
name = wxPanelNameStr)
600 : wxScrolledWindow(parent, winid, pos,
size, style,
name)
605 wxScrolledWindow::SetDoubleBuffered(
true);
607 auto rootSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
610 effectListContainer->SetBackgroundColorIndex(clrMedium);
611 effectListContainer->SetSizer(
safenew wxBoxSizer(wxVERTICAL));
612 effectListContainer->SetDoubleBuffered(
true);
613 effectListContainer->Hide();
617 addEffect->SetImageIndices(0,
623 addEffect->SetTranslatableLabel(
XO(
"Add effect"));
625 addEffect->SetBackgroundColorIndex(clrMedium);
626 addEffect->SetForegroundColorIndex(clrTrackPanelText);
632 addEffectHint->SetForegroundColorIndex(clrTrackPanelText);
636 this, wxID_ANY,
_(
"Watch video"),
637 "https://www.audacityteam.org/realtime-video", wxDefaultPosition,
638 wxDefaultSize, wxHL_ALIGN_LEFT | wxHL_CONTEXTMENU);
641 addEffectTutorialLink->SetTranslatableLabel(
XO(
"Watch video"));
642#if wxUSE_ACCESSIBILITY
646 addEffectTutorialLink->Bind(
647 wxEVT_HYPERLINK, [](wxHyperlinkEvent& event)
654 dropHintLine->SetBackgroundColorIndex(clrDropHintHighlight);
655 dropHintLine->Hide();
658 rootSizer->Add(addEffect, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 20);
659 rootSizer->Add(addEffectHint, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 20);
660 rootSizer->Add(addEffectTutorialLink, 0, wxLEFT | wxRIGHT | wxEXPAND, 20);
662 SetSizer(rootSizer.release());
667 if(
auto window =
dynamic_cast<wxWindow*
>(event.GetEventObject()))
670 Bind(EVT_MOVABLE_CONTROL_DRAG_POSITION, [
this, dropHintLine](
const MovableControlEvent& event)
672 constexpr auto DropHintLineHeight { 3 };
675 assert(sizer !=
nullptr);
677 if(event.GetSourceIndex() == event.GetTargetIndex())
680 dropHintLine->Hide();
684 if(!dropHintLine->IsShown())
686 dropHintLine->Show();
687 dropHintLine->Raise();
688 if(
auto window =
dynamic_cast<wxWindow*
>(event.GetEventObject()))
692 auto item = sizer->GetItem(event.GetTargetIndex());
693 dropHintLine->SetSize(item->GetSize().x, DropHintLineHeight);
695 if(event.GetTargetIndex() > event.GetSourceIndex())
696 dropHintLine->SetPosition(item->GetRect().GetBottomLeft() - wxPoint(0, DropHintLineHeight));
698 dropHintLine->SetPosition(item->GetRect().GetTopLeft());
700 Bind(EVT_MOVABLE_CONTROL_DRAG_FINISHED, [
this, dropHintLine](
const MovableControlEvent& event)
702 dropHintLine->Hide();
708 const auto from =
event.GetSourceIndex();
709 const auto to =
event.GetTargetIndex();
713 effectList.GetStateAt(from)->GetEffect()->GetName();
714 bool up = (to < from);
715 effectList.MoveEffect(from, to);
722 ?
XO(
"Moved %s up in %s")
727 :
XO(
"Moved %s down in %s"))
733 wxWindowUpdateLocker freeze(
this);
737 SetScrollRate(0, 20);
752 std::optional<wxString>
PickEffect(wxWindow* parent,
const wxString& selectedEffectID)
override
755 if(!selectedEffectID.empty())
758 menu.Append(wxID_REMOVE,
_(
"No Effect"));
759 menu.AppendSeparator();
762 RealtimeEffectsMenuVisitor visitor { menu };
766 int commandId = wxID_NONE;
768 menu.AppendSeparator();
769 menu.Append(wxID_MORE,
_(
"Get more effects..."));
771 menu.Bind(wxEVT_MENU, [&](wxCommandEvent evt) { commandId = evt.GetId(); });
773 if(parent->PopupMenu(&menu, parent->GetClientRect().GetLeftBottom()) && commandId != wxID_NONE)
775 if(commandId == wxID_REMOVE)
777 else if(commandId == wxID_MORE)
780 return visitor.GetPluginID(commandId).GET();
792 return desc.IsEffectRealtime();
799 {}, groupby,
nullptr,
800 realtimeEffectPredicate
803 if(!analyzeItems.empty())
807 std::make_unique<MenuTable::MenuItem>(
810 std::move(analyzeItems)
813 root->items.push_back(std::move(analyzeSection));
818 {}, groupby,
nullptr,
819 realtimeEffectPredicate
822 std::move(processItems.begin(), processItems.end(), std::back_inserter(root->items));
836 mAddEffectHint->SetLabel(
_(
"Realtime effects are non-destructive and can be changed at any time."));
837 mAddEffectHint->Wrap(GetClientSize().x - sizerItem->GetBorder() * 2);
846 const auto insertItem = [
this, &msg](){
852 const auto removeItem = [&](){
858 auto window = sizer->GetItem(msg.
srcIndex)->GetWindow();
860 wxTheApp->CallAfter([ref = wxWeakRef { window }] {
861 if(ref) ref->Destroy();
875 wxWindowUpdateLocker freeze(
this);
880 const auto movedItem = sizer->GetItem(msg.
srcIndex);
882 const auto proportion = movedItem->GetProportion();
883 const auto flag = movedItem->GetFlag();
884 const auto border = movedItem->GetBorder();
885 const auto window = movedItem->GetWindow();
888 window->MoveAfterInTabOrder(sizer->GetItem(msg.
dstIndex)->GetWindow());
890 window->MoveBeforeInTabOrder(sizer->GetItem(msg.
dstIndex)->GetWindow());
893 sizer->Insert(msg.
dstIndex, window, proportion,
flag, border);
911 SendSizeEventToParent();
952 wxWindowUpdateLocker freeze(
this);
967 isEmpty = effects.GetStatesCount() == 0;
968 for(
size_t i = 0, count = effects.GetStatesCount(); i < count; ++i)
978 SendSizeEventToParent();
986 const auto effectID =
PickEffect(
dynamic_cast<wxWindow*
>(event.GetEventObject()), {});
988 if(!effectID || effectID->empty())
997 XO(
"This plugin could not be loaded.\nIt may have been deleted."),
999 .Caption(
XO(
"Plugin Error")));
1006 auto effect = state->GetEffect();
1008 const auto effectName = effect->GetName();
1021 const std::shared_ptr<RealtimeEffectState> &pState)
1031 row->SetBackgroundColorIndex(clrEffectListItemBackground);
1049 for (
auto waveTrack : trackList.Any<
WaveTrack>())
1055AttachedWindows::RegisteredFactory
sKey{
1057 constexpr auto EffectsPanelMinWidth { 255 };
1061 project, pProjectWindow->GetContainerWindow(), wxID_ANY);
1062 effectsPanel->SetMinSize({EffectsPanelMinWidth, -1});
1063 effectsPanel->SetName(
_(
"Realtime effects"));
1064 effectsPanel->SetBackgroundColorIndex(clrMedium);
1065 effectsPanel->Hide();
1066 return effectsPanel;
1083 AudacityProject& project, wxWindow* parent, wxWindowID
id,
const wxPoint& pos,
1085 long style,
const wxString&
name)
1086 : wxPanel(parent,
id, pos,
size, style,
name)
1090 auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
1093#if wxUSE_ACCESSIBILITY
1096 header->SetBackgroundColorIndex(clrMedium);
1098 auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
1100 toggleEffects->SetImageIndices(0, bmpEffectOff, bmpEffectOff, bmpEffectOn, bmpEffectOn, bmpEffectOff);
1101 toggleEffects->SetButtonToggles(
true);
1102 toggleEffects->SetTranslatableLabel(
XO(
"Power"));
1103 toggleEffects->SetBackgroundColorIndex(clrMedium);
1106 toggleEffects->Bind(wxEVT_BUTTON, [
this](wxCommandEvent&) {
1115 hSizer->Add(toggleEffects, 0, wxSTRETCH_NOT | wxALIGN_CENTER | wxLEFT, 5);
1117 auto vSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
1120 headerText->SetFont(wxFont(wxFontInfo().Bold()));
1121 headerText->SetTranslatableLabel(
XO(
"Realtime Effects"));
1122 headerText->SetForegroundColorIndex(clrTrackPanelText);
1125 trackTitle->SetForegroundColorIndex(clrTrackPanelText);
1128 vSizer->Add(headerText);
1129 vSizer->Add(trackTitle);
1131 hSizer->Add(vSizer.release(), 1, wxEXPAND | wxALL, 10);
1134 close->SetTranslatableLabel(
XO(
"Close"));
1135 close->SetImageIndices(0, bmpCloseNormal, bmpCloseHover, bmpCloseDown, bmpCloseHover, bmpCloseDisabled);
1136 close->SetBackgroundColorIndex(clrMedium);
1138 close->Bind(wxEVT_BUTTON, [
this](wxCommandEvent&) { Close(); });
1140 hSizer->Add(close, 0, wxSTRETCH_NOT | wxALIGN_CENTER | wxRIGHT, 5);
1142 header->SetSizer(hSizer.release());
1144 vSizer->Add(header, 0, wxEXPAND);
1147 effectList->SetBackgroundColorIndex(clrMedium);
1148 vSizer->Add(effectList, 1, wxEXPAND);
1153 SetSizerAndFit(vSizer.release());
1157 auto track = evt.
mpTrack.lock();
1158 auto waveTrack =
dynamic_cast<WaveTrack*
>(track.get());
1160 if (waveTrack ==
nullptr)
1189 message.
type == UndoRedoMessage::Type::Purge ||
1190 message.
type == UndoRedoMessage::Type::BeginPurge ||
1191 message.
type == UndoRedoMessage::Type::EndPurge)
1200 message.
type == UndoRedoMessage::Type::UndoOrRedo ||
1201 message.
type == UndoRedoMessage::Type::Reset)
1203 for (auto waveTrack : waveTracks)
1204 UpdateRealtimeEffectUIData(*waveTrack);
1215 std::vector<RealtimeEffectStateUI*> shownUIs;
1220 assert(track !=
nullptr);
1224 [&shownUIs](
auto& ui)
1227 shownUIs.push_back(&ui);
1233 for (
auto effectUI : shownUIs)
1235 bool reachable =
false;
1237 for (
auto track : waveTracks)
1241 [effectUI, &reachable](
auto& ui)
1243 if (effectUI == &ui)
1268 Bind(wxEVT_CLOSE_WINDOW, [
this](wxCloseEvent&) {
1278 if(track ==
nullptr)
1284 wxWindowUpdateLocker freeze(
this);
1286 SetTrack(track->shared_from_this());
1289 const auto pContainerWindow = projectWindow.GetContainerWindow();
1290 if (pContainerWindow->GetWindow1() !=
this)
1293 pContainerWindow->SplitVertically(
1295 projectWindow.GetTrackListWindow(),
1296 this->GetSize().GetWidth());
1300 projectWindow.Layout();
1305 wxWindowUpdateLocker freeze(
this);
1308 const auto pContainerWindow = projectWindow.GetContainerWindow();
1309 const auto pTrackListWindow = projectWindow.GetTrackListWindow();
1310 if (pContainerWindow->GetWindow2() ==
nullptr)
1313 pContainerWindow->SplitVertically(
this, pTrackListWindow);
1315 pContainerWindow->Unsplit(
this);
1316 pTrackListWindow->SetFocus();
1317 projectWindow.Layout();
1323 if(track &&
dynamic_cast<WaveTrack*
>(&*track) !=
nullptr)
1334 mHeader->SetName(wxString::Format(
_(
"Realtime effects for %s"), track->GetName()));
1346 mHeader->SetName(wxEmptyString);
1356 if(evt.GetKeyCode() == WXK_ESCAPE && IsShown() && IsDescendant(
FindFocus()))
Toolkit-neutral facade for basic user interface services.
const TranslatableString name
ChoiceSetting RealtimeEffectsGroupBy
const TranslatableString desc
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)
declares abstract base class Track, TrackList, and iterators over TrackList
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, Track *pTrack, 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)
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)
std::shared_ptr< Track > mTrack
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< MenuTable::MenuItem > mEffectMenuRoot
void UpdateEffectMenuItems()
void SetTrack(AudacityProject &project, const std::shared_ptr< Track > &track)
std::optional< wxString > PickEffect(wxWindow *parent, const wxString &selectedEffectID) override
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,...
std::weak_ptr< Track > mCurrentTrack
Observer::Subscription mUndoSubscription
void ShowPanel(Track *track, bool focus)
std::vector< std::shared_ptr< Track > > mPotentiallyRemovedTracks
wxStaticText * mTrackTitle
void SetTrack(const std::shared_ptr< Track > &track)
Shows effects from the effect stack of the track.
RealtimeEffectListWindow * mEffectList
void OnCharHook(wxKeyEvent &evt)
static RealtimeEffectPanel & Get(AudacityProject &project)
~RealtimeEffectPanel() override
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
static RealtimeEffectStateUI & Get(RealtimeEffectState &state)
std::vector< Identifier > Path
wxColour & Colour(int iIndex)
wxBitmap & Bitmap(int iIndex)
Abstract base class for an object holding data associated with points on a time axis.
auto Any() -> TrackIterRange< TrackType >
static TrackList & Get(AudacityProject &project)
Holds a msgid for the translation catalog; may also bind format arguments.
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)
void SetEffect(AudacityProject &project, const std::shared_ptr< Track > &track, const std::shared_ptr< RealtimeEffectState > &pState)
Observer::Subscription mSubscription
std::shared_ptr< Track > mTrack
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 OnChangeButtonClicked(wxCommandEvent &event)
wxWeakRef< AudacityProject > mProject
TranslatableString GetEffectName() const
RealtimeEffectControl(wxWindow *parent, RealtimeEffectPicker *effectPicker, wxWindowID winid, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
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 Visit(Visitor &visitor, BaseItem *pTopItem, const GroupItem *pRegistry)
AttachedWindows::RegisteredFactory sKey
void UpdateRealtimeEffectUIData(Track &track)
static wxString GetSafeVendor(const PluginDescriptor &descriptor)
void ReopenRealtimeEffectUIData(AudacityProject &project, Track &track)
void VisitRealtimeEffectStateUIs(Track &track, Visitor &&visitor)
@ 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