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

Static Public Member Functions

static NoteTrackVRulerMenuTableInstance ()
 
- 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 >
static Registry::BaseItemPtr Computed (const std::function< Registry::BaseItemPtr(Table &) > &factory)
 

Protected Types

enum  {
  kZoomIn = 6 , kZoomOut = 7 , kZoomReset = 8 , kZoomMax = 9 ,
  kUpOctave = 10 , kDownOctave = 11
}
 

Protected Member Functions

void OnZoom (int iZoomCode)
 
void OnZoomReset (wxCommandEvent &)
 
void OnZoomInVertical (wxCommandEvent &)
 
void OnZoomOutVertical (wxCommandEvent &)
 
void OnZoomMax (wxCommandEvent &)
 
void OnUpOctave (wxCommandEvent &)
 
void OnDownOctave (wxCommandEvent &)
 
- Protected Member Functions inherited from PopupMenuTable
virtual void Populate ()=0
 
void Append (Registry::BaseItemPtr 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 ()
 

Protected Attributes

InitMenuData * mpData {}
 
- Protected Attributes inherited from PopupMenuTable
std::shared_ptr< Registry::GroupItemmTop
 
std::vector< Registry::GroupItem * > mStack
 
Identifier mId
 
TranslatableString mCaption
 
std::unique_ptr< Registry::GroupItemmRegistry
 

Private Member Functions

 NoteTrackVRulerMenuTable ()
 
virtual ~NoteTrackVRulerMenuTable ()
 
 DECLARE_POPUP_MENU (NoteTrackVRulerMenuTable)
 
void InitUserData (void *pUserData) override
 Called before the menu items are appended. More...
 
void UpdatePrefs () override
 
- Private Member Functions inherited from PrefsListener
 PrefsListener ()
 
virtual ~PrefsListener ()
 
virtual void UpdatePrefs ()=0
 
virtual void UpdateSelectedPrefs (int id)
 

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 Registry::GroupItemGetRegistry () const
 
const std::shared_ptr< Registry::GroupItem > & 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...
 
- Static Protected Member Functions inherited from PopupMenuTable
static TranslatableString MakeLabel (const TranslatableString &label, bool useExtra, const TranslatableString &extra)
 
- Static Private Member Functions inherited from PrefsListener
static void Broadcast (int id=0)
 Call this static function to notify all PrefsListener objects. More...
 

Detailed Description

Definition at line 161 of file NoteTrackVZoomHandle.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
kZoomIn 
kZoomOut 
kZoomReset 
kZoomMax 
kUpOctave 
kDownOctave 

Definition at line 175 of file NoteTrackVZoomHandle.cpp.

175 {
176// Note that these can be with or without spectrum view which
177// adds a constant.
178//const int kZoom1to1 = 1;
179//const int kZoomTimes2 = 2;
180//const int kZoomDiv2 = 3;
181//const int kZoomHalfWave = 4;
182//const int kZoomInByDrag = 5;
183 kZoomIn = 6,
184 kZoomOut = 7,
185 kZoomReset = 8,
186 kZoomMax = 9,
187 kUpOctave = 10,
188 kDownOctave = 11,
189 };

Constructor & Destructor Documentation

◆ NoteTrackVRulerMenuTable()

NoteTrackVRulerMenuTable::NoteTrackVRulerMenuTable ( )
inlineprivate

Definition at line 165 of file NoteTrackVZoomHandle.cpp.

166 : PopupMenuTable{ "NoteTrackVRuler" }
167 {};

◆ ~NoteTrackVRulerMenuTable()

virtual NoteTrackVRulerMenuTable::~NoteTrackVRulerMenuTable ( )
inlineprivatevirtual

Definition at line 168 of file NoteTrackVZoomHandle.cpp.

168{}

Member Function Documentation

◆ DECLARE_POPUP_MENU()

NoteTrackVRulerMenuTable::DECLARE_POPUP_MENU ( NoteTrackVRulerMenuTable  )
private

◆ InitUserData()

void NoteTrackVRulerMenuTable::InitUserData ( void *  pUserData)
overrideprivatevirtual

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 220 of file NoteTrackVZoomHandle.cpp.

221{
222 mpData = static_cast<InitMenuData*>(pUserData);
223}

References mpData.

◆ Instance()

NoteTrackVRulerMenuTable & NoteTrackVRulerMenuTable::Instance ( )
static

Definition at line 214 of file NoteTrackVZoomHandle.cpp.

215{
216 static NoteTrackVRulerMenuTable instance;
217 return instance;
218}

Referenced by NoteTrackVZoomHandle::Release().

Here is the caller graph for this function:

◆ OnDownOctave()

void NoteTrackVRulerMenuTable::OnDownOctave ( wxCommandEvent &  )
inlineprotected

Definition at line 202 of file NoteTrackVZoomHandle.cpp.

202{ OnZoom( kDownOctave );};

References kDownOctave, and OnZoom().

Here is the call graph for this function:

◆ OnUpOctave()

void NoteTrackVRulerMenuTable::OnUpOctave ( wxCommandEvent &  )
inlineprotected

Definition at line 201 of file NoteTrackVZoomHandle.cpp.

201{ OnZoom( kUpOctave );};

References kUpOctave, and OnZoom().

Here is the call graph for this function:

◆ OnZoom()

void NoteTrackVRulerMenuTable::OnZoom ( int  iZoomCode)
protected

Definition at line 225 of file NoteTrackVZoomHandle.cpp.

225 {
226 switch( iZoomCode ){
227 case kZoomReset:
228 mpData->pTrack->ZoomAllNotes();
229 break;
230 case kZoomIn:
231 mpData->pTrack->ZoomIn(mpData->rect, mpData->yy);
232 break;
233 case kZoomOut:
234 mpData->pTrack->ZoomOut(mpData->rect, mpData->yy);
235 break;
236 case kZoomMax:
237 mpData->pTrack->ZoomMaxExtent();
238 break;
239 case kUpOctave:
240 mpData->pTrack->ShiftNoteRange(12);
241 break;
242 case kDownOctave:
243 mpData->pTrack->ShiftNoteRange(-12);
244 break;
245 }
246 AudacityProject *const project = &mpData->project;
247 ProjectHistory::Get( *project ).ModifyState(false);
248 using namespace RefreshCode;
249 mpData->result = UpdateVRuler | RefreshAll;
250}
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)
Namespace containing an enum 'what to do on a refresh?'.
Definition: RefreshCode.h:16

