Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix metadata when exporting multiple tracks (#4996) #5005

Merged
merged 2 commits into from
Jun 7, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
JohannesLorenz marked this conversation as resolved.
Show resolved Hide resolved
// Currently, this is save, because this is only called by
JohannesLorenz marked this conversation as resolved.
Show resolved Hide resolved
// 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