16#ifndef __AUDACITY_METER_PANEL__
17#define __AUDACITY_METER_PANEL__
90 ,
public NonInterferingBase
108 wxWindow* parent, wxWindowID
id,
110 const wxPoint& pos = wxDefaultPosition,
111 const wxSize&
size = wxDefaultSize,
112 Style
style = HorizontalStereo,
113 float fDecayRate = 60.0f);
115 void SetFocusFromKbd()
override;
117 void Clear()
override;
121 void SetStyle(Style newStyle);
153 int numFrames,
const float *sampleData)
override;
170 float GetPeakHold()
const;
172 bool IsMonitoring()
const;
173 bool IsActive()
const;
177 void StartMonitoring();
178 void StopMonitoring();
183 void RestoreState(
const State &state);
184 void SetMixer(wxCommandEvent& event);
186 int GetDBRange()
const override {
return mDB ? mDBRange : -1; }
189 void Increase(
float steps);
190 void Decrease(
float steps);
191 void UpdateSliderControl();
193 void ShowMenu(
const wxPoint & pos);
205 void OnErase(wxEraseEvent &evt);
206 void OnPaint(wxPaintEvent &evt);
207 void OnSize(wxSizeEvent &evt);
208 void OnMouse(wxMouseEvent &evt);
209 void OnKeyDown(wxKeyEvent &evt);
210 void OnCharHook(wxKeyEvent &evt);
211 void OnContext(wxContextMenuEvent &evt);
212 void OnSetFocus(wxFocusEvent &evt);
213 void OnKillFocus(wxFocusEvent &evt);
218 void OnMeterUpdate(wxTimerEvent &evt);
219 void OnTipTimeout(wxTimerEvent& evt);
221 void HandleLayout(wxDC &dc);
222 void SetActiveStyle(Style
style);
223 void SetBarAndClip(
int iBar,
bool vert);
224 void DrawMeterBar(wxDC &dc,
MeterBar *meterBar);
225 void ResetBar(
MeterBar *bar,
bool resetClipping);
226 void RepaintBarsNow();
227 wxFont GetFont()
const;
232 void OnMonitor(wxCommandEvent &evt);
235 wxString Key(
const wxString &
key)
const;
265 long mMeterRefreshRate{};
266 long mMeterDisabled{};
298 bool mEnabled{
true };
303 friend class MeterAx;
305 DECLARE_EVENT_TABLE()
static void OnSize(wxSizeEvent &evt)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Inherits wxPanel and has a Meter; exposes shared_ptr to the Meter.
virtual bool IsClipping() const =0
virtual bool IsMeterDisabled() const =0
virtual void UpdateDisplay(unsigned numChannels, int numFrames, const float *sampleData)=0
virtual float GetMaxPeak() const =0
virtual void Reset(double sampleRate, bool resetClipping)=0
MeterPanel is a panel that paints the meter used for monitoring or playback.
Observer::Subscription mAudioCaptureSubscription
wxBrush mDisabledBkgndBrush
std::unique_ptr< LWSlider > mSlider
AudacityProject * mProject
Style GetDesiredStyle() const
Observer::Subscription mAudioIOStatusSubscription
std::unique_ptr< wxBitmap > mBitmap
int mNumPeakSamplesToClip
@ HorizontalStereoCompact
int GetDBRange() const override
Message used to update the MeterPanel.
bool clipping[kMaxMeterBars]
float peak[kMaxMeterBars]
int tailPeakCount[kMaxMeterBars]
int headPeakCount[kMaxMeterBars]
wxString toStringIfClipped()
Only print meter updates if clipping may be happening.
wxString toString()
Print out all the values in the meter update message.
Queue of MeterUpdateMsg used to feed the MeterPanel.
A move-only handle representing a connection to a Publisher.
A listener notified of changes in preferences.
virtual void UpdateSelectedPrefs(int id)
virtual void UpdatePrefs()=0
Holds a msgid for the translation catalog; may also bind format arguments.
constexpr auto sampleRate
A struct used by MeterPanel to hold the position of one bar.