Update of /cvsroot/audacity/audacity-src/src/export In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv17413/export
Modified Files: ExportFFmpeg.cpp ExportFFmpegDialogs.cpp ExportFFmpegDialogs.h Log Message: Convert global variables for AC3 exporter into static const members of the class to provide a tidier, more OO implementation. It also avoids a load of GCC warnings about unused variables which are not in fact unused. Index: ExportFFmpegDialogs.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/export/ExportFFmpegDialogs.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ExportFFmpegDialogs.cpp 11 Aug 2008 04:16:45 -0000 1.3 +++ ExportFFmpegDialogs.cpp 11 Aug 2008 20:06:40 -0000 1.4 @@ -82,6 +82,11 @@ EVT_BUTTON(wxID_OK,ExportFFmpegAC3Options::OnOK) END_EVENT_TABLE() +// This initialises content for the static const member variables defined in +// ExportFFmpegDialogs.h (note no static keyword - important!) +const int ExportFFmpegAC3Options::iAC3BitRates[] = { 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000, 448000, 512000, 576000, 640000 }; +const int ExportFFmpegAC3Options::iAC3SampleRates[] = { 32000, 44100, 48000, 0 }; + ExportFFmpegAC3Options::ExportFFmpegAC3Options(wxWindow *parent) : wxDialog(NULL, wxID_ANY, wxString(_("Specify AC3 Options")), Index: ExportFFmpegDialogs.h =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/export/ExportFFmpegDialogs.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ExportFFmpegDialogs.h 11 Aug 2008 04:16:45 -0000 1.2 +++ ExportFFmpegDialogs.h 11 Aug 2008 20:06:40 -0000 1.3 @@ -367,12 +367,6 @@ { NULL, CODEC_ID_NONE } }; -/// Bit Rates supported by AC3 encoder -static int iAC3BitRates[] = { 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000, 448000, 512000, 576000, 640000 }; - -/// Sample Rates supported by AC3 encoder (must end with zero-element) -/// It is not used in dialog anymore, but will be required later -static int iAC3SampleRates[] = { 32000, 44100, 48000, 0 }; /// AAC profiles static int iAACProfileValues[] = { FF_PROFILE_AAC_LOW, FF_PROFILE_AAC_MAIN, /*FF_PROFILE_AAC_SSR,*/ FF_PROFILE_AAC_LTP }; @@ -402,6 +396,11 @@ ExportFFmpegAC3Options(wxWindow *parent); void PopulateOrExchange(ShuttleGui & S); void OnOK(wxCommandEvent& event); + /// Bit Rates supported by AC3 encoder + static const int iAC3BitRates[]; + /// Sample Rates supported by AC3 encoder (must end with zero-element) + /// It is not used in dialog anymore, but will be required later + static const int iAC3SampleRates[]; private: Index: ExportFFmpeg.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/export/ExportFFmpeg.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- ExportFFmpeg.cpp 11 Aug 2008 04:16:44 -0000 1.35 +++ ExportFFmpeg.cpp 11 Aug 2008 20:06:40 -0000 1.36 @@ -297,8 +297,8 @@ break; case FMT_AC3: mEncAudioCodecCtx->bit_rate = gPrefs->Read(wxT("/FileFormats/AC3BitRate"), 192000); - if (!CheckSampleRate(mSampleRate,iAC3SampleRates[0],iAC3SampleRates[2],&iAC3SampleRates[0])) - mSampleRate = AskResample(mEncAudioCodecCtx->bit_rate,mSampleRate,iAC3SampleRates[0],iAC3SampleRates[2],&iAC3SampleRates[0]); + if (!CheckSampleRate(mSampleRate,ExportFFmpegAC3Options::iAC3SampleRates[0], ExportFFmpegAC3Options::iAC3SampleRates[2], &ExportFFmpegAC3Options::iAC3SampleRates[0])) + mSampleRate = AskResample(mEncAudioCodecCtx->bit_rate,mSampleRate, ExportFFmpegAC3Options::iAC3SampleRates[0], ExportFFmpegAC3Options::iAC3SampleRates[2], &ExportFFmpegAC3Options::iAC3SampleRates[0]); break; case FMT_GSMAIFF: case FMT_GSMMSWAV: ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Audacity-cvs mailing list Audacity-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/audacity-cvs