Audacity 3.2.0
|
Public Member Functions | |
RateMenuTable () | |
DECLARE_POPUP_MENU (RateMenuTable) | |
void | InitUserData (void *pUserData) override |
Called before the menu items are appended. More... | |
void | SetRate (WaveTrack &track, double rate) |
Sets the sample rate for a track. More... | |
void | OnRateChange (wxCommandEvent &event) |
void | OnRateOther (wxCommandEvent &event) |
Public Member Functions inherited from PopupMenuTable | |
PopupMenuTable (const Identifier &id, const TranslatableString &caption={}) | |
const Identifier & | Id () const |
const TranslatableString & | Caption () const |
const auto * | GetRegistry () const |
const auto & | Get (void *pUserData) |
void | Clear () |
Public Member Functions inherited from PopupMenuHandler | |
PopupMenuHandler ()=default | |
PopupMenuHandler (const PopupMenuHandler &)=delete | |
PopupMenuHandler & | operator= (const PopupMenuHandler &)=delete |
virtual void | InitUserData (void *pUserData)=0 |
Called before the menu items are appended. More... | |
Static Public Member Functions | |
static RateMenuTable & | Instance () |
static int | IdOfRate (int rate) |
Converts a sampling rate to a wxWidgets menu item id. More... | |
Static Public Member Functions inherited from PopupMenuTable | |
static std::unique_ptr< PopupMenu > | BuildMenu (PopupMenuTable *pTable, void *pUserData=NULL) |
static void | ExtendMenu (PopupMenu &menu, PopupMenuTable &otherTable) |
template<typename Table , typename Factory > | |
static auto | Adapt (const Factory &factory) |
Public Attributes | |
PlayableTrackControls::InitMenuData * | mpData {} |
Additional Inherited Members | |
Public Types inherited from PopupMenuTable | |
using | Entry = PopupMenuTableEntry |
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< PopupSubMenu > | mTop |
std::vector< PopupMenuGroupItem * > | mStack |
Identifier | mId |
TranslatableString | mCaption |
std::unique_ptr< PopupMenuGroupItem > | mRegistry |
Definition at line 304 of file WaveTrackControls.cpp.
|
inline |
Definition at line 306 of file WaveTrackControls.cpp.
RateMenuTable::DECLARE_POPUP_MENU | ( | RateMenuTable | ) |
|
static |
Converts a sampling rate to a wxWidgets menu item id.
Definition at line 370 of file WaveTrackControls.cpp.
References gRates, nRates, OnRate8ID, and OnRateOtherID.
|
overridevirtual |
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 331 of file WaveTrackControls.cpp.
References mpData.
|
static |
Definition at line 325 of file WaveTrackControls.cpp.
void RateMenuTable::OnRateChange | ( | wxCommandEvent & | event | ) |
This method handles the selection from the Rate submenu of the track menu, except for "Other" (/see OnRateOther).
Definition at line 403 of file WaveTrackControls.cpp.
References RefreshCode::FixScrollbars, gRates, mpData, OnRate384ID, OnRate8ID, RefreshCode::RefreshAll, CommonTrackControls::InitMenuData::result, SetRate(), and CommonTrackControls::InitMenuData::track.
void RateMenuTable::OnRateOther | ( | wxCommandEvent & | event | ) |
Definition at line 415 of file WaveTrackControls.cpp.
References AudacityMessageBox(), eIsCreating, RefreshCode::FixScrollbars, WaveTrack::GetRate(), lrint, mpData, CommonTrackControls::InitMenuData::pParent, RefreshCode::RefreshAll, CommonTrackControls::InitMenuData::result, S, wxDialogWrapper::SetName(), SetRate(), CommonTrackControls::InitMenuData::track, wxT(), XO(), and XXO().
void RateMenuTable::SetRate | ( | WaveTrack & | track, |
double | rate | ||
) |
Sets the sample rate for a track.
Definition at line 379 of file WaveTrackControls.cpp.
References ProjectHistory::Get(), SyncLockState::Get(), WaveTrack::GetEndTime(), Track::GetName(), SyncLock::Group(), SyncLockState::IsSyncLocked(), mpData, project, CommonTrackControls::InitMenuData::project, ProjectHistory::PushState(), WaveTrack::SetRate(), wxT(), and XO().
Referenced by OnRateChange(), and OnRateOther().
PlayableTrackControls::InitMenuData* RateMenuTable::mpData {} |
Definition at line 315 of file WaveTrackControls.cpp.
Referenced by InitUserData(), OnRateChange(), OnRateOther(), and SetRate().