Default time/duration settings?
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Default time/duration settings?
I've started using Audacity quite a bit lately for some personal projects. I am familiar with a few other audio editing programs such as Cubase VST and Pro Tools, although it's been a while since I've used them heavily, and most of that was on previous (or in some cases previous^4) versions. Besides a few minor things tripping me up from switching programs, there is one thing that is bugging the crap out of me in this otherwise fine effort: while generating tones or silences, the default duration setting either switches back to mm:ss or mm:ss:samples instead of staying with the last selection, in this case mm:ss milliseconds. Yeah, don't ask me why, I just work better in ms, unless I'm doing video. This is pretty annoying when you are flying through a project and accidentally generate a 24 second sine wave instead of a .25 second wave, or other similar occurrences. Is this a bug, feature, or none of the above? Is there some setting in preferences I am missing? Is there any way to fix/change/break this problem/option/feature? If this is old news, please chastise me for not searching (though I did) or reading, but if this is new news, consider it a feature request/suggestion. Thanks and cheers, Me
Re: Default time/duration settings?
I've moved this to the feature request section because as far as I'm aware Audacity has always done that, so my guess is that it is a "feature" rather than a "bug".
I'll also add my vote to your suggestion:
Generate menus to default to last used units (or the same units as the Selection Toolbar)
+1
I'll also add my vote to your suggestion:
Generate menus to default to last used units (or the same units as the Selection Toolbar)
+1
Learn more about Nyquist programming at audionyq.com
Re: Default time/duration settings?
This is a very simple fix but requires adding a few more entries to the Prefs file. The code already exists as the Selection Toolbar already does this. I have implemented it on my personal version of Audacity and had no problems.
-Edgar
running Audacity personally customized 2.0.6 daily in a professional audio studio
occasionally using current Audacity alpha for testing and support situations
64-bit Windows Pro 10
running Audacity personally customized 2.0.6 daily in a professional audio studio
occasionally using current Audacity alpha for testing and support situations
64-bit Windows Pro 10
Re: Default time/duration settings?
Could you tell us more about how you did that, or perhaps a patch?Edgar wrote:I have implemented it on my personal version of Audacity
I'd like to try it out, but I'm not a programmer and I don't think I'd be able to work it out myself.
Learn more about Nyquist programming at audionyq.com
Re: Default time/duration settings?
A patch might rapidly become stale and almost certainly never be applied. The developers of Audacity are very reluctant to add these kinds of features at this time, because of feature and preferences creep. If the patch were not applied to the SVN head, anyone who wish to use it would need to modify the patch frequently as the SVN HEAD changed, I will attach a patch to this-- .patch files not allowed -- attached file trd.patch.txt needs a name change to trd.patch.stevethefiddle wrote: Could you tell us more about how you did that, or perhaps a patch?
Here's a description of the current situation and enough information so that anyone who is compiling their own version of Audacity may make this change for themselves (all line numbers are approximate).
As we can see, the Selection Toolbar already recalls its state by saving the information in Audacity's preferences file:
(a snippet from the preference file with default setting)
Code: Select all
NewPrefsInitialized=1
Version=1.3.13-alpha-Jul 19 2010
[...]
SelectionFormat=hh:mm:ssCode: Select all
NewPrefsInitialized=1
Version=1.3.13-alpha-Jul 19 2010
[...]
SelectionFormat=CDDA frames (75 fps)srctoolbarsSelectionBar.cpp line number 101 (read in from preferences):
Code: Select all
void SelectionBar::Populate()
{
[...]
TimeTextCtrl *ttc = new TimeTextCtrl(this, wxID_ANY, wxT(""), 0.0, mRate);
wxString formatName;
gPrefs->Read(wxT("/SelectionFormat"), &formatName);
wxString format = ttc->GetBuiltinFormat(formatName);
delete ttc;Code: Select all
void SelectionBar::OnUpdate(wxCommandEvent &evt)
{
[...]
TimeTextCtrl *ttc = new TimeTextCtrl(this, wxID_ANY, wxT(""), 0.0, mRate);
wxString formatName(ttc->GetBuiltinName(index));
gPrefs->Write(wxT("/SelectionFormat"), formatName);
delete ttc;Code: Select all
Find all "new TimeTextCtrl", Regular expressions, Subfolders, Find Results 1, "Entire Solution", "*.c; *.cpp"
D:audioAudacitySVNsrcSnap.cpp(47): ttc = new TimeTextCtrl(p, wxID_ANY, wxT(""), 0.0, p->GetRate());
D:audioAudacitySVNsrcTimerRecordDialog.cpp(337): m_pTimeTextCtrl_Start = new TimeTextCtrl(this, ID_TIMETEXT_START, strFormat);
D:audioAudacitySVNsrcTimerRecordDialog.cpp(356): m_pTimeTextCtrl_End = new TimeTextCtrl(this, ID_TIMETEXT_END, strFormat);
D:audioAudacitySVNsrcTimerRecordDialog.cpp(367): m_pTimeTextCtrl_Duration = new TimeTextCtrl(this, ID_TIMETEXT_DURATION, strFormat1);
D:audioAudacitySVNsrctoolbarsSelectionBar.cpp(113): TimeTextCtrl *ttc = new TimeTextCtrl(this, wxID_ANY, wxT(""), 0.0, mRate);
D:audioAudacitySVNsrctoolbarsSelectionBar.cpp(244): mLeftTime = new TimeTextCtrl(this, OnLeftTimeID, wxT(""), 0.0, mRate);
D:audioAudacitySVNsrctoolbarsSelectionBar.cpp(250): mRightTime = new TimeTextCtrl(this, OnRightTimeID, format, 0.0, mRate);
D:audioAudacitySVNsrctoolbarsSelectionBar.cpp(262): mAudioTime = new TimeTextCtrl(this, -1, format, 0.0, mRate);
D:audioAudacitySVNsrctoolbarsSelectionBar.cpp(357): TimeTextCtrl *ttc = new TimeTextCtrl(this, wxID_ANY, wxT(""), 0.0, mRate);
D:audioAudacitySVNsrcwidgetsGrid.cpp(47): m_control = new TimeTextCtrl(parent,
D:audioAudacitySVNsrcwidgetsTimeTextCtrl.cpp(417): SetAccessible(new TimeTextCtrlAx(this));
Matching lines: 11 Matching files: 5 Total files searched: 873srcTimerRecordDialog.cpp line number 320:
Code: Select all
void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
{
[...]
wxString strFormat = wxT("099 h 060 m 060 s");
[...]
m_pTimeTextCtrl_Start = new TimeTextCtrl(this, ID_TIMETEXT_START, strFormat);srcTimerRecordDialog.h line number 47 add function declaration:
Code: Select all
void OnUpdate(wxCommandEvent &evt);
Code: Select all
void TimerRecordDialog::OnUpdate(wxCommandEvent &evt)
{
int index = evt.GetInt();
evt.Skip(true);
/* we don't actually need a TimeTextCtrl, but need it's
* translations which are done at runtime */
TimeTextCtrl *ttc = new TimeTextCtrl(this, wxID_ANY, wxT(""), 0.0, 0.0);
wxString formatName(ttc->GetBuiltinName(index));
gPrefs->Write(wxT("/TimerRecordDialogFormat"), formatName);
delete ttc;
}Code: Select all
EVT_COMMAND(wxID_ANY, EVT_TIMETEXTCTRL_UPDATED, TimerRecordDialog::OnUpdate)Code: Select all
void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
{
S.SetBorder(5);
S.StartVerticalLay(true);
{
/* we don't actually need a control yet, but we want to use it's methods
* to do some look-ups, so we'll have to create one. We can't make the
* look-ups static because they depend on translations which are done at
* runtime */
TimeTextCtrl *ttc = new TimeTextCtrl(this, wxID_ANY, wxT(""), 0.0, 0.0);
wxString formatName;
gPrefs->Read(wxT("/TimerRecordDialogFormat"), &formatName);
wxString format = ttc->GetBuiltinFormat(formatName);
delete ttc;
S.StartStatic(_("Start Date and Time"), true);
{
m_pDatePickerCtrl_Start =
new wxDatePickerCtrl(this, // wxWindow *parent,
ID_DATEPICKER_START, // wxWindowID id,
m_DateTime_Start); // const wxDateTime& dt = wxDefaultDateTime,
// const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = "datectrl")
m_pDatePickerCtrl_Start->SetName(_("Start Date"));
m_pDatePickerCtrl_Start->SetRange(wxDateTime::Today(), wxInvalidDateTime); // No backdating.
S.AddWindow(m_pDatePickerCtrl_Start);
m_pTimeTextCtrl_Start = new TimeTextCtrl(this, ID_TIMETEXT_START, format);
m_pTimeTextCtrl_Start->EnableMenu(true);
m_pTimeTextCtrl_Start->SetName(_("Start Time"));
m_pTimeTextCtrl_Start->SetTimeValue(wxDateTime_to_AudacityTime(m_DateTime_Start));
S.AddWindow(m_pTimeTextCtrl_Start);
}
S.EndStatic();
S.StartStatic(_("End Date and Time"), true);
{
m_pDatePickerCtrl_End =
new wxDatePickerCtrl(this, // wxWindow *parent,
ID_DATEPICKER_END, // wxWindowID id,
m_DateTime_End); // const wxDateTime& dt = wxDefaultDateTime,
// const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = "datectrl")
m_pDatePickerCtrl_End->SetRange(m_DateTime_Start, wxInvalidDateTime); // No backdating.
m_pDatePickerCtrl_End->SetName(_("End Date"));
S.AddWindow(m_pDatePickerCtrl_End);
m_pTimeTextCtrl_End = new TimeTextCtrl(this, ID_TIMETEXT_END, format);
m_pTimeTextCtrl_Start->EnableMenu(true);
m_pTimeTextCtrl_End->SetName(_("End Time"));
m_pTimeTextCtrl_End->SetTimeValue(wxDateTime_to_AudacityTime(m_DateTime_End));
S.AddWindow(m_pTimeTextCtrl_End);
}
S.EndStatic();
S.StartStatic(_("Duration"), true);
{
m_pTimeTextCtrl_Duration = new TimeTextCtrl(this, ID_TIMETEXT_DURATION, format);
m_pTimeTextCtrl_Duration->SetName(_("Duration"));
m_pTimeTextCtrl_Duration->SetTimeValue(
Internat::CompatibleToDouble(m_TimeSpan_Duration.GetSeconds().ToString()));
S.AddWindow(m_pTimeTextCtrl_Duration);
}
S.EndStatic();
}
S.EndVerticalLay();
S.AddStandardButtons();
Layout();
Fit();
SetMinSize(GetSize());
Center();
}Error checking is also left out--it may well be fatal to set the "start time" in NTSC Frames, Samples or other non-time based "times"!
Code: Select all
NewPrefsInitialized=1
Version=1.3.13-alpha-Jul 21 2010
PrefsVersion=1.1.1r1
[...]
SelectionFormat=CDDA frames (75 fps)
[...]
TimerRecordDialogFormat=samples- Attachments
-
- trd.patch.txt
- really a .patch file
- (4.01 KiB) Downloaded 128 times
-Edgar
running Audacity personally customized 2.0.6 daily in a professional audio studio
occasionally using current Audacity alpha for testing and support situations
64-bit Windows Pro 10
running Audacity personally customized 2.0.6 daily in a professional audio studio
occasionally using current Audacity alpha for testing and support situations
64-bit Windows Pro 10
Re: Default time/duration settings?
Thanks very much Edgar. There's plenty there for me (not a programmer) to chew on. Hopefully have time to try it out at the weekend.
Re: Default time/duration settings?
Of course, the simple fix (on a personal basis) is to make the hardcoded format string hardcoded to the format you prefer!
-Edgar
running Audacity personally customized 2.0.6 daily in a professional audio studio
occasionally using current Audacity alpha for testing and support situations
64-bit Windows Pro 10
running Audacity personally customized 2.0.6 daily in a professional audio studio
occasionally using current Audacity alpha for testing and support situations
64-bit Windows Pro 10
-
kozikowski
- Posts: 71538
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Default time/duration settings?
There is a really bad workaround for this. I noticed that my former duration numbers stick if I select hh:mm:ss from the default of 30 seconds-only.
I'm doing a task that requires 5 minutes of tone, repeatedly. Each time I switch from seconds-only to hh:mm:ss, my five minute duration comes back without me typing it in again.
Koz
I'm doing a task that requires 5 minutes of tone, repeatedly. Each time I switch from seconds-only to hh:mm:ss, my five minute duration comes back without me typing it in again.
Koz
-
waxcylinder
- Posts: 15366
- Joined: Tue Jul 31, 2007 11:03 am
- Operating System: Windows 10 / 11
Re: Default time/duration settings?
I've moved the gist of this thread to the Pending Feature Requests page in the Audacity Wiki.
I have retained it on the forum here and moved it to Audio Processing so that other readers may benefit from Ed's code if they want to try the DIY approach.
WC
I have retained it on the forum here and moved it to Audio Processing so that other readers may benefit from Ed's code if they want to try the DIY approach.
WC