2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
SoundActivatedRecord.cpp
|
|
|
|
|
|
|
|
Martyn Shaw
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
********************************************************************//**
|
|
|
|
|
2019-12-06 10:39:07 +00:00
|
|
|
\class SoundActivatedRecordDialog
|
2010-01-23 19:44:49 +00:00
|
|
|
\brief Configures sound activated recording.
|
|
|
|
|
|
|
|
*//********************************************************************/
|
|
|
|
|
|
|
|
#include "Audacity.h"
|
2015-07-09 17:39:20 +00:00
|
|
|
#include "SoundActivatedRecord.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
#include "ShuttleGui.h"
|
|
|
|
#include "Prefs.h"
|
2015-07-09 17:39:20 +00:00
|
|
|
#include "prefs/GUISettings.h"
|
2010-01-23 19:44:49 +00:00
|
|
|
|
2019-12-06 10:39:07 +00:00
|
|
|
BEGIN_EVENT_TABLE(SoundActivatedRecordDialog, wxDialogWrapper)
|
|
|
|
EVT_BUTTON(wxID_OK, SoundActivatedRecordDialog::OnOK)
|
2010-01-23 19:44:49 +00:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
2019-12-06 10:39:07 +00:00
|
|
|
SoundActivatedRecordDialog::SoundActivatedRecordDialog(wxWindow* parent)
|
2019-12-08 05:25:47 +00:00
|
|
|
: wxDialogWrapper(parent, -1, XO("Sound Activated Record"), wxDefaultPosition,
|
2010-01-23 19:44:49 +00:00
|
|
|
wxDefaultSize, wxCAPTION )
|
|
|
|
// wxDefaultSize, wxCAPTION | wxTHICK_FRAME)
|
|
|
|
{
|
2019-12-08 05:25:47 +00:00
|
|
|
SetName();
|
2010-01-23 19:44:49 +00:00
|
|
|
ShuttleGui S(this, eIsCreatingFromPrefs);
|
|
|
|
PopulateOrExchange(S);
|
|
|
|
Fit();
|
|
|
|
Center();
|
|
|
|
}
|
|
|
|
|
2019-12-06 10:39:07 +00:00
|
|
|
SoundActivatedRecordDialog::~SoundActivatedRecordDialog()
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-12-06 10:39:07 +00:00
|
|
|
void SoundActivatedRecordDialog::PopulateOrExchange(ShuttleGui & S)
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
S.SetBorder(5);
|
|
|
|
|
|
|
|
S.StartVerticalLay();
|
|
|
|
{
|
|
|
|
S.StartMultiColumn(2, wxEXPAND);
|
2018-01-31 01:03:46 +00:00
|
|
|
S.SetStretchyCol(1);
|
|
|
|
S.TieSlider(
|
2019-12-23 21:59:53 +00:00
|
|
|
XO("Activation level (dB):"),
|
2018-01-31 01:03:46 +00:00
|
|
|
{wxT("/AudioIO/SilenceLevel"), -50},
|
|
|
|
0, -gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE)
|
|
|
|
);
|
2010-01-23 19:44:49 +00:00
|
|
|
S.EndMultiColumn();
|
|
|
|
}
|
|
|
|
S.EndVerticalLay();
|
|
|
|
S.AddStandardButtons();
|
|
|
|
}
|
|
|
|
|
2019-12-06 10:39:07 +00:00
|
|
|
void SoundActivatedRecordDialog::OnOK(wxCommandEvent & WXUNUSED(event))
|
2010-01-23 19:44:49 +00:00
|
|
|
{
|
|
|
|
ShuttleGui S( this, eIsSavingToPrefs );
|
|
|
|
PopulateOrExchange( S );
|
2015-12-22 02:07:24 +00:00
|
|
|
|
|
|
|
gPrefs->Flush();
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
EndModal(0);
|
|
|
|
}
|
|
|
|
|