Update of /cvsroot/audacity/audacity-src/src/effects
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv32382
Modified Files:
DtmfGen.cpp DtmfGen.h Noise.cpp Noise.h Silence.cpp
ToneGen.cpp ToneGen.h
Log Message:
All the generators now will have the TimeTextCtrl set to "seconds" if no
selection, and "hh:mm:ss+samples" if a selection has been made on the track.
This to avoid the rounding issue with the default "seconds" representation, but
keeps dialogs 'nice and clean' when the extra precision is not needed.
Index: DtmfGen.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/DtmfGen.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- DtmfGen.cpp 24 Jan 2007 13:29:05 -0000 1.5
+++ DtmfGen.cpp 31 Jan 2007 07:21:31 -0000 1.6
@@ -57,9 +57,11 @@
if (mT1 > mT0) {
// there is a selection: let's fit in there...
dtmfDuration = mT1 - mT0;
+ dlog.dIsSelection = true;
} else {
// retrieve last used values
gPrefs->Read(wxT("/CsPresets/DtmfGen_SequenceDuration"), &dtmfDuration,
2L);
+ dlog.dIsSelection = false;
}
gPrefs->Read(wxT("/CsPresets/DtmfGen_String"), &dtmfString, _("12345"));
@@ -394,7 +396,7 @@
I want it (dDuration) to be used as the duration, and
with "seconds" this does
not always work properly. For example, it rounds down to
zero...
*/
- TimeTextCtrl::GetBuiltinFormat(wxT("hh:mm:ss +
milliseconds")),
+
TimeTextCtrl::GetBuiltinFormat(dIsSelection==true?(wxT("hh:mm:ss +
samples")):(wxT("seconds"))),
dDuration,
44100,
wxDefaultPosition,
Index: Noise.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Noise.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Noise.cpp 21 Jan 2007 20:35:01 -0000 1.16
+++ Noise.cpp 31 Jan 2007 07:21:31 -0000 1.17
@@ -47,10 +47,13 @@
// value from saved config: this is useful is user wants to
// replace selection with noise
//
- if (mT1 > mT0)
+ if (mT1 > mT0) {
noiseDuration = mT1 - mT0;
- else
+ dlog.nIsSelection = true;
+ } else {
gPrefs->Read(wxT("/CsPresets/NoiseGen_Duration"), &noiseDuration, 1L);
+ dlog.nIsSelection = false;
+ }
gPrefs->Read(wxT("/CsPresets/NoiseGen_Type"), &noiseType, 0L);
gPrefs->Read(wxT("/CsPresets/NoiseGen_Amp"), &noiseAmplitude, 1.0);
@@ -225,7 +228,7 @@
I want it (nDuration) to be used as the duration, and with
"seconds" this does
not always work properly. For example, it rounds down to
zero...
*/
- TimeTextCtrl::GetBuiltinFormat(wxT("hh:mm:ss +
milliseconds")),
+
TimeTextCtrl::GetBuiltinFormat(nIsSelection==true?(wxT("hh:mm:ss +
samples")):(wxT("seconds"))),
nDuration,
44100,
wxDefaultPosition,
Index: Silence.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Silence.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- Silence.cpp 25 Aug 2006 05:12:23 -0000 1.17
+++ Silence.cpp 31 Jan 2007 07:21:31 -0000 1.18
@@ -29,10 +29,17 @@
bool EffectSilence::PromptUser()
{
- if (mT1 > mT0)
+ TimeDialog dlog(mParent, wxID_ANY, _("Silence Generator"));
+
+ if (mT1 > mT0) {
+ // there is a selection: let's fit in there...
length = mT1 - mT0;
+ dlog.SetFormatString(wxT("hh:mm:ss + samples"));
- TimeDialog dlog(mParent, wxID_ANY, _("Silence Generator"));
+ } else {
+ // retrieve last used values
+ dlog.SetFormatString(wxT("seconds"));
+ }
dlog.SetTimeValue(length);
if (dlog.ShowModal() == wxID_CANCEL)
Index: DtmfGen.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/DtmfGen.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- DtmfGen.h 13 Jan 2007 00:06:18 -0000 1.3
+++ DtmfGen.h 31 Jan 2007 07:21:31 -0000 1.4
@@ -108,11 +108,6 @@
wxStaticText *mDtmfToneT;
wxStaticText *mDtmfSilenceT;
wxStaticText *mDtmfDutyT;
- bool startup; // this is needed to discriminate between first time
dialog is up
- // and subsequent text updates, as the Recalculate()
method is called
- // The problem is caused by the fact that the
EVT_TEXT is generated
- // also by an internal SetValue. Maybe with wxWidget
2.8 we can clean
- // this up...
DECLARE_EVENT_TABLE()
@@ -123,6 +118,7 @@
double dSilence; // duration of silence between tones
double dDuration; // duration of the whole dtmf tone sequence
double dDutyCycle; // ratio of dTone/(dTone+dSilence)
+ bool dIsSelection; // true if duration comes from selection
};
Index: Noise.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/Noise.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Noise.h 13 Jan 2007 00:06:18 -0000 1.9
+++ Noise.h 31 Jan 2007 07:21:31 -0000 1.10
@@ -99,6 +99,7 @@
double nDuration;
int nType;
double nAmplitude;
+ bool nIsSelection;
private:
TimeTextCtrl *mNoiseDurationT;
Index: ToneGen.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/ToneGen.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- ToneGen.cpp 16 Jan 2007 00:10:44 -0000 1.37
+++ ToneGen.cpp 31 Jan 2007 07:21:31 -0000 1.38
@@ -63,15 +63,18 @@
bool EffectToneGen::PromptUser()
{
wxArrayString waveforms;
- if (mT1 > mT0)
- length = mT1 - mT0;
-
+ ToneGenDialog dlog(mParent, mbChirp ? _("Chirp Generator") : _("Tone
Generator"));
waveforms.Add(_("Sine"));
waveforms.Add(_("Square"));
waveforms.Add(_("Sawtooth"));
waveforms.Add(_("Square, no alias"));
+ dlog.isSelection= false;
- ToneGenDialog dlog(mParent, mbChirp ? _("Chirp Generator") : _("Tone
Generator"));
+ if (mT1 > mT0) {
+ length = mT1 - mT0;
+ dlog.isSelection= true;
+ }
+
dlog.mbChirp = mbChirp;
dlog.waveform = waveform;
dlog.frequency[0] = frequency[0];
@@ -298,7 +301,7 @@
mToneDurationT = new
TimeTextCtrl(this,
ID_TONE_DURATION_TEXT,
- TimeTextCtrl::GetBuiltinFormat(wxT("hh:mm:ss +
milliseconds")),
+
TimeTextCtrl::GetBuiltinFormat(isSelection==true?(wxT("hh:mm:ss +
samples")):(wxT("seconds"))),
length,
44100,
wxDefaultPosition,
@@ -336,7 +339,7 @@
mToneDurationT = new
TimeTextCtrl(this,
ID_TONE_DURATION_TEXT,
- TimeTextCtrl::GetBuiltinFormat(wxT("hh:mm:ss +
milliseconds")),
+
TimeTextCtrl::GetBuiltinFormat(isSelection==true?(wxT("hh:mm:ss +
samples")):(wxT("seconds"))),
length,
44100,
wxDefaultPosition,
Index: ToneGen.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/effects/ToneGen.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- ToneGen.h 15 Jan 2007 08:05:07 -0000 1.18
+++ ToneGen.h 31 Jan 2007 07:21:31 -0000 1.19
@@ -112,6 +112,7 @@
double frequency[2];
double amplitude[2];
double length;
+ bool isSelection;
private:
TimeTextCtrl *mToneDurationT;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs