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

Static Public Member Functions

static NoteTrackMenuTableInstance ()
 
- Static Public Member Functions inherited from PopupMenuTable
static std::unique_ptr< PopupMenuBuildMenu (PopupMenuTable *pTable, void *pUserData=NULL)
 
static void ExtendMenu (PopupMenu &menu, PopupMenuTable &otherTable)
 
template<typename Table , typename Factory >
static auto Adapt (const Factory &factory)
 

Private Member Functions

 NoteTrackMenuTable ()
 
 DECLARE_POPUP_MENU (NoteTrackMenuTable)
 
void InitUserData (void *pUserData) override
 Called before the menu items are appended. More...
 
void OnChangeOctave (wxCommandEvent &)
 Scrolls the note track up or down by an octave. More...
 

Private Attributes

NoteTrackControlsBase::InitMenuDatampData {}
 

Additional Inherited Members

- Public Types inherited from PopupMenuTable
using Entry = PopupMenuTableEntry
 
- Public Member Functions inherited from PopupMenuTable
 PopupMenuTable (const Identifier &id, const TranslatableString &caption={})
 
const IdentifierId () const
 
const TranslatableStringCaption () const
 
const auto * GetRegistry () const
 
const auto & Get (void *pUserData)
 
void Clear ()
 
- Public Member Functions inherited from PopupMenuHandler
 PopupMenuHandler ()=default
 
 PopupMenuHandler (const PopupMenuHandler &)=delete
 
PopupMenuHandleroperator= (const PopupMenuHandler &)=delete
 
virtual void InitUserData (void *pUserData)=0
 Called before the menu items are appended. More...
 
- Protected Member Functions inherited from PopupMenuTable
virtual void Populate ()=0
 
template<typename Ptr >
void Append (Ptr pItem)
 
void Append (const Identifier &stringId, PopupMenuTableEntry::Type type, int id, const TranslatableString &string, wxCommandEventFunction memFn, const PopupMenuTableEntry::InitFunction &init)
 
void AppendItem (const Identifier &stringId, int id, const TranslatableString &string, wxCommandEventFunction memFn, const PopupMenuTableEntry::InitFunction &init={})
 
void AppendRadioItem (const Identifier &stringId, int id, const TranslatableString &string, wxCommandEventFunction memFn, const PopupMenuTableEntry::InitFunction &init={})
 
void AppendCheckItem (const Identifier &stringId, int id, const TranslatableString &string, wxCommandEventFunction memFn, const PopupMenuTableEntry::InitFunction &init={})
 
void BeginSection (const Identifier &name)
 
void EndSection ()
 
- Static Protected Member Functions inherited from PopupMenuTable
static TranslatableString MakeLabel (const TranslatableString &label, bool useExtra, const TranslatableString &extra)
 
- Protected Attributes inherited from PopupMenuTable
std::shared_ptr< PopupSubMenumTop
 
std::vector< PopupMenuGroupItem * > mStack
 
Identifier mId
 
TranslatableString mCaption
 
std::unique_ptr< PopupMenuGroupItemmRegistry
 

Detailed Description

Definition at line 75 of file NoteTrackControls.cpp.

Constructor & Destructor Documentation

◆ NoteTrackMenuTable()

NoteTrackMenuTable::NoteTrackMenuTable ( )
inlineprivate

Definition at line 77 of file NoteTrackControls.cpp.

78 : PopupMenuTable{ "NoteTrack" }
79 {}

Member Function Documentation

◆ DECLARE_POPUP_MENU()

NoteTrackMenuTable::DECLARE_POPUP_MENU ( NoteTrackMenuTable  )
private

◆ InitUserData()

void NoteTrackMenuTable::InitUserData ( void *  pUserData)
inlineoverrideprivatevirtual

Called before the menu items are appended.

Store context data, if needed. May be called more than once before the menu opens. Pointer remains valid for the duration of any callback, if PopupMenuTable::BuildMenu() is called and the result's Popup() is called before any other menus are built.

Implements PopupMenuHandler.

Definition at line 86 of file NoteTrackControls.cpp.

87 {
88 mpData = static_cast<NoteTrackControlsBase::InitMenuData*>(pUserData);
89 }
NoteTrackControlsBase::InitMenuData * mpData

References mpData.

◆ Instance()

NoteTrackMenuTable & NoteTrackMenuTable::Instance ( )
static

Definition at line 96 of file NoteTrackControls.cpp.

97{
98 static NoteTrackMenuTable instance;
99 return instance;
100}

Referenced by NoteTrackControls::GetMenuExtension().

Here is the caller graph for this function:

◆ OnChangeOctave()

void NoteTrackMenuTable::OnChangeOctave ( wxCommandEvent &  event)
private

Scrolls the note track up or down by an octave.

Definition at line 108 of file NoteTrackControls.cpp.

109{
110 NoteTrack *const pTrack = static_cast<NoteTrack*>(mpData->pTrack);
111
112 wxASSERT(event.GetId() == OnUpOctaveID
113 || event.GetId() == OnDownOctaveID);
114
115 const bool bDown = (OnDownOctaveID == event.GetId());
116 NoteTrackRange::Get(*pTrack).ShiftNoteRange((bDown) ? -12 : 12);
117
120 .ModifyState(false);
122}
@ OnUpOctaveID
@ OnDownOctaveID
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:86
static NoteTrackRange & Get(const NoteTrack &track)
Allow mutative access to attached data of a const track.
void ShiftNoteRange(int offset)
Shifts all notes vertically by the given pitch.
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)

References ProjectHistory::Get(), NoteTrackRange::Get(), ProjectHistory::ModifyState(), mpData, OnDownOctaveID, OnUpOctaveID, project, CommonTrackControls::InitMenuData::project, CommonTrackControls::InitMenuData::pTrack, RefreshCode::RefreshAll, CommonTrackControls::InitMenuData::result, and NoteTrackRange::ShiftNoteRange().

Here is the call graph for this function:

Member Data Documentation

◆ mpData

NoteTrackControlsBase::InitMenuData* NoteTrackMenuTable::mpData {}
private

Definition at line 91 of file NoteTrackControls.cpp.

Referenced by InitUserData(), and OnChangeOctave().


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