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

#include <SpectrumVZoomHandle.h>

Inheritance diagram for SpectrumVRulerMenuTable:
[legend]
Collaboration diagram for SpectrumVRulerMenuTable:
[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 , typename Factory >
static auto Adapt (const Factory &factory)
 

Private Member Functions

 SpectrumVRulerMenuTable ()
 
virtual ~SpectrumVRulerMenuTable ()
 
 DECLARE_POPUP_MENU (SpectrumVRulerMenuTable)
 
void OnSpectrumScaleType (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 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 WaveTrackVRulerMenuTable
 WaveTrackVRulerMenuTable (const Identifier &id)
 
void InitUserData (void *pUserData) override
 Called before the menu items are appended. More...
 
void OnZoom (WaveChannelViewConstants::ZoomActions iZoomCode)
 
void OnZoomFitVertical (wxCommandEvent &)
 
void OnZoomReset (wxCommandEvent &)
 
void OnZoomHalfWave (wxCommandEvent &)
 
void OnZoomInVertical (wxCommandEvent &)
 
void OnZoomOutVertical (wxCommandEvent &)
 
void UpdatePrefs () override
 
- 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 WaveTrackVRulerMenuTable
InitMenuDatampData {}
 
- 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 78 of file SpectrumVZoomHandle.h.

Constructor & Destructor Documentation

◆ SpectrumVRulerMenuTable()

SpectrumVRulerMenuTable::SpectrumVRulerMenuTable ( )
inlineprivate

Definition at line 80 of file SpectrumVZoomHandle.h.

◆ ~SpectrumVRulerMenuTable()

virtual SpectrumVRulerMenuTable::~SpectrumVRulerMenuTable ( )
inlineprivatevirtual

Definition at line 83 of file SpectrumVZoomHandle.h.

83{}

Member Function Documentation

◆ DECLARE_POPUP_MENU()

SpectrumVRulerMenuTable::DECLARE_POPUP_MENU ( SpectrumVRulerMenuTable  )
private

◆ Instance()

PopupMenuTable & SpectrumVRulerMenuTable::Instance ( )
static

Definition at line 266 of file SpectrumVZoomHandle.cpp.

267{
268 static SpectrumVRulerMenuTable instance;
269 return instance;
270}

Referenced by SpectrumVZoomHandle::Release().

Here is the caller graph for this function:

◆ OnSpectrumScaleType()

void SpectrumVRulerMenuTable::OnSpectrumScaleType ( wxCommandEvent &  evt)
private

Definition at line 301 of file SpectrumVZoomHandle.cpp.

302{
303 WaveTrack *const wt = mpData->pTrack;
304
305 const SpectrogramSettings::ScaleType newScaleType =
307 std::max(0,
309 evt.GetId() - OnFirstSpectrumScaleID
310 )));
311 if (SpectrogramSettings::Get(*wt).scaleType != newScaleType) {
312 SpectrogramSettings::Own(*wt).scaleType = newScaleType;
313
315
316 using namespace RefreshCode;
318 }
319}
int min(int a, int b)
@ OnFirstSpectrumScaleID
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)
static SpectrogramSettings & Get(const WaveTrack &track)
Mutative access to attachment even if the track argument is const.
static SpectrogramSettings & Own(WaveTrack &track)
A Track that contains audio waveform data.
Definition: WaveTrack.h:227
Namespace containing an enum 'what to do on a refresh?'.
Definition: RefreshCode.h:16

References ProjectHistory::Get(), SpectrogramSettings::Get(), min(), ProjectHistory::ModifyState(), OnFirstSpectrumScaleID, SpectrogramSettings::Own(), RefreshCode::RefreshAll, SpectrogramSettings::scaleType, SpectrogramSettings::stNumScaleTypes, and RefreshCode::UpdateVRuler.

Here is the call graph for this function:

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