![]() |
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 *pTrack, double rate) |
void | OnRateChange (wxCommandEvent &event) |
void | OnRateOther (wxCommandEvent &event) |
![]() | |
PopupMenuTable (const Identifier &id, const TranslatableString &caption={}) | |
const Identifier & | Id () const |
const TranslatableString & | Caption () const |
const Registry::GroupItem * | GetRegistry () const |
const std::shared_ptr< Registry::GroupItem > & | Get (void *pUserData) |
void | Clear () |
![]() | |
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 std::unique_ptr< PopupMenu > | BuildMenu (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) |
Public Attributes | |
PlayableTrackControls::InitMenuData * | mpData {} |
Additional Inherited Members | |
![]() | |
using | Entry = PopupMenuTableEntry |
![]() | |
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 TranslatableString | MakeLabel (const TranslatableString &label, bool useExtra, const TranslatableString &extra) |
![]() | |
std::shared_ptr< Registry::GroupItem > | mTop |
std::vector< Registry::GroupItem * > | mStack |
Identifier | mId |
TranslatableString | mCaption |
std::unique_ptr< Registry::GroupItem > | mRegistry |
Definition at line 303 of file WaveTrackControls.cpp.
|
inline |
Definition at line 305 of file WaveTrackControls.cpp.
RateMenuTable::DECLARE_POPUP_MENU | ( | RateMenuTable | ) |
|
static |
Converts a sampling rate to a wxWidgets menu item id.
Definition at line 368 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 329 of file WaveTrackControls.cpp.
References mpData.
|
static |
Definition at line 323 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 396 of file WaveTrackControls.cpp.
References RefreshCode::FixScrollbars, gRates, mpData, OnRate384ID, OnRate8ID, CommonTrackControls::InitMenuData::pTrack, RefreshCode::RefreshAll, CommonTrackControls::InitMenuData::result, and SetRate().
void RateMenuTable::OnRateOther | ( | wxCommandEvent & | event | ) |
Definition at line 408 of file WaveTrackControls.cpp.
References AudacityMessageBox(), eIsCreating, RefreshCode::FixScrollbars, lrint, mpData, CommonTrackControls::InitMenuData::pParent, CommonTrackControls::InitMenuData::pTrack, RefreshCode::RefreshAll, CommonTrackControls::InitMenuData::result, S, wxDialogWrapper::SetName(), SetRate(), wxT(), XO(), and XXO().
void RateMenuTable::SetRate | ( | WaveTrack * | pTrack, |
double | rate | ||
) |
Sets the sample rate for a track, and if it is linked to another track, that one as well.
Definition at line 379 of file WaveTrackControls.cpp.
References TrackList::Channels(), ProjectHistory::Get(), Track::GetName(), mpData, CommonTrackControls::InitMenuData::project, ProjectHistory::PushState(), wxT(), and XO().
Referenced by OnRateChange(), and OnRateOther().
PlayableTrackControls::InitMenuData* RateMenuTable::mpData {} |
Definition at line 314 of file WaveTrackControls.cpp.
Referenced by InitUserData(), OnRateChange(), OnRateOther(), and SetRate().