Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
RealtimeEffectListWindow Class Reference
Inheritance diagram for RealtimeEffectListWindow:
[legend]
Collaboration diagram for RealtimeEffectListWindow:
[legend]

Public Member Functions

 RealtimeEffectListWindow (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxScrolledWindowStyle, const wxString &name=wxPanelNameStr)
 
void UpdatePrefs () override
 
std::optional< wxString > PickEffect (wxWindow *parent, const wxString &selectedEffectID) override
 
void UpdateEffectMenuItems ()
 
void OnSizeChanged (wxSizeEvent &event)
 
void OnEffectListItemChange (const RealtimeEffectListMessage &msg)
 
void ResetTrack ()
 
void SetTrack (AudacityProject &project, const std::shared_ptr< SampleTrack > &track)
 
void EnableEffects (bool enable)
 
void ReloadEffectsList ()
 
void OnAddEffectClicked (const wxCommandEvent &event)
 
void InsertEffectRow (size_t index, const std::shared_ptr< RealtimeEffectState > &pState)
 
- Public Member Functions inherited from PrefsListener
 PrefsListener ()
 
virtual ~PrefsListener ()
 
virtual void UpdatePrefs ()=0
 

Private Attributes

wxWeakRef< AudacityProjectmProject
 
std::shared_ptr< SampleTrackmTrack
 
AButtonmAddEffect {nullptr}
 
wxStaticText * mAddEffectHint {nullptr}
 
wxWindow * mAddEffectTutorialLink {nullptr}
 
wxWindow * mEffectListContainer {nullptr}
 
std::unique_ptr< MenuRegistry::MenuItemmEffectMenuRoot
 
Observer::Subscription mEffectListItemMovedSubscription
 
Observer::Subscription mPluginsChangedSubscription
 

Additional Inherited Members

- Static Public Member Functions inherited from PrefsListener
static void Broadcast (int id=0)
 Call this static function to notify all PrefsListener objects. More...
 
- Protected Member Functions inherited from PrefsListener
virtual void UpdateSelectedPrefs (int id)
 

Detailed Description

Definition at line 561 of file RealtimeEffectPanel.cpp.

Constructor & Destructor Documentation

◆ RealtimeEffectListWindow()

RealtimeEffectListWindow::RealtimeEffectListWindow ( wxWindow *  parent,
wxWindowID  winid = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxScrolledWindowStyle,
const wxString &  name = wxPanelNameStr 
)
inline

i18n-hint: undo history record first parameter - realtime effect name second parameter - track name

i18n-hint: undo history record first parameter - realtime effect name second parameter - track name

Definition at line 579 of file RealtimeEffectPanel.cpp.

