Audacity  2.2.2
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 #include "Audacity.h"
22 #include "SoundActivatedRecord.h"
23 
24 #include "ShuttleGui.h"
25 #include "ShuttlePrefs.h"
26 #include "Prefs.h"
27 #include "prefs/GUISettings.h"
28 #include "Internat.h"
29 
30 BEGIN_EVENT_TABLE(SoundActivatedRecord, wxDialogWrapper)
31  EVT_BUTTON(wxID_OK, SoundActivatedRecord::OnOK)
33 
35 : wxDialogWrapper(parent, -1, _("Sound Activated Record"), wxDefaultPosition,
36  wxDefaultSize, wxCAPTION )
37 // wxDefaultSize, wxCAPTION | wxTHICK_FRAME)
38 {
39  SetName(GetTitle());
41  PopulateOrExchange(S);
42  Fit();
43  Center();
44 }
45 
47 {
48 }
49 
51 {
52  S.SetBorder(5);
53  int dBRange;
54 
55  S.StartVerticalLay();
56  {
57  S.StartMultiColumn(2, wxEXPAND);
58  S.SetStretchyCol(1);
59  dBRange = gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE);
60  S.TieSlider(_("Activation level (dB):"), wxT("/AudioIO/SilenceLevel"), -50, 0, -dBRange);
61  S.EndMultiColumn();
62  }
63  S.EndVerticalLay();
65 }
66 
67 void SoundActivatedRecord::OnOK(wxCommandEvent & WXUNUSED(event))
68 {
69  ShuttleGui S( this, eIsSavingToPrefs );
70  PopulateOrExchange( S );
71 
72  gPrefs->Flush();
73 
74  EndModal(0);
75 }
76 
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
#define ENV_DB_KEY
Definition: GUISettings.h:15
wxSlider * TieSlider(const wxString &Prompt, WrappedType &WrappedRef, const int max, const int min=0)
void PopulateOrExchange(ShuttleGui &S)
void EndMultiColumn()
#define ENV_DB_RANGE
Definition: GUISettings.h:16
void EndVerticalLay()
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
Configures sound activated recording.
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxButton *extra=NULL)
END_EVENT_TABLE()
void SetBorder(int Border)
Definition: ShuttleGui.h:286
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:203
void OnOK(wxCommandEvent &event)
void StartVerticalLay(int iProp=1)