1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 07:13:49 +01:00

Add custom track name defaults to preferences

This commit is contained in:
Steve Daulton
2016-01-16 14:44:45 +00:00
parent 1d6d08c47d
commit 8a6edf3623
6 changed files with 120 additions and 8 deletions

View File

@@ -146,9 +146,6 @@ void GUIPrefs::PopulateOrExchange(ShuttleGui & S)
S.TieCheckBox(_("&Beep on completion of longer activities"),
wxT("/GUI/BeepOnCompletion"),
false);
S.TieCheckBox(_("&Show track name in waveform display"),
wxT("/GUI/ShowTrackNameInWaveform"),
false);
S.TieCheckBox(_("Re&tain labels if selection snaps to a label edge"),
wxT("/GUI/RetainLabels"),
false);

View File

@@ -34,9 +34,19 @@
using std::min;
enum {
UseCustomTrackNameID = 1000,
};
BEGIN_EVENT_TABLE(RecordingPrefs, PrefsPanel)
EVT_CHECKBOX(UseCustomTrackNameID, RecordingPrefs::OnToggleCustomName)
END_EVENT_TABLE()
RecordingPrefs::RecordingPrefs(wxWindow * parent)
: PrefsPanel(parent, _("Recording"))
{
gPrefs->Read(wxT("/GUI/TrackNames/RecordingNameCustom"), &mUseCustomTrackName, false);
mOldNameChoice = mUseCustomTrackName;
Populate();
}
@@ -125,6 +135,37 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S)
}
S.EndStatic();
S.StartStatic(_("Naming newly recorded tracks"));
{
S.StartMultiColumn(3);
{
S.Id(UseCustomTrackNameID).TieCheckBox(_("Use Custom Track &Name"),
wxT("/GUI/TrackNames/RecordingNameCustom"),
mUseCustomTrackName ? true : false);
mToggleCustomName = S.TieTextBox(wxT(""),
wxT("/GUI/TrackNames/RecodingTrackName"),
_("Recorded_Audio"),
30);
mToggleCustomName->SetName(_("Custom name text"));
mToggleCustomName->Enable(mUseCustomTrackName);
}
S.EndMultiColumn();
S.TieCheckBox(_("Add &Track Number"),
wxT("/GUI/TrackNames/TrackNumber"),
false);
S.TieCheckBox(_("Add System &Date"),
wxT("/GUI/TrackNames/DateStamp"),
false);
S.TieCheckBox(_("Add System T&ime"),
wxT("/GUI/TrackNames/TimeStamp"),
false);
}
S.EndStatic();
#ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
S.StartStatic(_("Automated Recording Level Adjustment"));
{
@@ -203,6 +244,12 @@ bool RecordingPrefs::Apply()
return true;
}
void RecordingPrefs::OnToggleCustomName(wxCommandEvent & Evt)
{
mUseCustomTrackName = !mUseCustomTrackName;
mToggleCustomName->Enable(mUseCustomTrackName);
}
PrefsPanel *RecordingPrefsFactory::Create(wxWindow *parent)
{
return new RecordingPrefs(parent);

View File

@@ -13,6 +13,7 @@
#define __AUDACITY_RECORDING_PREFS__
#include <wx/defs.h>
#include <wx/textctrl.h>
#include <wx/window.h>
@@ -30,6 +31,13 @@ class RecordingPrefs :public PrefsPanel
private:
void Populate();
void PopulateOrExchange(ShuttleGui & S);
void OnToggleCustomName(wxCommandEvent & Evt);
wxTextCtrl *mToggleCustomName;
bool mUseCustomTrackName;
bool mOldNameChoice;
DECLARE_EVENT_TABLE();
};
class RecordingPrefsFactory : public PrefsPanelFactory

View File

@@ -30,8 +30,6 @@
#include "../Experimental.h"
////////////////////////////////////////////////////////////////////////////////
TracksPrefs::TracksPrefs(wxWindow * parent)
: PrefsPanel(parent, _("Tracks"))
{
@@ -96,15 +94,23 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
S.StartMultiColumn(2);
{
S.TieChoice(_("Default &View Mode:"),
S.TieChoice(_("Default &view mode:"),
wxT("/GUI/DefaultViewModeNew"),
0,
mViewChoices,
mViewCodes);
S.SetSizeHints(mViewChoices);
S.TieTextBox(_("Default audio track &name:"),
wxT("/GUI/TrackNames/DefaultTrackName"),
_("Audio Track"),
30);
}
S.EndMultiColumn();
S.TieCheckBox(_("Sho&w track name in waveform display"),
wxT("/GUI/ShowTrackNameInWaveform"),
false);
}
S.EndStatic();