585 : wxScrolledWindow(parent, winid, pos, size, style, name)
586 {
587 Bind(wxEVT_SIZE, &RealtimeEffectListWindow::OnSizeChanged, this);
588#ifdef __WXMSW__
589 //Fixes flickering on redraw
590 wxScrolledWindow::SetDoubleBuffered(true);
591#endif
592 auto rootSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
593
594 auto effectListContainer = safenew ThemedWindowWrapper<wxPanel>(this, wxID_ANY);
595 effectListContainer->SetBackgroundColorIndex(clrMedium);
596 effectListContainer->SetSizer(safenew wxBoxSizer(wxVERTICAL));
597 effectListContainer->SetDoubleBuffered(true);
598 effectListContainer->Hide();
599 mEffectListContainer = effectListContainer;
600
601 auto addEffect = safenew ThemedAButtonWrapper<AButton>(this, wxID_ANY);
602 addEffect->SetImageIndices(0,
603 bmpHButtonNormal,
604 bmpHButtonHover,
605 bmpHButtonDown,
606 bmpHButtonHover,
607 bmpHButtonDisabled);
608 addEffect->SetTranslatableLabel(XO("Add effect"));
609 addEffect->SetButtonType(AButton::TextButton);
610 addEffect->SetBackgroundColorIndex(clrMedium);
611 addEffect->SetForegroundColorIndex(clrTrackPanelText);
612 addEffect->Bind(wxEVT_BUTTON, &RealtimeEffectListWindow::OnAddEffectClicked, this);
613 mAddEffect = addEffect;
614
615 auto addEffectHint = safenew ThemedWindowWrapper<wxStaticText>(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
616 //Workaround: text is set in the OnSizeChange
617 addEffectHint->SetForegroundColorIndex(clrTrackPanelText);
618 mAddEffectHint = addEffectHint;
619
620 auto addEffectTutorialLink = safenew ThemedWindowWrapper<wxHyperlinkCtrl>(
621 this, wxID_ANY, _("Watch video"),
622 "https://www.audacityteam.org/realtime-video", wxDefaultPosition,
623 wxDefaultSize, wxHL_ALIGN_LEFT | wxHL_CONTEXTMENU);
624
625 //i18n-hint: Hyperlink to the effects stack panel tutorial video
626 addEffectTutorialLink->SetTranslatableLabel(XO("Watch video"));
627#if wxUSE_ACCESSIBILITY
628 safenew WindowAccessible(addEffectTutorialLink);
629#endif
630
631 addEffectTutorialLink->Bind(
632 wxEVT_HYPERLINK, [](wxHyperlinkEvent& event)
633 { BasicUI::OpenInDefaultBrowser(event.GetURL()); });
634
635 mAddEffectTutorialLink = addEffectTutorialLink;
636
637 //indicates the insertion position of the item
638 auto dropHintLine = safenew ThemedWindowWrapper<DropHintLine>(effectListContainer, wxID_ANY);
639 dropHintLine->SetBackgroundColorIndex(clrDropHintHighlight);
640 dropHintLine->Hide();
641
642 rootSizer->Add(mEffectListContainer, 0, wxEXPAND | wxBOTTOM, 10);
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);
646
647 SetSizer(rootSizer.release());
648 SetMinSize({});
649
650 Bind(EVT_MOVABLE_CONTROL_DRAG_STARTED, [dropHintLine](const MovableControlEvent& event)
651 {
652 if(auto window = dynamic_cast<wxWindow*>(event.GetEventObject()))
653 window->Raise();
654 });
655 Bind(EVT_MOVABLE_CONTROL_DRAG_POSITION, [this, dropHintLine](const MovableControlEvent& event)
656 {
657 constexpr auto DropHintLineHeight { 3 };//px
658
659 auto sizer = mEffectListContainer->GetSizer();
660 assert(sizer != nullptr);
661
662 if(event.GetSourceIndex() == event.GetTargetIndex())
663 {
664 //do not display hint line if position didn't change
665 dropHintLine->Hide();
666 return;
667 }
668
669 if(!dropHintLine->IsShown())
670 {
671 dropHintLine->Show();
672 dropHintLine->Raise();
673 if(auto window = dynamic_cast<wxWindow*>(event.GetEventObject()))
674 window->Raise();
675 }
676
677 auto item = sizer->GetItem(event.GetTargetIndex());
678 dropHintLine->SetSize(item->GetSize().x, DropHintLineHeight);
679
680 if(event.GetTargetIndex() > event.GetSourceIndex())
681 dropHintLine->SetPosition(item->GetRect().GetBottomLeft() - wxPoint(0, DropHintLineHeight));
682 else
683 dropHintLine->SetPosition(item->GetRect().GetTopLeft());
684 });
685 Bind(EVT_MOVABLE_CONTROL_DRAG_FINISHED, [this, dropHintLine](const MovableControlEvent& event)
686 {
687 dropHintLine->Hide();
688
689 if(mProject == nullptr)
690 return;
691
692 auto& effectList = RealtimeEffectList::Get(*mTrack);
693 const auto from = event.GetSourceIndex();
694 const auto to = event.GetTargetIndex();
695 if(from != to)
696 {
697 auto effectName =
698 effectList.GetStateAt(from)->GetEffect()->GetName();
699 bool up = (to < from);
700 effectList.MoveEffect(from, to);
702 (up
707 ? XO("Moved %s up in %s")
712 : XO("Moved %s down in %s"))
713 .Format(effectName, mTrack->GetName()),
714 XO("Change effect order"), UndoPush::CONSOLIDATE);
715 }
716 else
717 {
718 wxWindowUpdateLocker freeze(this);
719 Layout();
720 }
721 });
722 SetScrollRate(0, 20);
723
726 {
728 });
730 }
const TranslatableString name
Definition: Distortion.cpp:76
XO("Cut/Copy/Paste")
#define _(s)
Definition: Internat.h:73
#define safenew
Definition: MemoryX.h:9
@ TextButton
Definition: AButton.h:112
Abstract base class used in importing a file.
int GetSourceIndex() const noexcept
int GetTargetIndex() const noexcept
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
Definition: Observer.h:199
static PluginManager & Get()
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
static ProjectHistory & Get(AudacityProject &project)
static RealtimeEffectList & Get(AudacityProject &project)
void OnAddEffectClicked(const wxCommandEvent &event)
void OnSizeChanged(wxSizeEvent &event)
std::shared_ptr< SampleTrack > mTrack
Observer::Subscription mPluginsChangedSubscription
wxWeakRef< AudacityProject > mProject
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
bool OpenInDefaultBrowser(const wxString &url)
Open an URL in default browser.
Definition: BasicUI.cpp:240

