Audacity 3.2.0
Static Public Member Functions | Private Member Functions | List of all members
WaveformVRulerMenuTable Class Reference

#include <WaveformVZoomHandle.h>

Inheritance diagram for WaveformVRulerMenuTable:
[legend]
Collaboration diagram for WaveformVRulerMenuTable:
[legend]

Static Public Member Functions

static PopupMenuTableInstance ()
 
- 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)
 

Private Member Functions

 WaveformVRulerMenuTable ()
 
virtual ~WaveformVRulerMenuTable ()
 
 DECLARE_POPUP_MENU (WaveformVRulerMenuTable)
 
void OnWaveformScaleType (wxCommandEvent &evt)
 

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::GroupItemBaseGetRegistry () const
 
const std::shared_ptr< Registry::GroupItemBase > & 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 WaveTrackVRulerMenuTable
 WaveTrackVRulerMenuTable (const Identifier &id)
 
void InitUserData (void *pUserData) override
 Called before the menu items are appended. More...
 
void OnZoom (WaveTrackViewConstants::ZoomActions iZoomCode)
 
void OnZoomFitVertical (wxCommandEvent &)
 
void OnZoomReset (wxCommandEvent &)
 
void OnZoomDiv2Vertical (wxCommandEvent &)
 
void OnZoomTimes2Vertical (wxCommandEvent &)
 
void OnZoomHalfWave (wxCommandEvent &)
 
void OnZoomInVertical (wxCommandEvent &)
 
void OnZoomOutVertical (wxCommandEvent &)
 
void UpdatePrefs () override
 
- 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 ()
 
- Static Protected Member Functions inherited from PopupMenuTable
static TranslatableString MakeLabel (const TranslatableString &label, bool useExtra, const TranslatableString &extra)
 
- Protected Attributes inherited from WaveTrackVRulerMenuTable
InitMenuDatampData {}
 
- Protected Attributes inherited from PopupMenuTable
std::shared_ptr< Registry::GroupItemBasemTop
 
std::vector< Registry::GroupItemBase * > mStack
 
Identifier mId
 
TranslatableString mCaption
 
std::unique_ptr< Registry::GroupItemBasemRegistry
 

Detailed Description

Definition at line 78 of file WaveformVZoomHandle.h.

Constructor & Destructor Documentation

◆ WaveformVRulerMenuTable()

WaveformVRulerMenuTable::WaveformVRulerMenuTable ( )
inlineprivate

Definition at line 80 of file WaveformVZoomHandle.h.

◆ ~WaveformVRulerMenuTable()

virtual WaveformVRulerMenuTable::~WaveformVRulerMenuTable ( )
inlineprivatevirtual

Definition at line 83 of file WaveformVZoomHandle.h.

83{}

Member Function Documentation

◆ DECLARE_POPUP_MENU()

WaveformVRulerMenuTable::DECLARE_POPUP_MENU ( WaveformVRulerMenuTable  )
private

◆ Instance()

PopupMenuTable & WaveformVRulerMenuTable::Instance ( )
static

Definition at line 264 of file WaveformVZoomHandle.cpp.

265{
266 static WaveformVRulerMenuTable instance;
267 return instance;
268}

Referenced by WaveformVZoomHandle::Release().

Here is the caller graph for this function:

◆ OnWaveformScaleType()

void WaveformVRulerMenuTable::OnWaveformScaleType ( wxCommandEvent &  evt)
private

Definition at line 322 of file WaveformVZoomHandle.cpp.

323{
324 WaveTrack *const wt = mpData->pTrack;
325 // Assume linked track is wave or null
326 const WaveformSettings::ScaleType newScaleType =
328 std::max(0,
330 evt.GetId() - OnFirstWaveformScaleID
331 )));
332
333 if (WaveformSettings::Get(*wt).scaleType != newScaleType) {
334 WaveformSettings::Get(*wt).scaleType = newScaleType;
335
336 AudacityProject *const project = &mpData->project;
337 ProjectHistory::Get( *project ).ModifyState(true);
338
339 using namespace RefreshCode;
341 }
342}
int min(int a, int b)
@ OnFirstWaveformScaleID
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)
A Track that contains audio waveform data.
Definition: WaveTrack.h:51
static WaveformSettings & Get(const WaveTrack &track)
Namespace containing an enum 'what to do on a refresh?'.
Definition: RefreshCode.h:16

References ProjectHistory::Get(), WaveformSettings::Get(), min(), ProjectHistory::ModifyState(), OnFirstWaveformScaleID, RefreshCode::RefreshAll, WaveformSettings::scaleType, WaveformSettings::stNumScaleTypes, and RefreshCode::UpdateVRuler.

Here is the call graph for this function:

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