Audacity  2.2.2
Contrast.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  Contrast.cpp
6 
7 \class ContrastDialog
8 \brief Dialog used for Contrast menu item
9 
10 *//*******************************************************************/
11 
12 #include "../Audacity.h"
13 #include "Contrast.h"
14 
15 #include "../WaveTrack.h"
16 #include "../Prefs.h"
17 #include "../Project.h"
18 #include "../ShuttleGui.h"
19 #include "../FileNames.h"
20 #include "../widgets/LinkingHtmlWindow.h"
21 #include "../widgets/HelpSystem.h"
22 #include "../widgets/NumericTextCtrl.h"
23 #include "../widgets/ErrorDialog.h"
24 
25 #include <cmath>
26 #include <limits>
27 
28 #if defined(__WXMSW__) && !defined(__CYGWIN__)
29 #include <float.h>
30 #define finite(x) _finite(x)
31 #endif
32 
33 #include <wx/filedlg.h>
34 #include <wx/valtext.h>
35 #include <wx/log.h>
36 
37 #include "../PlatformCompatibility.h"
38 
39 #define DB_MAX_LIMIT 0.0 // Audio is massively distorted.
40 #define WCAG2_PASS 20.0 // dB difference required to pass WCAG2 test.
41 
42 
43 bool ContrastDialog::GetDB(float &dB)
44 {
45  float rms = float(0.0);
46  int numberSelecteTracks = 0;
47 
48  // For stereo tracks: sqrt((mean(L)+mean(R))/2)
49  bool isStereo = false;
50  double meanSq = 0.0;
51 
54  WaveTrack *t = (WaveTrack *) iter.First();
55  while (t) {
56  numberSelecteTracks++;
57  if (numberSelecteTracks > 1 && !isStereo) {
58  AudacityMessageDialog m(NULL, _("You can only measure one track at a time."), _("Error"), wxOK);
59  m.ShowModal();
60  return false;
61  }
62  isStereo = t->GetLinked();
63 
64  wxASSERT(mT0 <= mT1);
65 
66  // Ignore whitespace beyond ends of track.
67  if(mT0 < t->GetStartTime())
68  mT0 = t->GetStartTime();
69  if(mT1 > t->GetEndTime())
70  mT1 = t->GetEndTime();
71 
72  auto SelT0 = t->TimeToLongSamples(mT0);
73  auto SelT1 = t->TimeToLongSamples(mT1);
74 
75  if(SelT0 > SelT1)
76  {
77  AudacityMessageDialog m(NULL, _("Invalid audio selection.\nPlease ensure that audio is selected."), _("Error"), wxOK);
78  m.ShowModal();
79  return false;
80  }
81 
82  if(SelT0 == SelT1)
83  {
84  AudacityMessageDialog m(NULL, _("Nothing to measure.\nPlease select a section of a track."), _("Error"), wxOK);
85  m.ShowModal();
86  return false;
87  }
88 
89  // Don't throw in this analysis dialog
90  rms = ((WaveTrack *)t)->GetRMS(mT0, mT1, false);
91  meanSq += rms * rms;
92  t = (WaveTrack *) iter.Next();
93  }
94  // TODO: This works for stereo, provided the audio clips are in both channels.
95  // We should really count gaps between clips as silence.
96  rms = (meanSq > 0.0)? sqrt(meanSq/(double)numberSelecteTracks) : 0.0;
97 
98  if(numberSelecteTracks == 0) {
99  AudacityMessageDialog m(NULL, _("Please select an audio track."), _("Error"), wxOK);
100  m.ShowModal();
101  return false;
102  }
103  // Gives warning C4056, Overflow in floating-point constant arithmetic
104  // -INFINITY is intentional here.
105  // Looks like we are stuck with this warning, as
106  // #pragma warning( disable : 4056)
107  // even around the whole function does not disable it successfully.
108 
109  dB = (rms == 0.0)? -INFINITY : LINEAR_TO_DB(rms);
110  return true;
111 }
112 
114 {
118 }
119 
120 
121 // WDR: class implementations
122 
123 //----------------------------------------------------------------------------
124 // ContrastDialog
125 //----------------------------------------------------------------------------
126 
127 // WDR: event table for ContrastDialog
128 
129 enum {
132  //ID_BUTTON_GETURL,
135  //ID_BUTTON_CLOSE,
144 };
145 
146 BEGIN_EVENT_TABLE(ContrastDialog,wxDialogWrapper)
149  EVT_BUTTON(wxID_HELP, ContrastDialog::OnGetURL)
152  EVT_BUTTON(wxID_CANCEL, ContrastDialog::OnClose)
154 
155 /* i18n-hint: WCAG2 is the 'Web Content Accessibility Guidelines (WCAG) 2.0', see http://www.w3.org/TR/WCAG20/ */
156 ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
157  const wxString & title,
158  const wxPoint & pos):
159  wxDialogWrapper(parent, id, title, pos, wxDefaultSize,
160  wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX )
161 {
162  SetName(GetTitle());
163 
164  mT0 = 0.0;
165  mT1 = 0.0;
166  foregrounddB = 0.0;
167  backgrounddB = 0.0;
168  mForegroundIsDefined = false;
169  mBackgroundIsDefined = false;
170 
171  // NULL out the control members until the controls are created.
172  mForegroundStartT = NULL;
173  mForegroundEndT = NULL;
174  mBackgroundStartT = NULL;
175  mBackgroundEndT = NULL;
176  wxTextValidator vld(wxFILTER_NUMERIC);
177  wxString number;
178 
180  mProjectRate = p->GetRate();
181 
182  ShuttleGui S(this, eIsCreating);
183 
184  S.SetBorder(5);
185  S.StartHorizontalLay(wxCENTER, false);
186  {
187  /* i18n-hint: RMS abbreviates root mean square, a certain averaging method */
188  S.AddTitle(_("Contrast Analyzer, for measuring RMS volume differences between two selections of audio."));
189  }
190  S.EndHorizontalLay();
191  S.StartStatic( _("Parameters") );
192  {
193  S.StartMultiColumn(5, wxEXPAND);
194  {
195 
196  // Headings
197  S.AddFixedText( {} ); // spacer
198  S.AddFixedText(_("Start"));
199  S.AddFixedText(_("End"));
200  S.AddFixedText( {} ); // spacer
201  S.AddFixedText(_("Volume "));
202 
203  //Foreground
204  S.AddFixedText(_("&Foreground:"), false);
205  if (S.GetMode() == eIsCreating)
206  {
207  mForegroundStartT = safenew
210  _("hh:mm:ss + hundredths"),
211  0.0,
212  mProjectRate,
213  wxDefaultPosition,
214  wxDefaultSize,
215  true);
216  mForegroundStartT->SetName(_("Foreground start time"));
217  mForegroundStartT->EnableMenu(false);
218  mForegroundStartT->SetReadOnly(true);
219  }
220  S.AddWindow(mForegroundStartT);
221 
222  if (S.GetMode() == eIsCreating)
223  {
224  mForegroundEndT = safenew
227  _("hh:mm:ss + hundredths"),
228  0.0,
229  mProjectRate,
230  wxDefaultPosition,
231  wxDefaultSize,
232  true);
233  mForegroundEndT->SetName(_("Foreground end time"));
234  mForegroundEndT->EnableMenu(false);
235  mForegroundEndT->SetReadOnly(true);
236  }
237  S.AddWindow(mForegroundEndT);
238 
239  m_pButton_UseCurrentF = S.Id(ID_BUTTON_USECURRENTF).AddButton(_("&Measure selection"));
240  mForegroundRMSText=S.Id(ID_FOREGROUNDDB_TEXT).AddTextBox( {}, wxT(""), 17);
241  mForegroundRMSText->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar));
242 
243  //Background
244  S.AddFixedText(_("&Background:"));
245  if (S.GetMode() == eIsCreating)
246  {
247  mBackgroundStartT = safenew
250  _("hh:mm:ss + hundredths"),
251  0.0,
252  mProjectRate,
253  wxDefaultPosition,
254  wxDefaultSize,
255  true);
256  mBackgroundStartT->SetName(_("Background start time"));
257  mBackgroundStartT->EnableMenu(false);
258  mBackgroundStartT->SetReadOnly(true);
259  }
260  S.AddWindow(mBackgroundStartT);
261 
262  if (S.GetMode() == eIsCreating)
263  {
264  mBackgroundEndT = safenew
267  _("hh:mm:ss + hundredths"),
268  0.0,
269  mProjectRate,
270  wxDefaultPosition,
271  wxDefaultSize,
272  true);
273  mBackgroundEndT->SetName(_("Background end time"));
274  mBackgroundEndT->EnableMenu(false);
275  mBackgroundEndT->SetReadOnly(true);
276  }
277  S.AddWindow(mBackgroundEndT);
278 
279  m_pButton_UseCurrentB = S.Id(ID_BUTTON_USECURRENTB).AddButton(_("Mea&sure selection"));
280  mBackgroundRMSText = S.Id(ID_BACKGROUNDDB_TEXT).AddTextBox( {}, wxT(""), 17);
281  mBackgroundRMSText->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar));
282  }
283  S.EndMultiColumn();
284  }
285  S.EndStatic();
286 
287  //Result
288  S.StartStatic( _("Result") );
289  {
290  S.StartMultiColumn(3, wxCENTER);
291  {
292  S.AddFixedText(_("Co&ntrast Result:"));
293  mPassFailText = S.Id(ID_RESULTS_TEXT).AddTextBox( {}, wxT(""), 50);
294  mPassFailText->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar));
295  m_pButton_Reset = S.Id(ID_BUTTON_RESET).AddButton(_("R&eset"));
296  S.AddFixedText(_("&Difference:"));
297  mDiffText = S.Id(ID_RESULTSDB_TEXT).AddTextBox( {}, wxT(""), 50);
298  mDiffText->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar));
299  m_pButton_Export = S.Id(ID_BUTTON_EXPORT).AddButton(_("E&xport..."));
300  }
301  S.EndMultiColumn();
302  }
303  S.EndStatic();
305 #if 0
306  S.StartMultiColumn(3, wxEXPAND);
307  {
308  S.SetStretchyCol(1);
309  m_pButton_GetURL = S.Id(ID_BUTTON_GETURL).AddButton(_("&Help"));
310  S.AddFixedText(wxT(" ")); // spacer
311  m_pButton_Close = S.Id(ID_BUTTON_CLOSE).AddButton(_("&Close"));
312  }
313  S.EndMultiColumn();
314 #endif
315  Layout();
316  Fit();
317  SetMinSize(GetSize());
318  Center();
319 }
320 
322 {
323  mForegroundRMSText->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar));
324  mBackgroundRMSText->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar));
325  mPassFailText->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar));
326  mDiffText->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar));
327 }
328 
329 void ContrastDialog::OnGetURL(wxCommandEvent & WXUNUSED(event))
330 {
331  // Original help page is back on-line (March 2016), but the manual should be more reliable.
332  // http://www.eramp.com/WCAG_2_audio_contrast_tool_help.htm
333  HelpSystem::ShowHelp(this, wxT("Contrast"));
334 }
335 
336 void ContrastDialog::OnClose(wxCommandEvent & WXUNUSED(event))
337 {
338  wxCommandEvent dummyEvent;
339  OnReset(dummyEvent);
340 
341  Show(false);
342 }
343 
344 void ContrastDialog::OnGetForeground(wxCommandEvent & /*event*/)
345 {
348 
349  for (Track *t = iter.First(); t; t = iter.Next()) {
352  }
353 
356  m_pButton_UseCurrentF->SetFocus();
357  results();
358 }
359 
360 void ContrastDialog::OnGetBackground(wxCommandEvent & /*event*/)
361 {
364 
365  for (Track *t = iter.First(); t; t = iter.Next()) {
368  }
369 
372  m_pButton_UseCurrentB->SetFocus();
373  results();
374 }
375 
376 namespace {
377  // PRL: I gathered formatting into these functions, and eliminated some
378  // repetitions, and removed the redundant word "Average" as applied to RMS.
379  // Should these variations in formats be collapsed further?
380 
381  // Pass nullptr when value is not yet defined
382  wxString FormatRMSMessage( float *pValue )
383  {
384 
385  /* i18n-hint: RMS abbreviates root mean square, a certain averaging method */
386  wxString format0{ _("RMS = %s.") };
387 
388  /* i18n-hint: dB abbreviates decibels */
389  wxString format1{ _("%s dB") };
390 
391  wxString value;
392 
393  if ( pValue )
394  if( fabs( *pValue ) != std::numeric_limits<float>::infinity() ) {
395  auto number = wxString::Format( _("%.2f"), *pValue );
396  value = wxString::Format( format1, number );
397  }
398  else
399  value = _("zero");
400  else
401  value = wxString::Format( format1, "" );
402 
403  return wxString::Format( format0, value );
404  }
405 
406  wxString FormatDifference( float diffdB )
407  {
408  if( diffdB != diffdB ) // test for NaN, reliant on IEEE implementation
409  return _("indeterminate");
410  else {
411  if( diffdB != std::numeric_limits<float>::infinity() )
412  /* i18n-hint: dB abbreviates decibels */
413  /* i18n-hint: RMS abbreviates root mean square, a certain averaging method */
414  return wxString::Format(_("%.2f dB RMS"), diffdB);
415  else
416  /* i18n-hint: dB abbreviates decibels */
417  return _("Infinite dB difference");
418  }
419  }
420 
421  wxString FormatDifferenceForExport( float diffdB )
422  {
423  if( diffdB != diffdB ) //test for NaN, reliant on IEEE implementation
424  return _("Difference is indeterminate.");
425  else
426  if( fabs(diffdB) != std::numeric_limits<float>::infinity() )
427  /* i18n-hint: dB abbreviates decibels */
428  /* i18n-hint: RMS abbreviates root mean square, a certain averaging method */
429  return wxString::Format(_("Difference = %.2f RMS dB."), diffdB );
430  else
431  /* i18n-hint: dB abbreviates decibels */
432  /* i18n-hint: RMS abbreviates root mean square, a certain averaging method */
433  return _("Difference = infinite RMS dB.");
434  }
435 }
436 
438 {
439  mPassFailText->SetName(wxT(""));
440  mPassFailText->ChangeValue(wxT(""));
441  mDiffText->ChangeValue(wxT(""));
442 
443  // foreground and background defined.
445  float diffdB = std::fabs(foregrounddB - backgrounddB);
446  if(foregrounddB > DB_MAX_LIMIT) {
447  mPassFailText->ChangeValue(_("Foreground level too high"));
448  }
449  else if (backgrounddB > DB_MAX_LIMIT) {
450  mPassFailText->ChangeValue(_("Background level too high"));
451  }
452  else if (backgrounddB > foregrounddB) {
453  mPassFailText->ChangeValue(_("Background higher than foreground"));
454  }
455  else if(diffdB > WCAG2_PASS) {
456  /* i18n-hint: WCAG abbreviates Web Content Accessibility Guidelines */
457  mPassFailText->ChangeValue(_("WCAG2 Pass"));
458  }
459  else {
460  /* i18n-hint: WCAG abbreviates Web Content Accessibility Guidelines */
461  mPassFailText->ChangeValue(_("WCAG2 Fail"));
462  }
463 
464  /* i18n-hint: i.e. difference in loudness at the moment. */
465  mDiffText->SetName(_("Current difference"));
466  mDiffText->ChangeValue( FormatDifference( diffdB ) );
467  }
468 
469  if (mForegroundIsDefined) {
470  mForegroundRMSText->SetName(_("Measured foreground level")); // Read by screen-readers
471  if(std::isinf(- foregrounddB))
472  mForegroundRMSText->ChangeValue(_("zero"));
473  else
474  mForegroundRMSText->ChangeValue(wxString::Format(_("%.2f dB"), foregrounddB)); // i18n-hint: short form of 'decibels'
475  }
476  else {
477  mForegroundRMSText->SetName(_("No foreground measured")); // Read by screen-readers
478  mForegroundRMSText->ChangeValue(wxT(""));
479  mPassFailText->ChangeValue(_("Foreground not yet measured"));
480  }
481 
482  if (mBackgroundIsDefined) {
483  mBackgroundRMSText->SetName(_("Measured background level"));
484  if(std::isinf(- backgrounddB))
485  mBackgroundRMSText->ChangeValue(_("zero"));
486  else
487  mBackgroundRMSText->ChangeValue(wxString::Format(_("%.2f dB"), backgrounddB));
488  }
489  else {
490  mBackgroundRMSText->SetName(_("No background measured"));
491  mBackgroundRMSText->ChangeValue(wxT(""));
492  mPassFailText->ChangeValue(_("Background not yet measured"));
493  }
494 }
495 
496 void ContrastDialog::OnExport(wxCommandEvent & WXUNUSED(event))
497 {
498  // TODO: Handle silence checks better (-infinity dB)
499  AudacityProject * project = GetActiveProject();
500  wxString fName = wxT("contrast.txt");
501 
503  _("Export Contrast Result As:"),
504  wxEmptyString,
505  fName,
506  wxT("txt"),
507  wxT("*.txt"),
508  wxFD_SAVE | wxRESIZE_BORDER,
509  this);
510 
511  if (fName == wxT(""))
512  return;
513 
514  wxTextFile f(fName);
515 #ifdef __WXMAC__
516  wxFile{}.Create(fName);
517 #else
518  f.Create();
519 #endif
520  f.Open();
521  if (!f.IsOpened()) {
523  wxString::Format( _("Couldn't write to file: %s"), fName) );
524  return;
525  }
526 
527  f.AddLine(wxT("==================================="));
528  /* i18n-hint: WCAG abbreviates Web Content Accessibility Guidelines */
529  f.AddLine(_("WCAG 2.0 Success Criteria 1.4.7 Contrast Results"));
530  f.AddLine(wxT(""));
531  f.AddLine(wxString::Format(_("Filename = %s."), project->GetFileName() ));
532  f.AddLine(wxT(""));
533  f.AddLine(_("Foreground"));
534  float t = (float)mForegroundStartT->GetValue();
535  int h = (int)(t/3600); // there must be a standard function for this!
536  int m = (int)((t - h*3600)/60);
537  float s = t - h*3600.0 - m*60.0;
538  f.AddLine(wxString::Format(_("Time started = %2d hour(s), %2d minute(s), %.2f seconds."), h, m, s ));
539  t = (float)mForegroundEndT->GetValue();
540  h = (int)(t/3600);
541  m = (int)((t - h*3600)/60);
542  s = t - h*3600.0 - m*60.0;
543  f.AddLine(wxString::Format(_("Time ended = %2d hour(s), %2d minute(s), %.2f seconds."), h, m, s ));
544  f.AddLine( FormatRMSMessage( mForegroundIsDefined ? &foregrounddB : nullptr ) );
545  f.AddLine(wxT(""));
546  f.AddLine(_("Background"));
547  t = (float)mBackgroundStartT->GetValue();
548  h = (int)(t/3600);
549  m = (int)((t - h*3600)/60);
550  s = t - h*3600.0 - m*60.0;
551  f.AddLine(wxString::Format(_("Time started = %2d hour(s), %2d minute(s), %.2f seconds."), h, m, s ));
552  t = (float)mBackgroundEndT->GetValue();
553  h = (int)(t/3600);
554  m = (int)((t - h*3600)/60);
555  s = t - h*3600.0 - m*60.0;
556  f.AddLine(wxString::Format(_("Time ended = %2d hour(s), %2d minute(s), %.2f seconds."), h, m, s ));
557  f.AddLine( FormatRMSMessage( mBackgroundIsDefined ? &backgrounddB : nullptr ) );
558  f.AddLine(wxT(""));
559  f.AddLine(_("Results"));
560  float diffdB = foregrounddB - backgrounddB;
561 
562  f.AddLine( FormatDifferenceForExport( diffdB ) );
563  if( diffdB > 20. )
564  f.AddLine(_("Success Criteria 1.4.7 of WCAG 2.0: Pass"));
565  else
566  f.AddLine(_("Success Criteria 1.4.7 of WCAG 2.0: Fail"));
567 
568  f.AddLine(wxT(""));
569  f.AddLine(_("Data gathered"));
570  wxString sNow;
571  wxDateTime now = wxDateTime::Now();
572  int year = now.GetYear();
573  wxDateTime::Month month = now.GetMonth();
574  wxString monthName = now.GetMonthName(month);
575  int dom = now.GetDay();
576  int hour = now.GetHour();
577  int minute = now.GetMinute();
578  int second = now.GetSecond();
579  sNow = wxString::Format(wxT("%d %s %02d %02dh %02dm %02ds"),
580  dom, monthName, year, hour, minute, second);
581  f.AddLine(sNow);
582 
583  f.AddLine(wxT("==================================="));
584  f.AddLine(wxT(""));
585 
586 #ifdef __WXMAC__
587  f.Write(wxTextFileType_Mac);
588 #else
589  f.Write();
590 #endif
591  f.Close();
592 }
593 
594 void ContrastDialog::OnReset(wxCommandEvent & /*event*/)
595 {
600  mForegroundIsDefined = false;
601  mBackgroundIsDefined = false;
602 
603  mForegroundRMSText->SetName(_("No foreground measured")); // Read by screen-readers
604  mBackgroundRMSText->SetName(_("No background measured"));
605  mForegroundRMSText->ChangeValue(wxT("")); // Displayed value
606  mBackgroundRMSText->ChangeValue(wxT(""));
607  mPassFailText->ChangeValue(wxT(""));
608  mDiffText->ChangeValue(wxT(""));
609 }
610 
611 void ContrastDialog::OnChar(wxKeyEvent & event)
612 {
613  // Is this still required?
614  if (event.GetKeyCode() == WXK_TAB) {
615  event.Skip();
616  return;
617  }
618 
619  event.Skip(false);
620  return;
621 }
void OnExport(const wxString &Format)
void OnClose(wxCommandEvent &event)
Definition: Contrast.cpp:336
double t0() const
#define WCAG2_PASS
Definition: Contrast.cpp:40
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:366
void OnChar(wxKeyEvent &event)
Definition: Contrast.cpp:611
SelectedRegion selectedRegion
Definition: ViewInfo.h:160
bool mForegroundIsDefined
Definition: Contrast.h:75
wxWindow * AddWindow(wxWindow *pWindow, int Flags=wxALIGN_CENTRE|wxALL)
Definition: ShuttleGui.cpp:257
double mT1
Definition: Contrast.h:50
void OnGetURL(wxCommandEvent &event)
Definition: Contrast.cpp:329
wxTextCtrl * mDiffText
Definition: Contrast.h:71
void EndMultiColumn()
void results()
Definition: Contrast.cpp:437
int AudacityMessageBox(const wxString &message, const wxString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: ErrorDialog.h:92
#define DB_MAX_LIMIT
Definition: Contrast.cpp:39
void OnExport(wxCommandEvent &event)
Definition: Contrast.cpp:496
wxButton * m_pButton_UseCurrentF
Definition: Contrast.h:37
double t1() const
wxTextCtrl * mForegroundRMSText
Definition: Contrast.h:68
wxTextCtrl * mPassFailText
Definition: Contrast.h:70
#define safenew
Definition: Audacity.h:223
void EndHorizontalLay()
Definition: ShuttleGui.cpp:975
void OnGetForeground(wxCommandEvent &event)
Definition: Contrast.cpp:344
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:161
wxTextCtrl * AddTextBox(const wxString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:493
void SetStartAndEndTime()
Definition: Contrast.cpp:113
void OnReset(wxCommandEvent &event)
Definition: Contrast.cpp:594
NumericTextCtrl * mForegroundStartT
Definition: Contrast.h:44
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:966
wxTextCtrl * mBackgroundRMSText
Definition: Contrast.h:69
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:998
wxButton * m_pButton_UseCurrentB
Definition: Contrast.h:38
A Track that contains audio waveform data.
Definition: WaveTrack.h:60
ShuttleGui & Id(int id)
Fundamental data object of Audacity, placed in the TrackPanel. Classes derived form it include the Wa...
Definition: Track.h:67
ViewInfo mViewInfo
Definition: Project.h:545
static void ShowHelp(wxWindow *parent, const wxString &localFileName, const wxString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:201
void AddFixedText(const wxString &Str, bool bCenter=false)
Definition: ShuttleGui.cpp:356
bool GetDB(float &dB)
Definition: Contrast.cpp:43
void AddTitle(const wxString &Prompt)
Centred text string.
Definition: ShuttleGui.cpp:243
void SetValue(double newValue)
void OnGetBackground(wxCommandEvent &event)
Definition: Contrast.cpp:360
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
teShuttleMode GetMode()
Definition: ShuttleGui.h:387
double mT0
Definition: Contrast.h:49
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop"))), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom"))), OnMoveTrack) void TrackMenuTable::OnSetName(wxCommandEvent &)
static wxString SelectFile(Operation op, const wxString &message, const wxString &default_path, const wxString &default_filename, const wxString &default_extension, const wxString &wildcard, int flags, wxWindow *parent)
Definition: FileNames.cpp:405
#define LINEAR_TO_DB(x)
Definition: Audacity.h:210
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:302
float foregrounddB
Definition: Contrast.h:73
wxStaticBox * StartStatic(const wxString &Str, int iProp=0)
Definition: ShuttleGui.cpp:701
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxButton *extra=NULL)
double GetRate() const
Definition: Project.h:184
END_EVENT_TABLE()
TrackList * GetTracks()
Definition: Project.h:177
NumericTextCtrl * mBackgroundStartT
Definition: Contrast.h:46
float backgrounddB
Definition: Contrast.h:74
void SetBorder(int Border)
Definition: ShuttleGui.h:251
void OnClose(const CommandContext &)
const wxString & GetFileName()
Definition: Project.h:287
NumericTextCtrl * mForegroundEndT
Definition: Contrast.h:45
wxButton * AddButton(const wxString &Text, int PositionFlags=wxALIGN_CENTRE)
Definition: ShuttleGui.cpp:301
bool mBackgroundIsDefined
Definition: Contrast.h:76
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:192
NumericTextCtrl * mBackgroundEndT
Definition: Contrast.h:47