References _, CONSOLIDATE, PluginManager::Get(), ProjectHistory::Get(), RealtimeEffectList::Get(), mAddEffect, mAddEffectHint, mAddEffectTutorialLink, mEffectListContainer, mPluginsChangedSubscription, mProject, mTrack, OnAddEffectClicked(), OnSizeChanged(), BasicUI::OpenInDefaultBrowser(), ProjectHistory::PushState(), safenew, Observer::Publisher< Message, NotifyAll >::Subscribe(), AButton::TextButton, UpdateEffectMenuItems(), and XO().

Here is the call graph for this function:

Member Function Documentation

◆ EnableEffects()

void RealtimeEffectListWindow::EnableEffects ( bool  enable)
inline

Definition at line 929 of file RealtimeEffectPanel.cpp.

930 {
931 if (mTrack)
932 RealtimeEffectList::Get(*mTrack).SetActive(enable);
933 }
void SetActive(bool value)
Done by main thread only, under a lock guard.

References RealtimeEffectList::Get(), mTrack, and RealtimeEffectList::SetActive().

Referenced by RealtimeEffectPanel::RealtimeEffectPanel().

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

◆ InsertEffectRow()

void RealtimeEffectListWindow::InsertEffectRow ( size_t  index,
const std::shared_ptr< RealtimeEffectState > &  pState 
)
inline

Definition at line 1005 of file RealtimeEffectPanel.cpp.

1007 {
1008 if(mProject == nullptr)
1009 return;
1010
1011 // See comment in ReloadEffectsList
1012 if(!mEffectListContainer->IsShown())
1013 mEffectListContainer->Show();
1014
1016 row->SetBackgroundColorIndex(clrEffectListItemBackground);
1017 row->SetEffect(*mProject, mTrack, pState);
1018 mEffectListContainer->GetSizer()->Insert(index, row, 0, wxEXPAND);
1019 }

References mEffectListContainer, mProject, mTrack, and safenew.

Referenced by OnEffectListItemChange(), and ReloadEffectsList().

Here is the caller graph for this function:

◆ OnAddEffectClicked()

void RealtimeEffectListWindow::OnAddEffectClicked ( const wxCommandEvent &  event)
inline

