Audacity 3.2.0
|
Class used to export MP3 files. More...
Public Types | |
enum | AskUser { No , Maybe , Yes } |
Public Member Functions | |
MP3Exporter () | |
~MP3Exporter () | |
bool | FindLibrary (wxWindow *parent) |
bool | LoadLibrary (wxWindow *parent, AskUser askuser) |
bool | ValidLibraryLoaded () |
void | SetMode (int mode) |
void | SetBitrate (int rate) |
void | SetQuality (int q) |
bool | InitLibrary (wxString libpath) |
bool | InitLibraryInternal () |
bool | InitLibraryExternal (wxString libpath) |
void | FreeLibrary () |
wxString | GetLibraryVersion () |
wxString | GetLibraryName () |
wxString | GetLibraryPath () |
FileNames::FileTypes | GetLibraryTypes () |
int | InitializeStream (unsigned channels, int sampleRate) |
int | GetOutBufferSize () |
int | EncodeBuffer (float inbuffer[], unsigned char outbuffer[]) |
int | EncodeRemainder (float inbuffer[], int nSamples, unsigned char outbuffer[]) |
int | EncodeBufferMono (float inbuffer[], unsigned char outbuffer[]) |
int | EncodeRemainderMono (float inbuffer[], int nSamples, unsigned char outbuffer[]) |
int | FinishStream (unsigned char outbuffer[]) |
void | CancelEncoding () |
bool | PutInfoTag (wxFFile &f, wxFileOffset off) |
Static Private Attributes | |
static const int | mSamplesPerChunk = 220500 |
static const int | mOutBufferSize |
Class used to export MP3 files.
Definition at line 690 of file ExportMP3.cpp.
enum MP3Exporter::AskUser |
Enumerator | |
---|---|
No | |
Maybe | |
Yes |
Definition at line 693 of file ExportMP3.cpp.
MP3Exporter::MP3Exporter | ( | ) |
Definition at line 811 of file ExportMP3.cpp.
References gPrefs, mBitrate, mEncoding, mGF, mLibIsExternal, mLibPath, mLibraryLoaded, mMode, MODE_CBR, mQuality, QUALITY_2, audacity::BasicSettings::Read(), and wxT().
MP3Exporter::~MP3Exporter | ( | ) |
Definition at line 842 of file ExportMP3.cpp.
References FreeLibrary().
void MP3Exporter::CancelEncoding | ( | ) |
Definition at line 1337 of file ExportMP3.cpp.
References mEncoding.
int MP3Exporter::EncodeBuffer | ( | float | inbuffer[], |
unsigned char | outbuffer[] | ||
) |
Definition at line 1274 of file ExportMP3.cpp.
References lame_encode_buffer_interleaved_ieee_float, mEncoding, mGF, mOutBufferSize, and mSamplesPerChunk.
Referenced by MP3ExportProcessor::Process().
int MP3Exporter::EncodeBufferMono | ( | float | inbuffer[], |
unsigned char | outbuffer[] | ||
) |
Definition at line 1295 of file ExportMP3.cpp.
References lame_encode_buffer_ieee_float, mEncoding, mGF, mOutBufferSize, and mSamplesPerChunk.
Referenced by MP3ExportProcessor::Process().
int MP3Exporter::EncodeRemainder | ( | float | inbuffer[], |
int | nSamples, | ||
unsigned char | outbuffer[] | ||
) |
Definition at line 1284 of file ExportMP3.cpp.
References lame_encode_buffer_interleaved_ieee_float, mEncoding, mGF, and mOutBufferSize.
Referenced by MP3ExportProcessor::Process().
int MP3Exporter::EncodeRemainderMono | ( | float | inbuffer[], |
int | nSamples, | ||
unsigned char | outbuffer[] | ||
) |
Definition at line 1305 of file ExportMP3.cpp.
References lame_encode_buffer_ieee_float, mEncoding, mGF, and mOutBufferSize.
Referenced by MP3ExportProcessor::Process().
bool MP3Exporter::FindLibrary | ( | wxWindow * | parent | ) |
Definition at line 849 of file ExportMP3.cpp.
References audacity::BasicSettings::Flush(), fn, FindDialog::GetLibPath(), GetLibraryName(), GetLibraryPath(), GetLibraryTypes(), gPrefs, mLibPath, name, audacity::BasicSettings::Write(), and wxT().
Referenced by GetMP3Version(), and LoadLibrary().
int MP3Exporter::FinishStream | ( | unsigned char | outbuffer[] | ) |
Definition at line 1316 of file ExportMP3.cpp.
References lame_encode_flush, lame_get_lametag_frame, mEncoding, mGF, mInfoTagBuf, mInfoTagLen, and mOutBufferSize.
Referenced by MP3ExportProcessor::Process().
void MP3Exporter::FreeLibrary | ( | ) |
Definition at line 1143 of file ExportMP3.cpp.
References lame_close, lame_lib, and mGF.
Referenced by LoadLibrary(), and ~MP3Exporter().
wxString MP3Exporter::GetLibraryName | ( | ) |
Definition at line 1393 of file ExportMP3.cpp.
References wxT().
Referenced by FindLibrary(), and LoadLibrary().
wxString MP3Exporter::GetLibraryPath | ( | ) |
Definition at line 1375 of file ExportMP3.cpp.
References anonymous_namespace{CompareAudioCommand.cpp}::reg, and wxT().
Referenced by FindLibrary(), and LoadLibrary().
FileNames::FileTypes MP3Exporter::GetLibraryTypes | ( | ) |
Definition at line 1398 of file ExportMP3.cpp.
References FileNames::AllFiles, FileNames::DynamicLibraries, wxT(), and XO().
Referenced by FindLibrary().
wxString MP3Exporter::GetLibraryVersion | ( | ) |
Definition at line 1157 of file ExportMP3.cpp.
References get_lame_version, mLibraryLoaded, and wxT().
Referenced by GetMP3Version().
int MP3Exporter::GetOutBufferSize | ( | ) |
Definition at line 1266 of file ExportMP3.cpp.
References mEncoding, and mOutBufferSize.
Referenced by MP3ExportProcessor::Initialize().
int MP3Exporter::InitializeStream | ( | unsigned | channels, |
int | sampleRate | ||
) |
Definition at line 1168 of file ExportMP3.cpp.
References lame_init_params, lame_set_brate, lame_set_bWriteVbrTag, lame_set_disable_reservoir, lame_set_error_protection, lame_set_in_samplerate, lame_set_mode, lame_set_num_channels, lame_set_out_samplerate, lame_set_preset, lame_set_VBR, lame_set_VBR_q, mBitrate, mEncoding, mGF, mInfoTagLen, mLibraryLoaded, mMode, MODE_ABR, MODE_SET, MODE_VBR, mQuality, mSamplesPerChunk, preset, PRESET_EXTREME, PRESET_INSANE, PRESET_STANDARD, and anonymous_namespace{ClipSegmentTest.cpp}::sampleRate.
Referenced by MP3ExportProcessor::Initialize().
bool MP3Exporter::InitLibrary | ( | wxString | libpath | ) |
Definition at line 969 of file ExportMP3.cpp.
References InitLibraryExternal(), InitLibraryInternal(), and mLibIsExternal.
Referenced by MP3ExportProcessor::Initialize(), and LoadLibrary().
bool MP3Exporter::InitLibraryExternal | ( | wxString | libpath | ) |
Definition at line 1026 of file ExportMP3.cpp.
References beVersion, beWriteInfoTag, be_version::byMajorVersion, be_version::byMinorVersion, get_lame_version, lame_close, lame_encode_buffer_ieee_float, lame_encode_buffer_interleaved_ieee_float, lame_encode_flush, lame_get_lametag_frame, lame_init, lame_init_params, lame_lib, lame_mp3_tags_fid, lame_set_brate, lame_set_bWriteVbrTag, lame_set_disable_reservoir, lame_set_error_protection, lame_set_in_samplerate, lame_set_mode, lame_set_num_channels, lame_set_out_samplerate, lame_set_preset, lame_set_quality, lame_set_VBR, lame_set_VBR_min_bitrate_kbps, lame_set_VBR_q, mBladeVersion, mGF, FileNames::PathFromAddr(), wxT(), and XO().
Referenced by InitLibrary().
bool MP3Exporter::InitLibraryInternal | ( | ) |
Definition at line 974 of file ExportMP3.cpp.
References beVersion, beWriteInfoTag, get_lame_version, lame_close, lame_encode_buffer_ieee_float, lame_encode_buffer_interleaved_ieee_float, lame_encode_flush, lame_get_lametag_frame, lame_init, lame_init_params, lame_mp3_tags_fid, lame_set_brate, lame_set_bWriteVbrTag, lame_set_disable_reservoir, lame_set_error_protection, lame_set_in_samplerate, lame_set_mode, lame_set_num_channels, lame_set_out_samplerate, lame_set_preset, lame_set_quality, lame_set_VBR, lame_set_VBR_min_bitrate_kbps, lame_set_VBR_q, mGF, and wxT().
Referenced by InitLibrary(), and LoadLibrary().
bool MP3Exporter::LoadLibrary | ( | wxWindow * | parent, |
AskUser | askuser | ||
) |
Definition at line 884 of file ExportMP3.cpp.
References TranslatableString::empty(), FindLibrary(), fn, FreeLibrary(), GetLibraryName(), GetLibraryPath(), InitLibrary(), InitLibraryInternal(), Maybe, mBladeVersion, mLibIsExternal, mLibPath, mLibraryLoaded, BasicUI::ShowMessageBox(), ValidLibraryLoaded(), and wxT().
Referenced by ExportMP3::CheckFileName(), GetMP3Version(), and MP3ExportProcessor::Initialize().
bool MP3Exporter::PutInfoTag | ( | wxFFile & | f, |
wxFileOffset | off | ||
) |
Definition at line 1342 of file ExportMP3.cpp.
References beWriteInfoTag, lame_mp3_tags_fid, mGF, mInfoTagBuf, mInfoTagLen, and OSOUTPUT.
Referenced by MP3ExportProcessor::Process().
void MP3Exporter::SetBitrate | ( | int | rate | ) |
Definition at line 959 of file ExportMP3.cpp.
References mBitrate.
Referenced by MP3ExportProcessor::Initialize().
void MP3Exporter::SetMode | ( | int | mode | ) |
Definition at line 954 of file ExportMP3.cpp.
References mMode.
Referenced by MP3ExportProcessor::Initialize().
void MP3Exporter::SetQuality | ( | int | q | ) |
Definition at line 964 of file ExportMP3.cpp.
References mQuality.
Referenced by MP3ExportProcessor::Initialize().
bool MP3Exporter::ValidLibraryLoaded | ( | ) |
Definition at line 947 of file ExportMP3.cpp.
References mLibraryLoaded.
Referenced by MP3ExportProcessor::Initialize(), and LoadLibrary().
|
private |
Definition at line 794 of file ExportMP3.cpp.
Referenced by InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 793 of file ExportMP3.cpp.
Referenced by InitLibraryExternal(), InitLibraryInternal(), and PutInfoTag().
|
private |
Definition at line 775 of file ExportMP3.cpp.
Referenced by GetLibraryVersion(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 774 of file ExportMP3.cpp.
Referenced by FreeLibrary(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 771 of file ExportMP3.cpp.
Referenced by EncodeBufferMono(), EncodeRemainderMono(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 772 of file ExportMP3.cpp.
Referenced by EncodeBuffer(), EncodeRemainder(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 773 of file ExportMP3.cpp.
Referenced by FinishStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 790 of file ExportMP3.cpp.
Referenced by FinishStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 769 of file ExportMP3.cpp.
Referenced by InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 770 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 753 of file ExportMP3.cpp.
Referenced by FreeLibrary(), and InitLibraryExternal().
|
private |
Definition at line 791 of file ExportMP3.cpp.
Referenced by InitLibraryExternal(), InitLibraryInternal(), and PutInfoTag().
|
private |
Definition at line 781 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 789 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 788 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 787 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 777 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 785 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 779 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 778 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 786 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 780 of file ExportMP3.cpp.
Referenced by InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 782 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 784 of file ExportMP3.cpp.
Referenced by InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 783 of file ExportMP3.cpp.
Referenced by InitializeStream(), InitLibraryExternal(), and InitLibraryInternal().
|
private |
Definition at line 763 of file ExportMP3.cpp.
Referenced by InitializeStream(), MP3Exporter(), and SetBitrate().
|
private |
Definition at line 758 of file ExportMP3.cpp.
Referenced by InitLibraryExternal(), and LoadLibrary().
|
private |
Definition at line 761 of file ExportMP3.cpp.
Referenced by CancelEncoding(), EncodeBuffer(), EncodeBufferMono(), EncodeRemainder(), EncodeRemainderMono(), FinishStream(), GetOutBufferSize(), InitializeStream(), and MP3Exporter().
|
private |
Definition at line 798 of file ExportMP3.cpp.
Referenced by EncodeBuffer(), EncodeBufferMono(), EncodeRemainder(), EncodeRemainderMono(), FinishStream(), FreeLibrary(), InitializeStream(), InitLibraryExternal(), InitLibraryInternal(), MP3Exporter(), and PutInfoTag().
|
private |
Definition at line 807 of file ExportMP3.cpp.
Referenced by FinishStream(), and PutInfoTag().
|
private |
Definition at line 808 of file ExportMP3.cpp.
Referenced by FinishStream(), InitializeStream(), and PutInfoTag().
|
private |
Definition at line 749 of file ExportMP3.cpp.
Referenced by InitLibrary(), LoadLibrary(), and MP3Exporter().
|
private |
Definition at line 752 of file ExportMP3.cpp.
Referenced by FindLibrary(), LoadLibrary(), and MP3Exporter().
|
private |
Definition at line 754 of file ExportMP3.cpp.
Referenced by GetLibraryVersion(), InitializeStream(), LoadLibrary(), MP3Exporter(), and ValidLibraryLoaded().
|
private |
Definition at line 762 of file ExportMP3.cpp.
Referenced by InitializeStream(), MP3Exporter(), and SetMode().
|
staticprivate |
Definition at line 803 of file ExportMP3.cpp.
Referenced by EncodeBuffer(), EncodeBufferMono(), EncodeRemainder(), EncodeRemainderMono(), FinishStream(), and GetOutBufferSize().
|
private |
Definition at line 764 of file ExportMP3.cpp.
Referenced by InitializeStream(), MP3Exporter(), and SetQuality().
|
staticprivate |
Definition at line 800 of file ExportMP3.cpp.
Referenced by EncodeBuffer(), EncodeBufferMono(), and InitializeStream().