Hello again!
and here a pre-version for the Noise Removal, which now
allows to use different window functions as well.
This is more "experimental", in the sense that I would like
some feedback as for the "alfa" thing - there is some
relation between higher alfa, lower window lenght, sampling
frequency - and as for the usage. Also, I did not take care
of the ClearSpeach case - what to do there? ...
thx!
.salvo
ps. in order to apply this patch, you will need to apply
also the ones of my other email. I believe only those for
the FFT are needed, but haven't double checked.
--- salvatore ventura <venturasalvatore@...> ha
scritto:
> Hi,
> so here we go: different files in here, they do the
> following:
>
> - the "generate noise" with more options
> - additional window functions available in the FFT
> - new window functions available for use in the Analyze
>
> Spectrum
>
> Hope the format is ok. Files are DOS mode: if needed, I
> can generate UNIX ones.
>
> Let me know,
>
> thx,
> .salvo
>
>
> worth a visit...
> ======================================
> http://www.bytekiln.com
> http://guidamadrid.altervista.org
> http://www.worldbuildingservice.com
>
> __________________________________________________
> Do You Yahoo!?
> Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo
> spam e ti da tanto spazio gratuito per i tuoi file e i
> messaggi
> http://mail.yahoo.it > Index: FFT.h
>
===================================================================
> RCS file: /cvsroot/audacity/audacity-src/src/FFT.h,v
> retrieving revision 1.4
> diff -u -r1.4 FFT.h
> --- FFT.h 8 Feb 2005 04:49:30 -0000 1.4
> +++ FFT.h 7 Nov 2006 07:00:20 -0000
> @@ -72,6 +72,12 @@
> * 1: Bartlett (triangular)
> * 2: Hamming
> * 3: Hanning
> + * 4: Blackman
> + * 5: Blackman-Harris
> + * 6: Welch
> + * 7: Gaussian(a=2.5)
> + * 8: Gaussian(a=3.5)
> + * 9: Gaussian(a=4.5)
> */
>
> void WindowFunc(int whichFunction, int NumSamples, float
> *data);
> > Index: FFT.cpp
>
===================================================================
> RCS file: /cvsroot/audacity/audacity-src/src/FFT.cpp,v
> retrieving revision 1.8
> diff -u -r1.8 FFT.cpp
> --- FFT.cpp 15 Jun 2006 14:26:13 -0000 1.8
> +++ FFT.cpp 7 Nov 2006 06:58:35 -0000
> @@ -68,9 +68,11 @@
> exit(1);
> }
>
> +
> for (i = 0;; i++)
> if (PowerOfTwo & (1 << i))
> return i;
> +
> }
>
> int ReverseBits(int index, int NumBits)
> @@ -361,7 +363,7 @@
>
> int NumWindowFuncs()
> {
> - return 4;
> + return 10;
> }
>
> const wxChar *WindowFuncName(int whichFunction)
> @@ -376,12 +378,25 @@
> return wxT("Hamming");
> case 3:
> return wxT("Hanning");
> + case 4:
> + return wxT("Blackman");
> + case 5:
> + return wxT("Blackman-Harris");
> + case 6:
> + return wxT("Welch");
> + case 7:
> + return wxT("Gaussian(a=2.5)");
> + case 8:
> + return wxT("Gaussian(a=3.5)");
> + case 9:
> + return wxT("Gaussian(a=4.5)");
> }
> }
>
> void WindowFunc(int whichFunction, int NumSamples, float
> *in)
> {
> int i;
> + double A;
>
> if (whichFunction == 1) {
> // Bartlett (triangular) window
> @@ -403,6 +418,62 @@
> for (i = 0; i < NumSamples; i++)
> in[i] *= 0.50 - 0.50 * cos(2 * M_PI * i /
> (NumSamples - 1));
> }
> +
> + if (whichFunction == 4) {
> + // Blackman
> + for (i = 0; i < NumSamples; i++) {
> + in[i] *= 0.42 - 0.5 * cos (2 * M_PI * i /
> (NumSamples - 1)) + 0.08 * cos (4 * M_PI * i /
> (NumSamples - 1));
> + }
> + }
> +
> + if (whichFunction == 5) {
> + // Blackman-Harris
> + for (i = 0; i < NumSamples; i++) {
> + in[i] *= 0.35875 - 0.48829 * cos(2 * M_PI * i
> /(NumSamples-1)) + 0.14128 * cos(4 * M_PI *
> i/(NumSamples-1)) - 0.01168 * cos(6 * M_PI *
> i/(NumSamples-1));
> + }
> + }
> +
> + if (whichFunction == 6) {
> + // Welch
> + for (i = 0; i < NumSamples; i++) {
> + in[i] *=
> 4*i/(float)NumSamples*(1-(i/(float)NumSamples));
> + }
> + }
> +
> + if (whichFunction == 7) {
> + // Gaussian (a=2.5)
> + // Precalculate some values, and simplify the fmla
> to try and reduce overhead
> + A=-2*2.5*2.5;
> +
> + for (i = 0; i < NumSamples; i++) {
> + // full
> + // in[i] *=
>
exp(-0.5*(A*((i-NumSamples/2)/NumSamples/2))*(A*((i-NumSamples/2)/NumSamples/2)));
> + // reduced
> + in[i] *= exp(A*(0.25 +
> ((i/(float)NumSamples)*(i/(float)NumSamples)) -
> (i/(float)NumSamples)));
> + }
> + }
> +
> + if (whichFunction == 8) {
> + // Gaussian (a=3.5)
> + A=-2*3.5*3.5;
> +
> + for (i = 0; i < NumSamples; i++) {
> + // reduced
> + in[i] *= exp(A*(0.25 +
> ((i/(float)NumSamples)*(i/(float)NumSamples)) -
> (i/(float)NumSamples)));
> + }
> + }
> +
> + if (whichFunction == 9) {
> + // Gaussian (a=4.5)
> + A=-2*4.5*4.5;
> +
> + for (i = 0; i < NumSamples; i++) {
> + // reduced
> + in[i] *= exp(A*(0.25 +
> ((i/(float)NumSamples)*(i/(float)NumSamples)) -
> (i/(float)NumSamples)));
> + }
> + }
> +
> +
> }
>
> // Indentation settings for Vim and Emacs and unique
> identifier for Arch, a
> > Index: FreqWindow.cpp
>
===================================================================
> RCS file:
> /cvsroot/audacity/audacity-src/src/FreqWindow.cpp,v
> retrieving revision 1.38
> diff -u -r1.38 FreqWindow.cpp
> --- FreqWindow.cpp 23 Sep 2006 02:28:04 -0000 1.38
> +++ FreqWindow.cpp 28 Oct 2006 08:31:24 -0000
> @@ -143,7 +143,7 @@
> wxStaticText *algLabel = new wxStaticText(this,
> wxID_ANY, _("Algorithm:"));
> mAlgChoice = new wxChoice(this, FreqAlgChoiceID,
> wxDefaultPosition,
> wxDefaultSize,
> - 4, algChoiceStrings);
> + 5, algChoiceStrings);
>
> mAlgChoice->SetSelection(0);
>
> @@ -818,7 +818,7 @@
>
> (mSizeChoice->GetStringSelection()).ToLong(&windowSize);
>
> if (!(windowSize >= 32 && windowSize <= 65536 &&
> - alg >= 0 && alg <= 3 && windowFunc >= 0 &&
> windowFunc <= 3)) {
> + alg >= 0 && alg <= 3 && windowFunc >= 0 &&
> windowFunc <= 9)) {
> mFreqPlot->Refresh(true);
> return;
> }
> > Index: Noise.h
>
===================================================================
> RCS file:
> /cvsroot/audacity/audacity-src/src/effects/Noise.h,v
> retrieving revision 1.6
> diff -u -r1.6 Noise.h
> --- Noise.h 28 Nov 2005 19:14:13 -0000 1.6
> +++ Noise.h 7 Nov 2006 08:22:20 -0000
> @@ -5,7 +5,7 @@
> Noise.h
>
> Dominic Mazzoni
> -
> +
> An effect for the "Generator" menu to add white noise.
>
>
>
**********************************************************************/
> @@ -17,6 +17,13 @@
> #include <wx/intl.h>
>
> #include "Effect.h"
> +#include <wx/dialog.h>
> +#include <wx/choice.h>
> +#include "../widgets/TimeTextCtrl.h"
> +
> +class wxString;
> +class wxChoice;
> +class wxTextCtrl;
>
> class EffectNoise:public Effect {
>
> @@ -24,15 +31,15 @@
> EffectNoise() {}
>
> virtual wxString GetEffectName() {
> - return wxString(_("&White Noise"));
> + return wxString(_("&Noise"));
> }
>
> - virtual wxString GetEffectDescription() {
> - return wxString::Format(_("Applied effect:
> Generate White Noise, %.6lf seconds"), length);
> - }
> + virtual wxString GetEffectDescription() {
> + return wxString::Format(_("Applied effect:
> Generate Noise, %.6lf seconds"), noiseDuration);
> + }
>
> virtual wxString GetEffectAction() {
> - return wxString(_("Generating White Noise"));
> + return wxString(_("Generating Noise"));
> }
>
> virtual int GetEffectFlags() {
> @@ -43,9 +50,88 @@
> virtual bool Process();
>
> private:
> - double length;
> + double noiseDuration;
> + int noiseType;
> + double noiseAmplitude;
> +
> +
> + // friendship ...
> + friend class NoiseDialog;
> +
> +};
> +
> +
>
+//----------------------------------------------------------------------------
> +// NoiseDialog
>
+//----------------------------------------------------------------------------
> +
> +// Declare window functions
> +
> +class NoiseDialog: public wxDialog
> +{
> +public:
> + // constructors and destructors
> +NoiseDialog::NoiseDialog(EffectNoise * effect,
> + wxWindow *parent,
> wxWindowID id,
> + const wxString &title,
> + const wxPoint& position = wxDefaultPosition,
> + const wxSize& size = wxDefaultSize,
> + long style = wxDEFAULT_DIALOG_STYLE );
> +
> + wxSizer *MakeNoiseDialog(bool call_fit = true, bool
> set_sizer = true);
> +
> +private:
> + // handlers
> + void OnMakeNoise( wxCommandEvent &event );
> + void OnCancel( wxCommandEvent &event );
> + void OnPreview(wxCommandEvent &event);
> + void OnNoiseTypeChoice( wxCommandEvent &event );
> + void OnAmplitudeUpdate( wxCommandEvent &event );
> + void OnTimeDurationUpdate( wxCommandEvent &event );
> +
> +private:
> + EffectNoise * m_pEffect;
> + wxString mFormat;
> + double mRate;
> + double mTime;
> + double mAmp;
> + int mNoiseType;
> +
> +public:
> + TimeTextCtrl *mTimeCtrl;
> + wxTextCtrl * m_pText_Amplitude;
> + wxChoice * m_pChoice_NoiseType;
> + wxButton * m_pButton_MakeNoise;
> + wxButton * m_pButton_Cancel;
> + wxButton * m_pButton_Preview;
> +
> +private:
> + DECLARE_EVENT_TABLE()
> +
> +public:
> + //
> + int GetNoiseType(){
> + return mNoiseType;
> + };
> +
> + double GetNoiseDuration(){
> + return mTimeCtrl->GetTimeValue();
> + };
> +
> + double GetNoiseAmplitude(){
> + return mAmp;
> + };
> +
> + void SetNoiseDuration(double noiseDuration){
> + mTime = noiseDuration;
> + mTimeCtrl->SetTimeValue(noiseDuration);
> + };
> +
> +
> +
> };
>
> +
> #endif
>
> // Indentation settings for Vim and Emacs and unique
> identifier for Arch, a
> > Index: Noise.cpp
>
===================================================================
> RCS file:
> /cvsroot/audacity/audacity-src/src/effects/Noise.cpp,v
> retrieving revision 1.12
> diff -u -r1.12 Noise.cpp
> --- Noise.cpp 25 Aug 2006 05:12:23 -0000 1.12
> +++ Noise.cpp 7 Nov 2006 08:15:44 -0000
> @@ -6,6 +6,10 @@
>
> Dominic Mazzoni
>
> + Salvo Ventura:
> + - added "colored" noise, and new dialog with more
> options
> + - params are not saved, so user is always presented
> defaults (white, 30s, 0.8)
> +
>
>
*******************************************************************//**
>
> \class EffectNoise
> @@ -14,47 +18,98 @@
>
>
*//*******************************************************************/
>
> #include "../Audacity.h"
> -
> -#include <wx/defs.h>
> #include <stdlib.h>
> -
> #include "Noise.h"
> -#include "Silence.h"
> -
> #include "../WaveTrack.h"
> -#include "../TimeDialog.h"
> +#include "../Project.h"
> +#include <wx/button.h>
> +#include <wx/sizer.h>
> +#include <wx/stattext.h>
> +#include <wx/textctrl.h>
> +#include <wx/valtext.h>
> +#include <wx/defs.h>
> +#include <math.h>
> +
> +#ifndef M_PI
> +#define M_PI 3.14159265358979323846 /* pi */
> +#endif
> +#define AMP_MIN 0
> +#define AMP_MAX 1
>
> -void MakeNoise(float *buffer, sampleCount len)
> +// adding type for different noise colors, amplitude and
> sampling frequency...
> +void MakeNoise(float *buffer, sampleCount len, int
> noiseType, double noiseAmplitude, float fs)
> {
> + float white, buf0, buf1, buf2, buf3, buf4, buf5;
> + float a0, b1, fc, y;
> sampleCount i;
> float div = ((float)RAND_MAX) / 2.0f;
>
> - for(i=0; i<len; i++)
> - buffer[i] = (rand() / div) - 1.0;
> +
> + switch (noiseType) {
> + default:
> + case 0: // white
> + for(i=0; i<len; i++)
> + buffer[i] = noiseAmplitude * ((rand() / div) -
> 1.0);
> + break;
> +
> + case 1: // pink
> + white=buf0=buf1=buf2=buf3=buf4=buf5=0;
> + for(i=0; i<len; i++) {
> + white=(rand() / div) - 1.0;
> + buf0=0.997 * buf0 + 0.029591 * white;
> + buf1=0.985 * buf1 + 0.032534 * white;
> + buf2=0.950 * buf2 + 0.048056 * white;
> + buf3=0.850 * buf3 + 0.090579 * white;
> + buf4=0.620 * buf4 + 0.108990 * white;
> + buf5=0.250 * buf5 + 0.255784 * white;
> + buffer[i]=noiseAmplitude * (buf0 + buf1 + buf2 +
> buf3 + buf4 + buf5);
> + }
> + break;
> +
> + case 2: // brown
> + // fc=100 Hz,
> + // y[n]=a0*x[n] + b1*y[n-1];
> + white=a0=b1=fc=y=0;
> + fc=100; //fs=44100;
> + b1=exp(-2*M_PI*fc/fs);
> + a0=1.0-b1;
> +
> + for(i=0; i<len; i++){
> + white=(rand() / div) - 1.0;
> + y = (a0 * white + b1 * y);
> + buffer[i] = noiseAmplitude * y;
> + };
> +
> + break;
> + }
> }
>
> bool EffectNoise::PromptUser()
> {
> if (mT1 > mT0)
> - length = mT1 - mT0;
> + noiseDuration = mT1 - mT0;
> else
> - length = sDefaultGenerateLen;
> + noiseDuration = sDefaultGenerateLen;
> + noiseType = 0;
> + noiseAmplitude = 0.8;
>
> - TimeDialog dlog(mParent, wxID_ANY, _("White Noise
> Generator"));
> - dlog.SetTimeValue(length);
> + NoiseDialog dlog(this, mParent, -1, _("Noise
> Generator"));
> + dlog.SetNoiseDuration(noiseDuration);
>
> if (dlog.ShowModal() == wxID_CANCEL)
> return false;
>
> - length = dlog.GetTimeValue();
> + noiseDuration = dlog.GetNoiseDuration();
> + noiseType = dlog.GetNoiseType();
> + noiseAmplitude = dlog.GetNoiseAmplitude();
>
> return true;
> }
>
> bool EffectNoise::Process()
> {
> - if (length <= 0.0)
> - length = sDefaultGenerateLen;
> + if (noiseDuration <= 0.0)
> + noiseDuration = sDefaultGenerateLen;
>
> //Iterate over each track
> TrackListIterator iter(mWaveTracks);
> @@ -62,7 +117,7 @@
> while (track) {
> WaveTrack *tmp =
> mFactory->NewWaveTrack(track->GetSampleFormat(),
> track->GetRate());
> longSampleCount numSamples =
> - (longSampleCount)(length * track->GetRate() +
> 0.5);
> + (longSampleCount)(noiseDuration *
> track->GetRate() + 0.5);
> longSampleCount i = 0;
> float *data = new float[tmp->GetMaxBlockSize()];
> sampleCount block;
> @@ -71,7 +126,7 @@
> block = tmp->GetBestBlockSize(i);
> if (block > (numSamples - i))
> block = numSamples - i;
> - MakeNoise(data, block);
> + MakeNoise(data, block, noiseType,
> noiseAmplitude, float(track->GetRate()));
> tmp->Append((samplePtr)data, floatSample,
> block);
> i += block;
> }
> @@ -81,15 +136,237 @@
> track->Clear(mT0, mT1);
> track->Paste(mT0, tmp);
> delete tmp;
> -
> +
> //Iterate to the next track
> track = (WaveTrack *)iter.Next();
> }
>
> - mT1 = mT0 + length; // Update selection.
> + mT1 = mT0 + noiseDuration; // Update selection.
> return true;
> }
>
>
+//----------------------------------------------------------------------------
> +// NoiseDialog
>
+//----------------------------------------------------------------------------
> +// salvo: adapted (copied) from NoiseRemoval.cpp :-)
> +// WDR: event table for NoiseDialog
> +
> +enum {
> + ID_BUTTON_GETPROFILE = 10001,
> + ID_BUTTON_PREVIEW,
> + ID_CHOICE_NOISETYPE,
> + ID_TEXT_AMPLITUDE
> +};
> +
> +BEGIN_EVENT_TABLE(NoiseDialog,wxDialog)
> + EVT_BUTTON(wxID_OK, NoiseDialog::OnMakeNoise)
> + EVT_BUTTON(wxID_CANCEL, NoiseDialog::OnCancel)
> + EVT_BUTTON(ID_BUTTON_PREVIEW,
> NoiseDialog::OnPreview)
> + EVT_CHOICE(ID_CHOICE_NOISETYPE,
> NoiseDialog::OnNoiseTypeChoice)
> + EVT_COMMAND(wxID_ANY, EVT_TIMETEXTCTRL_UPDATED,
> NoiseDialog::OnTimeDurationUpdate)
> + EVT_TEXT(ID_TEXT_AMPLITUDE,
> NoiseDialog::OnAmplitudeUpdate)
> +END_EVENT_TABLE()
> +
> +/*
> + Noise Dialog
> +*/
> +NoiseDialog::NoiseDialog(EffectNoise * effect,
> + wxWindow *parent,
> wxWindowID id,
> + const wxString &title,
> + const wxPoint &position,
> + const wxSize& size,
> + long style ) :
> + wxDialog( parent, id, title, position, size, style )
> +{
> +
> + mFormat=(wxT("seconds"));
> + mRate=44100;
> + mTime=0.0;
> + mAmp=0.8;
> + mNoiseType=0;
> +
> + m_pEffect = effect;
> +
> + // NULL out the control members until the controls are
> created.
> + m_pButton_MakeNoise = NULL;
> + m_pButton_Cancel = NULL;
> + m_pButton_Preview = NULL;
> + m_pChoice_NoiseType = NULL;
> + mTimeCtrl = NULL;
> + m_pText_Amplitude = NULL;
> +
> + this->MakeNoiseDialog(true);
> +}
> +
> +/*******************************************************
> + NoiseDialog::OnCancel
> +
> *******************************************************/
> +void NoiseDialog::OnCancel( wxCommandEvent &event )
> +{
> + EndModal(wxID_CANCEL);
> +}
> +/*******************************************************
> + NoiseDialog::OnPreview
> +
> *******************************************************/
> +void NoiseDialog::OnPreview(wxCommandEvent &event)
> +{
> + // Save & restore parameters around Preview, because
> we didn't press OK.
> + double old_noiseDuration = m_pEffect->noiseDuration;
> + int old_noiseType = m_pEffect->noiseType;
> + double old_noiseAmplitude =
> m_pEffect->noiseAmplitude;
> +
> + // get values from controls
> + m_pEffect->noiseDuration=GetNoiseDuration();
> + m_pEffect->noiseType=GetNoiseType();
> + m_pEffect->noiseAmplitude=GetNoiseAmplitude();
> +
> + m_pEffect->Preview();
> +
> + m_pEffect->noiseDuration=old_noiseDuration;
> + m_pEffect->noiseType=old_noiseType;
> + m_pEffect->noiseAmplitude=old_noiseAmplitude;
> +}
> +
> +/*******************************************************
> + NoiseDialog::OnNoiseTypeChoice
> +
> *******************************************************/
> +void NoiseDialog::OnNoiseTypeChoice( wxCommandEvent
> &event )
> +{
> + int noisetype = m_pChoice_NoiseType->GetSelection();
> +
> + if (noisetype>=0 && noisetype<=2) {
> + //m_pEffect->noiseType = noisetype;
> + mNoiseType = noisetype;
> + } else {
> + // revert to default: white
> + // m_pEffect->noiseType = 0;
> + mNoiseType = 0;
> + }
> +}
> +
> +/*******************************************************
> + NoiseDialog::OnTimeDurationUpdate
> +
> *******************************************************/
> +void NoiseDialog::OnTimeDurationUpdate( wxCommandEvent
> &event )
> +{
> + double mtime = mTimeCtrl->GetTimeValue();
> + mTime = mtime;
> +}
> +
> +/*******************************************************
> + NoiseDialog::OnTimeDurationUpdate
> +
> *******************************************************/
> +void NoiseDialog::OnAmplitudeUpdate( wxCommandEvent
> &event )
> +{
> + double amp=0.8;
> + //m_pEffect->amplitude = TrapDouble(amp, AMP_MIN,
> AMP_MAX);
> +
> + if (m_pText_Amplitude)
> + m_pText_Amplitude->GetValue().ToDouble(&);
> + mAmp = TrapDouble(amp, AMP_MIN, AMP_MAX);
> +
> +}
> +
> +/*******************************************************
> + NoiseDialog::OnMakeNoise
> +
> *******************************************************/
> +void NoiseDialog::OnMakeNoise( wxCommandEvent &event )
> +{
> + EndModal(wxID_OK);
> +}
> +
> +
> +/*******************************************************
> + NoiseDialog::MakeNoiseDialog
> +
> *******************************************************/
> +wxSizer *NoiseDialog::MakeNoiseDialog(bool call_fit /* =
> true */,
> + bool set_sizer /* = true */)
> +{
> + wxBoxSizer *mainSizer = new wxBoxSizer( wxVERTICAL );
> + wxBoxSizer *colSizer;
> + wxBoxSizer *rowSizer;
> + wxControl *item;
> +
> + AudacityProject * p;
> + p=GetActiveProject();
> +
> + /*
> + Title
> + */
> + item = new wxStaticText(this, -1, _("Noise
> generator"), wxDefaultPosition, wxDefaultSize,
> wxALIGN_CENTRE );
> + mainSizer->Add(item, 0, wxALIGN_CENTRE|wxALL, 5);
> +
> +
> + // will hold both colums
> + rowSizer = new wxBoxSizer( wxHORIZONTAL );
> + /*
> + Let's prepare the left column with all the
> text
> + */
> + colSizer = new wxBoxSizer( wxVERTICAL );
> + item = new wxStaticText(this, -1, _("Duration"),
> wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
> + colSizer->Add(item, 0, wxALIGN_RIGHT|wxALL, 5);
> + colSizer->Add(20, 5);
> + item = new wxStaticText(this, -1, _("Amplitude"),
> wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
> + colSizer->Add(item, 0, wxALIGN_RIGHT|wxALL, 5);
> + colSizer->Add(20, 5);
> + item = new wxStaticText(this, -1, _("Noise
> type"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
> + colSizer->Add(item, 0, wxALIGN_RIGHT|wxALL, 5);
> + colSizer->Add(20, 5);
> + // add left column
> + rowSizer->Add(colSizer, 0, wxALIGN_LEFT|wxALL, 5);
> + /*
> + Let's prepare the right column with all the
> controls
> + */
> + colSizer = new wxBoxSizer( wxVERTICAL );
> + mTimeCtrl = new TimeTextCtrl(this, wxID_ANY,
> TimeTextCtrl::GetBuiltinFormat(mFormat),
> + mTime, mRate, wxDefaultPosition,
> wxDefaultSize, true);
> + mTimeCtrl->EnableMenu();
> + m_pText_Amplitude = new wxTextCtrl(this,
> ID_TEXT_AMPLITUDE, wxT("0.8"), wxDefaultPosition,
> wxDefaultSize, 0, wxTextValidator(wxFILTER_NUMERIC));
> + wxString noiseTypeChoiceStrings[3] = {
> wxT("White"), wxT("Pink"), wxT("Brown") };
> + m_pChoice_NoiseType = new wxChoice(this,
> ID_CHOICE_NOISETYPE, wxDefaultPosition, wxDefaultSize, 3,
> noiseTypeChoiceStrings);
> + m_pChoice_NoiseType->SetSelection(0);
> +
> + colSizer->Add(mTimeCtrl, 0, wxALIGN_LEFT|wxALL,
> 5);
> + colSizer->Add(m_pText_Amplitude, 0,
> wxALIGN_LEFT|wxALL, 5);
> + colSizer->Add(m_pChoice_NoiseType, 0,
> wxALIGN_LEFT|wxALL, 5);
> +
> + // add right column
> + rowSizer->Add(colSizer, 0, wxALIGN_RIGHT|wxALL, 5);
> +
> + // add columns to main
> + mainSizer->Add(rowSizer, 0, wxALIGN_CENTRE|wxALL, 5);
> +
> + /* ..................................................
> + OK, CANCEL, PREVIEW
> + */
> + rowSizer = new wxBoxSizer( wxHORIZONTAL );
> +
> + m_pButton_Preview = new wxButton(this,
> ID_BUTTON_PREVIEW, m_pEffect->GetPreviewName());
> + m_pButton_MakeNoise = new wxButton(this, wxID_OK,
> _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
> + item = new wxButton( this, wxID_CANCEL, _("&Cancel"),
> wxDefaultPosition, wxDefaultSize, 0 );
> +
> + rowSizer->Add(m_pButton_Preview, 0,
> wxALIGN_LEFT|wxALL, 5);
> + rowSizer->Add(20, 1); // horizontal spacer
> + rowSizer->Add(m_pButton_MakeNoise, 0, wxALIGN_CENTRE
> | wxALL, 5 );
> + rowSizer->Add(20, 1); // horizontal spacer
> + rowSizer->Add(item, 0, wxALIGN_RIGHT|wxALL, 5);
> + mainSizer->Add(rowSizer, 0, wxALIGN_CENTRE|wxALL, 5);
> +
> + // other properties of controls
> + if (set_sizer) {
> + this->SetAutoLayout( TRUE );
> + this->SetSizer( mainSizer );
> + if (call_fit) {
> + mainSizer->Fit( this );
> + mainSizer->SetSizeHints( this );
> + }
> + }
> +
> + return mainSizer;
> +}
> +
> +
> +
> // Indentation settings for Vim and Emacs and unique
> identifier for Arch, a
> // version control system. Please do not modify past
> this point.
> //
> >
-------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web
> services, security?
> Get stuff done quickly with pre-integrated technology to
> make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based
> on Apache Geronimo
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
_______________________________________________
> Audacity-devel mailing list
> Audacity-devel@...
>
https://lists.sourceforge.net/lists/listinfo/audacity-devel
>
worth a visit...
======================================
http://www.bytekiln.com
http://guidamadrid.altervista.org
http://www.worldbuildingservice.com
__________________________________________________
Do You Yahoo!?
Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi
http://mail.yahoo.it
|