mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 16:49:41 +02:00
Add a setting for whether labels can be created by typing
Added a setting for whether labels can be created by typing in a label track. The setting can be changed in either the Tracks menu, or the Tracks category in Preferences. By default the setting is set to on.
This commit is contained in:
parent
cf547077d5
commit
a79596fb4e
@ -1687,7 +1687,9 @@ bool LabelTrack::CaptureKey(wxKeyEvent & event)
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (IsGoodLabelFirstKey(event)) {
|
||||
bool typeToCreateLabel;
|
||||
gPrefs->Read(wxT("/GUI/TypeToCreateLabel"), &typeToCreateLabel, true);
|
||||
if (IsGoodLabelFirstKey(event) && typeToCreateLabel) {
|
||||
AudacityProject * pProj = GetActiveProject();
|
||||
|
||||
// If we're playing, don't capture if the selection is the same as the
|
||||
|
@ -920,6 +920,9 @@ void AudacityProject::CreateMenusAndCommands()
|
||||
AudioIOBusyFlag);
|
||||
c->AddItem(wxT("EditLabels"), _("&Edit Labels..."), FN(OnEditLabels));
|
||||
|
||||
c->AddCheck(wxT("TypeToCreateLabel"), _("&Type to Create a Label (on/off)"),
|
||||
FN(OnToggleTypeToCreateLabel), 0, AlwaysEnabledFlag, AlwaysEnabledFlag);
|
||||
|
||||
c->AddSeparator();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@ -1911,6 +1914,8 @@ void AudacityProject::ModifyToolbarMenus()
|
||||
gPrefs->Read(wxT("/GUI/SyncLockTracks"), &active, false);
|
||||
SetSyncLock(active);
|
||||
mCommandManager.Check(wxT("SyncLock"), active);
|
||||
gPrefs->Read(wxT("/GUI/TypeToCreateLabel"),&active, true);
|
||||
mCommandManager.Check(wxT("TypeToCreateLabel"), active);
|
||||
}
|
||||
|
||||
// checkActive is a temporary hack that should be removed as soon as we
|
||||
@ -6694,6 +6699,15 @@ void AudacityProject::OnEditLabels()
|
||||
DoEditLabels();
|
||||
}
|
||||
|
||||
void AudacityProject::OnToggleTypeToCreateLabel()
|
||||
{
|
||||
bool typeToCreateLabel;
|
||||
gPrefs->Read(wxT("/GUI/TypeToCreateLabel"), &typeToCreateLabel, true);
|
||||
gPrefs->Write(wxT("/GUI/TypeToCreateLabel"), !typeToCreateLabel);
|
||||
gPrefs->Flush();
|
||||
ModifyAllProjectToolbarMenus();
|
||||
}
|
||||
|
||||
void AudacityProject::OnApplyChain()
|
||||
{
|
||||
BatchProcessDialog dlg(this);
|
||||
|
@ -377,6 +377,7 @@ void OnAddLabel();
|
||||
void OnAddLabelPlaying();
|
||||
void DoEditLabels(LabelTrack *lt = nullptr, int index = -1);
|
||||
void OnEditLabels();
|
||||
void OnToggleTypeToCreateLabel();
|
||||
|
||||
// Effect Menu
|
||||
|
||||
|
@ -144,7 +144,7 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
wxT("/GUI/SelectAllOnNone"),
|
||||
true);
|
||||
/* i18n-hint: cut-lines are a lines indicating where to cut.*/
|
||||
S.TieCheckBox(_("Enable cu&t lines"),
|
||||
S.TieCheckBox(_("Enable c&ut lines"),
|
||||
wxT("/GUI/EnableCutLines"),
|
||||
false);
|
||||
S.TieCheckBox(_("Enable &dragging of left and right selection edges"),
|
||||
@ -156,6 +156,9 @@ void TracksPrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
S.TieCheckBox(_("Editing a clip can &move other clips"),
|
||||
wxT("/GUI/EditClipCanMove"),
|
||||
true);
|
||||
S.TieCheckBox(_("&Type to create a label"),
|
||||
wxT("/GUI/TypeToCreateLabel"),
|
||||
true);
|
||||
#ifdef EXPERIMENTAL_SCROLLING_LIMITS
|
||||
S.TieCheckBox(_("Enable scrolling left of &zero"),
|
||||
ScrollingPreferenceKey(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user