ProjectRenderer: renamed OutputSettings to EncoderSettings + Doxygen comments

Renamed the ProjectRenderer::OutputSettings structure to
ProjectRenderer::EncoderSettings to better reflect its meaning.

Additionally added some basic Doxygen comments.
This commit is contained in:
Tobias Doerffel
2009-11-29 15:29:46 +01:00
parent 20589f19e4
commit 03d3548ba1
4 changed files with 57 additions and 41 deletions

View File

@@ -31,38 +31,41 @@
class QTimer;
/*! \brief The ProjectRenderer class provides functionality to render current Song into a file. */
class ProjectRenderer : public QThread
{
Q_OBJECT
public:
/*! Lists all supported output file formats. */
enum ExportFileFormats
{
WaveFile,
OggFile,
Mp3File,
FlacFile,
WaveFile, /*!< Uncompressed WAV file */
OggFile, /*!< Vorbis-encoded OGG file */
Mp3File, /*!< MP3 file encoded via LAME */
FlacFile, /*!< Free Lossless Audio Codec */
NumFileFormats
} ;
static const char * EFF_ext[];
/*! Lists all supported sample type depths. */
enum Depths
{
Depth_16Bit,
Depth_24Bit,
Depth_32Bit,
Depth_16Bit, /*!< 16 bit signed integer */
Depth_24Bit, /*!< 24 bit floating point */
Depth_32Bit, /*!< 32 bit floating point */
NumDepths
} ;
struct OutputSettings
/*! Settings for the output file encoder. */
struct EncoderSettings
{
sample_rate_t samplerate;
bool vbr;
int bitrate;
Depths depth;
sample_rate_t samplerate; /*!< Desired output sample rate */
bool vbr; /*!< Use variable bitrate encoding */
int bitrate; /*!< Desired bitrate (kbps) */
Depths depth; /*!< Depth of samples */
OutputSettings( sample_rate_t _sr, bool _vbr, int _bitrate,
Depths _d ) :
EncoderSettings( sample_rate_t _sr, bool _vbr, int _bitrate, Depths _d ) :
samplerate( _sr ),
vbr( _vbr ),
bitrate( _bitrate ),
@@ -71,30 +74,40 @@ public:
}
} ;
ProjectRenderer( const AudioOutputContext::QualitySettings & _qs,
const OutputSettings & _os,
ExportFileFormats _file_format,
const QString & _out_file );
/*! \brief Constructs a ProjectRenderer object with given settings.
*
* \param qualitySettings The desired quality settings for the AudioOutputContext
* \param encoderSettings The desired settings for the output file encoder
* \param fileFormat One of the file formats listed in the ExportFileFormats enumeration
* \param outFile The output file name
*/
ProjectRenderer( const AudioOutputContext::QualitySettings & qualitySettings,
const EncoderSettings & encoderSettings,
ExportFileFormats fileFormat,
const QString & outFile );
virtual ~ProjectRenderer();
/*! \brief Returns whether the ProjectRenderer was initialized properly. */
bool isReady() const
{
return m_fileDev != NULL;
}
static ExportFileFormats getFileFormatFromExtension(
const QString & _ext );
static ExportFileFormats getFileFormatFromExtension( const QString & _ext );
void setConsoleUpdateTimer(QTimer * t)
void setConsoleUpdateTimer( QTimer * t )
{
m_consoleUpdateTimer = t;
}
public slots:
/*! \brief Sets according AudioOutputContext for Mixer and starts render thread. */
void startProcessing();
/*! \brief Aborts the processing and cleans up resources. */
void abortProcessing();
/*! \brief Prints current render progress to the console. */
void updateConsoleProgress();
@@ -103,6 +116,7 @@ signals:
private slots:
/*! \brief Finalizes the render process and restores Mixer's AudioOutputContext. */
void finishProcessing();
@@ -120,6 +134,7 @@ private:
} ;
/*! \brief Holds information about a certain file encoder. */
struct FileEncodeDevice
{
ProjectRenderer::ExportFileFormats m_fileFormat;