1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 00:20:06 +02:00

Rename TimerToolBar to TimeToolBar

This commit is contained in:
Leland Lucius 2020-05-30 16:00:24 -05:00
parent 56e78922ae
commit 7b9040c7e2
7 changed files with 44 additions and 44 deletions

View File

@ -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

View File

@ -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

View File

@ -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(

View File

@ -21,7 +21,7 @@ class ProjectSelectionManager final
: public ClientData::Base
, public SelectionBarListener
, public SpectralSelectionBarListener
, public TimerToolBarListener
, public TimeToolBarListener
{
public:
static ProjectSelectionManager &Get( AudacityProject &project );

View File

@ -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;

View File

@ -23,7 +23,7 @@
#include <wx/sizer.h>
#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<TimerToolBar*>(toolManager.GetToolBar(TimeBarID));
return *static_cast<TimeToolBar*>(toolManager.GetToolBar(TimeBarID));
}
const TimerToolBar &TimerToolBar::Get(const AudacityProject &project)
const TimeToolBar &TimeToolBar::Get(const AudacityProject &project)
{
return Get(const_cast<AudacityProject&>(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 } };
}
};

View File

@ -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);
}