From 9d0daf8662530bcf70fc7b84ce2594aa5b6dbdd2 Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Wed, 20 Feb 2013 23:42:58 +0000 Subject: [PATCH] Campbell Barton's patch to turn many, many tabs to our 3-space convenbtion --- src/AboutDialog.cpp | 4 +- src/AudacityApp.h | 6 +- src/AudioIO.cpp | 2 +- src/BatchCommandDialog.h | 4 +- src/BatchProcessDialog.cpp | 10 +-- src/BatchProcessDialog.h | 2 +- src/CrossFade.cpp | 32 +++++----- src/CrossFade.h | 12 ++-- src/Dependencies.cpp | 10 +-- src/DeviceManager.cpp | 6 +- src/DirManager.cpp | 8 +-- src/FFmpeg.h | 2 +- src/FileNames.h | 18 +++--- src/Lyrics.cpp | 2 +- src/Matrix.cpp | 2 +- src/Matrix.h | 2 +- src/Mix.cpp | 4 +- src/PitchName.cpp | 10 +-- src/Printing.cpp | 2 +- src/Project.cpp | 8 +-- src/RealFFTf.cpp | 58 ++++++++--------- src/RealFFTf.h | 6 +- src/Sequence.cpp | 4 +- src/ShuttleGui.cpp | 4 +- src/ShuttleGui.h | 30 ++++----- src/TimeTrack.cpp | 4 +- src/TimerRecordDialog.cpp | 28 ++++---- src/TrackArtist.h | 6 +- src/TrackPanel.cpp | 8 +-- src/TrackPanel.h | 4 +- src/VoiceKey.cpp | 128 ++++++++++++++++++------------------- src/VoiceKey.h | 92 +++++++++++++------------- src/WaveClip.cpp | 14 ++-- src/WaveClip.h | 20 +++--- src/WaveTrack.h | 12 ++-- 35 files changed, 282 insertions(+), 282 deletions(-) diff --git a/src/AboutDialog.cpp b/src/AboutDialog.cpp index c0f3703b4..c16b06544 100644 --- a/src/AboutDialog.cpp +++ b/src/AboutDialog.cpp @@ -231,7 +231,7 @@ void AboutDialog::PopulateAudacityPage( ShuttleGui & S ) wxT("
") + wxT("

Audacity ") + versionStr + wxT("

")+ _("A Free Digital Audio Editor
") + - wxT("http://audacity.sourceforge.net/") + + wxT("http://audacity.sourceforge.net/") + wxT("

") + par1Str + wxT("

") + par2Str + wxT("

") + _("Credits") + wxT("
") @@ -274,7 +274,7 @@ void AboutDialog::PopulateAudacityPage( ShuttleGui & S ) wxT("
") + GetCreditsByRole(roleThanks) + wxT("


