45#include <wx/wxcrtvararg.h>
47#include <wx/dcbuffer.h>
50#include <wx/settings.h>
51#include <wx/textdlg.h>
53#include <wx/radiobut.h>
54#include <wx/tooltip.h>
60#include "../widgets/BasicMenu.h"
67#include "../ProjectWindows.h"
72#include "../widgets/LinearUpdater.h"
73#include "../widgets/LinearDBFormat.h"
74#include "../widgets/RealFormat.h"
77#include "../widgets/valnum.h"
79#if wxUSE_ACCESSIBILITY
85 MeterAx(wxWindow * window);
93 wxAccStatus DoDefaultAction(
int childId)
override;
97 wxAccStatus GetChild(
int childId, wxAccessible** child)
override;
100 wxAccStatus GetChildCount(
int* childCount)
override;
108 wxAccStatus GetDefaultAction(
int childId, wxString *actionName)
override;
111 wxAccStatus GetDescription(
int childId, wxString *description)
override;
117 wxAccStatus GetFocus(
int *childId, wxAccessible **child)
override;
120 wxAccStatus GetHelpText(
int childId, wxString *helpText)
override;
124 wxAccStatus GetKeyboardShortcut(
int childId, wxString *shortcut)
override;
128 wxAccStatus GetLocation(wxRect& rect,
int elementId)
override;
131 wxAccStatus GetRole(
int childId, wxAccRole *role)
override;
141 wxAccStatus GetSelections(wxVariant *selections)
override;
144 wxAccStatus GetState(
int childId,
long* state)
override;
148 wxAccStatus GetValue(
int childId, wxString* strValue)
override;
162output = wxString::Format(
wxT(
"Meter update msg: %i channels, %i samples\n"), \
166 output += wxString::Format(
wxT(
"%f peak, %f rms "),
peak[i],
rms[i]);
168 output += wxString::Format(
wxT(
"clipped "));
170 output += wxString::Format(
wxT(
"no clip "));
213 auto start =
mStart.load(std::memory_order_acquire);
214 auto end =
mEnd.load(std::memory_order_relaxed);
236 auto start =
mStart.load(std::memory_order_relaxed);
237 auto end =
mEnd.load(std::memory_order_acquire);
253#include "../../images/SpeakerMenu.xpm"
254#include "../../images/MicMenu.xpm"
261 wxT(
"AutomaticStereo"),
262 wxT(
"HorizontalStereo"),
263 wxT(
"VerticalStereo")
293 wxWindow* parent, wxWindowID
id,
299:
MeterPanelBase(parent,
id, pos,
size, wxTAB_TRAVERSAL | wxNO_BORDER | wxWANTS_CHARS),
305 mDesiredStyle(style),
310 mDecayRate(fDecayRate),
312 mNumPeakSamplesToClip(3),
313 mPeakHoldDuration(3),
324 SetName(
XO(
"Meter") );
326 wxUnusedVar(SpeakerMenu_xpm);
327 wxUnusedVar(MicMenu_xpm);
330 mStyle = mDesiredStyle;
334#if wxUSE_ACCESSIBILITY
335 SetAccessible(
safenew MeterAx(
this));
339 mRuler.SetFonts(GetFont(), GetFont(), GetFont());
341 mRuler.SetLabelEdges(
true);
346 mSlider = std::make_unique<LWSlider>(
this,
XO(
""),
355 mSlider->SetScroll(0.1f, 2.0f);
358 UpdateSliderControl();
362 mBkgndBrush = wxBrush(backgroundColour, wxBRUSHSTYLE_SOLID);
363 SetBackgroundColour( backgroundColour );
365 mPeakPeakPen = wxPen(
theTheme.
Colour( clrMeterPeak), 1, wxPENSTYLE_SOLID);
366 mDisabledPen = wxPen(
theTheme.
Colour( clrMeterDisabledPen), 1, wxPENSTYLE_SOLID);
375 mPen = wxPen(
theTheme.
Colour( clrMeterInputPen ), 1, wxPENSTYLE_SOLID);
376 mBrush = wxBrush(
theTheme.
Colour( clrMeterInputBrush ), wxBRUSHSTYLE_SOLID);
377 mRMSBrush = wxBrush(
theTheme.
Colour( clrMeterInputRMSBrush ), wxBRUSHSTYLE_SOLID);
378 mClipBrush = wxBrush(
theTheme.
Colour( clrMeterInputClipBrush ), wxBRUSHSTYLE_SOLID);
383 mPen = wxPen(
theTheme.
Colour( clrMeterOutputPen ), 1, wxPENSTYLE_SOLID);
384 mBrush = wxBrush(
theTheme.
Colour( clrMeterOutputBrush ), wxBRUSHSTYLE_SOLID);
385 mRMSBrush = wxBrush(
theTheme.
Colour( clrMeterOutputRMSBrush ), wxBRUSHSTYLE_SOLID);
386 mClipBrush = wxBrush(
theTheme.
Colour( clrMeterOutputClipBrush ), wxBRUSHSTYLE_SOLID);
394 mDisabledBkgndBrush = mBkgndBrush;
402 Reset(44100.0,
true);
424 if (style ==
wxT(
"AutomaticStereo"))
428 else if (style ==
wxT(
"HorizontalStereo"))
432 else if (style ==
wxT(
"VerticalStereo"))
458 static int value = wxNewId();
482 float playbackVolume;
490 gAudioIO->GetMixer(&inputSource, &inputVolume, &playbackVolume);
492 const auto volume =
mIsInput ? inputVolume : playbackVolume;
507#if defined(__WXMAC__)
508 auto paintDC = std::make_unique<wxPaintDC>(
this);
510 std::unique_ptr<wxDC> paintDC{ wxAutoBufferedPaintDCFactory(
this) };
512 wxDC & destDC = *paintDC;
519 mBitmap = std::make_unique<wxBitmap>();
530#ifdef EXPERIMENTAL_THEMING
537 dc.SetPen(*wxTRANSPARENT_PEN);
546 dc.SetTextForeground( clrText );
547 dc.SetTextBackground( clrBoxFill );
553 wxColor green(117, 215, 112);
554 wxColor yellow(255, 255, 0);
555 wxColor red(255, 0, 0);
560 if (GetBackgroundColour().GetLuminance() < 0.25)
562 green = wxColor(117-100, 215-100, 112-100);
563 yellow = wxColor(255-100, 255-100, 0);
564 red = wxColor(255-100, 0, 0);
566 else if (GetBackgroundColour().GetLuminance() < 0.50)
568 green = wxColor(117-50, 215-50, 112-50);
569 yellow = wxColor(255-50, 255-50, 0);
570 red = wxColor(255-50, 0, 0);
574 for (
unsigned int i = 0; i <
mNumBars; i++)
586 wxRect r =
mBar[i].
r;
595 gradw = (double) r.GetWidth() /
mDBRange * 6.0;
596 gradh = (double) r.GetHeight() /
mDBRange * 6.0;
600 gradw = (double) r.GetWidth() / 100 * 25;
601 gradh = (double) r.GetHeight() / 100 * 25;
608 dc.GradientFillLinear(r, red, yellow, wxSOUTH);
611 r.SetTop(r.GetBottom());
612 dc.GradientFillLinear(r, yellow, green, wxSOUTH);
615 r.SetTop(r.GetBottom());
616 r.SetBottom(
mBar[i].r.GetBottom());
617 dc.SetPen(*wxTRANSPARENT_PEN);
624 r.SetWidth(r.GetWidth() - (int) (gradw + gradw + 0.5));
625 dc.SetPen(*wxTRANSPARENT_PEN);
630 r.SetLeft(r.GetRight() + 1);
631 r.SetWidth(floor(gradw));
632 dc.GradientFillLinear(r, green, yellow);
635 r.SetLeft(r.GetRight() + 1);
636 r.SetRight(
mBar[i].r.GetRight());
637 dc.GradientFillLinear(r, yellow, red);
639#ifdef EXPERIMENTAL_METER_LED_STYLE
642 wxRect r =
mBar[i].
r;
644 BackgroundPen.SetColour( wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE) );
645 dc.SetPen( BackgroundPen );
647 for(i=0;i<r.width;i++)
655 int j = abs( (i%7)-4);
657 AColor::Line( dc, i+r.x, r.y+r.height-j, i+r.x, r.y+r.height );
665 dc.SetTextForeground( clrText );
667#ifndef EXPERIMENTAL_DA
672 dc.SelectObject(wxNullBitmap);
676 destDC.DrawBitmap(*
mBitmap, 0, 0);
679 for (
unsigned int i = 0; i <
mNumBars; i++)
684 destDC.SetTextForeground( clrText );
686#ifndef EXPERIMENTAL_DA
696 destDC.SetBackgroundMode( wxSOLID );
697 destDC.SetTextBackground( clrBoxFill );
708 ::wxGetMousePosition()));
712 mSlider->OnPaint(destDC, highlighted);
717 auto r = GetClientRect();
732 if ((evt.GetEventType() == wxEVT_MOTION || evt.Entering() || evt.Leaving())) {
740 if (evt.Entering()) {
743 else if(evt.Leaving())
758 switch(evt.GetKeyCode())
764 case WXK_NUMPAD_ENTER:
765 case WXK_WINDOWS_MENU:
768 ShowMenu(GetClientRect().GetBottomLeft());
782 ShowMenu(GetClientRect().GetBottomLeft());
792 switch (evt.GetKeyCode())
796 Navigate(wxNavigationKeyEvent::IsBackward);
798 Navigate(wxNavigationKeyEvent::IsForward);
846 gAudioIO->GetMixer(&inputSource, &inputVolume, &outputVolume);
853 gAudioIO->SetMixer(inputSource, inputVolume, outputVolume);
855#if wxUSE_ACCESSIBILITY
856 GetAccessible()->NotifyEvent( wxACC_EVENT_OBJECT_VALUECHANGE,
871 auto changed =
mSlider->ShowDialog();
953static float ToDB(
float v,
float range)
964 unsigned numChannels,
int numFrames,
const float *sampleData)
966 auto sptr = sampleData;
970 memset(&msg, 0,
sizeof(msg));
973 for(
int i=0; i<numFrames; i++) {
974 for(
unsigned int j=0; j<num; j++) {
976 msg.
rms[j] += sptr[j]*sptr[j];
994 for(
unsigned int j=0; j<
mNumBars; j++)
1049#ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
1050 double maxPeak = 0.0;
1051 bool discarded =
false;
1071 for(
unsigned int j=0; j<
mNumBars; j++) {
1097 float smooth = pow(0.9, (
double)msg.
numFrames/1024.0);
1106 if (
mBar[j].peak >
mBar[j].peakPeakHold )
1117#ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
1118 if (
mT > gAudioIO->AILAGetLastDecisionTime()) {
1120 maxPeak = msg.
peak[j] > maxPeak ? msg.
peak[j] : maxPeak;
1121 wxPrintf(
"%f@%f ", msg.
peak[j],
mT);
1125 wxPrintf(
"%f@%f discarded\n", msg.
peak[j],
mT);
1131 if (numChanges > 0) {
1132 #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
1133 if (gAudioIO->AILAIsActive() &&
mIsInput && !discarded) {
1134 gAudioIO->AILAProcess(maxPeak);
1153 for(
unsigned int j=0; j<
mNumBars; j++)
1154 maxPeak =
mBar[j].peak > maxPeak ?
mBar[j].peak : maxPeak;
1161 auto peakHold = .0f;
1162 for (
unsigned int i = 0; i <
mNumBars; i++)
1163 peakHold = std::max(peakHold,
mBar[i].peakPeakHold);
1170#if defined __WXMSW__
1174 return wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
1205 if (
mBar[c].clipping)
1258 mBar[iBar].
r.x += 1;
1259 mBar[iBar].
r.width -= 1;
1260 mBar[iBar].
r.y += 1;
1261 mBar[iBar].
r.height -= 1;
1283 mBar[iBar].
b.width -= 4;
1284 mBar[iBar].
r.width -= 4;
1344 wxPrintf(
wxT(
"Style not handled yet!\n"));
1351 height -= top +
gap;
1354 barw = (width -
gap) / 2;
1363 mBar[0].
b = wxRect(left, top, barw, barh);
1376 mBar[1].
r.GetBottom());
1381 lside = ltxtWidth +
gap;
1398 width -=
gap + rside +
gap + left;
1401 height -= top +
gap;
1407 barw = (width -
gap) / 2;
1416 mBar[0].
b = wxRect(left, top, barw, barh);
1429 mBar[1].
r.GetBottom());
1437 height -= top +
gap + ltxtHeight +
gap;
1443 barw = (width / 2) -
gap;
1452 mBar[0].
b = wxRect(left, top, barw, barh);
1469 mBar[1].
r.GetBottom());
1482 height -= rtxtHeight +
gap;
1485 mLeftTextPos = wxPoint(left, (height / 4) - ltxtHeight / 2);
1486 mRightTextPos = wxPoint(left, (height * 3 / 4) - rtxtHeight / 2);
1489 left +=
intmax(ltxtWidth, rtxtWidth);
1505 barh = (height -
gap) / 2;
1511 mBar[0].
b = wxRect(left, top, barw, barh);
1522 mBar[1].
r.GetBottom() + 1,
1523 mBar[1].
r.GetRight(),
1530 mLeftTextPos = wxPoint(left, (height / 4) - (ltxtHeight / 2));
1531 mRightTextPos = wxPoint(left, (height * 3 / 4) - (ltxtHeight / 2));
1534 left +=
intmax(ltxtWidth, rtxtWidth);
1550 barh = (height -
gap) / 2;
1556 mBar[0].
b = wxRect(left, top, barw, barh);
1572 mBar[1].
r.GetRight(),
1586 for (
unsigned int i = 0; i <
mNumBars; i++)
1601 wxCoord x = bar->
r.GetLeft();
1602 wxCoord y = bar->
r.GetTop();
1603 wxCoord w = bar->
r.GetWidth();
1604 wxCoord h = bar->
r.GetHeight();
1609 dc.SetPen(*wxTRANSPARENT_PEN);
1623 ht = (int)(bar->
peak * (h - 1) + 0.5);
1629 dc.DrawRectangle(x, y, w, h - ht);
1637 dc.Blit(x, y + h - ht - 1, w, ht + 1, &srcDC, x, y + h - ht - 1);
1643 ht = (int)(bar->
peakHold * (h - 1) + 0.5);
1646 dc.Blit(x, y + h - ht - 1, w, 2, &srcDC, x, y + h - ht - 1);
1655 AColor::Line(dc, x, y + h - ht - 1, x + w - 1, y + h - ht - 1);
1658 AColor::Line(dc, x, y + h - ht, x + w - 1, y + h - ht);
1666 wd = (int)(bar->
peak * (w - 1) + 0.5);
1672 dc.DrawRectangle(x + wd, y, w - wd, h);
1681 dc.Blit(x, y, wd + 1, h, &srcDC, x, y);
1687 wd = (int)(bar->
peakHold * (w - 1) + 0.5);
1690 dc.Blit(x + wd - 1, y, 2, h, &srcDC, x + wd, y);
1702 AColor::Line(dc, x + wd - 1, y, x + wd - 1, y + h - 1);
1708 srcDC.SelectObject(wxNullBitmap);
1716 ht = (int)(bar->
peak * (h - 1) + 0.5);
1722 dc.DrawRectangle(x, y, w, h - ht);
1727 dc.SetPen(*wxTRANSPARENT_PEN);
1731 dc.DrawRectangle(x, y + h - ht - 1, w, ht + 1);
1737 ht = (int)(bar->
peakHold * (h - 1) + 0.5);
1740 AColor::Line(dc, x, y + h - ht - 1, x + w - 1, y + h - ht - 1);
1743 AColor::Line(dc, x, y + h - ht, x + w - 1, y + h - ht);
1750 ht = (int)(bar->
rms * (h - 1) + 0.5);
1753 dc.SetPen(*wxTRANSPARENT_PEN);
1757 dc.DrawRectangle(x, y + h - ht - 1, w, ht + 1);
1766 AColor::Line(dc, x, y + h - ht - 1, x + w - 1, y + h - ht - 1);
1769 AColor::Line(dc, x, y + h - ht, x + w - 1, y + h - ht);
1777 wd = (int)(bar->
peak * (w - 1) + 0.5);
1783 dc.DrawRectangle(x + wd, y, w - wd, h);
1788 dc.SetPen(*wxTRANSPARENT_PEN);
1792 dc.DrawRectangle(x, y, wd + 1, h);
1798 wd = (int)(bar->
peakHold * (w - 1) + 0.5);
1804 AColor::Line(dc, x + wd - 1, y, x + wd - 1, y + h - 1);
1810 wd = (int)(bar->
rms * (w - 1) + 0.5);
1814 dc.SetPen(*wxTRANSPARENT_PEN);
1818 dc.DrawRectangle(x, y, wd + 1, h);
1830 AColor::Line(dc, x + wd - 1, y, x + wd - 1, y + h - 1);
1849 dc.SetPen(*wxTRANSPARENT_PEN);
1850 wxRect r(bar->
rClip.GetX() + 1,
1851 bar->
rClip.GetY() + 1,
1852 bar->
rClip.GetWidth() - 1,
1853 bar->
rClip.GetHeight() - 1);
1854 dc.DrawRectangle(r);
1868 if (gAudioIO->IsMonitoring()){
1869 gAudioIO->StopStream();
1872 if (start && !gAudioIO->IsBusy()){
1886 if (gAudioIO->IsMonitoring()){
1887 gAudioIO->StopStream();
1908 if (IsShownOnScreen())
1928 return {
true, mMonitoring, mActive };
1955 mi = menu.Append(
OnMonitorID,
_(
"Disable Silent Monitoring"));
1957 mi = menu.Append(
OnMonitorID,
_(
"Enable Silent Monitoring"));
1985 wxRadioButton *gradient;
1988 wxRadioButton *linear;
1989 wxRadioButton *automatic;
1990 wxRadioButton *horizontal;
1991 wxRadioButton *vertical;
1994 auto title =
mIsInput ?
XO(
"Recording Meter Options") :
XO(
"Playback Meter Options");
2002 S.StartVerticalLay();
2004 S.StartStatic(
XO(
"Refresh Rate"), 0);
2007"Higher refresh rates make the meter show more frequent\nchanges. A rate of 30 per second or less should prevent\nthe meter affecting audio quality on slower machines."));
2008 S.StartHorizontalLay();
2010 rate =
S.Name(
XO(
"Meter refresh rate per second [1-100]"))
2011 .Validator<IntegerValidator<long>>(
2014 .AddTextBox(
XXO(
"Meter refresh rate per second [1-100]: "),
2015 wxString::Format(
wxT(
"%d"), meterRefreshRate),
2018 S.EndHorizontalLay();
2022 S.StartHorizontalLay();
2024 S.StartStatic(
XO(
"Meter Style"), 0);
2026 S.StartVerticalLay();
2028 gradient =
S.AddRadioButton(
XXO(
"Gradient"),
true,
mGradient);
2029 rms =
S.AddRadioButtonToGroup(
XXO(
"RMS"),
false,
mGradient);
2035 S.StartStatic(
XO(
"Meter Type"), 0);
2037 S.StartVerticalLay();
2039 db =
S.AddRadioButton(
XXO(
"dB"),
true,
mDB);
2040 linear =
S.AddRadioButtonToGroup(
XXO(
"Linear"),
false,
mDB);
2046 S.StartStatic(
XO(
"Orientation"), 1);
2048 S.StartVerticalLay();
2050 automatic =
S.AddRadioButton(
2052 horizontal =
S.AddRadioButtonToGroup(
2054 vertical =
S.AddRadioButtonToGroup(
2061 S.EndHorizontalLay();
2062 S.AddStandardButtons();
2068 dlg.CenterOnParent();
2070 if (dlg.ShowModal() == wxID_OK)
2073 wxT(
"AutomaticStereo") ,
2074 wxT(
"HorizontalStereo") ,
2075 wxT(
"VerticalStereo") ,
2079 s = automatic->GetValue() ? 0 : s;
2080 s = horizontal->GetValue() ? 1 : s;
2081 s = vertical->GetValue() ? 2 : s;
2101 return wxT(
"/Meter/Mixerboard/") +
key;
2106 return wxT(
"/Meter/Input/") +
key;
2109 return wxT(
"/Meter/Output/") +
key;
2122#if wxUSE_ACCESSIBILITY
2124MeterAx::MeterAx(wxWindow *window):
2137wxAccStatus MeterAx::DoDefaultAction(
int WXUNUSED(childId))
2149wxAccStatus MeterAx::GetChild(
int childId, wxAccessible** child)
2151 if (childId == wxACC_SELF)
2159wxAccStatus MeterAx::GetChildCount(
int* childCount)
2172wxAccStatus MeterAx::GetDefaultAction(
int WXUNUSED(childId), wxString* actionName)
2174 *actionName =
_(
"Press");
2179wxAccStatus MeterAx::GetDescription(
int WXUNUSED(childId), wxString *description)
2181 description->clear();
2182 return wxACC_NOT_SUPPORTED;
2189wxAccStatus MeterAx::GetFocus(
int* childId, wxAccessible** child)
2197wxAccStatus MeterAx::GetHelpText(
int WXUNUSED(childId), wxString *helpText)
2200 return wxACC_NOT_SUPPORTED;
2205wxAccStatus MeterAx::GetKeyboardShortcut(
int WXUNUSED(childId), wxString *shortcut)
2213wxAccStatus MeterAx::GetLocation(wxRect & rect,
int WXUNUSED(elementId))
2217 rect = m->GetClientRect();
2218 rect.SetPosition(m->ClientToScreen(rect.GetPosition()));
2224wxAccStatus MeterAx::GetRole(
int WXUNUSED(childId), wxAccRole* role)
2226 *role = wxROLE_SYSTEM_SLIDER;
2239wxAccStatus MeterAx::GetSelections(wxVariant * WXUNUSED(selections))
2241 return wxACC_NOT_IMPLEMENTED;
2245wxAccStatus MeterAx::GetState(
int WXUNUSED(childId),
long* state)
2249 *state = wxACC_STATE_SYSTEM_FOCUSABLE;
2257wxAccStatus MeterAx::GetValue(
int WXUNUSED(childId), wxString* strValue)
2261 *strValue = m->
mSlider->GetStringValue();
EVT_MENU(OnSetPlayRegionToSelectionID, AdornedRulerPanel::OnSetPlayRegionToSelection) EVT_COMMAND(OnTogglePinnedStateID
static const AudacityProject::AttachedObjects::RegisteredFactory key
IntSetting DecibelScaleCutoff
Negation of this value is the lowest dB level that should be shown in dB scales.
XXO("&Cut/Copy/Paste Toolbar")
static float ClipZeroToOne(float z)
static int intmax(int a, int b)
static const long MIN_REFRESH_RATE
static const long MAX_REFRESH_RATE
static const wxChar * PrefStyles[]
static float ToDB(float v, float range)
static float floatMax(float a, float b)
static int MeterPrefsID()
audacity::BasicSettings * gPrefs
wxFrame * FindProjectFrame(AudacityProject *project)
Get a pointer to the window associated with a project, or null if the given pointer is null,...
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
static void Bevel(wxDC &dc, bool up, const wxRect &r)
static void DrawFocus(wxDC &dc, wxRect &r)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
void Popup(const BasicUI::WindowPlacement &window, const Point &pos={})
Display the menu at pos, invoke at most one action, then hide it.
static const LinearUpdater & Instance()
Inherits wxPanel and has a Meter; exposes shared_ptr to the Meter.
static TempAllowFocus TemporarilyAllowFocus()
MeterPanel is a panel that paints the meter used for monitoring or playback.
void HandleLayout(wxDC &dc)
void OnCharHook(wxKeyEvent &evt)
void UpdatePrefs() override
void UpdateDisplay(unsigned numChannels, int numFrames, const float *sampleData) override
Update the meters with a block of audio data.
void ResetBar(MeterBar *bar, bool resetClipping)
void OnTipTimeout(wxTimerEvent &evt)
void OnKeyDown(wxKeyEvent &evt)
void Decrease(float steps)
float GetPeakHold() const
void OnErase(wxEraseEvent &evt)
void SetFocusFromKbd() override
void OnContext(wxContextMenuEvent &evt)
void Increase(float steps)
wxBrush mDisabledBkgndBrush
std::unique_ptr< LWSlider > mSlider
wxString Key(const wxString &key) const
AudacityProject * mProject
MeterBar mBar[kMaxMeterBars]
bool IsMonitoring() const
void OnAudioIOStatus(AudioIOEvent)
bool IsClipping() const override
void UpdateSliderControl()
void OnMonitor(wxCommandEvent &evt)
void OnMouse(wxMouseEvent &evt)
void SetBarAndClip(int iBar, bool vert)
std::unique_ptr< wxBitmap > mBitmap
void OnPreferences(wxCommandEvent &evt)
void OnSetFocus(wxFocusEvent &evt)
void SetStyle(Style newStyle)
void ShowMenu(const wxPoint &pos)
int mNumPeakSamplesToClip
void OnPaint(wxPaintEvent &evt)
void UpdateSelectedPrefs(int) override
@ HorizontalStereoCompact
void OnMeterUpdate(wxTimerEvent &evt)
void SetActiveStyle(Style style)
void Reset(double sampleRate, bool resetClipping) override
This method is thread-safe! Feel free to call from a different thread (like from an audio I/O callbac...
void DrawMeterBar(wxDC &dc, MeterBar *meterBar)
void OnAudioCapture(AudioIOEvent)
float GetMaxPeak() const override
void OnSize(wxSizeEvent &evt)
void OnKillFocus(wxFocusEvent &evt)
void SetMixer(wxCommandEvent &event)
void RestoreState(const State &state)
bool IsMeterDisabled() const override
Find out if the level meter is disabled or not.
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.
bool Put(MeterUpdateMsg &msg)
ArrayOf< MeterUpdateMsg > mBuffer
NonInterfering< std::atomic< size_t > > mEnd
NonInterfering< std::atomic< size_t > > mStart
MeterUpdateQueue(size_t maxLen)
bool Get(MeterUpdateMsg &msg)
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
static void Broadcast(int id=0)
Call this static function to notify all PrefsListener objects.
static AudioIOStartStreamOptions GetDefaultOptions(AudacityProject &project, bool newDefaults=false)
Invoke the global hook, supplying a default argument.
void SetTickColour(const wxColour &colour)
void OfflimitsPixels(int start, int end)
void SetOrientation(int orient)
void SetFormat(const RulerFormat *pFormat)
void Draw(wxDC &dc) const
void GetMaxSize(wxCoord *width, wxCoord *height)
void SetBounds(int left, int top, int right, int bottom)
void SetRange(double min, double max)
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined */
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
wxColour & Colour(int iIndex)
int ColourDistance(wxColour &From, wxColour &To)
Holds a msgid for the translation catalog; may also bind format arguments.
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
virtual bool Flush() noexcept=0
virtual bool Write(const wxString &key, bool value)=0
virtual bool Read(const wxString &key, bool *value) const =0
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
void SetName(const TranslatableString &title)
void SetFocus(const WindowPlacement &focus)
Set the window that accepts keyboard input.
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
AUDACITY_DLL_API void UpdatePrefs(wxWindow *pParent)
constexpr auto sampleRate
__finl float_x4 __vecc sqrt(const float_x4 &a)
enum AudioIOEvent::Type type
AudacityProject * pProject
A struct used by MeterPanel to hold the position of one bar.