Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectsMenuVisitor Class Referencefinal
Inheritance diagram for anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectsMenuVisitor:
[legend]
Collaboration diagram for anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectsMenuVisitor:
[legend]

Public Member Functions

 RealtimeEffectsMenuVisitor (wxMenu &menu)
 
Identifier GetPluginID (int menuIndex) const
 
- Public Member Functions inherited from MenuRegistry::Visitor< Traits >
 Visitor (VisitorFunctions< Traits > functions, std::function< void()> doSeparator)
 
- Public Member Functions inherited from Registry::VisitorFunctions< Traits >
 VisitorFunctions (Visitors &&visitors)
 Type-erasing constructor. More...
 
void BeginGroup (const GroupItem< Traits > &item, const Path &path) const
 Call-through for a decorating pre-visitor. More...
 
void Visit (const SingleItem &item, const Path &path) const
 Call-through for a decorating leaf-visitor. More...
 
void EndGroup (const GroupItem< Traits > &item, const Path &path) const
 Call-through for a decorating post-visitor. More...
 
- Public Member Functions inherited from MenuRegistry::detail::VisitorBase
std::pair< bool, bool > ShouldBeginGroup (const ItemProperties *pProperties)
 
void AfterBeginGroup (const ItemProperties *pProperties)
 
bool ShouldEndGroup (const ItemProperties *pProperties)
 
bool ShouldDoSeparator ()
 

Private Attributes

wxMenu & mMenu
 
wxMenu * mMenuPtr { nullptr }
 
int mMenuItemIdCounter { wxID_HIGHEST }
 
std::vector< IdentifiermIndexedPluginList
 
int mMenuLevelCounter { 0 }
 

Additional Inherited Members

- Public Types inherited from Registry::VisitorFunctions< Traits >
using NodeTypes = detail::VisitedNodeTypes< Traits >
 
using LeafTypes = detail::VisitedLeafTypes< Traits >
 
- Public Attributes inherited from MenuRegistry::detail::VisitorBase
std::vector< bool > firstItem
 
std::vector< bool > needSeparator
 

Detailed Description

Definition at line 60 of file RealtimeEffectPanel.cpp.

Constructor & Destructor Documentation

◆ RealtimeEffectsMenuVisitor()

anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectsMenuVisitor::RealtimeEffectsMenuVisitor ( wxMenu &  menu)
inline

Definition at line 67 of file RealtimeEffectPanel.cpp.

67 : Visitor<Traits>{ std::tuple{
68 [this](const MenuRegistry::MenuItem &menuItem, const auto&) {
69 //Don't create a group item for root
70 if (mMenuLevelCounter != 0)
71 {
72 auto submenu = std::make_unique<wxMenu>();
73 mMenuPtr->AppendSubMenu(submenu.get(), menuItem.GetTitle().Translation());
74 mMenuPtr = submenu.release();
75 }
77 },
78
79 [this](const MenuRegistry::CommandItem &commandItem, const auto&) {
80 mMenuPtr->Append(mMenuItemIdCounter, commandItem.label_in.Translation());
81 mIndexedPluginList.push_back(commandItem.name);
83 },
84
85 [this](const MenuRegistry::MenuItem &, const auto&) {
87 if (mMenuLevelCounter != 0)
88 {
89 assert(mMenuPtr->GetParent() != nullptr);
90 mMenuPtr = mMenuPtr->GetParent();
91 }
92 }},
93
94 [this]() {
95 mMenuPtr->AppendSeparator();
96 }}
97 , mMenu(menu), mMenuPtr(&mMenu)
98 {}
wxString Translation() const
const TranslatableString label_in
Definition: MenuRegistry.h:321
const auto & GetTitle() const
Definition: MenuRegistry.h:226
const Identifier name
Definition: Registry.h:86

References MenuRegistry::MenuItem::GetTitle(), MenuRegistry::CommandItem::label_in, Registry::detail::BaseItem::name, and TranslatableString::Translation().

Here is the call graph for this function:

Member Function Documentation

◆ GetPluginID()

Identifier anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectsMenuVisitor::GetPluginID ( int  menuIndex) const
inline

Definition at line 100 of file RealtimeEffectPanel.cpp.

101 {
102 assert(menuIndex >= wxID_HIGHEST && menuIndex < (wxID_HIGHEST + mIndexedPluginList.size()));
103 return mIndexedPluginList[menuIndex - wxID_HIGHEST];
104 }

Member Data Documentation

◆ mIndexedPluginList

std::vector<Identifier> anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectsMenuVisitor::mIndexedPluginList
private

Definition at line 64 of file RealtimeEffectPanel.cpp.

◆ mMenu

wxMenu& anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectsMenuVisitor::mMenu
private

Definition at line 61 of file RealtimeEffectPanel.cpp.

◆ mMenuItemIdCounter

int anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectsMenuVisitor::mMenuItemIdCounter { wxID_HIGHEST }
private

Definition at line 63 of file RealtimeEffectPanel.cpp.

◆ mMenuLevelCounter

int anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectsMenuVisitor::mMenuLevelCounter { 0 }
private

Definition at line 65 of file RealtimeEffectPanel.cpp.

◆ mMenuPtr

wxMenu* anonymous_namespace{RealtimeEffectPanel.cpp}::RealtimeEffectsMenuVisitor::mMenuPtr { nullptr }
private

Definition at line 62 of file RealtimeEffectPanel.cpp.


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