Audacity  2.2.0
ExportMP3.cpp File Reference
#include "../Audacity.h"
#include "ExportMP3.h"
#include <wx/app.h>
#include <wx/defs.h>
#include <wx/choice.h>
#include <wx/checkbox.h>
#include <wx/dynlib.h>
#include <wx/ffile.h>
#include <wx/filedlg.h>
#include <wx/intl.h>
#include <wx/log.h>
#include <wx/mimetype.h>
#include <wx/msgdlg.h>
#include <wx/radiobut.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/timer.h>
#include <wx/utils.h>
#include <wx/window.h>
#include "../FileNames.h"
#include "../float_cast.h"
#include "../Internat.h"
#include "../Mix.h"
#include "../Prefs.h"
#include "../Project.h"
#include "../ShuttleGui.h"
#include "../Tags.h"
#include "../Track.h"
#include "../widgets/LinkingHtmlWindow.h"
#include "Export.h"
#include <lame/lame.h>

Classes

struct  CHOICES
 
class  ExportMP3Options
 
class  FindDialog
 
class  MP3Exporter
 Class used to export MP3 files. More...
 
class  ExportMP3
 
struct  id3_tag_deleter
 

Macros

#define MODE_SET   0
 
#define MODE_VBR   1
 
#define MODE_ABR   2
 
#define MODE_CBR   3
 
#define CHANNEL_JOINT   0
 
#define CHANNEL_STEREO   1
 
#define CHANNEL_MONO   2
 
#define QUALITY_0   0
 
#define QUALITY_1   1
 
#define QUALITY_2   2
 
#define QUALITY_3   3
 
#define QUALITY_4   4
 
#define QUALITY_5   5
 
#define QUALITY_6   6
 
#define QUALITY_7   7
 
#define QUALITY_8   8
 
#define QUALITY_9   9
 
#define ROUTINE_FAST   0
 
#define ROUTINE_STANDARD   1
 
#define PRESET_INSANE   0
 
#define PRESET_EXTREME   1
 
#define PRESET_STANDARD   2
 
#define PRESET_MEDIUM   3
 
#define ID_SET   7000
 
#define ID_VBR   7001
 
#define ID_ABR   7002
 
#define ID_CBR   7003
 
#define ID_QUALITY   7004
 
#define ID_MONO   7005
 
#define ID_BROWSE   5000
 
#define ID_DLOAD   5001
 

Typedefs

typedef lame_global_flagslame_init_t (void)
 
typedef int lame_init_params_t (lame_global_flags *)
 
typedef const char * get_lame_version_t (void)
 
typedef int lame_encode_buffer_t (lame_global_flags *gf, const short int buffer_l[], const short int buffer_r[], const int nsamples, unsigned char *mp3buf, const int mp3buf_size)
 
typedef int lame_encode_buffer_interleaved_t (lame_global_flags *gf, short int pcm[], int num_samples, unsigned char *mp3buf, int mp3buf_size)
 
typedef int lame_encode_flush_t (lame_global_flags *gf, unsigned char *mp3buf, int size)
 
typedef int lame_close_t (lame_global_flags *)
 
typedef int lame_set_in_samplerate_t (lame_global_flags *, int)
 
typedef int lame_set_out_samplerate_t (lame_global_flags *, int)
 
typedef int lame_set_num_channels_t (lame_global_flags *, int)
 
typedef int lame_set_quality_t (lame_global_flags *, int)
 
typedef int lame_set_brate_t (lame_global_flags *, int)
 
typedef int lame_set_VBR_t (lame_global_flags *, vbr_mode)
 
typedef int lame_set_VBR_q_t (lame_global_flags *, int)
 
typedef int lame_set_VBR_min_bitrate_kbps_t (lame_global_flags *, int)
 
typedef int lame_set_mode_t (lame_global_flags *, MPEG_mode)
 
typedef int lame_set_preset_t (lame_global_flags *, int)
 
typedef int lame_set_error_protection_t (lame_global_flags *, int)
 
typedef int lame_set_disable_reservoir_t (lame_global_flags *, int)
 
typedef int lame_set_padding_type_t (lame_global_flags *, Padding_type)
 
typedef int lame_set_bWriteVbrTag_t (lame_global_flags *, int)
 
typedef size_t lame_get_lametag_frame_t (const lame_global_flags *, unsigned char *buffer, size_t size)
 
typedef void lame_mp3_tags_fid_t (lame_global_flags *, FILE *)
 
using id3_tag_holder = std::unique_ptr< id3_tag, id3_tag_deleter >
 

Functions

static void InitMP3_Statics ()
 
movable_ptr< ExportPluginNew_ExportMP3 ()
 
wxString GetMP3Version (wxWindow *parent, bool prompt)
 

Variables

static CHOICES fixRates []
 
static CHOICES varRates []
 
static CHOICES varModes []
 
static CHOICES setRates []
 
static CHOICES sampRates []
 

Macro Definition Documentation

#define CHANNEL_MONO   2
#define ID_ABR   7002
#define ID_BROWSE   5000
#define ID_CBR   7003
#define ID_DLOAD   5001
#define ID_MONO   7005
#define ID_QUALITY   7004
#define ID_SET   7000
#define ID_VBR   7001
#define PRESET_EXTREME   1
#define PRESET_INSANE   0
#define PRESET_MEDIUM   3
#define QUALITY_0   0
#define QUALITY_1   1
#define QUALITY_3   3
#define QUALITY_4   4
#define QUALITY_5   5
#define QUALITY_6   6
#define QUALITY_7   7
#define QUALITY_8   8
#define QUALITY_9   9
#define ROUTINE_STANDARD   1

