Rename Meter as MeterPanel, and some DOxygen
This commit is contained in:
parent
ee4f35f288
commit
57ce726a25
|
@ -2475,7 +2475,7 @@ bool AudioIO::IsAvailable(AudacityProject *project)
|
|||
return mOwningProject == NULL || mOwningProject == project;
|
||||
}
|
||||
|
||||
void AudioIO::SetCaptureMeter(AudacityProject *project, Meter *meter)
|
||||
void AudioIO::SetCaptureMeter(AudacityProject *project, MeterPanel *meter)
|
||||
{
|
||||
if (!mOwningProject || mOwningProject == project)
|
||||
{
|
||||
|
@ -2487,7 +2487,7 @@ void AudioIO::SetCaptureMeter(AudacityProject *project, Meter *meter)
|
|||
}
|
||||
}
|
||||
|
||||
void AudioIO::SetPlaybackMeter(AudacityProject *project, Meter *meter)
|
||||
void AudioIO::SetPlaybackMeter(AudacityProject *project, MeterPanel *meter)
|
||||
{
|
||||
if (!mOwningProject || mOwningProject == project)
|
||||
{
|
||||
|
@ -2499,7 +2499,7 @@ void AudioIO::SetPlaybackMeter(AudacityProject *project, Meter *meter)
|
|||
}
|
||||
}
|
||||
|
||||
Meter * AudioIO::GetCaptureMeter(){
|
||||
MeterPanel * AudioIO::GetCaptureMeter(){
|
||||
return mInputMeter;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ class Mixer;
|
|||
class Resample;
|
||||
class TimeTrack;
|
||||
class AudioThread;
|
||||
class Meter;
|
||||
class MeterPanel;
|
||||
class SelectedRegion;
|
||||
|
||||
class AudacityProject;
|
||||
|
@ -408,9 +408,9 @@ class AUDACITY_DLL_API AudioIO final {
|
|||
#endif
|
||||
|
||||
bool IsAvailable(AudacityProject *projecT);
|
||||
void SetCaptureMeter(AudacityProject *project, Meter *meter);
|
||||
void SetPlaybackMeter(AudacityProject *project, Meter *meter);
|
||||
Meter * GetCaptureMeter();
|
||||
void SetCaptureMeter(AudacityProject *project, MeterPanel *meter);
|
||||
void SetPlaybackMeter(AudacityProject *project, MeterPanel *meter);
|
||||
MeterPanel * GetCaptureMeter();
|
||||
|
||||
private:
|
||||
/** \brief Set the current VU meters - this should be done once after
|
||||
|
@ -694,8 +694,8 @@ private:
|
|||
PaError mLastPaError;
|
||||
|
||||
AudacityProject *mOwningProject;
|
||||
Meter *mInputMeter;
|
||||
Meter *mOutputMeter;
|
||||
MeterPanel *mInputMeter;
|
||||
MeterPanel *mOutputMeter;
|
||||
bool mUpdateMeters;
|
||||
volatile bool mUpdatingMeters;
|
||||
|
||||
|
|
|
@ -3704,7 +3704,7 @@ void AudacityProject::NextOrPrevFrame(bool forward)
|
|||
// clicked.
|
||||
auto temp1 = AButton::TemporarilyAllowFocus();
|
||||
auto temp2 = ASlider::TemporarilyAllowFocus();
|
||||
auto temp3 = Meter::TemporarilyAllowFocus();
|
||||
auto temp3 = MeterPanel::TemporarilyAllowFocus();
|
||||
|
||||
|
||||
// Define the set of windows we rotate among.
|
||||
|
|
|
@ -303,11 +303,11 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
|
|||
mMeter = NULL;
|
||||
if (GetWave()) {
|
||||
mMeter =
|
||||
safenew Meter(GetActiveProject(), // AudacityProject* project,
|
||||
safenew MeterPanel(GetActiveProject(), // AudacityProject* project,
|
||||
this, -1, // wxWindow* parent, wxWindowID id,
|
||||
false, // bool isInput
|
||||
ctrlPos, ctrlSize, // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
Meter::MixerTrackCluster); // Style style = HorizontalStereo,
|
||||
MeterPanel::MixerTrackCluster); // Style style = HorizontalStereo,
|
||||
mMeter->SetName(_("Signal Level Meter"));
|
||||
}
|
||||
|
||||
|
@ -540,12 +540,12 @@ void MixerTrackCluster::UpdateMeter(const double t0, const double t1)
|
|||
|
||||
// Vaughan, 2010-11-27:
|
||||
// This commented out code is flawed. Mistaken understanding of "frame" vs "window".
|
||||
// Caused me to override Meter::UpdateDisplay().
|
||||
// Caused me to override MeterPanel::UpdateDisplay().
|
||||
// But I think it's got a good idea, of calling WaveTracks' GetMinMax and GetRMS
|
||||
// instead of passing in all the data and asking the meter to derive peak and rms.
|
||||
// May be worth revisiting as I think it should perform better, because it uses the min/max/rms
|
||||
// stored in blockfiles, rather than calculating them, but for now, changing it to use the
|
||||
// original Meter::UpdateDisplay(). New code is below the previous (now commented out).
|
||||
// original MeterPanel::UpdateDisplay(). New code is below the previous (now commented out).
|
||||
//
|
||||
//const size_t kFramesPerBuffer = 4;
|
||||
//float min; // dummy, since it's not shown in meters
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
|
||||
|
||||
class AudacityProject;
|
||||
class Meter;
|
||||
class MeterPanel;
|
||||
class MixerBoard;
|
||||
|
||||
class Track;
|
||||
|
@ -150,7 +150,7 @@ private:
|
|||
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||
MixerTrackSlider* mSlider_Velocity;
|
||||
#endif
|
||||
Meter* mMeter;
|
||||
MeterPanel* mMeter;
|
||||
|
||||
public:
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
|
|
@ -4871,12 +4871,12 @@ TranscriptionToolBar *AudacityProject::GetTranscriptionToolBar()
|
|||
NULL);
|
||||
}
|
||||
|
||||
Meter *AudacityProject::GetPlaybackMeter()
|
||||
MeterPanel *AudacityProject::GetPlaybackMeter()
|
||||
{
|
||||
return mPlaybackMeter;
|
||||
}
|
||||
|
||||
void AudacityProject::SetPlaybackMeter(Meter *playback)
|
||||
void AudacityProject::SetPlaybackMeter(MeterPanel *playback)
|
||||
{
|
||||
mPlaybackMeter = playback;
|
||||
if (gAudioIO)
|
||||
|
@ -4885,12 +4885,12 @@ void AudacityProject::SetPlaybackMeter(Meter *playback)
|
|||
}
|
||||
}
|
||||
|
||||
Meter *AudacityProject::GetCaptureMeter()
|
||||
MeterPanel *AudacityProject::GetCaptureMeter()
|
||||
{
|
||||
return mCaptureMeter;
|
||||
}
|
||||
|
||||
void AudacityProject::SetCaptureMeter(Meter *capture)
|
||||
void AudacityProject::SetCaptureMeter(MeterPanel *capture)
|
||||
{
|
||||
mCaptureMeter = capture;
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class EffectPlugs;
|
|||
class TrackPanel;
|
||||
class FreqWindow;
|
||||
class ContrastDialog;
|
||||
class Meter;
|
||||
class MeterPanel;
|
||||
|
||||
// toolbar classes
|
||||
class ControlToolBar;
|
||||
|
@ -494,10 +494,10 @@ public:
|
|||
const ToolsToolBar *GetToolsToolBar() const;
|
||||
TranscriptionToolBar *GetTranscriptionToolBar();
|
||||
|
||||
Meter *GetPlaybackMeter();
|
||||
void SetPlaybackMeter(Meter *playback);
|
||||
Meter *GetCaptureMeter();
|
||||
void SetCaptureMeter(Meter *capture);
|
||||
MeterPanel *GetPlaybackMeter();
|
||||
void SetPlaybackMeter(MeterPanel *playback);
|
||||
MeterPanel *GetCaptureMeter();
|
||||
void SetCaptureMeter(MeterPanel *capture);
|
||||
|
||||
LyricsWindow* GetLyricsWindow() { return mLyricsWindow; }
|
||||
MixerBoard* GetMixerBoard() { return mMixerBoard; }
|
||||
|
@ -679,8 +679,8 @@ private:
|
|||
bool mShownOnce{ false };
|
||||
|
||||
// Project owned meters
|
||||
Meter *mPlaybackMeter{};
|
||||
Meter *mCaptureMeter{};
|
||||
MeterPanel *mPlaybackMeter{};
|
||||
MeterPanel *mCaptureMeter{};
|
||||
|
||||
std::unique_ptr<ToolManager> mToolManager;
|
||||
|
||||
|
|
|
@ -881,7 +881,7 @@ void ControlToolBar::StopPlaying(bool stopStream /* = true*/)
|
|||
if( project ) {
|
||||
project->MayStartMonitoring();
|
||||
|
||||
Meter *meter = project->GetPlaybackMeter();
|
||||
MeterPanel *meter = project->GetPlaybackMeter();
|
||||
if( meter ) {
|
||||
meter->Clear();
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ void MeterToolBar::Create(wxWindow * parent)
|
|||
|
||||
void MeterToolBar::ReCreateButtons()
|
||||
{
|
||||
Meter::State playState{ false }, recordState{ false };
|
||||
MeterPanel::State playState{ false }, recordState{ false };
|
||||
|
||||
if (mPlayMeter && mProject->GetPlaybackMeter() == mPlayMeter)
|
||||
{
|
||||
|
@ -118,7 +118,7 @@ void MeterToolBar::Populate()
|
|||
if( mWhichMeters & kWithRecordMeter ){
|
||||
//JKC: Record on left, playback on right. Left to right flow
|
||||
//(maybe we should do it differently for Arabic language :-) )
|
||||
mRecordMeter = safenew Meter( mProject,
|
||||
mRecordMeter = safenew MeterPanel( mProject,
|
||||
this,
|
||||
wxID_ANY,
|
||||
true,
|
||||
|
@ -134,7 +134,7 @@ void MeterToolBar::Populate()
|
|||
}
|
||||
|
||||
if( mWhichMeters & kWithPlayMeter ){
|
||||
mPlayMeter = safenew Meter( mProject,
|
||||
mPlayMeter = safenew MeterPanel( mProject,
|
||||
this,
|
||||
wxID_ANY,
|
||||
false,
|
||||
|
|
|
@ -22,7 +22,7 @@ class wxGridBagSizer;
|
|||
class wxSizeEvent;
|
||||
class wxWindow;
|
||||
|
||||
class Meter;
|
||||
class MeterPanel;
|
||||
|
||||
|
||||
// Constants used as bit pattern
|
||||
|
@ -58,8 +58,8 @@ class MeterToolBar final : public ToolBar {
|
|||
AudacityProject *mProject;
|
||||
int mWhichMeters;
|
||||
wxGridBagSizer *mSizer;
|
||||
Meter *mPlayMeter;
|
||||
Meter *mRecordMeter;
|
||||
MeterPanel *mPlayMeter;
|
||||
MeterPanel *mRecordMeter;
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
@ -1542,7 +1542,7 @@ bool ToolManager::RestoreFocus()
|
|||
if (mLastFocus) {
|
||||
auto temp1 = AButton::TemporarilyAllowFocus();
|
||||
auto temp2 = ASlider::TemporarilyAllowFocus();
|
||||
auto temp3 = Meter::TemporarilyAllowFocus();
|
||||
auto temp3 = MeterPanel::TemporarilyAllowFocus();
|
||||
mLastFocus->SetFocus();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -11,30 +11,30 @@
|
|||
|
||||
*******************************************************************//**
|
||||
|
||||
\class Meter
|
||||
\class MeterPanel
|
||||
\brief VU Meter, for displaying recording/playback level
|
||||
|
||||
This is a bunch of common code that can display many different
|
||||
forms of VU meters and other displays.
|
||||
|
||||
But note that a lot of later code here assumes these are
|
||||
MeterToolBar meters, e.g., Meter::StartMonitoring,
|
||||
MeterToolBar meters, e.g., MeterPanel::StartMonitoring,
|
||||
so these are not as generic/common as originally intended.
|
||||
|
||||
*//****************************************************************//**
|
||||
|
||||
\class MeterBar
|
||||
\brief A struct used by Meter to hold the position of one bar.
|
||||
\brief A struct used by MeterPanel to hold the position of one bar.
|
||||
|
||||
*//****************************************************************//**
|
||||
|
||||
\class MeterUpdateMsg
|
||||
\brief Message used to update the Meter
|
||||
\brief Message used to update the MeterPanel
|
||||
|
||||
*//****************************************************************//**
|
||||
|
||||
\class MeterUpdateQueue
|
||||
\brief Queue of MeterUpdateMsg used to feed the Meter.
|
||||
\brief Queue of MeterUpdateMsg used to feed the MeterPanel.
|
||||
|
||||
*//******************************************************************/
|
||||
|
||||
|
@ -106,7 +106,7 @@ wxString MeterUpdateMsg::toStringIfClipped()
|
|||
}
|
||||
|
||||
//
|
||||
// The Meter passes itself messages via this queue so that it can
|
||||
// The MeterPanel passes itself messages via this queue so that it can
|
||||
// communicate between the audio thread and the GUI thread.
|
||||
// This class is as simple as possible in order to be thread-safe
|
||||
// without needing mutexes.
|
||||
|
@ -166,7 +166,7 @@ bool MeterUpdateQueue::Get(MeterUpdateMsg &msg)
|
|||
}
|
||||
|
||||
//
|
||||
// Meter class
|
||||
// MeterPanel class
|
||||
//
|
||||
|
||||
#include "../../images/SpeakerMenu.xpm"
|
||||
|
@ -191,24 +191,24 @@ enum {
|
|||
OnPreferencesID
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(Meter, wxPanelWrapper)
|
||||
EVT_TIMER(OnMeterUpdateID, Meter::OnMeterUpdate)
|
||||
EVT_MOUSE_EVENTS(Meter::OnMouse)
|
||||
EVT_CONTEXT_MENU(Meter::OnContext)
|
||||
EVT_KEY_DOWN(Meter::OnKeyDown)
|
||||
EVT_KEY_UP(Meter::OnKeyUp)
|
||||
EVT_SET_FOCUS(Meter::OnSetFocus)
|
||||
EVT_KILL_FOCUS(Meter::OnKillFocus)
|
||||
EVT_ERASE_BACKGROUND(Meter::OnErase)
|
||||
EVT_PAINT(Meter::OnPaint)
|
||||
EVT_SIZE(Meter::OnSize)
|
||||
EVT_MENU(OnMonitorID, Meter::OnMonitor)
|
||||
EVT_MENU(OnPreferencesID, Meter::OnPreferences)
|
||||
BEGIN_EVENT_TABLE(MeterPanel, wxPanelWrapper)
|
||||
EVT_TIMER(OnMeterUpdateID, MeterPanel::OnMeterUpdate)
|
||||
EVT_MOUSE_EVENTS(MeterPanel::OnMouse)
|
||||
EVT_CONTEXT_MENU(MeterPanel::OnContext)
|
||||
EVT_KEY_DOWN(MeterPanel::OnKeyDown)
|
||||
EVT_KEY_UP(MeterPanel::OnKeyUp)
|
||||
EVT_SET_FOCUS(MeterPanel::OnSetFocus)
|
||||
EVT_KILL_FOCUS(MeterPanel::OnKillFocus)
|
||||
EVT_ERASE_BACKGROUND(MeterPanel::OnErase)
|
||||
EVT_PAINT(MeterPanel::OnPaint)
|
||||
EVT_SIZE(MeterPanel::OnSize)
|
||||
EVT_MENU(OnMonitorID, MeterPanel::OnMonitor)
|
||||
EVT_MENU(OnPreferencesID, MeterPanel::OnPreferences)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_CLASS(Meter, wxPanelWrapper)
|
||||
IMPLEMENT_CLASS(MeterPanel, wxPanelWrapper)
|
||||
|
||||
Meter::Meter(AudacityProject *project,
|
||||
MeterPanel::MeterPanel(AudacityProject *project,
|
||||
wxWindow* parent, wxWindowID id,
|
||||
bool isInput,
|
||||
const wxPoint& pos /*= wxDefaultPosition*/,
|
||||
|
@ -271,17 +271,17 @@ Meter::Meter(AudacityProject *project,
|
|||
|
||||
// Register for our preference update event
|
||||
wxTheApp->Connect(EVT_METER_PREFERENCES_CHANGED,
|
||||
wxCommandEventHandler(Meter::OnMeterPrefsUpdated),
|
||||
wxCommandEventHandler(MeterPanel::OnMeterPrefsUpdated),
|
||||
NULL,
|
||||
this);
|
||||
|
||||
if (mIsInput) {
|
||||
wxTheApp->Connect(EVT_AUDIOIO_MONITOR,
|
||||
wxCommandEventHandler(Meter::OnAudioIOStatus),
|
||||
wxCommandEventHandler(MeterPanel::OnAudioIOStatus),
|
||||
NULL,
|
||||
this);
|
||||
wxTheApp->Connect(EVT_AUDIOIO_CAPTURE,
|
||||
wxCommandEventHandler(Meter::OnAudioIOStatus),
|
||||
wxCommandEventHandler(MeterPanel::OnAudioIOStatus),
|
||||
NULL,
|
||||
this);
|
||||
|
||||
|
@ -295,7 +295,7 @@ Meter::Meter(AudacityProject *project,
|
|||
else {
|
||||
// Register for AudioIO events
|
||||
wxTheApp->Connect(EVT_AUDIOIO_PLAYBACK,
|
||||
wxCommandEventHandler(Meter::OnAudioIOStatus),
|
||||
wxCommandEventHandler(MeterPanel::OnAudioIOStatus),
|
||||
NULL,
|
||||
this);
|
||||
|
||||
|
@ -335,36 +335,36 @@ Meter::Meter(AudacityProject *project,
|
|||
Reset(44100.0, true);
|
||||
}
|
||||
|
||||
void Meter::Clear()
|
||||
void MeterPanel::Clear()
|
||||
{
|
||||
mQueue.Clear();
|
||||
}
|
||||
|
||||
Meter::~Meter()
|
||||
MeterPanel::~MeterPanel()
|
||||
{
|
||||
if (mIsInput)
|
||||
{
|
||||
// Unregister for AudioIO events
|
||||
wxTheApp->Disconnect(EVT_AUDIOIO_MONITOR,
|
||||
wxCommandEventHandler(Meter::OnAudioIOStatus),
|
||||
wxCommandEventHandler(MeterPanel::OnAudioIOStatus),
|
||||
NULL,
|
||||
this);
|
||||
wxTheApp->Disconnect(EVT_AUDIOIO_CAPTURE,
|
||||
wxCommandEventHandler(Meter::OnAudioIOStatus),
|
||||
wxCommandEventHandler(MeterPanel::OnAudioIOStatus),
|
||||
NULL,
|
||||
this);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxTheApp->Disconnect(EVT_AUDIOIO_PLAYBACK,
|
||||
wxCommandEventHandler(Meter::OnAudioIOStatus),
|
||||
wxCommandEventHandler(MeterPanel::OnAudioIOStatus),
|
||||
NULL,
|
||||
this);
|
||||
}
|
||||
|
||||
// Unregister for our preference update event
|
||||
wxTheApp->Disconnect(EVT_METER_PREFERENCES_CHANGED,
|
||||
wxCommandEventHandler(Meter::OnMeterPrefsUpdated),
|
||||
wxCommandEventHandler(MeterPanel::OnMeterPrefsUpdated),
|
||||
NULL,
|
||||
this);
|
||||
|
||||
|
@ -375,7 +375,7 @@ Meter::~Meter()
|
|||
gAudioIO->StopStream();
|
||||
}
|
||||
|
||||
void Meter::UpdatePrefs()
|
||||
void MeterPanel::UpdatePrefs()
|
||||
{
|
||||
mDBRange = gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE);
|
||||
|
||||
|
@ -419,12 +419,12 @@ void Meter::UpdatePrefs()
|
|||
mLayoutValid = false;
|
||||
}
|
||||
|
||||
void Meter::OnErase(wxEraseEvent & WXUNUSED(event))
|
||||
void MeterPanel::OnErase(wxEraseEvent & WXUNUSED(event))
|
||||
{
|
||||
// Ignore it to prevent flashing
|
||||
}
|
||||
|
||||
void Meter::OnPaint(wxPaintEvent & WXUNUSED(event))
|
||||
void MeterPanel::OnPaint(wxPaintEvent & WXUNUSED(event))
|
||||
{
|
||||
#if defined(__WXMAC__)
|
||||
auto paintDC = std::make_unique<wxPaintDC>(this);
|
||||
|
@ -679,20 +679,20 @@ void Meter::OnPaint(wxPaintEvent & WXUNUSED(event))
|
|||
}
|
||||
}
|
||||
|
||||
void Meter::OnSize(wxSizeEvent & WXUNUSED(event))
|
||||
void MeterPanel::OnSize(wxSizeEvent & WXUNUSED(event))
|
||||
{
|
||||
GetClientSize(&mWidth, &mHeight);
|
||||
|
||||
mLayoutValid = false;
|
||||
}
|
||||
|
||||
bool Meter::InIcon(wxMouseEvent *pEvent) const
|
||||
bool MeterPanel::InIcon(wxMouseEvent *pEvent) const
|
||||
{
|
||||
auto point = pEvent ? pEvent->GetPosition() : ScreenToClient(::wxGetMousePosition());
|
||||
return mIconRect.Contains(point);
|
||||
}
|
||||
|
||||
void Meter::OnMouse(wxMouseEvent &evt)
|
||||
void MeterPanel::OnMouse(wxMouseEvent &evt)
|
||||
{
|
||||
bool shouldHighlight = InIcon(&evt);
|
||||
if ((evt.GetEventType() == wxEVT_MOTION || evt.Entering() || evt.Leaving()) &&
|
||||
|
@ -757,7 +757,7 @@ void Meter::OnMouse(wxMouseEvent &evt)
|
|||
}
|
||||
}
|
||||
|
||||
void Meter::OnContext(wxContextMenuEvent &evt)
|
||||
void MeterPanel::OnContext(wxContextMenuEvent &evt)
|
||||
{
|
||||
#if defined(__WXMSW__)
|
||||
if (mHadKeyDown)
|
||||
|
@ -776,7 +776,7 @@ void Meter::OnContext(wxContextMenuEvent &evt)
|
|||
#endif
|
||||
}
|
||||
|
||||
void Meter::OnKeyDown(wxKeyEvent &evt)
|
||||
void MeterPanel::OnKeyDown(wxKeyEvent &evt)
|
||||
{
|
||||
switch (evt.GetKeyCode())
|
||||
{
|
||||
|
@ -813,7 +813,7 @@ void Meter::OnKeyDown(wxKeyEvent &evt)
|
|||
}
|
||||
}
|
||||
|
||||
void Meter::OnKeyUp(wxKeyEvent &evt)
|
||||
void MeterPanel::OnKeyUp(wxKeyEvent &evt)
|
||||
{
|
||||
switch (evt.GetKeyCode())
|
||||
{
|
||||
|
@ -836,19 +836,19 @@ void Meter::OnKeyUp(wxKeyEvent &evt)
|
|||
}
|
||||
}
|
||||
|
||||
void Meter::OnSetFocus(wxFocusEvent & WXUNUSED(evt))
|
||||
void MeterPanel::OnSetFocus(wxFocusEvent & WXUNUSED(evt))
|
||||
{
|
||||
mIsFocused = true;
|
||||
Refresh(false);
|
||||
}
|
||||
|
||||
void Meter::OnKillFocus(wxFocusEvent & WXUNUSED(evt))
|
||||
void MeterPanel::OnKillFocus(wxFocusEvent & WXUNUSED(evt))
|
||||
{
|
||||
mIsFocused = false;
|
||||
Refresh(false);
|
||||
}
|
||||
|
||||
void Meter::SetStyle(Style newStyle)
|
||||
void MeterPanel::SetStyle(Style newStyle)
|
||||
{
|
||||
if (mStyle != newStyle && mDesiredStyle == AutomaticStereo)
|
||||
{
|
||||
|
@ -860,7 +860,7 @@ void Meter::SetStyle(Style newStyle)
|
|||
}
|
||||
}
|
||||
|
||||
void Meter::Reset(double sampleRate, bool resetClipping)
|
||||
void MeterPanel::Reset(double sampleRate, bool resetClipping)
|
||||
{
|
||||
mT = 0;
|
||||
mRate = sampleRate;
|
||||
|
@ -920,7 +920,7 @@ static float ToDB(float v, float range)
|
|||
return ClipZeroToOne((db + range) / range);
|
||||
}
|
||||
|
||||
void Meter::UpdateDisplay(unsigned numChannels, int numFrames, float *sampleData)
|
||||
void MeterPanel::UpdateDisplay(unsigned numChannels, int numFrames, float *sampleData)
|
||||
{
|
||||
float *sptr = sampleData;
|
||||
auto num = std::min(numChannels, mNumBars);
|
||||
|
@ -957,7 +957,7 @@ void Meter::UpdateDisplay(unsigned numChannels, int numFrames, float *sampleData
|
|||
}
|
||||
|
||||
// Vaughan, 2010-11-29: This not currently used. See comments in MixerTrackCluster::UpdateMeter().
|
||||
//void Meter::UpdateDisplay(int numChannels, int numFrames,
|
||||
//void MeterPanel::UpdateDisplay(int numChannels, int numFrames,
|
||||
// // Need to make these double-indexed arrays if we handle more than 2 channels.
|
||||
// float* maxLeft, float* rmsLeft,
|
||||
// float* maxRight, float* rmsRight,
|
||||
|
@ -1001,7 +1001,7 @@ void Meter::UpdateDisplay(unsigned numChannels, int numFrames, float *sampleData
|
|||
// mQueue.Put(msg);
|
||||
//}
|
||||
|
||||
void Meter::OnMeterUpdate(wxTimerEvent & WXUNUSED(event))
|
||||
void MeterPanel::OnMeterUpdate(wxTimerEvent & WXUNUSED(event))
|
||||
{
|
||||
MeterUpdateMsg msg;
|
||||
int numChanges = 0;
|
||||
|
@ -1097,7 +1097,7 @@ void Meter::OnMeterUpdate(wxTimerEvent & WXUNUSED(event))
|
|||
}
|
||||
}
|
||||
|
||||
float Meter::GetMaxPeak() const
|
||||
float MeterPanel::GetMaxPeak() const
|
||||
{
|
||||
float maxPeak = 0.;
|
||||
|
||||
|
@ -1107,7 +1107,7 @@ float Meter::GetMaxPeak() const
|
|||
return(maxPeak);
|
||||
}
|
||||
|
||||
wxFont Meter::GetFont() const
|
||||
wxFont MeterPanel::GetFont() const
|
||||
{
|
||||
int fontSize = 10;
|
||||
#if defined __WXMSW__
|
||||
|
@ -1117,7 +1117,7 @@ wxFont Meter::GetFont() const
|
|||
return wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
||||
}
|
||||
|
||||
void Meter::ResetBar(MeterBar *b, bool resetClipping)
|
||||
void MeterPanel::ResetBar(MeterBar *b, bool resetClipping)
|
||||
{
|
||||
b->peak = 0.0;
|
||||
b->rms = 0.0;
|
||||
|
@ -1132,7 +1132,7 @@ void Meter::ResetBar(MeterBar *b, bool resetClipping)
|
|||
b->tailPeakCount = 0;
|
||||
}
|
||||
|
||||
bool Meter::IsClipping() const
|
||||
bool MeterPanel::IsClipping() const
|
||||
{
|
||||
for (int c = 0; c < kMaxMeterBars; c++)
|
||||
if (mBar[c].isclipping)
|
||||
|
@ -1140,7 +1140,7 @@ bool Meter::IsClipping() const
|
|||
return false;
|
||||
}
|
||||
|
||||
void Meter::SetActiveStyle(Style newStyle)
|
||||
void MeterPanel::SetActiveStyle(Style newStyle)
|
||||
{
|
||||
mStyle = newStyle;
|
||||
|
||||
|
@ -1181,7 +1181,7 @@ void Meter::SetActiveStyle(Style newStyle)
|
|||
mRuler.GetMaxSize(&mRulerWidth, &mRulerHeight);
|
||||
}
|
||||
|
||||
void Meter::SetBarAndClip(int iBar, bool vert)
|
||||
void MeterPanel::SetBarAndClip(int iBar, bool vert)
|
||||
{
|
||||
// Save the orientation
|
||||
mBar[iBar].vert = vert;
|
||||
|
@ -1224,7 +1224,7 @@ void Meter::SetBarAndClip(int iBar, bool vert)
|
|||
}
|
||||
}
|
||||
|
||||
void Meter::HandleLayout(wxDC &dc)
|
||||
void MeterPanel::HandleLayout(wxDC &dc)
|
||||
{
|
||||
// Refresh to reflect any language changes
|
||||
/* i18n-hint: One-letter abbreviation for Left, in VU Meter */
|
||||
|
@ -1530,7 +1530,7 @@ void Meter::HandleLayout(wxDC &dc)
|
|||
mLayoutValid = true;
|
||||
}
|
||||
|
||||
void Meter::RepaintBarsNow()
|
||||
void MeterPanel::RepaintBarsNow()
|
||||
{
|
||||
if (mLayoutValid)
|
||||
{
|
||||
|
@ -1547,7 +1547,7 @@ void Meter::RepaintBarsNow()
|
|||
}
|
||||
}
|
||||
|
||||
void Meter::DrawMeterBar(wxDC &dc, MeterBar *bar)
|
||||
void MeterPanel::DrawMeterBar(wxDC &dc, MeterBar *bar)
|
||||
{
|
||||
// Cache some metrics
|
||||
wxCoord x = bar->r.GetLeft();
|
||||
|
@ -1807,12 +1807,12 @@ void Meter::DrawMeterBar(wxDC &dc, MeterBar *bar)
|
|||
}
|
||||
}
|
||||
|
||||
bool Meter::IsMeterDisabled() const
|
||||
bool MeterPanel::IsMeterDisabled() const
|
||||
{
|
||||
return mMeterDisabled != 0;
|
||||
}
|
||||
|
||||
void Meter::StartMonitoring()
|
||||
void MeterPanel::StartMonitoring()
|
||||
{
|
||||
bool start = !mMonitoring;
|
||||
|
||||
|
@ -1832,14 +1832,14 @@ void Meter::StartMonitoring()
|
|||
}
|
||||
}
|
||||
|
||||
void Meter::StopMonitoring(){
|
||||
void MeterPanel::StopMonitoring(){
|
||||
mMonitoring = false;
|
||||
if (gAudioIO->IsMonitoring()){
|
||||
gAudioIO->StopStream();
|
||||
}
|
||||
}
|
||||
|
||||
void Meter::OnAudioIOStatus(wxCommandEvent &evt)
|
||||
void MeterPanel::OnAudioIOStatus(wxCommandEvent &evt)
|
||||
{
|
||||
evt.Skip();
|
||||
AudacityProject *p = (AudacityProject *) evt.GetEventObject();
|
||||
|
@ -1863,12 +1863,12 @@ void Meter::OnAudioIOStatus(wxCommandEvent &evt)
|
|||
// SaveState() and RestoreState() exist solely for purpose of recreating toolbars
|
||||
// They should really be quering the project for current audio I/O state, but there
|
||||
// isn't a clear way of doing that just yet. (It should NOT query AudioIO.)
|
||||
auto Meter::SaveState() -> State
|
||||
auto MeterPanel::SaveState() -> State
|
||||
{
|
||||
return { true, mMonitoring, mActive };
|
||||
}
|
||||
|
||||
void Meter::RestoreState(const State &state)
|
||||
void MeterPanel::RestoreState(const State &state)
|
||||
{
|
||||
if (!state.mSaved)
|
||||
return;
|
||||
|
@ -1885,7 +1885,7 @@ void Meter::RestoreState(const State &state)
|
|||
// Pop-up menu
|
||||
//
|
||||
|
||||
void Meter::ShowMenu(const wxPoint & pos)
|
||||
void MeterPanel::ShowMenu(const wxPoint & pos)
|
||||
{
|
||||
wxMenu menu;
|
||||
// Note: these should be kept in the same order as the enum
|
||||
|
@ -1917,12 +1917,12 @@ void Meter::ShowMenu(const wxPoint & pos)
|
|||
#endif
|
||||
}
|
||||
|
||||
void Meter::OnMonitor(wxCommandEvent & WXUNUSED(event))
|
||||
void MeterPanel::OnMonitor(wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
StartMonitoring();
|
||||
}
|
||||
|
||||
void Meter::OnMeterPrefsUpdated(wxCommandEvent & evt)
|
||||
void MeterPanel::OnMeterPrefsUpdated(wxCommandEvent & evt)
|
||||
{
|
||||
evt.Skip();
|
||||
|
||||
|
@ -1931,7 +1931,7 @@ void Meter::OnMeterPrefsUpdated(wxCommandEvent & evt)
|
|||
Refresh(false);
|
||||
}
|
||||
|
||||
void Meter::OnPreferences(wxCommandEvent & WXUNUSED(event))
|
||||
void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
wxTextCtrl *rate;
|
||||
wxRadioButton *gradient;
|
||||
|
@ -2062,7 +2062,7 @@ void Meter::OnPreferences(wxCommandEvent & WXUNUSED(event))
|
|||
}
|
||||
}
|
||||
|
||||
wxString Meter::Key(const wxString & key) const
|
||||
wxString MeterPanel::Key(const wxString & key) const
|
||||
{
|
||||
if (mStyle == MixerTrackCluster)
|
||||
{
|
||||
|
@ -2077,9 +2077,9 @@ wxString Meter::Key(const wxString & key) const
|
|||
return wxT("/Meter/Output/") + key;
|
||||
}
|
||||
|
||||
bool Meter::s_AcceptsFocus{ false };
|
||||
bool MeterPanel::s_AcceptsFocus{ false };
|
||||
|
||||
auto Meter::TemporarilyAllowFocus() -> TempAllowFocus {
|
||||
auto MeterPanel::TemporarilyAllowFocus() -> TempAllowFocus {
|
||||
s_AcceptsFocus = true;
|
||||
return TempAllowFocus{ &s_AcceptsFocus };
|
||||
}
|
||||
|
@ -2087,7 +2087,7 @@ auto Meter::TemporarilyAllowFocus() -> TempAllowFocus {
|
|||
// This compensates for a but in wxWidgets 3.0.2 for mac:
|
||||
// Couldn't set focus from keyboard when AcceptsFocus returns false;
|
||||
// this bypasses that limitation
|
||||
void Meter::SetFocusFromKbd()
|
||||
void MeterPanel::SetFocusFromKbd()
|
||||
{
|
||||
auto temp = TemporarilyAllowFocus();
|
||||
SetFocus();
|
||||
|
@ -2111,12 +2111,10 @@ MeterAx::~MeterAx()
|
|||
// window (e.g. an edit control).
|
||||
wxAccStatus MeterAx::DoDefaultAction(int WXUNUSED(childId))
|
||||
{
|
||||
Meter *m = wxDynamicCast(GetWindow(), Meter);
|
||||
MeterPanel *m = wxDynamicCast(GetWindow(), MeterPanel);
|
||||
|
||||
if (m && m->mIsInput)
|
||||
{
|
||||
m->StartMonitoring();
|
||||
}
|
||||
|
||||
return wxACC_OK;
|
||||
}
|
||||
|
@ -2126,14 +2124,9 @@ wxAccStatus MeterAx::DoDefaultAction(int WXUNUSED(childId))
|
|||
wxAccStatus MeterAx::GetChild(int childId, wxAccessible** child)
|
||||
{
|
||||
if (childId == wxACC_SELF)
|
||||
{
|
||||
*child = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
*child = NULL;
|
||||
}
|
||||
|
||||
return wxACC_OK;
|
||||
}
|
||||
|
||||
|
@ -2141,7 +2134,6 @@ wxAccStatus MeterAx::GetChild(int childId, wxAccessible** child)
|
|||
wxAccStatus MeterAx::GetChildCount(int* childCount)
|
||||
{
|
||||
*childCount = 0;
|
||||
|
||||
return wxACC_OK;
|
||||
}
|
||||
|
||||
|
@ -2155,7 +2147,6 @@ wxAccStatus MeterAx::GetChildCount(int* childCount)
|
|||
wxAccStatus MeterAx::GetDefaultAction(int WXUNUSED(childId), wxString* actionName)
|
||||
{
|
||||
*actionName = _("Press");
|
||||
|
||||
return wxACC_OK;
|
||||
}
|
||||
|
||||
|
@ -2163,7 +2154,6 @@ wxAccStatus MeterAx::GetDefaultAction(int WXUNUSED(childId), wxString* actionNam
|
|||
wxAccStatus MeterAx::GetDescription(int WXUNUSED(childId), wxString *description)
|
||||
{
|
||||
description->Clear();
|
||||
|
||||
return wxACC_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
|
@ -2175,7 +2165,6 @@ wxAccStatus MeterAx::GetFocus(int* childId, wxAccessible** child)
|
|||
{
|
||||
*childId = 0;
|
||||
*child = this;
|
||||
|
||||
return wxACC_OK;
|
||||
}
|
||||
|
||||
|
@ -2183,7 +2172,6 @@ wxAccStatus MeterAx::GetFocus(int* childId, wxAccessible** child)
|
|||
wxAccStatus MeterAx::GetHelpText(int WXUNUSED(childId), wxString *helpText)
|
||||
{
|
||||
helpText->Clear();
|
||||
|
||||
return wxACC_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
|
@ -2192,7 +2180,6 @@ wxAccStatus MeterAx::GetHelpText(int WXUNUSED(childId), wxString *helpText)
|
|||
wxAccStatus MeterAx::GetKeyboardShortcut(int WXUNUSED(childId), wxString *shortcut)
|
||||
{
|
||||
shortcut->Clear();
|
||||
|
||||
return wxACC_OK;
|
||||
}
|
||||
|
||||
|
@ -2200,7 +2187,7 @@ wxAccStatus MeterAx::GetKeyboardShortcut(int WXUNUSED(childId), wxString *shortc
|
|||
// rect is in screen coordinates.
|
||||
wxAccStatus MeterAx::GetLocation(wxRect & rect, int WXUNUSED(elementId))
|
||||
{
|
||||
Meter *m = wxDynamicCast(GetWindow(), Meter);
|
||||
MeterPanel *m = wxDynamicCast(GetWindow(), MeterPanel);
|
||||
|
||||
rect = m->mIconRect;
|
||||
rect.SetPosition(m->ClientToScreen(rect.GetPosition()));
|
||||
|
@ -2211,7 +2198,7 @@ wxAccStatus MeterAx::GetLocation(wxRect & rect, int WXUNUSED(elementId))
|
|||
// Gets the name of the specified object.
|
||||
wxAccStatus MeterAx::GetName(int WXUNUSED(childId), wxString* name)
|
||||
{
|
||||
Meter *m = wxDynamicCast(GetWindow(), Meter);
|
||||
MeterPanel *m = wxDynamicCast(GetWindow(), MeterPanel);
|
||||
|
||||
if (m->mAccSilent)
|
||||
{
|
||||
|
@ -2219,30 +2206,21 @@ wxAccStatus MeterAx::GetName(int WXUNUSED(childId), wxString* name)
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
*name = m->GetName();
|
||||
if (name->IsEmpty())
|
||||
{
|
||||
*name = m->GetLabel();
|
||||
}
|
||||
|
||||
if (name->IsEmpty())
|
||||
{
|
||||
*name = _("Meter");
|
||||
}
|
||||
|
||||
if (m->mMonitoring)
|
||||
{
|
||||
// translations of strings such as " Monitoring " did not
|
||||
// always retain the leading space. Therefore a space has
|
||||
// been added to ensure at least one space, and stop
|
||||
// words from being merged
|
||||
*name += wxT(" ") + _(" Monitoring ");
|
||||
}
|
||||
else if (m->mActive)
|
||||
{
|
||||
*name += wxT(" ") + _(" Active ");
|
||||
}
|
||||
|
||||
float peak = 0.;
|
||||
bool clipped = false;
|
||||
|
@ -2254,18 +2232,12 @@ wxAccStatus MeterAx::GetName(int WXUNUSED(childId), wxString* name)
|
|||
}
|
||||
|
||||
if (m->mDB)
|
||||
{
|
||||
*name += wxT(" ") + wxString::Format(_(" Peak %2.f dB"), (peak * m->mDBRange) - m->mDBRange);
|
||||
}
|
||||
else
|
||||
{
|
||||
*name += wxT(" ") + wxString::Format(_(" Peak %.2f "), peak);
|
||||
}
|
||||
|
||||
if (clipped)
|
||||
{
|
||||
*name += wxT(" ") + _(" Clipped ");
|
||||
}
|
||||
}
|
||||
|
||||
return wxACC_OK;
|
||||
|
@ -2274,7 +2246,7 @@ wxAccStatus MeterAx::GetName(int WXUNUSED(childId), wxString* name)
|
|||
// Returns a role constant.
|
||||
wxAccStatus MeterAx::GetRole(int WXUNUSED(childId), wxAccRole* role)
|
||||
{
|
||||
Meter *m = wxDynamicCast(GetWindow(), Meter);
|
||||
MeterPanel *m = wxDynamicCast(GetWindow(), MeterPanel);
|
||||
|
||||
if (m->mAccSilent)
|
||||
*role = wxROLE_NONE; // Jaws and nvda both read nothing
|
||||
|
@ -2300,10 +2272,9 @@ wxAccStatus MeterAx::GetSelections(wxVariant * WXUNUSED(selections))
|
|||
// Returns a state constant.
|
||||
wxAccStatus MeterAx::GetState(int WXUNUSED(childId), long* state)
|
||||
{
|
||||
Meter *m = wxDynamicCast( GetWindow(), Meter );
|
||||
MeterPanel *m = wxDynamicCast( GetWindow(), MeterPanel );
|
||||
|
||||
*state = wxACC_STATE_SYSTEM_FOCUSABLE;
|
||||
|
||||
*state |= ( m == wxWindow::FindFocus() ? wxACC_STATE_SYSTEM_FOCUSED : 0 );
|
||||
|
||||
return wxACC_OK;
|
||||
|
|
|
@ -85,9 +85,13 @@ class MeterUpdateQueue
|
|||
|
||||
class MeterAx;
|
||||
|
||||
class Meter final : public wxPanelWrapper
|
||||
/********************************************************************//**
|
||||
\brief MeterPanel is a panel that paints the meter used for monitoring
|
||||
or playback.
|
||||
************************************************************************/
|
||||
class MeterPanel final : public wxPanelWrapper
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(Meter)
|
||||
DECLARE_DYNAMIC_CLASS(MeterPanel)
|
||||
|
||||
public:
|
||||
// These should be kept in the same order as they appear
|
||||
|
@ -102,7 +106,7 @@ class Meter final : public wxPanelWrapper
|
|||
};
|
||||
|
||||
|
||||
Meter(AudacityProject *,
|
||||
MeterPanel(AudacityProject *,
|
||||
wxWindow* parent, wxWindowID id,
|
||||
bool isInput,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
|
@ -110,7 +114,7 @@ class Meter final : public wxPanelWrapper
|
|||
Style style = HorizontalStereo,
|
||||
float fDecayRate = 60.0f);
|
||||
|
||||
~Meter();
|
||||
~MeterPanel();
|
||||
|
||||
bool AcceptsFocus() const override { return s_AcceptsFocus; }
|
||||
bool AcceptsFocusFromKeyboard() const override { return true; }
|
||||
|
|
Loading…
Reference in New Issue