References ProjectHistory::Get(), kDownOctave, kUpOctave, kZoomIn, kZoomMax, kZoomOut, kZoomReset, ProjectHistory::ModifyState(), mpData, RefreshCode::RefreshAll, and RefreshCode::UpdateVRuler.

Referenced by OnDownOctave(), OnUpOctave(), OnZoomInVertical(), OnZoomMax(), OnZoomOutVertical(), and OnZoomReset().

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

◆ OnZoomInVertical()

void NoteTrackVRulerMenuTable::OnZoomInVertical ( wxCommandEvent &  )
inlineprotected

Definition at line 198 of file NoteTrackVZoomHandle.cpp.

198{ OnZoom( kZoomIn );};

References kZoomIn, and OnZoom().

Here is the call graph for this function:

◆ OnZoomMax()

void NoteTrackVRulerMenuTable::OnZoomMax ( wxCommandEvent &  )
inlineprotected

Definition at line 200 of file NoteTrackVZoomHandle.cpp.

200{ OnZoom( kZoomMax );};

References kZoomMax, and OnZoom().

Here is the call graph for this function:

◆ OnZoomOutVertical()

void NoteTrackVRulerMenuTable::OnZoomOutVertical ( wxCommandEvent &  )
inlineprotected

Definition at line 199 of file NoteTrackVZoomHandle.cpp.

199{ OnZoom( kZoomOut );};

References kZoomOut, and OnZoom().

Here is the call graph for this function:

◆ OnZoomReset()

void NoteTrackVRulerMenuTable::OnZoomReset ( wxCommandEvent &  )
inlineprotected

Definition at line 194 of file NoteTrackVZoomHandle.cpp.

194{ OnZoom( kZoomReset );};

References kZoomReset, and OnZoom().

Here is the call graph for this function:

◆ UpdatePrefs()

void NoteTrackVRulerMenuTable::UpdatePrefs ( )
inlineoverrideprivatevirtual

Implements PrefsListener.

Definition at line 207 of file NoteTrackVZoomHandle.cpp.

208 {
209 // Because labels depend on advanced vertical zoom setting
211 }

References PopupMenuTable::Clear().

Here is the call graph for this function:

Member Data Documentation

◆ mpData

InitMenuData* NoteTrackVRulerMenuTable::mpData {}
protected

Definition at line 191 of file NoteTrackVZoomHandle.cpp.

Referenced by InitUserData(), and OnZoom().


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