i18n-hint: undo history record first parameter - realtime effect name second parameter - track name

Definition at line 966 of file RealtimeEffectPanel.cpp.

967 {
968 if(!mTrack || mProject == nullptr)
969 return;
970
971 const auto effectID = PickEffect(dynamic_cast<wxWindow*>(event.GetEventObject()), {});
972
973 if(!effectID || effectID->empty())
974 return;
975
976 auto plug = PluginManager::Get().GetPlugin(*effectID);
977 if(!plug)
978 return;
979
982 XO("This plugin could not be loaded.\nIt may have been deleted."),
984 .Caption(XO("Plugin Error")));
985
986 return;
987 }
988
989 if(auto state = AudioIO::Get()->AddState(*mProject, &*mTrack, *effectID))
990 {
991 auto effect = state->GetEffect();
992 assert(effect); // postcondition of AddState
993 const auto effectName = effect->GetName();
999 XO("Added %s to %s").Format(effectName, mTrack->GetName()),
1000 //i18n-hint: undo history record
1001 XO("Add %s").Format(effectName));
1002 }
1003 }
static AudioIO * Get()
Definition: AudioIO.cpp:126
static bool IsPluginAvailable(const PluginDescriptor &plug)
const PluginDescriptor * GetPlugin(const PluginID &ID) const
std::optional< wxString > PickEffect(wxWindow *parent, const wxString &selectedEffectID) override
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Definition: BasicUI.h:279

References AudioIO::Get(), PluginManager::Get(), ProjectHistory::Get(), PluginManager::GetPlugin(), PluginManager::IsPluginAvailable(), mProject, mTrack, PickEffect(), ProjectHistory::PushState(), BasicUI::ShowMessageBox(), and XO().

Referenced by RealtimeEffectListWindow().

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

◆ OnEffectListItemChange()

void RealtimeEffectListWindow::OnEffectListItemChange ( const RealtimeEffectListMessage msg)
inline

Definition at line 827 of file RealtimeEffectPanel.cpp.

828 {
829 auto sizer = mEffectListContainer->GetSizer();
830 const auto insertItem = [this, &msg](){
831 auto& effects = RealtimeEffectList::Get(*mTrack);
832 InsertEffectRow(msg.srcIndex, effects.GetStateAt(msg.srcIndex));
833 mAddEffectHint->Hide();
835 };
836 const auto removeItem = [&](){
838 // Don't need to auto-save changed settings of effect that is deleted
839 // Undo history push will do it anyway
840 ui.Hide();
841
842 auto window = sizer->GetItem(msg.srcIndex)->GetWindow();
843 sizer->Remove(msg.srcIndex);
844 wxTheApp->CallAfter([ref = wxWeakRef { window }] {
845 if(ref) ref->Destroy();
846 });
847
848 if(sizer->IsEmpty())
849 {
850 if(mEffectListContainer->IsDescendant(FindFocus()))
851 mAddEffect->SetFocus();
852
853 mEffectListContainer->Hide();
854 mAddEffectHint->Show();
856 }
857 };
858
859 wxWindowUpdateLocker freeze(this);
861 {
862 const auto sizer = mEffectListContainer->GetSizer();
863
864 const auto movedItem = sizer->GetItem(msg.srcIndex);
865
866 const auto proportion = movedItem->GetProportion();
867 const auto flag = movedItem->GetFlag();
868 const auto border = movedItem->GetBorder();
869 const auto window = movedItem->GetWindow();
870
871 if(msg.srcIndex < msg.dstIndex)
872 window->MoveAfterInTabOrder(sizer->GetItem(msg.dstIndex)->GetWindow());
873 else
874 window->MoveBeforeInTabOrder(sizer->GetItem(msg.dstIndex)->GetWindow());
875
876 sizer->Remove(msg.srcIndex);
877 sizer->Insert(msg.dstIndex, window, proportion, flag, border);
878 }
880 {
881 insertItem();
882 }
884 {
885 removeItem();
886 }
888 {
889 insertItem();
890 }
892 {
893 removeItem();
894 }
895 SendSizeEventToParent();
896 }
static std::once_flag flag
void InsertEffectRow(size_t index, const std::shared_ptr< RealtimeEffectState > &pState)
static RealtimeEffectStateUI & Get(RealtimeEffectState &state)
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
Definition: BasicUI.h:375
@ 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