") + - + _("Audacity® software is copyright")+ wxT("© 1999-2013 Audacity Team.
") + diff --git a/src/AudacityApp.h b/src/AudacityApp.h index 4cb12464d..05840b678 100644 --- a/src/AudacityApp.h +++ b/src/AudacityApp.h @@ -161,9 +161,9 @@ class AudacityApp:public wxApp { void OnMacOpenFile(wxCommandEvent & event); #endif - #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) && !defined(__CYGWIN__) - void AssociateFileTypes(); - #endif + #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) && !defined(__CYGWIN__) + void AssociateFileTypes(); + #endif /** \brief A list of directories that should be searched for Audacity files * (plug-ins, help files, etc.). diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp index 42af72289..1a29d26e5 100644 --- a/src/AudioIO.cpp +++ b/src/AudioIO.cpp @@ -583,7 +583,7 @@ AudioIO::AudioIO() errStr += _("Error: ") + pmErrStr; // XXX: we are in libaudacity, popping up dialogs not allowed! A // long-term solution will probably involve exceptions - wxMessageBox(errStr, _("Error Initializing Midi"), wxICON_ERROR|wxOK); + wxMessageBox(errStr, _("Error Initializing Midi"), wxICON_ERROR|wxOK); // Same logic for PortMidi as described above for PortAudio } diff --git a/src/BatchCommandDialog.h b/src/BatchCommandDialog.h index 69ab76065..aa8fad8f5 100644 --- a/src/BatchCommandDialog.h +++ b/src/BatchCommandDialog.h @@ -40,14 +40,14 @@ class BatchCommandDialog:public wxDialog { public: // constructors and destructors BatchCommandDialog(wxWindow *parent, wxWindowID id); - void SetCommandAndParams(const wxString &Command, const wxString &Params); + void SetCommandAndParams(const wxString &Command, const wxString &Params); public: wxString mSelectedCommand; wxString mSelectedParameters; private: void Populate(); void PopulateOrExchange(ShuttleGui &S); - void OnEditParams(wxCommandEvent &event); + void OnEditParams(wxCommandEvent &event); void OnChoice(wxCommandEvent &event); void OnOk(wxCommandEvent &event); void OnCancel(wxCommandEvent &event); diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index 11d252992..36b7d0928 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -266,11 +266,11 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent &event) } } - FileDialog dlog(this, - prompt, - path, - wxT(""), - mask, + FileDialog dlog(this, + prompt, + path, + wxT(""), + mask, wxFD_OPEN | wxFD_MULTIPLE | wxRESIZE_BORDER); dlog.SetFilterIndex(index); diff --git a/src/BatchProcessDialog.h b/src/BatchProcessDialog.h index 81541cb95..e1d6286d3 100644 --- a/src/BatchProcessDialog.h +++ b/src/BatchProcessDialog.h @@ -72,7 +72,7 @@ private: void Populate(); void PopulateOrExchange(ShuttleGui &S); void PopulateChains(); - void PopulateList(); + void PopulateList(); void AddItem(const wxString &command, wxString const ¶ms); bool ChangeOK(); diff --git a/src/CrossFade.cpp b/src/CrossFade.cpp index 06640158e..53c9206cd 100644 --- a/src/CrossFade.cpp +++ b/src/CrossFade.cpp @@ -39,23 +39,23 @@ CrossFader::~CrossFader() bool CrossFader::GetSamples(samplePtr buffer, sampleFormat format, - sampleCount start, sampleCount len) + sampleCount start, sampleCount len) { - switch (mType) - { - case FT_MIX: - return CrossFadeMix(buffer,format, start,len); - break; - case FT_TRIANGULAR: - return CrossFadeMix(buffer,format, start,len); - break; - case FT_EXPONENTIAL: - default: - return CrossFadeMix(buffer,format, start,len); - break; - - } - + switch (mType) + { + case FT_MIX: + return CrossFadeMix(buffer,format, start,len); + break; + case FT_TRIANGULAR: + return CrossFadeMix(buffer,format, start,len); + break; + case FT_EXPONENTIAL: + default: + return CrossFadeMix(buffer,format, start,len); + break; + + } + } bool CrossFader::CrossFadeMix(samplePtr buffer, sampleFormat format, sampleCount start, sampleCount len) diff --git a/src/CrossFade.h b/src/CrossFade.h index 079b48933..0b45abefe 100644 --- a/src/CrossFade.h +++ b/src/CrossFade.h @@ -21,11 +21,11 @@ enum FadeType - { - FT_MIX, - FT_TRIANGULAR, - FT_EXPONENTIAL - }; +{ + FT_MIX, + FT_TRIANGULAR, + FT_EXPONENTIAL +}; class CrossFader { @@ -44,7 +44,7 @@ class CrossFader void ClearClips(); //Produces samples according to crossfading rules. bool GetSamples(samplePtr buffer, sampleFormat format, - sampleCount start, sampleCount len); + sampleCount start, sampleCount len); protected: WaveClipList mClips; diff --git a/src/Dependencies.cpp b/src/Dependencies.cpp index ebccf0086..a9d370199 100644 --- a/src/Dependencies.cpp +++ b/src/Dependencies.cpp @@ -45,13 +45,13 @@ WX_DEFINE_OBJARRAY( AliasedFileArray ); WX_DECLARE_HASH_MAP(wxString, AliasedFile *, - wxStringHash, wxStringEqual, AliasedFileHash); + wxStringHash, wxStringEqual, AliasedFileHash); WX_DECLARE_HASH_MAP(BlockFile *, BlockFile *, - wxPointerHash, wxPointerEqual, ReplacedBlockFileHash); + wxPointerHash, wxPointerEqual, ReplacedBlockFileHash); WX_DECLARE_HASH_MAP(BlockFile *, bool, - wxPointerHash, wxPointerEqual, BoolBlockFileHash); + wxPointerHash, wxPointerEqual, BoolBlockFileHash); // Given a project, returns a single array of all SeqBlocks // in the current set of tracks. Enumerating that array allows @@ -86,7 +86,7 @@ void GetAllSeqBlocks(AudacityProject *project, // Note that this code respects reference-counting and thus the // process of making a project self-contained is actually undoable. void ReplaceBlockFiles(AudacityProject *project, - ReplacedBlockFileHash &hash) + ReplacedBlockFileHash &hash) { DirManager *dirManager = project->GetDirManager(); BlockArray blocks; @@ -158,7 +158,7 @@ void FindDependencies(AudacityProject *project, // longer be external dependencies (selected by the user), replace // all of those alias block files with disk block files. void RemoveDependencies(AudacityProject *project, - AliasedFileArray *aliasedFiles) + AliasedFileArray *aliasedFiles) { DirManager *dirManager = project->GetDirManager(); diff --git a/src/DeviceManager.cpp b/src/DeviceManager.cpp index 4cbcd33ab..9576e0067 100644 --- a/src/DeviceManager.cpp +++ b/src/DeviceManager.cpp @@ -37,7 +37,7 @@ DeviceManager DeviceManager::dm; /// Gets the singleton instance DeviceManager* DeviceManager::Instance() { - return &dm; + return &dm; } /// Releases memory assosiated with the singleton @@ -294,13 +294,13 @@ void DeviceManager::Rescan() dt->RefillCombos(); } } - m_inited = true; + m_inited = true; } //private constructor - Singleton. DeviceManager::DeviceManager() { - m_inited = false; + m_inited = false; } DeviceManager::~DeviceManager() diff --git a/src/DirManager.cpp b/src/DirManager.cpp index dfc2e8f6f..5356b6bbc 100644 --- a/src/DirManager.cpp +++ b/src/DirManager.cpp @@ -944,12 +944,12 @@ BlockFile *DirManager::CopyBlockFile(BlockFile *b) { if (!b->IsLocked()) { b->Ref(); - //mchinen:July 13 2009 - not sure about this, but it needs to be added to the hash to be able to save if not locked. - //note that this shouldn't hurt mBlockFileHash's that already contain the filename, since it should just overwrite. - //but it's something to watch out for. + //mchinen:July 13 2009 - not sure about this, but it needs to be added to the hash to be able to save if not locked. + //note that this shouldn't hurt mBlockFileHash's that already contain the filename, since it should just overwrite. + //but it's something to watch out for. // // LLL: Except for silent block files which have uninitialized filename. - if (b->GetFileName().IsOk()) + if (b->GetFileName().IsOk()) mBlockFileHash[b->GetFileName().GetName()]=b; return b; } diff --git a/src/FFmpeg.h b/src/FFmpeg.h index 2ed4c06dc..b06cad0a0 100644 --- a/src/FFmpeg.h +++ b/src/FFmpeg.h @@ -269,7 +269,7 @@ public: } #else /* Library names and file filters for other platforms, basically Linux and - * other *nix platforms */ + * other *nix platforms */ wxString GetLibraryTypeString() { return _("Only libavformat.so|libavformat.so*|Dynamically Linked Libraries (*.so*)|*.so*|All Files (*)|*"); diff --git a/src/FileNames.h b/src/FileNames.h index f5c302842..84b5fc8a3 100644 --- a/src/FileNames.h +++ b/src/FileNames.h @@ -27,11 +27,11 @@ public: // originally an ExportMultiple method. Append suffix if newName appears in otherNames. static void MakeNameUnique(wxArrayString &otherNames, wxFileName &newName); - /** \brief Audacity user data directory - * - * Where audacity keeps it's settings and other user data squirreled away, - * by default ~/.audacity-data/ on Unix, Application Data/Audacity on - * windows system */ + /** \brief Audacity user data directory + * + * Where audacity keeps it's settings and other user data squirreled away, + * by default ~/.audacity-data/ on Unix, Application Data/Audacity on + * windows system */ static wxString DataDir(); static wxString AutoSaveDir(); static wxString HtmlHelpDir(); @@ -42,10 +42,10 @@ public: static wxString PluginsCache(); /** \brief The user plug-in directory (not a system one) - * - * This returns the string path to where the user may have put plug-ins - * if they don't have system admin rights. Under default settings, it's - * /Plug-Ins/ */ + * + * This returns the string path to where the user may have put plug-ins + * if they don't have system admin rights. Under default settings, it's + * /Plug-Ins/ */ static wxString PlugInDir(); static wxString ThemeDir(); static wxString ThemeComponentsDir(); diff --git a/src/Lyrics.cpp b/src/Lyrics.cpp index 7b33a4948..e525ce45c 100644 --- a/src/Lyrics.cpp +++ b/src/Lyrics.cpp @@ -74,7 +74,7 @@ BEGIN_EVENT_TABLE(Lyrics, wxPanel) EVT_SIZE(Lyrics::OnSize) //v Doesn't seem to be a way to capture a selection event in a read-only wxTextCtrl. - // EVT_COMMAND_LEFT_CLICK(kHighlightTextCtrlID, Lyrics::OnHighlightTextCtrl) + // EVT_COMMAND_LEFT_CLICK(kHighlightTextCtrlID, Lyrics::OnHighlightTextCtrl) END_EVENT_TABLE() IMPLEMENT_CLASS(Lyrics, wxPanel) diff --git a/src/Matrix.cpp b/src/Matrix.cpp index 157d560aa..417b152a3 100644 --- a/src/Matrix.cpp +++ b/src/Matrix.cpp @@ -299,7 +299,7 @@ Matrix MatrixMultiply(const Matrix &left, const Matrix &right) } Matrix MatrixSubset(const Matrix &input, - int startRow, int numRows, int startCol, int numCols) + int startRow, int numRows, int startCol, int numCols) { Matrix M(numRows, numCols); int i, j; diff --git a/src/Matrix.h b/src/Matrix.h index 5da8d5006..25df56c9b 100644 --- a/src/Matrix.h +++ b/src/Matrix.h @@ -103,7 +103,7 @@ Matrix ScalarMultiply(const Matrix &left, const Matrix &right); Matrix MatrixMultiply(const Matrix &left, const Matrix &right); Matrix MatrixSubset(const Matrix &M, - int startRow, int numRows, int startCol, int numCols); + int startRow, int numRows, int startCol, int numCols); Matrix MatrixConcatenateCols(const Matrix& left, const Matrix& right); diff --git a/src/Mix.cpp b/src/Mix.cpp index 39f45f7ab..8df7f64ae 100644 --- a/src/Mix.cpp +++ b/src/Mix.cpp @@ -317,13 +317,13 @@ Mixer::~Mixer() delete[] mEnvValues; delete[] mFloatBuffer; delete[] mGains; - delete[] mSamplePos; + delete[] mSamplePos; for(i=0; iPoints>0) { - free(h->BitReversed); - free(h->SinTable); - } - h->Points=0; - free(h); + if(h->Points>0) { + free(h->BitReversed); + free(h->SinTable); + } + h->Points=0; + free(h); } #define MAX_HFFT 10 @@ -210,13 +210,13 @@ void RealFFTf(fft_type *buffer,HFFT h) { v1=*B*cos + *(B+1)*sin; v2=*B*sin - *(B+1)*cos; - *B=(*A+v1); - *(A++)=*(B++)-2*v1; - *B=(*A-v2); - *(A++)=*(B++)+2*v2; - } - A=B; - B+=ButterfliesPerGroup*2; + *B=(*A+v1); + *(A++)=*(B++)-2*v1; + *B=(*A-v2); + *(A++)=*(B++)+2*v2; + } + A=B; + B+=ButterfliesPerGroup*2; sptr+=2; } ButterfliesPerGroup >>= 1; @@ -228,7 +228,7 @@ void RealFFTf(fft_type *buffer,HFFT h) while(br1SinTable[*br1]; - cos=h->SinTable[*br1+1]; + cos=h->SinTable[*br1+1]; A=buffer+*br1; B=buffer+*br2; HRplus = (HRminus = *A - *B ) + (*B * 2); @@ -346,13 +346,13 @@ void InverseRealFFTf(fft_type *buffer,HFFT h) while(A>= 1; @@ -362,9 +362,9 @@ void InverseRealFFTf(fft_type *buffer,HFFT h) void ReorderToFreq(HFFT hFFT, fft_type *buffer, fft_type *RealOut, fft_type *ImagOut) { // Copy the data into the real and imaginary outputs - for(int i=1;iPoints;i++) { - RealOut[i]=buffer[hFFT->BitReversed[i] ]; - ImagOut[i]=buffer[hFFT->BitReversed[i]+1]; + for(int i=1;iPoints;i++) { + RealOut[i]=buffer[hFFT->BitReversed[i] ]; + ImagOut[i]=buffer[hFFT->BitReversed[i]+1]; } RealOut[0] = buffer[0]; // DC component ImagOut[0] = 0; @@ -375,8 +375,8 @@ void ReorderToFreq(HFFT hFFT, fft_type *buffer, fft_type *RealOut, fft_type *Ima void ReorderToTime(HFFT hFFT, fft_type *buffer, fft_type *TimeOut) { // Copy the data into the real outputs - for(int i=0;iPoints;i++) { - TimeOut[i*2 ]=buffer[hFFT->BitReversed[i] ]; - TimeOut[i*2+1]=buffer[hFFT->BitReversed[i]+1]; + for(int i=0;iPoints;i++) { + TimeOut[i*2 ]=buffer[hFFT->BitReversed[i] ]; + TimeOut[i*2+1]=buffer[hFFT->BitReversed[i]+1]; } -} \ No newline at end of file +} diff --git a/src/RealFFTf.h b/src/RealFFTf.h index 764319b0c..f46119ca9 100644 --- a/src/RealFFTf.h +++ b/src/RealFFTf.h @@ -3,9 +3,9 @@ #define fft_type float typedef struct FFTParamType { - int *BitReversed; - fft_type *SinTable; - int Points; + int *BitReversed; + fft_type *SinTable; + int Points; } FFTParam; #define HFFT FFTParam * diff --git a/src/Sequence.cpp b/src/Sequence.cpp index 9ecfb6b2b..f259f51b1 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -895,8 +895,8 @@ bool Sequence::HandleXMLTag(const wxChar *tag, const wxChar **attrs) if (!wxStrcmp(attr, wxT("maxsamples"))) { // Dominic, 12/10/2006: - // Let's check that maxsamples is >= 1024 and <= 64 * 1024 * 1024 - // - that's a pretty wide range of reasonable values. + // Let's check that maxsamples is >= 1024 and <= 64 * 1024 * 1024 + // - that's a pretty wide range of reasonable values. if ((nValue < 1024) || (nValue > 64 * 1024 * 1024)) { mErrorOpening = true; diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index 86f609c21..2720532a4 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -2117,11 +2117,11 @@ AttachableScrollBar * ShuttleGui::AddAttachableScrollBar( long style ) AttachableScrollBar * pAttachableScrollBar; miProp=0; mpWind = pAttachableScrollBar = new AttachableScrollBar( - mpParent, + mpParent, miId, wxDefaultPosition, wxDefaultSize, - style + style ); mpWind->SetMinSize(wxSize(10,20)); UpdateSizers(); diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index 37354e679..0270f0bbb 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -25,7 +25,7 @@ const int nMaxNestedSizers = 20; enum teShuttleMode { - eIsCreating, + eIsCreating, eIsGettingFromDialog, eIsSettingToDialog, eIsSavingViaShuttle, @@ -84,10 +84,10 @@ public: wxSlider * AddSlider(const wxString &Prompt, int pos, int Max, int Min = 0); wxSlider * AddVSlider(const wxString &Prompt, int pos, int Max); wxSpinCtrl * AddSpinCtrl(const wxString &Prompt, int Value, int Max, int Min); - wxTreeCtrl * AddTree(); - wxRadioButton * AddRadioButton( const wxString & Prompt ); - wxRadioButton * AddRadioButtonToGroup( const wxString & Prompt); - wxButton * AddButton( const wxString & Text, int PositionFlags = wxALIGN_CENTRE ); + wxTreeCtrl * AddTree(); + wxRadioButton * AddRadioButton( const wxString & Prompt ); + wxRadioButton * AddRadioButtonToGroup( const wxString & Prompt); + wxButton * AddButton( const wxString & Text, int PositionFlags = wxALIGN_CENTRE ); wxBitmapButton * AddBitmapButton(const wxBitmap &Bitmap, int PositionFlags = wxALIGN_CENTRE); wxStaticText * AddVariableText(const wxString &Str, bool bCenter = false, int PositionFlags = 0); wxTextCtrl * AddTextBox(const wxString &Caption, const wxString &Value, const int nChars); @@ -103,9 +103,9 @@ public: wxChoice * AddChoice( const wxString &Prompt, const wxString &Selected, const wxArrayString * pChoices ); wxMenuBar * AddMenuBar( ); wxMenu * AddMenu( const wxString & Title ); - void AddIcon( wxBitmap * pBmp); - void AddIconButton( const wxString & Command, const wxString & Params,wxBitmap * pBmp ); - void AddFixedText( const wxString & Str, bool bCenter = false ); + void AddIcon( wxBitmap * pBmp); + void AddIconButton( const wxString & Command, const wxString & Params,wxBitmap * pBmp ); + void AddFixedText( const wxString & Str, bool bCenter = false ); void AddConstTextBox( const wxString &Caption, const wxString & Value ); //-- Start and end functions. These are used for sizer, or other window containers @@ -166,9 +166,9 @@ public: wxCheckBox * TieCheckBox( const wxString &Prompt, WrappedType & WrappedRef ); wxCheckBox * TieCheckBox( const wxString &Prompt, const wxString &Selected ); - wxCheckBox * TieCheckBox( const wxString &Prompt, bool & Var ); - wxCheckBox * TieCheckBoxOnRight( const wxString & Prompt, WrappedType & WrappedRef ); - wxCheckBox * TieCheckBoxOnRight( const wxString & Prompt, bool & Var ); + wxCheckBox * TieCheckBox( const wxString &Prompt, bool & Var ); + wxCheckBox * TieCheckBoxOnRight( const wxString & Prompt, WrappedType & WrappedRef ); + wxCheckBox * TieCheckBoxOnRight( const wxString & Prompt, bool & Var ); wxChoice * TieChoice( const wxString &Prompt, WrappedType & WrappedRef, const wxArrayString * pChoices ); wxChoice * TieChoice( const wxString &Prompt, wxString &Selected, const wxArrayString * pChoices ); @@ -262,9 +262,9 @@ public: protected: void SetProportions( int Default ); void PushSizer(); - void PopSizer(); + void PopSizer(); - void UpdateSizersCore( bool bPrepend, int Flags ); + void UpdateSizersCore( bool bPrepend, int Flags ); void UpdateSizers(); void UpdateSizersC(); void UpdateSizersAtStart(); @@ -272,8 +272,8 @@ protected: long Style( long Style ); wxWindow * mpLastWind; - wxWindow * mpDlg; - wxSizer * pSizerStack[ nMaxNestedSizers ]; + wxWindow * mpDlg; + wxSizer * pSizerStack[ nMaxNestedSizers ]; wxString mBoxName; Shuttle * mpShuttle; /*! Controls source/destination of shuttled data. You can diff --git a/src/TimeTrack.cpp b/src/TimeTrack.cpp index b1e1c5813..65a50ed9b 100644 --- a/src/TimeTrack.cpp +++ b/src/TimeTrack.cpp @@ -306,8 +306,8 @@ void TimeTrack::testMe() if( t0 > t1 ) { printf( "TimeTrack: Warping reverses an interval! [%.2f,%.2f] -> [%.2f,%.2f]\n", - reqt0, reqt1, - t0, t1 ); + reqt0, reqt1, + t0, t1 ); }*/ } diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp index c059d1959..c5b02f5c3 100644 --- a/src/TimerRecordDialog.cpp +++ b/src/TimerRecordDialog.cpp @@ -326,11 +326,11 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S) S.StartVerticalLay(true); { /* i18n-hint: This string is used to configure the controls for times when the recording is - * started and stopped. As such it is important that only the alphabetic parts of the string - * are translated, with the numbers left exactly as they are. - * The 'h' indicates the first number displayed is hours, the 'm' indicates the second number - * displayed is minutes, and the 's' indicates that the third number displayed is seconds. - */ + * started and stopped. As such it is important that only the alphabetic parts of the string + * are translated, with the numbers left exactly as they are. + * The 'h' indicates the first number displayed is hours, the 'm' indicates the second number + * displayed is minutes, and the 's' indicates that the third number displayed is seconds. + */ wxString strFormat = _("099 h 060 m 060 s"); S.StartStatic(_("Start Date and Time"), true); { @@ -372,14 +372,14 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S) S.StartStatic(_("Duration"), true); { - /* i18n-hint: This string is used to configure the controls which shows the recording - * duration. As such it is important that only the alphabetic parts of the string - * are translated, with the numbers left exactly as they are. - * The string 'days' indicates that the first number in the control will be the number of days, - * then the 'h' indicates the second number displayed is hours, the 'm' indicates the third - * number displayed is minutes, and the 's' indicates that the fourth number displayed is - * seconds. - */ + /* i18n-hint: This string is used to configure the controls which shows the recording + * duration. As such it is important that only the alphabetic parts of the string + * are translated, with the numbers left exactly as they are. + * The string 'days' indicates that the first number in the control will be the number of days, + * then the 'h' indicates the second number displayed is hours, the 'm' indicates the third + * number displayed is minutes, and the 's' indicates that the fourth number displayed is + * seconds. + */ wxString strFormat1 = _("099 days 024 h 060 m 060 s"); m_pTimeTextCtrl_Duration = new TimeTextCtrl(this, ID_TIMETEXT_DURATION, strFormat1); m_pTimeTextCtrl_Duration->SetName(_("Duration")); @@ -451,7 +451,7 @@ int TimerRecordDialog::WaitForStart() { wxString strMsg; /* i18n-hint: A time specification like "Sunday 28th October 2007 15:16:17 GMT" - * but hopefully translated by wxwidgets will be inserted into this */ + * but hopefully translated by wxwidgets will be inserted into this */ strMsg.Printf(_("Waiting to start recording at %s.\n"), GetDisplayDate(m_DateTime_Start).c_str()); wxDateTime startWait_DateTime = wxDateTime::UNow(); diff --git a/src/TrackArtist.h b/src/TrackArtist.h index f13b6b5ee..9642febb6 100644 --- a/src/TrackArtist.h +++ b/src/TrackArtist.h @@ -84,7 +84,7 @@ class AUDACITY_DLL_API TrackArtist { void SetSpectrumLogMaxFreq(int freq); void SetBackgroundBrushes(wxBrush unselectedBrush, wxBrush selectedBrush, - wxPen unselectedPen, wxPen selectedPen) { + wxPen unselectedPen, wxPen selectedPen) { this->unselectedBrush = unselectedBrush; this->selectedBrush = selectedBrush; this->unselectedPen = unselectedPen; @@ -239,8 +239,8 @@ class AUDACITY_DLL_API TrackArtist { }; extern int GetWaveYPos(float value, float min, float max, - int height, bool dB, bool outer, float dBr, - bool clip); + int height, bool dB, bool outer, float dBr, + bool clip); #endif // define __AUDACITY_TRACKARTIST__ diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index a3dd6a478..2f687e1a8 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -978,7 +978,7 @@ void TrackPanel::OnTimer() MakeParentRedrawScrollbars(); p->SetAudioIOToken(0); p->RedrawProject(); - //ANSWER-ME: Was DisplaySelection added to solve a repaint problem? + //ANSWER-ME: Was DisplaySelection added to solve a repaint problem? DisplaySelection(); } @@ -3459,7 +3459,7 @@ void TrackPanel::HandleVZoomButtonUp( wxMouseEvent & event ) } else { if(spectrumLog) - { + { float p1; p1 = (mZoomStart - ypos) / (float)height; c = 1.0-p1; @@ -3616,7 +3616,7 @@ void TrackPanel::HandleSampleEditingClick( wxMouseEvent & event ) t = FindTrack(event.m_x, event.m_y, false, false, &r); if (!t || (t->GetKind() != Track::Wave)) - return; + return; if( !IsSampleEditingPossible( event, t ) ) { @@ -7284,7 +7284,7 @@ const int nRates=12; /// gRates MUST CORRESPOND DIRECTLY TO THE RATES AS LISTED IN THE MENU!! /// IN THE SAME ORDER!! int gRates[nRates] = { 8000, 11025, 16000, 22050, 44100, 48000, 88200, 96000, - 176400, 192000, 352800, 384000 }; + 176400, 192000, 352800, 384000 }; /// This method handles the selection from the Rate /// submenu of the track menu, except for "Other" (/see OnRateOther). diff --git a/src/TrackPanel.h b/src/TrackPanel.h index 20f167e4f..df7a2d185 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -317,8 +317,8 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel { // AS: Selection handling virtual void HandleSelect(wxMouseEvent & event); virtual void SelectionHandleDrag(wxMouseEvent &event, Track *pTrack); - virtual void SelectionHandleClick(wxMouseEvent &event, - Track* pTrack, wxRect r); + virtual void SelectionHandleClick(wxMouseEvent &event, + Track* pTrack, wxRect r); virtual void StartSelection (int mouseXCoordinate, int trackLeftEdge); virtual void ExtendSelection(int mouseXCoordinate, int trackLeftEdge, Track *pTrack); diff --git a/src/VoiceKey.cpp b/src/VoiceKey.cpp index 33f9da855..0e06aa4d0 100644 --- a/src/VoiceKey.cpp +++ b/src/VoiceKey.cpp @@ -45,9 +45,9 @@ VoiceKey::VoiceKey(){ mEnergySD = .0002; // 44100 hertz mSignChangesMean = .08; mSignChangesSD= .02; - mDirectionChangesMean = .25; + mDirectionChangesMean = .25; mDirectionChangesSD = .2; - + AdjustThreshold(2); mSilentWindowSize = .05; //Amount of time (in seconds) below threshold to call it silence @@ -101,7 +101,7 @@ sampleCount VoiceKey::OnForward (WaveTrack & t, sampleCount start, sampleCount l double rate = t.GetRate(); //Translates seconds to samples unsigned int WindowSizeInt = (unsigned int)(rate * mWindowSize); //Size of window to examine unsigned int SignalWindowSizeInt = (unsigned int)(rate * mSignalWindowSize); //This much signal is necessary to trip key - + int samplesleft = len - WindowSizeInt; //Indexes the number of samples remaining in the selection lastsubthresholdsample = start; //start this off at the selection start unsigned int i; //iterates through waveblock @@ -115,7 +115,7 @@ sampleCount VoiceKey::OnForward (WaveTrack & t, sampleCount start, sampleCount l //If there are fewer than 10 samples leftover, don't bother. for(i = start; samplesleft >=10; i+=(WindowSizeInt-1) , samplesleft -= (WindowSizeInt -1)){ - + //Set blocksize so that it is the right size if((unsigned int)samplesleft < WindowSizeInt){ blocksize = samplesleft; @@ -132,17 +132,17 @@ sampleCount VoiceKey::OnForward (WaveTrack & t, sampleCount start, sampleCount l blockruns=0; //Miss--start over lastsubthresholdsample = i; } - + //If the blockrun is long enough, break out of the loop early: if(blockruns > mSignalWindowSize/mWindowSize) break; - + } - + //Now, if we broke out early (samplesleft > 10), go back to the lastsubthresholdsample and look more carefully if(samplesleft > 10){ - - + + //Calculate how many to scan through--we only have to go through (at most) //the first window + 1 samples--but we need another window samples to draw from. samplesleft = 2*WindowSizeInt+1; @@ -151,14 +151,14 @@ sampleCount VoiceKey::OnForward (WaveTrack & t, sampleCount start, sampleCount l //Only go through the first SignalWindowSizeInt samples, and choose the first that trips the key. sampleFormat *buffer = new sampleFormat[samplesleft]; t.Get((samplePtr)buffer, floatSample,lastsubthresholdsample,samplesleft); - + //Initialize these trend markers atrend and ztrend. They keep track of the //up/down trends at the start and end of the evaluation window. int atrend = sgn(buffer[1]-buffer[0]); int ztrend = sgn(buffer[WindowSizeInt+1]-buffer[WindowSizeInt]); - + double erg=0; double sc=0; @@ -177,13 +177,13 @@ sampleCount VoiceKey::OnForward (WaveTrack & t, sampleCount start, sampleCount l //Now, go through the sound again, sample by sample. for(i=0; imThresholdEnergy); testThreshold++; } @@ -233,7 +233,7 @@ sampleCount VoiceKey::OnForward (WaveTrack & t, sampleCount start, sampleCount l } } } - + //Move backward from end to find an ON region. sampleCount VoiceKey::OnBackward (WaveTrack & t, sampleCount end, sampleCount len) { @@ -251,7 +251,7 @@ sampleCount VoiceKey::OnBackward (WaveTrack & t, sampleCount end, sampleCount le double rate = t.GetRate(); //Translates seconds to samples unsigned int WindowSizeInt = (unsigned int)(rate * mWindowSize); //Size of window to examine //unsigned int SilentWindowSizeInt = (unsigned int)(rate * mSilentWindowSize); //This much signal is necessary to trip key - + int samplesleft = len - WindowSizeInt; //Indexes the number of samples remaining in the selection lastsubthresholdsample = end; //start this off at the end unsigned int i; //iterates through waveblock @@ -264,7 +264,7 @@ sampleCount VoiceKey::OnBackward (WaveTrack & t, sampleCount end, sampleCount le //go through one sample at a time. //If there are fewer than 10 samples leftover, don't bother. for(i = end - WindowSizeInt; samplesleft >=10; i-=(WindowSizeInt-1) , samplesleft -= (WindowSizeInt -1)){ - + //Set blocksize so that it is the right size if(samplesleft < (int)WindowSizeInt){ blocksize = samplesleft; @@ -272,7 +272,7 @@ sampleCount VoiceKey::OnBackward (WaveTrack & t, sampleCount end, sampleCount le else{ blocksize = WindowSizeInt; } - + //Test whether we are above threshold if(AboveThreshold(t,i,blocksize)) @@ -284,16 +284,16 @@ sampleCount VoiceKey::OnBackward (WaveTrack & t, sampleCount end, sampleCount le blockruns=0; //Miss--start over lastsubthresholdsample = i+WindowSizeInt; } - + //If the blockrun is long enough, break out of the loop early: if(blockruns > mSilentWindowSize/mWindowSize) break; - + } - + //Now, if we broke out early (samplesleft > 10), go back to the lastsubthresholdsample and look more carefully if(samplesleft > 10){ - + //Calculate how many to scan through--we only have to go through (at most) //the first window + 1 samples--but we need another window samples to draw from. samplesleft = 2*WindowSizeInt+1; @@ -302,7 +302,7 @@ sampleCount VoiceKey::OnBackward (WaveTrack & t, sampleCount end, sampleCount le //Only go through the first mSilentWindowSizeInt samples, and choose the first that trips the key. sampleFormat *buffer = new sampleFormat[samplesleft]; t.Get((samplePtr)buffer, floatSample, lastsubthresholdsample-samplesleft,samplesleft); - + //Initialize these trend markers atrend and ztrend. They keep track of the //up/down trends at the start and end of the evaluation window. int atrend = sgn(buffer[samplesleft - 2]-buffer[samplesleft - 1]); @@ -327,7 +327,7 @@ sampleCount VoiceKey::OnBackward (WaveTrack & t, sampleCount end, sampleCount le //Update the test statistics if(mUseEnergy) { - TestEnergyUpdate(erg, WindowSizeInt,buffer[i],buffer[i+WindowSizeInt+1]); + TestEnergyUpdate(erg, WindowSizeInt,buffer[i],buffer[i+WindowSizeInt+1]); tests += (int)(erg>mThresholdEnergy); testThreshold++; } @@ -379,7 +379,7 @@ sampleCount VoiceKey::OffForward (WaveTrack & t, sampleCount start, sampleCount if((mWindowSize) >= len+10){ wxMessageBox(_("Selection is too small to use voice key.")); - + return start; } else{ @@ -391,7 +391,7 @@ sampleCount VoiceKey::OffForward (WaveTrack & t, sampleCount start, sampleCount double rate = t.GetRate(); //Translates seconds to samples unsigned int WindowSizeInt = (unsigned int)(rate * mWindowSize); //Size of window to examine unsigned int SilentWindowSizeInt = (unsigned int)(rate * mSilentWindowSize); //This much signal is necessary to trip key - + int samplesleft = len - WindowSizeInt; //Indexes the number of samples remaining in the selection lastsubthresholdsample = start; //start this off at the selection start unsigned int i; //iterates through waveblock @@ -403,7 +403,7 @@ sampleCount VoiceKey::OffForward (WaveTrack & t, sampleCount start, sampleCount //go through one sample at a time. //If there are fewer than 10 samples leftover, don't bother. for(i = start; samplesleft >=10; i+=(WindowSizeInt-1) , samplesleft -= (WindowSizeInt -1)){ - + //Set blocksize so that it is the right size if(samplesleft < (int)WindowSizeInt){ blocksize = samplesleft; @@ -430,8 +430,8 @@ sampleCount VoiceKey::OffForward (WaveTrack & t, sampleCount start, sampleCount //Now, if we broke out early (samplesleft > 10), go back to the lastsubthresholdsample and look more carefully if(samplesleft > 10){ - - + + //Calculate how many to scan through--we only have to go through (at most) //the first window + 1 samples--but we need another window samples to draw from. samplesleft = 2*WindowSizeInt+1; @@ -440,12 +440,12 @@ sampleCount VoiceKey::OffForward (WaveTrack & t, sampleCount start, sampleCount //Only go through the first SilentWindowSizeInt samples, and choose the first that trips the key. sampleFormat *buffer = new sampleFormat[samplesleft]; t.Get((samplePtr)buffer, floatSample, lastsubthresholdsample,samplesleft); - + //Initialize these trend markers atrend and ztrend. They keep track of the //up/down trends at the start and end of the evaluation window. int atrend = sgn(buffer[1]-buffer[0]); int ztrend = sgn(buffer[WindowSizeInt+1]-buffer[WindowSizeInt]); - + double erg=0; double sc=0; @@ -466,7 +466,7 @@ sampleCount VoiceKey::OffForward (WaveTrack & t, sampleCount start, sampleCount //Update the test statistics if(mUseEnergy) { - TestEnergyUpdate(erg, WindowSizeInt,buffer[i],buffer[i+WindowSizeInt+1]); + TestEnergyUpdate(erg, WindowSizeInt,buffer[i],buffer[i+WindowSizeInt+1]); tests += (int)(erg>mThresholdEnergy); testThreshold++; } @@ -511,14 +511,14 @@ sampleCount VoiceKey::OffForward (WaveTrack & t, sampleCount start, sampleCount } } } - + //Move backward from the end to find an OFF region sampleCount VoiceKey::OffBackward (WaveTrack & t, sampleCount end, sampleCount len) { if((mWindowSize) >= len+10){ - + wxMessageBox(_("Selection is too small to use voice key.")); return end; } @@ -530,7 +530,7 @@ sampleCount VoiceKey::OffBackward (WaveTrack & t, sampleCount end, sampleCount l double rate = t.GetRate(); //Translates seconds to samples unsigned int WindowSizeInt = (unsigned int)(rate * mWindowSize); //Size of window to examine //unsigned int SilentWindowSizeInt = (unsigned int)(rate * mSilentWindowSize); //This much signal is necessary to trip key - + int samplesleft = len - WindowSizeInt; //Indexes the number of samples remaining in the selection lastsubthresholdsample = end; //start this off at the end unsigned int i; //iterates through waveblock @@ -542,7 +542,7 @@ sampleCount VoiceKey::OffBackward (WaveTrack & t, sampleCount end, sampleCount l //go through one sample at a time. //If there are fewer than 10 samples leftover, don't bother. for(i = end - WindowSizeInt; samplesleft >=10; i-=(WindowSizeInt-1) , samplesleft -= (WindowSizeInt -1)){ - + //Set blocksize so that it is the right size if(samplesleft < (int)WindowSizeInt){ blocksize = samplesleft; @@ -553,25 +553,25 @@ sampleCount VoiceKey::OffBackward (WaveTrack & t, sampleCount end, sampleCount l if(!AboveThreshold(t,i,blocksize)) { - + blockruns++; //Hit } else { blockruns=0; //Miss--start over lastsubthresholdsample = i+WindowSizeInt; - + } - + //If the blockrun is long enough, break out of the loop early: if(blockruns > mSilentWindowSize/mWindowSize) break; - + } - + //Now, if we broke out early (samplesleft > 10), go back to the lastsubthresholdsample and look more carefully if(samplesleft > 10){ - + //Calculate how many to scan through--we only have to go through (at most) //the first window + 1 samples--but we need another window samples to draw from. samplesleft = 2*WindowSizeInt+1; @@ -580,12 +580,12 @@ sampleCount VoiceKey::OffBackward (WaveTrack & t, sampleCount end, sampleCount l //Only go through the first SilentWindowSizeInt samples, and choose the first that trips the key. sampleFormat *buffer = new sampleFormat[samplesleft]; t.Get((samplePtr)buffer, floatSample, lastsubthresholdsample-samplesleft,samplesleft); - + //Initialize these trend markers atrend and ztrend. They keep track of the //up/down trends at the start and end of the evaluation window. int atrend = sgn(buffer[samplesleft - 2]-buffer[samplesleft - 1]); int ztrend = sgn(buffer[samplesleft - WindowSizeInt-2]-buffer[samplesleft - WindowSizeInt-2]); - + double erg=0; double sc=0; double dc=0; @@ -599,7 +599,7 @@ sampleCount VoiceKey::OffBackward (WaveTrack & t, sampleCount end, sampleCount l //Now, go through the sound again, sample by sample. for(i=samplesleft-1; i>WindowSizeInt; i--){ - + int tests = 0; int testThreshold = 0; //Update the test statistics @@ -633,8 +633,8 @@ sampleCount VoiceKey::OffBackward (WaveTrack & t, sampleCount end, sampleCount l tests += (int)(dc > mThresholdDirectionChangesUpper); testThreshold++; } - - + + if(tests < testThreshold) { //Finish off on the first hit @@ -753,13 +753,13 @@ void VoiceKey::CalibrateNoise(WaveTrack & t, sampleCount start, sampleCount len) // sampleFormat z2=0; // keeps track of initial and final samples of window to enable updating formulae int atrend=0; // equals sgn(a2-a1); Keeps track of trend at start of window int ztrend=0; // equals sgn(z2-z1); Keeps track of trend at end of window - + //Now, change the millisecond-based parameters into sample-based parameters //(This depends on WaveTrack t) double rate = t.GetRate(); unsigned int WindowSizeInt = (unsigned int)(rate * mWindowSize); // unsigned int SignalWindowSizeInt = (unsigned int)(rate * mSignalWindowSize); - + //Get the first test statistics @@ -831,7 +831,7 @@ void VoiceKey::CalibrateNoise(WaveTrack & t, sampleCount start, sampleCount len) } - + mEnergyMean = sumerg / samples; mEnergySD = sqrt(sumerg2/samples - mEnergyMean*mEnergyMean); @@ -875,7 +875,7 @@ void VoiceKey::SetKeyType(bool erg, bool scLow , bool scHigh, //This might continue over a number of blocks. double VoiceKey::TestEnergy (WaveTrack & t, sampleCount start, sampleCount len) { - + double sum = 1; sampleCount s = start; //Keep track of start sampleCount originalLen = len; //Keep track of the length of block to process (its not the length of t) @@ -919,24 +919,24 @@ void VoiceKey::TestEnergyUpdate (double & prevErg, int len, const sampleFormat & double VoiceKey::TestSignChanges(WaveTrack & t, sampleCount start, sampleCount len) { - + sampleCount s = start; //Keep track of start sampleCount originalLen = len; //Keep track of the length of block to process (its not the length of t) sampleCount blockSize = t.GetMaxBlockSize(); //Determine size of sampling buffer unsigned long signchanges = 1; int currentsign=0; - + if( blockSize > len) blockSize = len; sampleFormat *buffer = new sampleFormat[blockSize]; //Get a sampling buffer while(len > 0) { - + sampleCount block = t.GetBestBlockSize(s); //Figure out how much to grab if(block > len) block = len; //Don't grab too much! - + t.Get((samplePtr)buffer,floatSample, s,block); //grab the block; if (len == originalLen) @@ -964,10 +964,10 @@ double VoiceKey::TestSignChanges(WaveTrack & t, sampleCount start, sampleCount l } void VoiceKey::TestSignChangesUpdate(double & currentsignchanges, int len, - const sampleFormat & a1, - const sampleFormat & a2, - const sampleFormat & z1, - const sampleFormat & z2) + const sampleFormat & a1, + const sampleFormat & a2, + const sampleFormat & z1, + const sampleFormat & z2) { if(sgn(a1)!=sgn(a2)) currentsignchanges -= 1.0/len; @@ -978,7 +978,7 @@ void VoiceKey::TestSignChangesUpdate(double & currentsignchanges, int len, double VoiceKey::TestDirectionChanges(WaveTrack & t, sampleCount start, sampleCount len) { - + sampleCount s = start; //Keep track of start sampleCount originalLen = len; //Keep track of the length of block to process (its not the length of t) @@ -992,10 +992,10 @@ double VoiceKey::TestDirectionChanges(WaveTrack & t, sampleCount start, sampleCo sampleFormat *buffer = new sampleFormat[blockSize]; //Get a sampling buffer while(len > 0) { - + sampleCount block = t.GetBestBlockSize(s); //Figure out how much to grab if(block > len) block = len; //Don't grab too much! - + t.Get((samplePtr)buffer,floatSample, s,block); //grab the block; if (len == originalLen) { @@ -1013,7 +1013,7 @@ double VoiceKey::TestDirectionChanges(WaveTrack & t, sampleCount start, sampleCo lastdirection = sgn(buffer[i] - lastval); } lastval = buffer[i]; - + } len -= block; s += block; @@ -1028,8 +1028,8 @@ double VoiceKey::TestDirectionChanges(WaveTrack & t, sampleCount start, sampleCo // This method does an updating by looking at the trends // This will change currentdirections and atrend/trend, so be warned. void VoiceKey::TestDirectionChangesUpdate(double & currentdirectionchanges, int len, - int & atrend, const sampleFormat & a1, const sampleFormat & a2, - int & ztrend, const sampleFormat & z1, const sampleFormat & z2) + int & atrend, const sampleFormat & a1, const sampleFormat & a2, + int & ztrend, const sampleFormat & z1, const sampleFormat & z2) { if(sgn(a2 - a1)!= atrend ) { diff --git a/src/VoiceKey.h b/src/VoiceKey.h index 2da70a6f5..a05c48efb 100644 --- a/src/VoiceKey.h +++ b/src/VoiceKey.h @@ -31,63 +31,63 @@ enum VoiceKeyTypes class VoiceKey { public: - VoiceKey(); - ~VoiceKey(); - sampleCount OnForward (WaveTrack & t, sampleCount start, sampleCount len); - sampleCount OnBackward (WaveTrack & t, sampleCount start, sampleCount len); - sampleCount OffForward (WaveTrack & t, sampleCount start, sampleCount len); - sampleCount OffBackward (WaveTrack & t, sampleCount start, sampleCount len); + VoiceKey(); + ~VoiceKey(); + sampleCount OnForward (WaveTrack & t, sampleCount start, sampleCount len); + sampleCount OnBackward (WaveTrack & t, sampleCount start, sampleCount len); + sampleCount OffForward (WaveTrack & t, sampleCount start, sampleCount len); + sampleCount OffBackward (WaveTrack & t, sampleCount start, sampleCount len); - void CalibrateNoise(WaveTrack & t, sampleCount start, sampleCount len); - void AdjustThreshold(double t); + void CalibrateNoise(WaveTrack & t, sampleCount start, sampleCount len); + void AdjustThreshold(double t); - bool AboveThreshold(WaveTrack & t, sampleCount start,sampleCount len); + bool AboveThreshold(WaveTrack & t, sampleCount start,sampleCount len); - void SetKeyType(bool erg, bool scLow, bool scHigh, - bool dcLow, bool dcHigh); + void SetKeyType(bool erg, bool scLow, bool scHigh, + bool dcLow, bool dcHigh); private: - - double mWindowSize; //Size of analysis window, in milliseconds - - double mThresholdAdjustment; //User-accessible sensitivity calibration variable - double mEnergyMean; - double mEnergySD; - double mSignChangesMean; - double mSignChangesSD; - double mDirectionChangesMean; - double mDirectionChangesSD; + double mWindowSize; //Size of analysis window, in milliseconds - double mThresholdEnergy; // Threshold[*] is equal to [*]Mean + [*]SD * ThresholdAdjustment - double mThresholdSignChangesLower; - double mThresholdSignChangesUpper; - double mThresholdDirectionChangesLower; - double mThresholdDirectionChangesUpper; + double mThresholdAdjustment; //User-accessible sensitivity calibration variable - //These determine which statistics should be used. - bool mUseEnergy; - bool mUseSignChangesLow; - bool mUseSignChangesHigh; - bool mUseDirectionChangesLow; - bool mUseDirectionChangesHigh; + double mEnergyMean; + double mEnergySD; + double mSignChangesMean; + double mSignChangesSD; + double mDirectionChangesMean; + double mDirectionChangesSD; + + double mThresholdEnergy; // Threshold[*] is equal to [*]Mean + [*]SD * ThresholdAdjustment + double mThresholdSignChangesLower; + double mThresholdSignChangesUpper; + double mThresholdDirectionChangesLower; + double mThresholdDirectionChangesUpper; + + //These determine which statistics should be used. + bool mUseEnergy; + bool mUseSignChangesLow; + bool mUseSignChangesHigh; + bool mUseDirectionChangesLow; + bool mUseDirectionChangesHigh; - double mSilentWindowSize; //Time in milliseconds of below-threshold windows required for silence - double mSignalWindowSize; //Time in milliseconds of above-threshold windows required for speech - - double TestEnergy (WaveTrack & t, sampleCount start,sampleCount len); - double TestSignChanges (WaveTrack & t, sampleCount start, sampleCount len); - double TestDirectionChanges(WaveTrack & t, sampleCount start, sampleCount len); - - void TestEnergyUpdate (double & prevErg, int length, const sampleFormat & drop, const sampleFormat & add); - void TestSignChangesUpdate(double & currentsignchanges,int length, const sampleFormat & a1, - const sampleFormat & a2, const sampleFormat & z1, const sampleFormat & z2); - void TestDirectionChangesUpdate(double & currentdirectionchanges,int length, - int & atrend, const sampleFormat & a1, const sampleFormat & a2, - int & ztrend, const sampleFormat & z1, const sampleFormat & z2); - + double mSilentWindowSize; //Time in milliseconds of below-threshold windows required for silence + double mSignalWindowSize; //Time in milliseconds of above-threshold windows required for speech + + double TestEnergy (WaveTrack & t, sampleCount start,sampleCount len); + double TestSignChanges (WaveTrack & t, sampleCount start, sampleCount len); + double TestDirectionChanges(WaveTrack & t, sampleCount start, sampleCount len); + + void TestEnergyUpdate (double & prevErg, int length, const sampleFormat & drop, const sampleFormat & add); + void TestSignChangesUpdate(double & currentsignchanges,int length, const sampleFormat & a1, + const sampleFormat & a2, const sampleFormat & z1, const sampleFormat & z2); + void TestDirectionChangesUpdate(double & currentdirectionchanges,int length, + int & atrend, const sampleFormat & a1, const sampleFormat & a2, + int & ztrend, const sampleFormat & z1, const sampleFormat & z2); + }; diff --git a/src/WaveClip.cpp b/src/WaveClip.cpp index b650dc649..a1f883992 100644 --- a/src/WaveClip.cpp +++ b/src/WaveClip.cpp @@ -625,12 +625,12 @@ bool WaveClip::GetWaveDisplay(float *min, float *max, float *rms,int* bl, int i; sampleFormat seqFormat = mSequence->GetSampleFormat(); - bool didUpdate = false; + bool didUpdate = false; for(i=a; iwhere[i] - numSamples; + left = mWaveCache->where[i] - numSamples; sampleCount right; - right = mWaveCache->where[i+1] - numSamples; + right = mWaveCache->where[i+1] - numSamples; //wxCriticalSectionLocker locker(mAppendCriticalSection); @@ -672,16 +672,16 @@ bool WaveClip::GetWaveDisplay(float *min, float *max, float *rms,int* bl, if (seqFormat != floatSample) delete[] b; - - didUpdate=true; + + didUpdate=true; } - } + } // So that the sequence doesn't try to write any // of these values //mchinen: but only do this if we've updated pixels in the cache. if(didUpdate) - p1 = a; + p1 = a; } if (p1 > p0) { diff --git a/src/WaveClip.h b/src/WaveClip.h index 98274c413..8554363e4 100644 --- a/src/WaveClip.h +++ b/src/WaveClip.h @@ -129,15 +129,15 @@ public: Sequence* GetSequence() { return mSequence; } /** WaveTrack calls this whenever data in the wave clip changes. It is - * called automatically when WaveClip has a chance to know that something - * has changed, like when member functions SetSamples() etc. are called. */ + * called automatically when WaveClip has a chance to know that something + * has changed, like when member functions SetSamples() etc. are called. */ void MarkChanged() { mDirty++; } /// Create clip from copy, discarding previous information in the clip bool CreateFromCopy(double t0, double t1, WaveClip* other); /** Getting high-level data from the for screen display and clipping - * calculations and Contrast */ + * calculations and Contrast */ bool GetWaveDisplay(float *min, float *max, float *rms,int* bl, sampleCount *where, int numPixels, double t0, double pixelsPerSecond, bool &isLoadingOD); bool GetSpectrogram(float *buffer, sampleCount *where, @@ -154,8 +154,8 @@ public: void GetDisplayRect(wxRect* r); /** Whenever you do an operation to the sequence that will change the number - * of samples (that is, the length of the clip), you will want to call this - * function to tell the envelope about it. */ + * of samples (that is, the length of the clip), you will want to call this + * function to tell the envelope about it. */ void UpdateEnvelopeTrackLen(); /// You must call Flush after the last Append @@ -182,22 +182,22 @@ public: bool Paste(double t0, WaveClip* other); /** Insert silence - note that this is an efficient operation for large - * amounts of silence */ + * amounts of silence */ bool InsertSilence(double t, double len); /// Get access to cut lines list WaveClipList* GetCutLines() { return &mCutLines; } /** Find cut line at (approximately) this position. Returns true and fills - * in cutLineStart and cutLineEnd (if specified) if a cut line at this - * position could be found. Return false otherwise. */ + * in cutLineStart and cutLineEnd (if specified) if a cut line at this + * position could be found. Return false otherwise. */ bool FindCutLine(double cutLinePosition, double* cutLineStart = NULL, double *cutLineEnd = NULL); /** Expand cut line (that is, re-insert audio, then delete audio saved in - * cut line). Returns true if a cut line could be found and sucessfully - * expanded, false otherwise */ + * cut line). Returns true if a cut line could be found and sucessfully + * expanded, false otherwise */ bool ExpandCutLine(double cutLinePosition); /// Remove cut line, without expanding the audio in it diff --git a/src/WaveTrack.h b/src/WaveTrack.h index 1cd0ae8c3..55f4512ec 100644 --- a/src/WaveTrack.h +++ b/src/WaveTrack.h @@ -89,15 +89,15 @@ class AUDACITY_DLL_API WaveTrack: public Track { virtual void SetOffset (double o); /** @brief Get the time at which the first clip in the track starts - * - * @return time in seconds, or zero if there are no clips in the track - */ + * + * @return time in seconds, or zero if there are no clips in the track + */ double GetStartTime(); /** @brief Get the time at which the last clip in the track ends, plus * recorded stuff - * - * @return time in seconds, or zero if there are no clips in the track. + * + * @return time in seconds, or zero if there are no clips in the track. */ double GetEndTime(); @@ -375,7 +375,7 @@ class AUDACITY_DLL_API WaveTrack: public Track { WaveformDisplay, WaveformDBDisplay, SpectrumDisplay, - SpectrumLogDisplay, + SpectrumLogDisplay, PitchDisplay } WaveTrackDisplay;