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 562 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 580 of file RealtimeEffectPanel.cpp.

586 : wxScrolledWindow(parent, winid, pos, size, style, name)
587 {
588 Bind(wxEVT_SIZE, &RealtimeEffectListWindow::OnSizeChanged, this);
589#ifdef __WXMSW__
590 //Fixes flickering on redraw
591 wxScrolledWindow::SetDoubleBuffered(true);
592#endif
593 auto rootSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
594
595 auto effectListContainer = safenew ThemedWindowWrapper<wxPanel>(this, wxID_ANY);
596 effectListContainer->SetBackgroundColorIndex(clrMedium);
597 effectListContainer->SetSizer(safenew wxBoxSizer(wxVERTICAL));
598 effectListContainer->SetDoubleBuffered(true);
599 effectListContainer->Hide();
600 mEffectListContainer = effectListContainer;
601
602 auto addEffect = safenew ThemedAButtonWrapper<AButton>(this, wxID_ANY);
603 addEffect->SetImageIndices(0,
604 bmpHButtonNormal,
605 bmpHButtonHover,
606 bmpHButtonDown,
607 bmpHButtonHover,
608 bmpHButtonDisabled);
609 addEffect->SetTranslatableLabel(XO("Add effect"));
610 addEffect->SetButtonType(AButton::TextButton);
611 addEffect->SetBackgroundColorIndex(clrMedium);
612 addEffect->SetForegroundColorIndex(clrTrackPanelText);
613 addEffect->Bind(wxEVT_BUTTON, &RealtimeEffectListWindow::OnAddEffectClicked, this);
614 mAddEffect = addEffect;
615
616 auto addEffectHint = safenew ThemedWindowWrapper<wxStaticText>(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
617 //Workaround: text is set in the OnSizeChange
618 addEffectHint->SetForegroundColorIndex(clrTrackPanelText);
619 mAddEffectHint = addEffectHint;
620
621 auto addEffectTutorialLink = safenew ThemedWindowWrapper<wxHyperlinkCtrl>(
622 this, wxID_ANY, _("Watch video"),
623 "https://www.audacityteam.org/realtime-video", wxDefaultPosition,
624 wxDefaultSize, wxHL_ALIGN_LEFT | wxHL_CONTEXTMENU);
625
626 //i18n-hint: Hyperlink to the effects stack panel tutorial video
627 addEffectTutorialLink->SetTranslatableLabel(XO("Watch video"));
628#if wxUSE_ACCESSIBILITY
629 safenew WindowAccessible(addEffectTutorialLink);
630#endif
631
632 addEffectTutorialLink->Bind(
633 wxEVT_HYPERLINK, [](wxHyperlinkEvent& event)
634 { BasicUI::OpenInDefaultBrowser(event.GetURL()); });
635
636 mAddEffectTutorialLink = addEffectTutorialLink;
637
638 //indicates the insertion position of the item
639 auto dropHintLine = safenew ThemedWindowWrapper<DropHintLine>(effectListContainer, wxID_ANY);
640 dropHintLine->SetBackgroundColorIndex(clrDropHintHighlight);
641 dropHintLine->Hide();
642
643 rootSizer->Add(mEffectListContainer, 0, wxEXPAND | wxBOTTOM, 10);
644 rootSizer->Add(addEffect, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 20);
645 rootSizer->Add(addEffectHint, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 20);
646 rootSizer->Add(addEffectTutorialLink, 0, wxLEFT | wxRIGHT | wxEXPAND, 20);
647
648 SetSizer(rootSizer.release());
649 SetMinSize({});
650
651 Bind(EVT_MOVABLE_CONTROL_DRAG_STARTED, [dropHintLine](const MovableControlEvent& event)
652 {
653 if(auto window = dynamic_cast<wxWindow*>(event.GetEventObject()))
654 window->Raise();
655 });
656 Bind(EVT_MOVABLE_CONTROL_DRAG_POSITION, [this, dropHintLine](const MovableControlEvent& event)
657 {
658 constexpr auto DropHintLineHeight { 3 };//px
659
660 auto sizer = mEffectListContainer->GetSizer();
661 assert(sizer != nullptr);
662
663 if(event.GetSourceIndex() == event.GetTargetIndex())
664 {
665 //do not display hint line if position didn't change
666 dropHintLine->Hide();
667 return;
668 }
669
670 if(!dropHintLine->IsShown())
671 {
672 dropHintLine->Show();
673 dropHintLine->Raise();
674 if(auto window = dynamic_cast<wxWindow*>(event.GetEventObject()))
675 window->Raise();
676 }
677
678 auto item = sizer->GetItem(event.GetTargetIndex());
679 dropHintLine->SetSize(item->GetSize().x, DropHintLineHeight);
680
681 if(event.GetTargetIndex() > event.GetSourceIndex())
682 dropHintLine->SetPosition(item->GetRect().GetBottomLeft() - wxPoint(0, DropHintLineHeight));
683 else
684 dropHintLine->SetPosition(item->GetRect().GetTopLeft());
685 });
686 Bind(EVT_MOVABLE_CONTROL_DRAG_FINISHED, [this, dropHintLine](const MovableControlEvent& event)
687 {
688 dropHintLine->Hide();
689
690 if(mProject == nullptr)
691 return;
692
693 auto& effectList = RealtimeEffectList::Get(*mTrack);
694 const auto from = event.GetSourceIndex();
695 const auto to = event.GetTargetIndex();
696 if(from != to)
697 {
698 auto effectName =
699 effectList.GetStateAt(from)->GetEffect()->GetName();
700 bool up = (to < from);
701 effectList.MoveEffect(from, to);
703 (up
708 ? XO("Moved %s up in %s")
713 : XO("Moved %s down in %s"))
714 .Format(effectName, mTrack->GetName()),
715 XO("Change effect order"), UndoPush::CONSOLIDATE);
716 }
717 else
718 {
719 wxWindowUpdateLocker freeze(this);
720 Layout();
721 }
722 });
723 SetScrollRate(0, 20);
724
727 {
729 });
731 }
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 930 of file RealtimeEffectPanel.cpp.