References RealtimeEffectListMessage::affectedState, RealtimeEffectListMessage::DidReplace, RealtimeEffectListMessage::dstIndex, BasicUI::FindFocus(), flag, RealtimeEffectList::Get(), RealtimeEffectStateUI::Get(), RealtimeEffectListMessage::Insert, InsertEffectRow(), mAddEffect, mAddEffectHint, mAddEffectTutorialLink, mEffectListContainer, RealtimeEffectListMessage::Move, mTrack, RealtimeEffectListMessage::Remove, RealtimeEffectListMessage::srcIndex, RealtimeEffectListMessage::type, and RealtimeEffectListMessage::WillReplace.

Referenced by SetTrack().

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

◆ OnSizeChanged()

void RealtimeEffectListWindow::OnSizeChanged ( wxSizeEvent &  event)
inline

Definition at line 811 of file RealtimeEffectPanel.cpp.

812 {
813 if(auto sizerItem = GetSizer()->GetItem(mAddEffectHint))
814 {
815 //We need to wrap the text whenever panel width changes and adjust widget height
816 //so that text is fully visible, but there is no height-for-width layout algorithm
817 //in wxWidgets yet, so for now we just do it manually
818
819 //Restore original text, because 'Wrap' will replace it with wrapped one
820 mAddEffectHint->SetLabel(_("Realtime effects are non-destructive and can be changed at any time."));
821 mAddEffectHint->Wrap(GetClientSize().x - sizerItem->GetBorder() * 2);
822 mAddEffectHint->InvalidateBestSize();
823 }
824 event.Skip();
825 }

References _, and mAddEffectHint.

Referenced by RealtimeEffectListWindow().

Here is the caller graph for this function:

◆ PickEffect()

std::optional< wxString > RealtimeEffectListWindow::PickEffect ( wxWindow *  parent,
const wxString &  selectedEffectID 
)
inlineoverride

Definition at line 737 of file RealtimeEffectPanel.cpp.

738 {
739 if (mProject == nullptr)
740 return {};
741
742 wxMenu menu;
743 if(!selectedEffectID.empty())
744 {
745 //no need to handle language change since menu creates its own event loop
746 menu.Append(wxID_REMOVE, _("No Effect"));
747 menu.AppendSeparator();
748 }
749
750 RealtimeEffectsMenuVisitor visitor { menu };
751
753
754 int commandId = wxID_NONE;
755
756 menu.AppendSeparator();
757 menu.Append(wxID_MORE, _("Get more effects..."));
758
759 menu.Bind(wxEVT_MENU, [&](wxCommandEvent evt) { commandId = evt.GetId(); });
760
761 if(parent->PopupMenu(&menu, parent->GetClientRect().GetLeftBottom()) && commandId != wxID_NONE)
762 {
763 if(commandId == wxID_REMOVE)
764 return wxString {};
765 else if(commandId == wxID_MORE)
766 OpenInDefaultBrowser("https://plugins.audacityteam.org/");
767 else
768 return visitor.GetPluginID(commandId).GET();
769 }
770
771 return {};
772 }
std::unique_ptr< MenuRegistry::MenuItem > mEffectMenuRoot
void VisitWithFunctions(const VisitorFunctions< RegistryTraits > &visitors, const GroupItem< RegistryTraits > *pTopItem, const GroupItem< RegistryTraits > *pRegistry={}, typename RegistryTraits::ComputedItemContextType &computedItemContext=RegistryTraits::ComputedItemContextType::Instance)
Definition: Registry.h:623

