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 , typename Factory >
static auto Adapt (const Factory &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
 
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 ()
 

Protected Attributes

InitMenuData * mpData {}
 
- Protected Attributes inherited from PopupMenuTable
std::shared_ptr< PopupSubMenumTop
 
std::vector< PopupMenuGroupItem * > mStack
 
Identifier mId
 
TranslatableString mCaption
 
std::unique_ptr< PopupMenuGroupItemmRegistry
 

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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
kZoomIn 
kZoomOut 
kZoomReset 
kZoomMax 
kUpOctave 
kDownOctave 

Definition at line 174 of file NoteTrackVZoomHandle.cpp.

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

Constructor & Destructor Documentation

◆ NoteTrackVRulerMenuTable()

NoteTrackVRulerMenuTable::NoteTrackVRulerMenuTable ( )
inlineprivate

Definition at line 164 of file NoteTrackVZoomHandle.cpp.

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

◆ ~NoteTrackVRulerMenuTable()

virtual NoteTrackVRulerMenuTable::~NoteTrackVRulerMenuTable ( )
inlineprivatevirtual

Definition at line 167 of file NoteTrackVZoomHandle.cpp.

167{}

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

216{
217 mpData = static_cast<InitMenuData*>(pUserData);
218}

References mpData.

◆ Instance()

NoteTrackVRulerMenuTable & NoteTrackVRulerMenuTable::Instance ( )
static

Definition at line 209 of file NoteTrackVZoomHandle.cpp.

210{
211 static NoteTrackVRulerMenuTable instance;
212 return instance;
213}

Referenced by NoteTrackVZoomHandle::Release().

Here is the caller graph for this function:

◆ OnDownOctave()

void NoteTrackVRulerMenuTable::OnDownOctave ( wxCommandEvent &  )
inlineprotected

Definition at line 197 of file NoteTrackVZoomHandle.cpp.

197{ OnZoom( kDownOctave );};

References kDownOctave, and OnZoom().

Here is the call graph for this function:

◆ OnUpOctave()

void NoteTrackVRulerMenuTable::OnUpOctave ( wxCommandEvent &  )
inlineprotected

Definition at line 196 of file NoteTrackVZoomHandle.cpp.

196{ OnZoom( kUpOctave );};

References kUpOctave, and OnZoom().

Here is the call graph for this function:

◆ OnZoom()

void NoteTrackVRulerMenuTable::OnZoom ( int  iZoomCode)
protected

Definition at line 220 of file NoteTrackVZoomHandle.cpp.

220 {
221 auto &data = NoteTrackRange::Get(*mpData->pTrack);
222 switch( iZoomCode ){
223 case kZoomReset:
224 data.ZoomAllNotes(&mpData->pTrack->GetSeq());
225 break;
226 case kZoomIn:
227 NoteTrackDisplayData{ *mpData->pTrack, mpData->rect }.ZoomIn(mpData->yy);
228 break;
229 case kZoomOut:
230 NoteTrackDisplayData{ *mpData->pTrack, mpData->rect }.ZoomOut(mpData->yy);
231 break;
232 case kZoomMax:
233 data.ZoomMaxExtent();
234 break;
235 case kUpOctave:
236 data.ShiftNoteRange(12);
237 break;
238 case kDownOctave:
239 data.ShiftNoteRange(-12);
240 break;
241 }
242 AudacityProject *const project = &mpData->project;
243 ProjectHistory::Get( *project ).ModifyState(false);
244 using namespace RefreshCode;
245 mpData->result = UpdateVRuler | RefreshAll;
246}
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
Temporary data used to display a note track.
static NoteTrackRange & Get(const NoteTrack &track)
Allow mutative access to attached data of a const track.
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(), NoteTrackRange::Get(), kDownOctave, kUpOctave, kZoomIn, kZoomMax, kZoomOut, kZoomReset, ProjectHistory::ModifyState(), mpData, project, 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 193 of file NoteTrackVZoomHandle.cpp.

193{ OnZoom( kZoomIn );};

References kZoomIn, and OnZoom().

Here is the call graph for this function:

◆ OnZoomMax()

void NoteTrackVRulerMenuTable::OnZoomMax ( wxCommandEvent &  )
inlineprotected

Definition at line 195 of file NoteTrackVZoomHandle.cpp.

195{ OnZoom( kZoomMax );};

References kZoomMax, and OnZoom().

Here is the call graph for this function:

◆ OnZoomOutVertical()

void NoteTrackVRulerMenuTable::OnZoomOutVertical ( wxCommandEvent &  )
inlineprotected

Definition at line 194 of file NoteTrackVZoomHandle.cpp.

194{ OnZoom( kZoomOut );};

References kZoomOut, and OnZoom().

Here is the call graph for this function:

◆ OnZoomReset()

void NoteTrackVRulerMenuTable::OnZoomReset ( wxCommandEvent &  )
inlineprotected

Definition at line 191 of file NoteTrackVZoomHandle.cpp.

191{ OnZoom( kZoomReset );};

References kZoomReset, and OnZoom().

Here is the call graph for this function:

◆ UpdatePrefs()

void NoteTrackVRulerMenuTable::UpdatePrefs ( )
inlineoverrideprivatevirtual

Implements PrefsListener.

Definition at line 202 of file NoteTrackVZoomHandle.cpp.

203 {
204 // Because labels depend on advanced vertical zoom setting
206 }

References PopupMenuTable::Clear().

Here is the call graph for this function:

Member Data Documentation

◆ mpData

InitMenuData* NoteTrackVRulerMenuTable::mpData {}
protected

Definition at line 188 of file NoteTrackVZoomHandle.cpp.

Referenced by InitUserData(), and OnZoom().


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