Typedef Documentation

typedef const char* get_lame_version_t(void)
using id3_tag_holder = std::unique_ptr<id3_tag, id3_tag_deleter>
typedef int lame_close_t(lame_global_flags *)
typedef int lame_encode_buffer_interleaved_t(lame_global_flags *gf, short int pcm[], int num_samples,unsigned char *mp3buf, int mp3buf_size)
typedef int lame_encode_buffer_t(lame_global_flags *gf, const short int buffer_l[], const short int buffer_r[], const int nsamples, unsigned char *mp3buf, const int mp3buf_size)
typedef int lame_encode_flush_t(lame_global_flags *gf, unsigned char *mp3buf, int size)
typedef size_t lame_get_lametag_frame_t(const lame_global_flags *, unsigned char *buffer, size_t size)
typedef int lame_init_params_t(lame_global_flags *)
typedef lame_global_flags* lame_init_t(void)
typedef void lame_mp3_tags_fid_t(lame_global_flags *, FILE *)
typedef int lame_set_brate_t(lame_global_flags *, int)
typedef int lame_set_bWriteVbrTag_t(lame_global_flags *, int)
typedef int lame_set_disable_reservoir_t(lame_global_flags *, int)
typedef int lame_set_error_protection_t(lame_global_flags *, int)
typedef int lame_set_in_samplerate_t(lame_global_flags *, int)
typedef int lame_set_mode_t(lame_global_flags *, MPEG_mode)
typedef int lame_set_num_channels_t(lame_global_flags *, int)
typedef int lame_set_out_samplerate_t(lame_global_flags *, int)
typedef int lame_set_padding_type_t(lame_global_flags *, Padding_type)
typedef int lame_set_preset_t(lame_global_flags *, int)
typedef int lame_set_quality_t(lame_global_flags *, int)
typedef int lame_set_VBR_min_bitrate_kbps_t(lame_global_flags *, int)
typedef int lame_set_VBR_q_t(lame_global_flags *, int)
typedef int lame_set_VBR_t(lame_global_flags *, vbr_mode)

Function Documentation

wxString GetMP3Version ( wxWindow *  parent,
bool  prompt 
)
static void InitMP3_Statics ( )
static
movable_ptr<ExportPlugin> New_ExportMP3 ( )

Factory method New_ExportMP3() which creates a NEW ExportMP3 object and returns a pointer to it. The rest of the class declaration is in ExportMP3.cpp

Referenced by Exporter::Exporter().

Variable Documentation

CHOICES fixRates[]
static
Initial value:
=
{
{wxT(""), 320},
{wxT(""), 256},
{wxT(""), 224},
{wxT(""), 192},
{wxT(""), 160},
{wxT(""), 144},
{wxT(""), 128},
{wxT(""), 112},
{wxT(""), 96},
{wxT(""), 80},
{wxT(""), 64},
{wxT(""), 56},
{wxT(""), 48},
{wxT(""), 40},
{wxT(""), 32},
{wxT(""), 24},
{wxT(""), 16},
{wxT(""), 8}
}

Referenced by ExportMP3Options::PopulateOrExchange().

CHOICES sampRates[]
static
Initial value:
=
{
{wxT(""), 8000 },
{wxT(""), 11025 },
{wxT(""), 12000 },
{wxT(""), 16000 },
{wxT(""), 22050 },
{wxT(""), 24000 },
{wxT(""), 32000 },
{wxT(""), 44100 },
{wxT(""), 48000 }
}
CHOICES setRates[]
static
Initial value:
=
{
{wxT(""), PRESET_INSANE },
{wxT(""), PRESET_EXTREME },
{wxT(""), PRESET_STANDARD},
{wxT(""), PRESET_MEDIUM }
}
#define PRESET_MEDIUM
Definition: ExportMP3.cpp:133
#define PRESET_INSANE
Definition: ExportMP3.cpp:130
#define PRESET_EXTREME
Definition: ExportMP3.cpp:131
#define PRESET_STANDARD
Definition: ExportMP3.cpp:132

Referenced by ExportMP3Options::PopulateOrExchange().

CHOICES varModes[]
static
Initial value:
=
{
{wxT(""), ROUTINE_FAST },
{wxT(""), ROUTINE_STANDARD}
}
#define ROUTINE_FAST
Definition: ExportMP3.cpp:127
#define ROUTINE_STANDARD
Definition: ExportMP3.cpp:128
CHOICES varRates[]
static
Initial value:
=
{
{wxT(""), QUALITY_0},
{wxT(""), QUALITY_1},
{wxT(""), QUALITY_2},
{wxT(""), QUALITY_3},
{wxT(""), QUALITY_4},
{wxT(""), QUALITY_5},
{wxT(""), QUALITY_6},
{wxT(""), QUALITY_7},
{wxT(""), QUALITY_8},
{wxT(""), QUALITY_9}
}
#define QUALITY_2
Definition: ExportMP3.cpp:118
#define QUALITY_8
Definition: ExportMP3.cpp:124
#define QUALITY_7
Definition: ExportMP3.cpp:123
#define QUALITY_0
Definition: ExportMP3.cpp:116
#define QUALITY_3
Definition: ExportMP3.cpp:119
#define QUALITY_9
Definition: ExportMP3.cpp:125
#define QUALITY_5
Definition: ExportMP3.cpp:121
#define QUALITY_4
Definition: ExportMP3.cpp:120
#define QUALITY_1
Definition: ExportMP3.cpp:117
#define QUALITY_6
Definition: ExportMP3.cpp:122

Referenced by ExportMP3Options::PopulateOrExchange().