Audacity  3.0.3
SoundActivatedRecord.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  SoundActivatedRecord.cpp
6 
7  Martyn Shaw
8 
9  This program is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14 ********************************************************************//********************************************************************/
20 
21 
22 #include "SoundActivatedRecord.h"
23 
24 #include "ShuttleGui.h"
25 #include "Prefs.h"
26 #include "Decibels.h"
27 
31 
33 : wxDialogWrapper(parent, -1, XO("Sound Activated Record"), wxDefaultPosition,
34  wxDefaultSize, wxCAPTION )
35 // wxDefaultSize, wxCAPTION | wxTHICK_FRAME)
36 {
37  SetName();
39  PopulateOrExchange(S);
40  Fit();
41  Center();
42 }
43 
45 {
46 }
47 
49 {
50  S.SetBorder(5);
51 
52  S.StartVerticalLay();
53  {
54  S.StartMultiColumn(2, wxEXPAND);
55  S.SetStretchyCol(1);
56  S.TieSlider(
57  XXO("Activation level (dB):"),
58  {wxT("/AudioIO/SilenceLevel"), -50},
60  )->SetMinSize(wxSize(300, wxDefaultCoord));
61  S.EndMultiColumn();
62  }
63  S.EndVerticalLay();
65 }
66 
67 void SoundActivatedRecordDialog::OnOK(wxCommandEvent & WXUNUSED(event))
68 {
69  ShuttleGui S( this, eIsSavingToPrefs );
70  PopulateOrExchange( S );
71 
72  gPrefs->Flush();
73 
74  EndModal(0);
75 }
76 
EVT_BUTTON
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
ShuttleGuiBase::TieSlider
wxSlider * TieSlider(const TranslatableString &Prompt, int &pos, const int max, const int min=0)
Definition: ShuttleGui.cpp:1687
XO
#define XO(s)
Definition: Internat.h:31
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
SoundActivatedRecordDialog::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: SoundActivatedRecord.cpp:48
SoundActivatedRecordDialog::~SoundActivatedRecordDialog
~SoundActivatedRecordDialog()
Definition: SoundActivatedRecord.cpp:44
Setting::Read
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:128
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
Decibels.h
ShuttleGui.h
DecibelScaleCutoff
IntSetting DecibelScaleCutoff
Negation of this value is the lowest dB level that should be shown in dB scales.
Definition: Decibels.cpp:12
SoundActivatedRecord.h
eIsSavingToPrefs
@ eIsSavingToPrefs
Definition: ShuttleGui.h:48
wxDialogWrapper
Definition: wxPanelWrapper.h:81
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
SoundActivatedRecordDialog
Configures sound activated recording.
Definition: SoundActivatedRecord.h:24
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2444
Prefs.h
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
eIsCreatingFromPrefs
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:47
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
END_EVENT_TABLE
END_EVENT_TABLE()
SoundActivatedRecordDialog::OnOK
void OnOK(wxCommandEvent &event)
Definition: SoundActivatedRecord.cpp:67
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631