Implement 24 bit support for WAV export (#3021)

Add a new value of "24 Bit Float" to the "Depth" combo box in the
project export dialog.

Add a new enum value to ProjectRenderer::Depth and extend the evaluation
of the different enum values in ProjectRenderer.

Add the new case of a depth of 24 to AudioFileWave and remove some
repetition with regards to SF_FORMAT_WAV in the code. It's only set once
now and then the depth is "added" in a switch statement.
This commit is contained in:
Michael Gregorius
2017-04-28 22:16:57 +02:00
parent ff4ffd17f4
commit 4196a30415
4 changed files with 42 additions and 29 deletions

View File

@@ -76,14 +76,30 @@ ProjectRenderer::ProjectRenderer( const Mixer::qualitySettings & _qs,
return;
}
bool success_ful = false;
int depth;
switch (_os.depth)
{
case Depth_16Bit:
depth = 16;
break;
case Depth_24Bit:
depth = 24;
break;
case Depth_32Bit:
depth = 32;
break;
default:
// If this line is reached the enum has been extended without taking care here
Q_ASSERT(false);
}
bool successful = false;
m_fileDev = fileEncodeDevices[_file_format].m_getDevInst(
_os.samplerate, DEFAULT_CHANNELS, success_ful,
_os.samplerate, DEFAULT_CHANNELS, successful,
_out_file, _os.vbr,
_os.bitrate, _os.bitrate - 64, _os.bitrate + 64,
_os.depth == Depth_32Bit ? 32 : 16,
Engine::mixer() );
if( success_ful == false )
depth, Engine::mixer() );
if( !successful )
{
delete m_fileDev;
m_fileDev = NULL;