References _, mEffectMenuRoot, mProject, BasicUI::OpenInDefaultBrowser(), and Registry::VisitWithFunctions().

Referenced by OnAddEffectClicked().

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

◆ ReloadEffectsList()

void RealtimeEffectListWindow::ReloadEffectsList ( )
inline

Definition at line 935 of file RealtimeEffectPanel.cpp.

936 {
937 wxWindowUpdateLocker freeze(this);
938
939 const auto hadFocus = mEffectListContainer->IsDescendant(FindFocus());
940 //delete items that were added to the sizer
941 mEffectListContainer->Hide();
942 mEffectListContainer->GetSizer()->Clear(true);
943
944
945 if(!mTrack || RealtimeEffectList::Get(*mTrack).GetStatesCount() == 0)
946 mEffectListContainer->Hide();
947
948 auto isEmpty{true};
949 if(mTrack)
950 {
951 auto& effects = RealtimeEffectList::Get(*mTrack);
952 isEmpty = effects.GetStatesCount() == 0;
953 for(size_t i = 0, count = effects.GetStatesCount(); i < count; ++i)
954 InsertEffectRow(i, effects.GetStateAt(i));
955 }
957 //Workaround for GTK: Underlying GTK widget does not update
958 //its size when wxWindow size is set to zero
959 mEffectListContainer->Show(!isEmpty);
960 mAddEffectHint->Show(isEmpty);
961 mAddEffectTutorialLink->Show(isEmpty);
962
963 SendSizeEventToParent();
964 }
void SetEnabled(bool state)
Definition: AButton.h:182
size_t GetStatesCount() const noexcept

References BasicUI::FindFocus(), RealtimeEffectList::Get(), RealtimeEffectList::GetStatesCount(), InsertEffectRow(), mAddEffect, mAddEffectHint, mAddEffectTutorialLink, mEffectListContainer, mTrack, and AButton::SetEnabled().

Referenced by ResetTrack(), and SetTrack().

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

◆ ResetTrack()

void RealtimeEffectListWindow::ResetTrack ( )
inline

Definition at line 898 of file RealtimeEffectPanel.cpp.

899 {
901
902 mTrack.reset();
903 mProject = nullptr;
905 }
void Reset() noexcept
Breaks the connection (constant time)
Definition: Observer.cpp:101
Observer::Subscription mEffectListItemMovedSubscription

References mEffectListItemMovedSubscription, mProject, mTrack, ReloadEffectsList(), and Observer::Subscription::Reset().

Referenced by RealtimeEffectPanel::ResetTrack().

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

◆ SetTrack()

void RealtimeEffectListWindow::SetTrack ( AudacityProject project,
const std::shared_ptr< SampleTrack > &  track 
)
inline

Definition at line 907 of file RealtimeEffectPanel.cpp.

