From 7b9040c7e2236a71e4b0e2dfc3c1c5d14a3c9cef Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sat, 30 May 2020 16:00:24 -0500 Subject: [PATCH] Rename TimerToolBar to TimeToolBar --- src/CMakeLists.txt | 4 +- src/ProjectManager.cpp | 4 +- src/ProjectSelectionManager.cpp | 4 +- src/ProjectSelectionManager.h | 2 +- src/toolbars/SelectionBarListener.h | 6 +-- .../{TimerToolBar.cpp => TimeToolBar.cpp} | 48 +++++++++---------- .../{TimerToolBar.h => TimeToolBar.h} | 20 ++++---- 7 files changed, 44 insertions(+), 44 deletions(-) rename src/toolbars/{TimerToolBar.cpp => TimeToolBar.cpp} (89%) rename src/toolbars/{TimerToolBar.h => TimeToolBar.h} (76%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index db4834edb..93dc50c82 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -791,8 +791,8 @@ list( APPEND SOURCES toolbars/SpectralSelectionBar.cpp toolbars/SpectralSelectionBar.h toolbars/SpectralSelectionBarListener.h - toolbars/TimerToolBar.cpp - toolbars/TimerToolBar.h + toolbars/TimeToolBar.cpp + toolbars/TimeToolBar.h toolbars/ToolBar.cpp toolbars/ToolBar.h toolbars/ToolDock.cpp diff --git a/src/ProjectManager.cpp b/src/ProjectManager.cpp index b30f7a154..bd9747b02 100644 --- a/src/ProjectManager.cpp +++ b/src/ProjectManager.cpp @@ -45,7 +45,7 @@ Paul Licameli split from AudacityProject.cpp #include "toolbars/MixerToolBar.h" #include "toolbars/SelectionBar.h" #include "toolbars/SpectralSelectionBar.h" -#include "toolbars/TimerToolBar.h" +#include "toolbars/TimeToolBar.h" #include "toolbars/ToolManager.h" #include "widgets/AudacityMessageBox.h" #include "widgets/FileHistory.h" @@ -571,7 +571,7 @@ AudacityProject *ProjectManager::New() #ifdef EXPERIMENTAL_SPECTRAL_EDITING SpectralSelectionBar::Get( project ).SetListener( &projectSelectionManager ); #endif - TimerToolBar::Get( project ).SetListener( &projectSelectionManager ); + TimeToolBar::Get( project ).SetListener( &projectSelectionManager ); #if wxUSE_DRAG_AND_DROP // We can import now, so become a drag target diff --git a/src/ProjectSelectionManager.cpp b/src/ProjectSelectionManager.cpp index 03d9170a7..14f321c93 100644 --- a/src/ProjectSelectionManager.cpp +++ b/src/ProjectSelectionManager.cpp @@ -22,7 +22,7 @@ Paul Licameli split from ProjectManager.cpp #include "WaveTrack.h" #include "toolbars/SelectionBar.h" #include "toolbars/SpectralSelectionBar.h" -#include "toolbars/TimerToolBar.h" +#include "toolbars/TimeToolBar.h" static AudacityProject::AttachedObjects::RegisteredFactory sProjectSelectionManagerKey { @@ -167,7 +167,7 @@ void ProjectSelectionManager::TT_SetAudioTimeFormat( gPrefs->Write(wxT("/AudioTimeFormat"), format.Internal()); gPrefs->Flush(); - TimerToolBar::Get( project ).SetAudioTimeFormat(format); + TimeToolBar::Get( project ).SetAudioTimeFormat(format); } void ProjectSelectionManager::AS_ModifySelection( diff --git a/src/ProjectSelectionManager.h b/src/ProjectSelectionManager.h index 2dbce2f7c..0aad35ac0 100644 --- a/src/ProjectSelectionManager.h +++ b/src/ProjectSelectionManager.h @@ -21,7 +21,7 @@ class ProjectSelectionManager final : public ClientData::Base , public SelectionBarListener , public SpectralSelectionBarListener - , public TimerToolBarListener + , public TimeToolBarListener { public: static ProjectSelectionManager &Get( AudacityProject &project ); diff --git a/src/toolbars/SelectionBarListener.h b/src/toolbars/SelectionBarListener.h index 5b4006d16..82823b0f2 100644 --- a/src/toolbars/SelectionBarListener.h +++ b/src/toolbars/SelectionBarListener.h @@ -31,12 +31,12 @@ class AUDACITY_DLL_API SelectionBarListener /* not final */ { virtual void AS_ModifySelection(double &start, double &end, bool done) = 0; }; -class AUDACITY_DLL_API TimerToolBarListener /* not final */ { +class AUDACITY_DLL_API TimeToolBarListener /* not final */ { public: - TimerToolBarListener(){}; - virtual ~TimerToolBarListener(){}; + TimeToolBarListener(){}; + virtual ~TimeToolBarListener(){}; virtual const NumericFormatSymbol & TT_GetAudioTimeFormat() = 0; virtual void TT_SetAudioTimeFormat(const NumericFormatSymbol & format) = 0; diff --git a/src/toolbars/TimerToolBar.cpp b/src/toolbars/TimeToolBar.cpp similarity index 89% rename from src/toolbars/TimerToolBar.cpp rename to src/toolbars/TimeToolBar.cpp index c89257ec4..3d178bd13 100644 --- a/src/toolbars/TimerToolBar.cpp +++ b/src/toolbars/TimeToolBar.cpp @@ -23,7 +23,7 @@ #include #endif -#include "TimerToolBar.h" +#include "TimeToolBar.h" #include "ToolManager.h" #include "SelectionBarListener.h" @@ -31,7 +31,7 @@ #include "../ProjectAudioIO.h" #include "../ViewInfo.h" -IMPLEMENT_CLASS(TimerToolBar, ToolBar); +IMPLEMENT_CLASS(TimeToolBar, ToolBar); // Having a fixed ID for the Audio Position is helpful for // the Jaws screen reader script for Audacity. @@ -40,35 +40,35 @@ enum { AudioPositionID }; -BEGIN_EVENT_TABLE(TimerToolBar, ToolBar) - EVT_COMMAND(AudioPositionID, EVT_TIMETEXTCTRL_UPDATED, TimerToolBar::OnUpdate) - EVT_SIZE(TimerToolBar::OnSize) - EVT_IDLE(TimerToolBar::OnIdle) +BEGIN_EVENT_TABLE(TimeToolBar, ToolBar) + EVT_COMMAND(AudioPositionID, EVT_TIMETEXTCTRL_UPDATED, TimeToolBar::OnUpdate) + EVT_SIZE(TimeToolBar::OnSize) + EVT_IDLE(TimeToolBar::OnIdle) END_EVENT_TABLE() -TimerToolBar::TimerToolBar(AudacityProject &project) +TimeToolBar::TimeToolBar(AudacityProject &project) : ToolBar(project, TimeBarID, XO("Time"), wxT("Time"), true), mListener(NULL), mAudioTime(NULL) { } -TimerToolBar::~TimerToolBar() +TimeToolBar::~TimeToolBar() { } -TimerToolBar &TimerToolBar::Get(AudacityProject &project) +TimeToolBar &TimeToolBar::Get(AudacityProject &project) { auto &toolManager = ToolManager::Get(project); - return *static_cast(toolManager.GetToolBar(TimeBarID)); + return *static_cast(toolManager.GetToolBar(TimeBarID)); } -const TimerToolBar &TimerToolBar::Get(const AudacityProject &project) +const TimeToolBar &TimeToolBar::Get(const AudacityProject &project) { return Get(const_cast(project)) ; } -void TimerToolBar::Populate() +void TimeToolBar::Populate() { // Get the default sample rate auto rate = gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), @@ -98,7 +98,7 @@ void TimerToolBar::Populate() // SetResizingLimits(); } -void TimerToolBar::UpdatePrefs() +void TimeToolBar::UpdatePrefs() { // Since the language may have changed, we need to force an update to accommodate // different length text @@ -113,7 +113,7 @@ void TimerToolBar::UpdatePrefs() ToolBar::UpdatePrefs(); } -void TimerToolBar::SetToDefaultSize() +void TimeToolBar::SetToDefaultSize() { // Reset SetMaxSize(wxDefaultSize); @@ -129,7 +129,7 @@ void TimerToolBar::SetToDefaultSize() Updated(); } -wxSize TimerToolBar::GetDockedSize() +wxSize TimeToolBar::GetDockedSize() { wxSize sz = GetSize(); @@ -145,7 +145,7 @@ wxSize TimerToolBar::GetDockedSize() return sz; } -void TimerToolBar::SetDocked(ToolDock *dock, bool pushed) +void TimeToolBar::SetDocked(ToolDock *dock, bool pushed) { // It's important to call this FIRST since it unhides the resizer control. // Not doing so causes the calculated best size to be off by the width @@ -170,7 +170,7 @@ void TimerToolBar::SetDocked(ToolDock *dock, bool pushed) } } -void TimerToolBar::SetListener(TimerToolBarListener *l) +void TimeToolBar::SetListener(TimeToolBarListener *l) { // Remember the listener mListener = l; @@ -187,7 +187,7 @@ void TimerToolBar::SetListener(TimerToolBarListener *l) } } -void TimerToolBar::SetAudioTimeFormat(const NumericFormatSymbol & format) +void TimeToolBar::SetAudioTimeFormat(const NumericFormatSymbol & format) { // Set the format if it's different from previous if (mAudioTime->SetFormatString(mAudioTime->GetBuiltinFormat(format))) { @@ -200,7 +200,7 @@ void TimerToolBar::SetAudioTimeFormat(const NumericFormatSymbol & format) // The intention of this is to get the resize handle in the // correct position, after we've let go in dragging. -void TimerToolBar::ResizingDone() +void TimeToolBar::ResizingDone() { // Fit() while retaining height SetSize(GetBestSize().x, GetSize().y); @@ -209,7 +209,7 @@ void TimerToolBar::ResizingDone() Updated(); } -void TimerToolBar::SetResizingLimits() +void TimeToolBar::SetResizingLimits() { // Reset limits SetMinSize(wxDefaultSize); @@ -259,7 +259,7 @@ void TimerToolBar::SetResizingLimits() // Called when the format drop downs is changed. // This causes recreation of the toolbar contents. -void TimerToolBar::OnUpdate(wxCommandEvent &evt) +void TimeToolBar::OnUpdate(wxCommandEvent &evt) { evt.Skip(false); @@ -292,7 +292,7 @@ void TimerToolBar::OnUpdate(wxCommandEvent &evt) Updated(); } -void TimerToolBar::OnSize(wxSizeEvent &evt) +void TimeToolBar::OnSize(wxSizeEvent &evt) { evt.Skip(); @@ -338,7 +338,7 @@ void TimerToolBar::OnSize(wxSizeEvent &evt) Update(); } -void TimerToolBar::OnIdle(wxIdleEvent &evt) +void TimeToolBar::OnIdle(wxIdleEvent &evt) { evt.Skip(); @@ -362,7 +362,7 @@ static RegisteredToolbarFactory factory TimeBarID, []( AudacityProject &project ) { - return ToolBar::Holder{ safenew TimerToolBar{ project } }; + return ToolBar::Holder{ safenew TimeToolBar{ project } }; } }; diff --git a/src/toolbars/TimerToolBar.h b/src/toolbars/TimeToolBar.h similarity index 76% rename from src/toolbars/TimerToolBar.h rename to src/toolbars/TimeToolBar.h index 4257f85d3..25915acf0 100644 --- a/src/toolbars/TimerToolBar.h +++ b/src/toolbars/TimeToolBar.h @@ -17,16 +17,16 @@ #include "../widgets/NumericTextCtrl.h" class NumericTextCtrl; -class TimerToolBarListener; +class TimeToolBarListener; -class TimerToolBar final : public ToolBar +class TimeToolBar final : public ToolBar { public: - TimerToolBar(AudacityProject &project); - virtual ~TimerToolBar(); + TimeToolBar(AudacityProject &project); + virtual ~TimeToolBar(); - static TimerToolBar &Get(AudacityProject &project); - static const TimerToolBar &Get(const AudacityProject &project); + static TimeToolBar &Get(AudacityProject &project); + static const TimeToolBar &Get(const AudacityProject &project); void Populate() override; void Repaint(wxDC * WXUNUSED(dc)) override {}; @@ -38,7 +38,7 @@ public: void SetToDefaultSize() override; wxSize GetDockedSize() override; void SetDocked(ToolDock *dock, bool pushed) override; - void SetListener(TimerToolBarListener *l); + void SetListener(TimeToolBarListener *l); void SetAudioTimeFormat(const NumericFormatSymbol & format); void ResizingDone() override; @@ -50,7 +50,7 @@ private: void OnSize(wxSizeEvent &evt); void OnIdle(wxIdleEvent &evt); - TimerToolBarListener *mListener; + TimeToolBarListener *mListener; NumericTextCtrl *mAudioTime; float mDigitRatio; bool mSettingInitialSize; @@ -60,11 +60,11 @@ private: public: - DECLARE_CLASS(TimerToolBar) + DECLARE_CLASS(TimeToolBar) DECLARE_EVENT_TABLE() }; -inline wxSize TimerToolBar::ComputeSizing(int digitH) +inline wxSize TimeToolBar::ComputeSizing(int digitH) { return mAudioTime->ComputeSizing(false, digitH * mDigitRatio, digitH); }