Skip to content

Commit

Permalink
Fix metadata when exporting multiple tracks (#4996)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLorenz committed Jun 4, 2019
1 parent 665e503 commit ff1d75b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
4 changes: 4 additions & 0 deletions include/Mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ class EXPORT Mixer : public QObject
return m_audioDevStartFailed;
}

//! Set new audio device. Old device will be deleted,
//! unless it's stored using storeAudioDevice
void setAudioDevice( AudioDevice * _dev , bool startNow );
//! See overloaded function
void setAudioDevice( AudioDevice * _dev,
const struct qualitySettings & _qs,
bool _needs_fifo,
Expand Down Expand Up @@ -396,6 +399,7 @@ class EXPORT Mixer : public QObject
bool m_isProcessing;

// audio device stuff
void doSetAudioDevice( AudioDevice *_dev );
AudioDevice * m_audioDev;
AudioDevice * m_oldAudioDev;
QString m_audioDevName;
Expand Down
46 changes: 25 additions & 21 deletions src/core/Mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,21 +575,35 @@ void Mixer::changeQuality( const struct qualitySettings & _qs )



void Mixer::setAudioDevice( AudioDevice * _dev,
bool startNow )
void Mixer::doSetAudioDevice( AudioDevice * _dev )
{
stopProcessing();
// TODO: Use shared_ptr here in the future.
// Currently, this is save, because this is only called by
// ProjectRenderer, and after ProjectRenderer calls this function,
// it does not access the old device anymore.
if( m_audioDev != m_oldAudioDev ) {delete m_audioDev;}

if( _dev == NULL )
if( _dev )
{
printf( "param _dev == NULL in Mixer::setAudioDevice(...). "
"Trying any working audio-device\n" );
m_audioDev = tryAudioDevices();
m_audioDev = _dev;
}
else
{
m_audioDev = _dev;
printf( "param _dev == NULL in Mixer::setAudioDevice(...). "
"Trying any working audio-device\n" );
m_audioDev = tryAudioDevices();
}
}




void Mixer::setAudioDevice( AudioDevice * _dev,
bool startNow )
{
stopProcessing();

doSetAudioDevice( _dev );

emit sampleRateChanged();

Expand All @@ -599,26 +613,16 @@ void Mixer::setAudioDevice( AudioDevice * _dev,



void Mixer::setAudioDevice( AudioDevice * _dev,
void Mixer::setAudioDevice(AudioDevice * _dev,
const struct qualitySettings & _qs,
bool _needs_fifo,
bool startNow )
bool startNow)
{
// don't delete the audio-device
stopProcessing();

m_qualitySettings = _qs;

if( _dev == NULL )
{
printf( "param _dev == NULL in Mixer::setAudioDevice(...). "
"Trying any working audio-device\n" );
m_audioDev = tryAudioDevices();
}
else
{
m_audioDev = _dev;
}
doSetAudioDevice( _dev );

emit qualitySettingsChanged();
emit sampleRateChanged();
Expand Down

0 comments on commit ff1d75b

Please sign in to comment.