909 {
910 if (mTrack == track)
911 return;
912
914
915 mTrack = track;
916 mProject = &project;
918
919 if (track)
920 {
921 auto& effects = RealtimeEffectList::Get(*mTrack);
922 mEffectListItemMovedSubscription = effects.Subscribe(
924
926 }
927 }
const auto project
void OnEffectListItemChange(const RealtimeEffectListMessage &msg)

References RealtimeEffectList::Get(), mEffectListItemMovedSubscription, mProject, mTrack, OnEffectListItemChange(), project, ReloadEffectsList(), Observer::Subscription::Reset(), and anonymous_namespace{RealtimeEffectPanel.cpp}::UpdateRealtimeEffectUIData().

Referenced by RealtimeEffectPanel::SetTrack().

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

◆ UpdateEffectMenuItems()

void RealtimeEffectListWindow::UpdateEffectMenuItems ( )
inline

Definition at line 774 of file RealtimeEffectPanel.cpp.

775 {
776 using namespace MenuRegistry;
777 auto root = Menu("", TranslatableString{});
778
779 static auto realtimeEffectPredicate = [](const PluginDescriptor& desc)
780 {
781 return desc.IsEffectRealtime();
782 };
783
784 const auto groupby = RealtimeEffectsGroupBy.Read();
785
786 auto analyzeSection = Section("", Menu("", XO("Analyze")));
787 auto submenu =
788 static_cast<MenuItem*>(analyzeSection->begin()->get());
790 *submenu,
792 {}, groupby, nullptr,
793 realtimeEffectPredicate
794 );
795
796 if(!submenu->empty())
797 {
798 root->push_back(move(analyzeSection));
799 }
800
802 *root,
804 {}, groupby, nullptr,
805 realtimeEffectPredicate
806 );
807
808 mEffectMenuRoot.swap(root);
809 }
@ EffectTypeAnalyze
@ EffectTypeProcess
ChoiceSetting RealtimeEffectsGroupBy
wxString Read() const
Definition: Prefs.cpp:388
Holds a msgid for the translation catalog; may also bind format arguments.
void PopulateEffectsMenu(Group &menuItems, EffectType type, CommandFlag batchflags, const wxString &groupby, void(*onMenuCommand)(const CommandContext &), std::function< bool(const PluginDescriptor &)> pred={})
Definition: MenuHelper.cpp:563
constexpr auto Section
Definition: MenuRegistry.h:436
constexpr auto Menu
Items will appear in a main toolbar menu or in a sub-menu.
Definition: MenuRegistry.h:445
const TranslatableString desc
Definition: ExportPCM.cpp:51

References anonymous_namespace{ExportPCM.cpp}::desc, EffectTypeAnalyze, EffectTypeProcess, mEffectMenuRoot, MenuRegistry::Menu, MenuHelper::PopulateEffectsMenu(), ChoiceSetting::Read(), RealtimeEffectsGroupBy, MenuRegistry::Section, and XO().

Referenced by RealtimeEffectListWindow(), and UpdatePrefs().

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

◆ UpdatePrefs()

void RealtimeEffectListWindow::UpdatePrefs ( )
inlineoverridevirtual

Implements PrefsListener.

Definition at line 732 of file RealtimeEffectPanel.cpp.

733 {
735 }

References UpdateEffectMenuItems().

Here is the call graph for this function:

Member Data Documentation

◆ mAddEffect

AButton* RealtimeEffectListWindow::mAddEffect {nullptr}
private

◆ mAddEffectHint

wxStaticText* RealtimeEffectListWindow::mAddEffectHint {nullptr}
private

◆ mAddEffectTutorialLink

wxWindow* RealtimeEffectListWindow::mAddEffectTutorialLink {nullptr}
private

◆ mEffectListContainer

wxWindow* RealtimeEffectListWindow::mEffectListContainer {nullptr}
private

◆ mEffectListItemMovedSubscription

Observer::Subscription RealtimeEffectListWindow::mEffectListItemMovedSubscription
private

Definition at line 575 of file RealtimeEffectPanel.cpp.

Referenced by ResetTrack(), and SetTrack().

◆ mEffectMenuRoot

std::unique_ptr<MenuRegistry::MenuItem> RealtimeEffectListWindow::mEffectMenuRoot
private

Definition at line 573 of file RealtimeEffectPanel.cpp.

Referenced by PickEffect(), and UpdateEffectMenuItems().

◆ mPluginsChangedSubscription

Observer::Subscription RealtimeEffectListWindow::mPluginsChangedSubscription
private

Definition at line 576 of file RealtimeEffectPanel.cpp.

Referenced by RealtimeEffectListWindow().

◆ mProject

wxWeakRef<AudacityProject> RealtimeEffectListWindow::mProject
private

◆ mTrack

std::shared_ptr<SampleTrack> RealtimeEffectListWindow::mTrack
private

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