1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-06 17:13:49 +01:00

Type aliases for some uses of ComponentInterfaceSymbol...

... to be replaced later with distinct types

Also changing FamilyId => Family in function names

Also NumericFormatId => NumericFormatSymbol
This commit is contained in:
Paul Licameli
2019-02-28 13:16:09 -05:00
parent cc92c7605e
commit dfeb7e18aa
71 changed files with 231 additions and 226 deletions

View File

@@ -145,7 +145,7 @@ auStaticText * SelectionBar::AddTitle( const wxString & Title, wxSizer * pSizer
NumericTextCtrl * SelectionBar::AddTime( const wxString Name, int id, wxSizer * pSizer ){
auto formatName = mListener ? mListener->AS_GetSelectionFormat()
: NumericFormatId{};
: NumericFormatSymbol{};
auto pCtrl = safenew NumericTextCtrl(
this, id, NumericConverter::TIME, formatName, 0.0, mRate);
pCtrl->SetName(Name);
@@ -375,7 +375,7 @@ void SelectionBar::RegenerateTooltips()
auto formatName =
mListener
? mListener->AS_GetSelectionFormat()
: NumericFormatId{};
: NumericFormatSymbol{};
mSnapTo->SetToolTip(
wxString::Format(
_("Snap Clicks/Selections to %s"), formatName.Translation() ));
@@ -649,7 +649,7 @@ void SelectionBar::SetSnapTo(int snap)
mSnapTo->SetSelection(snap);
}
void SelectionBar::SetSelectionFormat(const NumericFormatId & format)
void SelectionBar::SetSelectionFormat(const NumericFormatSymbol & format)
{
mStartTime->SetFormatString(mStartTime->GetBuiltinFormat(format));

View File

@@ -39,8 +39,6 @@ class wxStaticText;
class SelectionBarListener;
class NumericTextCtrl;
using NumericFormatId = ComponentInterfaceSymbol;
class SelectionBar final : public ToolBar {
public:
@@ -56,7 +54,7 @@ class SelectionBar final : public ToolBar {
void SetTimes(double start, double end, double audio);
void SetSnapTo(int);
void SetSelectionFormat(const NumericFormatId & format);
void SetSelectionFormat(const NumericFormatSymbol & format);
void SetRate(double rate);
void SetListener(SelectionBarListener *l);
void RegenerateTooltips() override;

View File

@@ -11,8 +11,8 @@
#ifndef __AUDACITY_SELECTION_BAR_LISTENER__
#define __AUDACITY_SELECTION_BAR_LISTENER__
class ComponentInterfaceSymbol;
using NumericFormatId = ComponentInterfaceSymbol;
#include "audacity/Types.h"
class SelectedRegion;
class AUDACITY_DLL_API SelectionBarListener /* not final */ {
@@ -26,8 +26,8 @@ class AUDACITY_DLL_API SelectionBarListener /* not final */ {
virtual void AS_SetRate(double rate) = 0;
virtual int AS_GetSnapTo() = 0;
virtual void AS_SetSnapTo(int snap) = 0;
virtual const NumericFormatId & AS_GetSelectionFormat() = 0;
virtual void AS_SetSelectionFormat(const NumericFormatId & format) = 0;
virtual const NumericFormatSymbol & AS_GetSelectionFormat() = 0;
virtual void AS_SetSelectionFormat(const NumericFormatSymbol & format) = 0;
virtual void AS_ModifySelection(double &start, double &end, bool done) = 0;
};

View File

@@ -132,10 +132,10 @@ void SpectralSelectionBar::Populate()
auto frequencyFormatName = mListener
? mListener->SSBL_GetFrequencySelectionFormatName()
: NumericFormatId{};
: NumericFormatSymbol{};
auto bandwidthFormatName = mListener
? mListener->SSBL_GetBandwidthSelectionFormatName()
: NumericFormatId{};
: NumericFormatSymbol{};
wxFlexGridSizer *mainSizer;
Add((mainSizer = safenew wxFlexGridSizer(1, 1, 1)), 0,wxALIGN_TOP | wxLEFT | wxTOP, 5);
@@ -448,7 +448,7 @@ void SpectralSelectionBar::SetFrequencies(double bottom, double top)
ValuesToControls();
}
void SpectralSelectionBar::SetFrequencySelectionFormatName(const NumericFormatId & formatName)
void SpectralSelectionBar::SetFrequencySelectionFormatName(const NumericFormatSymbol & formatName)
{
NumericTextCtrl *frequencyCtrl = (mbCenterAndWidth ? mCenterCtrl : mLowCtrl);
frequencyCtrl->SetFormatName(formatName);
@@ -458,7 +458,7 @@ void SpectralSelectionBar::SetFrequencySelectionFormatName(const NumericFormatId
OnUpdate(e);
}
void SpectralSelectionBar::SetBandwidthSelectionFormatName(const NumericFormatId & formatName)
void SpectralSelectionBar::SetBandwidthSelectionFormatName(const NumericFormatSymbol & formatName)
{
if (mbCenterAndWidth) {
mWidthCtrl->SetFormatName(formatName);

View File

@@ -42,8 +42,8 @@ public:
void UpdatePrefs() override;
void SetFrequencies(double bottom, double top);
void SetFrequencySelectionFormatName(const NumericFormatId & formatName);
void SetBandwidthSelectionFormatName(const NumericFormatId & formatName);
void SetFrequencySelectionFormatName(const NumericFormatSymbol & formatName);
void SetBandwidthSelectionFormatName(const NumericFormatSymbol & formatName);
void SetListener(SpectralSelectionBarListener *l);
void RegenerateTooltips() override {};

View File

@@ -12,9 +12,7 @@
#define __AUDACITY_SPECTRAL_SELECTION_BAR_LISTENER__
#include "../Audacity.h"
class ComponentInterfaceSymbol;
using NumericFormatId = ComponentInterfaceSymbol;
#include "audacity/Types.h"
class AUDACITY_DLL_API SpectralSelectionBarListener /* not final */ {
@@ -25,11 +23,11 @@ class AUDACITY_DLL_API SpectralSelectionBarListener /* not final */ {
virtual double SSBL_GetRate() const = 0;
virtual const NumericFormatId & SSBL_GetFrequencySelectionFormatName() = 0;
virtual void SSBL_SetFrequencySelectionFormatName(const NumericFormatId & formatName) = 0;
virtual const NumericFormatSymbol & SSBL_GetFrequencySelectionFormatName() = 0;
virtual void SSBL_SetFrequencySelectionFormatName(const NumericFormatSymbol & formatName) = 0;
virtual const NumericFormatId & SSBL_GetBandwidthSelectionFormatName() = 0;
virtual void SSBL_SetBandwidthSelectionFormatName(const NumericFormatId & formatName) = 0;
virtual const NumericFormatSymbol & SSBL_GetBandwidthSelectionFormatName() = 0;
virtual void SSBL_SetBandwidthSelectionFormatName(const NumericFormatSymbol & formatName) = 0;
virtual void SSBL_ModifySpectralSelection(double &bottom, double &top, bool done) = 0;
};