near the very top add one additional include to pick up Preferences:
Code: Select all
#include "Audacity.h"
#include "../Prefs.h"//add this line
#include <wx/defs.h>Code: Select all
//mTimeCtrl->SetFormatString(mTimeCtrl->GetBuiltinFormat(mFormat));//comment out
mFormat = gPrefs->Read(wxT("/SelectionFormat"), _("Seconds"));//add this lineCode: Select all
mNoiseDurationT->SetName(_("Duration"));
wxString formatSelection = gPrefs->Read(wxT("/SelectionFormat"), _("Seconds"));//add this line
mNoiseDurationT->SetFormatString(mNoiseDurationT->GetBuiltinFormat(formatSelection));//add this line
//mNoiseDurationT->SetFormatString(mNoiseDurationT->GetBuiltinFormat(nIsSelection==true?(_("hh:mm:ss + samples")):(_("seconds"))));near the very top add one additional include to pick up Preferences:
Code: Select all
#include "Audacity.h"
#include "../Prefs.h"//add this line
#include <wx/defs.h>Code: Select all
mDuration = mT1 - mT0;
//dlog.SetFormatString(_("hh:mm:ss + samples"));//comment out this line
} else {
// Retrieve last used values
gPrefs->Read(wxT("/Effects/SilenceGen/Duration"), &mDuration, 30L);
//dlog.SetFormatString(_("seconds"));//comment out this line
}
dlog.SetTimeValue(mDuration);With even a cursory examination of Noise.cpp and Silence.cpp one can see that, although these two dialogues are virtually identical, the code implementing each is quite different. From what I understand the Developers would like to re-factor this code to get rid of all the duplicated functionality and make source code uniform. My understanding is that this is why they have not bothered to make this change yet. My contention is that we might as well make these little tiny changes now so that users are accommodated and when the Developers get around to modifying the code the improvements will already be there to be picked up regardless of which method is chosen. Although the Silence Dialog's solution is more elegant I have not examined all the code from both dialogues to see which would be best to use to represent both Silence and Noise as a dialog.