931 {
932 if (mTrack)
933 RealtimeEffectList::Get(*mTrack).SetActive(enable);
934 }
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 1006 of file RealtimeEffectPanel.cpp.

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

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 967 of file RealtimeEffectPanel.cpp.

968 {
969 if(!mTrack || mProject == nullptr)
970 return;
971
972 const auto effectID = PickEffect(dynamic_cast<wxWindow*>(event.GetEventObject()), {});
973
974 if(!effectID || effectID->empty())
975 return;
976
977 auto plug = PluginManager::Get().GetPlugin(*effectID);
978 if(!plug)
979 return;
980
983 XO("This plugin could not be loaded.\nIt may have been deleted."),
985 .Caption(XO("Plugin Error")));
986
987 return;
988 }
989
990 if(auto state = AudioIO::Get()->AddState(*mProject, &*mTrack, *effectID))
991 {
992 auto effect = state->GetEffect();
993 assert(effect); // postcondition of AddState
994 const auto effectName = effect->GetName();
1000 XO("Added %s to %s").Format(effectName, mTrack->GetName()),
1001 //i18n-hint: undo history record
1002 XO("Add %s").Format(effectName));
1003 }
1004 }
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:277

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 828 of file RealtimeEffectPanel.cpp.

829 {
830 auto sizer = mEffectListContainer->GetSizer();
831 const auto insertItem = [this, &msg](){
832 auto& effects = RealtimeEffectList::Get(*mTrack);
833 InsertEffectRow(msg.srcIndex, effects.GetStateAt(msg.srcIndex));
834 mAddEffectHint->Hide();
836 };
837 const auto removeItem = [&](){
839 // Don't need to auto-save changed settings of effect that is deleted
840 // Undo history push will do it anyway
841 ui.Hide();
842
843 auto window = sizer->GetItem(msg.srcIndex)->GetWindow();
844 sizer->Remove(msg.srcIndex);
845 wxTheApp->CallAfter([ref = wxWeakRef { window }] {
846 if(ref) ref->Destroy();
847 });
848
849 if(sizer->IsEmpty())
850 {
851 if(mEffectListContainer->IsDescendant(FindFocus()))
852 mAddEffect->SetFocus();
853
854 mEffectListContainer->Hide();
855 mAddEffectHint->Show();
857 }
858 };
859
860 wxWindowUpdateLocker freeze(this);
862 {
863 const auto sizer = mEffectListContainer->GetSizer();
864
865 const auto movedItem = sizer->GetItem(msg.srcIndex);
866
867 const auto proportion = movedItem->GetProportion();
868 const auto flag = movedItem->GetFlag();
869 const auto border = movedItem->GetBorder();
870 const auto window = movedItem->GetWindow();
871
872 if(msg.srcIndex < msg.dstIndex)
873 window->MoveAfterInTabOrder(sizer->GetItem(msg.dstIndex)->GetWindow());
874 else
875 window->MoveBeforeInTabOrder(sizer->GetItem(msg.dstIndex)->GetWindow());
876
877 sizer->Remove(msg.srcIndex);
878 sizer->Insert(msg.dstIndex, window, proportion, flag, border);
879 }
881 {
882 insertItem();
883 }
885 {
886 removeItem();
887 }
889 {
890 insertItem();
891 }
893 {
894 removeItem();
895 }
896 SendSizeEventToParent();
897 }
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:373
@ 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 812 of file RealtimeEffectPanel.cpp.

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

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 738 of file RealtimeEffectPanel.cpp.

739 {
740 if (mProject == nullptr)
741 return {};
742
743 wxMenu menu;
744 if(!selectedEffectID.empty())
745 {
746 //no need to handle language change since menu creates its own event loop
747 menu.Append(wxID_REMOVE, _("No Effect"));
748 menu.AppendSeparator();
749 }
750
751 RealtimeEffectsMenuVisitor visitor { menu };
752
754
755 int commandId = wxID_NONE;
756
757 menu.AppendSeparator();
758 menu.Append(wxID_MORE, _("Get more effects..."));
759
760 menu.Bind(wxEVT_MENU, [&](wxCommandEvent evt) { commandId = evt.GetId(); });
761
762 if(parent->PopupMenu(&menu, parent->GetClientRect().GetLeftBottom()) && commandId != wxID_NONE)
763 {
764 if(commandId == wxID_REMOVE)
765 return wxString {};
766 else if(commandId == wxID_MORE)
767 OpenInDefaultBrowser("https://plugins.audacityteam.org/");
768 else
769 return visitor.GetPluginID(commandId).GET();
770 }
771
772 return {};
773 }
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 936 of file RealtimeEffectPanel.cpp.

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

900 {
902
903 mTrack.reset();
904 mProject = nullptr;
906 }
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 908 of file RealtimeEffectPanel.cpp.

910 {
911 if (mTrack == track)
912 return;
913
915
916 mTrack = track;
917 mProject = &project;
919
920 if (track)
921 {
922 auto& effects = RealtimeEffectList::Get(*mTrack);
923 mEffectListItemMovedSubscription = effects.Subscribe(
925
927 }
928 }
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 775 of file RealtimeEffectPanel.cpp.

776 {
777 using namespace MenuRegistry;
778 auto root = Menu("", TranslatableString{});
779
780 static auto realtimeEffectPredicate = [](const PluginDescriptor& desc)
781 {
782 return desc.IsEffectRealtime();
783 };
784
785 const auto groupby = RealtimeEffectsGroupBy.Read();
786
787 auto analyzeSection = Section("", Menu("", XO("Analyze")));
788 auto submenu =
789 static_cast<MenuItem*>(analyzeSection->begin()->get());
791 *submenu,
793 {}, groupby, nullptr,
794 realtimeEffectPredicate
795 );
796
797 if(!submenu->empty())
798 {
799 root->push_back(move(analyzeSection));
800 }
801
803 *root,
805 {}, groupby, nullptr,
806 realtimeEffectPredicate
807 );
808
809 mEffectMenuRoot.swap(root);
810 }
@ 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 733 of file RealtimeEffectPanel.cpp.

734 {
736 }

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 576 of file RealtimeEffectPanel.cpp.

Referenced by ResetTrack(), and SetTrack().

◆ mEffectMenuRoot

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

Definition at line 574 of file RealtimeEffectPanel.cpp.

Referenced by PickEffect(), and UpdateEffectMenuItems().

◆ mPluginsChangedSubscription

Observer::Subscription RealtimeEffectListWindow::mPluginsChangedSubscription
private

Definition at line 577 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: