From df73263c0871308b24bad77c380730a2394440da Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Wed, 22 Apr 2015 18:27:22 +0200 Subject: [PATCH] Provide hints for opening audio sources via AudioSourceConfig --- plugins/soundsourcem4a/soundsourcem4a.cpp | 9 +++++---- plugins/soundsourcem4a/soundsourcem4a.h | 2 +- .../soundsourcemediafoundation.cpp | 10 +++++----- .../soundsourcemediafoundation.h | 4 ++-- plugins/soundsourcewv/soundsourcewv.cpp | 6 +++--- plugins/soundsourcewv/soundsourcewv.h | 2 +- src/analyserqueue.cpp | 4 +++- src/cachingreaderworker.cpp | 8 +++++--- src/musicbrainz/chromaprinter.cpp | 4 +++- src/soundsourceproxy.cpp | 4 ++-- src/soundsourceproxy.h | 2 +- src/sources/audiosource.h | 11 +++++++++++ src/sources/soundsource.cpp | 4 ++-- src/sources/soundsource.h | 4 ++-- src/sources/soundsourcecoreaudio.cpp | 4 ++-- src/sources/soundsourcecoreaudio.h | 2 +- src/sources/soundsourceffmpeg.cpp | 4 ++-- src/sources/soundsourceffmpeg.h | 2 +- src/sources/soundsourceflac.cpp | 2 +- src/sources/soundsourceflac.h | 2 +- src/sources/soundsourcemodplug.cpp | 2 +- src/sources/soundsourcemodplug.h | 2 +- src/sources/soundsourcemp3.cpp | 2 +- src/sources/soundsourcemp3.h | 2 +- src/sources/soundsourceoggvorbis.cpp | 2 +- src/sources/soundsourceoggvorbis.h | 2 +- src/sources/soundsourceopus.cpp | 2 +- src/sources/soundsourceopus.h | 2 +- src/sources/soundsourcesndfile.cpp | 2 +- src/sources/soundsourcesndfile.h | 2 +- 30 files changed, 64 insertions(+), 46 deletions(-) diff --git a/plugins/soundsourcem4a/soundsourcem4a.cpp b/plugins/soundsourcem4a/soundsourcem4a.cpp index 3e0bb46a8bf..7871b2934e3 100644 --- a/plugins/soundsourcem4a/soundsourcem4a.cpp +++ b/plugins/soundsourcem4a/soundsourcem4a.cpp @@ -114,7 +114,7 @@ SoundSourceM4A::~SoundSourceM4A() { close(); } -Result SoundSourceM4A::tryOpen(SINT channelCountHint) { +Result SoundSourceM4A::tryOpen(const AudioSourceConfig& audioSrcCfg) { DEBUG_ASSERT(MP4_INVALID_FILE_HANDLE == m_hFile); /* open MP4 file, check for >= ver 1.9.1 */ #if MP4V2_PROJECT_version_hex <= 0x00010901 @@ -155,9 +155,10 @@ Result SoundSourceM4A::tryOpen(SINT channelCountHint) { } NeAACDecConfigurationPtr pDecoderConfig = NeAACDecGetCurrentConfiguration( m_hDecoder); - pDecoderConfig->outputFormat = FAAD_FMT_FLOAT; /* 32-bit float */ - if ((kChannelCountZero < channelCountHint) && (2 >= channelCountHint)) { - pDecoderConfig->downMatrix = 1; /* multi -> stereo */ + pDecoderConfig->outputFormat = FAAD_FMT_FLOAT; + if ((1 == audioSrcCfg.channelCountHint) || (2 == audioSrcCfg.channelCountHint)) { + // mono or stereo requested + pDecoderConfig->downMatrix = 1; } else { pDecoderConfig->downMatrix = 0; } diff --git a/plugins/soundsourcem4a/soundsourcem4a.h b/plugins/soundsourcem4a/soundsourcem4a.h index df614553fc3..31f0a5bdd6a 100644 --- a/plugins/soundsourcem4a/soundsourcem4a.h +++ b/plugins/soundsourcem4a/soundsourcem4a.h @@ -39,7 +39,7 @@ class SoundSourceM4A: public SoundSourcePlugin { CSAMPLE* sampleBuffer) /*override*/; private: - Result tryOpen(SINT channelCountHint) /*override*/; + Result tryOpen(const AudioSourceConfig& audioSrcCfg) /*override*/; bool isValidSampleBlockId(MP4SampleId sampleBlockId) const; diff --git a/plugins/soundsourcemediafoundation/soundsourcemediafoundation.cpp b/plugins/soundsourcemediafoundation/soundsourcemediafoundation.cpp index a85d88e31cc..bde34ee56f3 100644 --- a/plugins/soundsourcemediafoundation/soundsourcemediafoundation.cpp +++ b/plugins/soundsourcemediafoundation/soundsourcemediafoundation.cpp @@ -115,7 +115,7 @@ SoundSourceMediaFoundation::~SoundSourceMediaFoundation() { close(); } -Result SoundSourceMediaFoundation::tryOpen(SINT channelCountHint) { +Result SoundSourceMediaFoundation::tryOpen(const Mixxx::AudioSourceConfig& audioSrcCfg) { if (SUCCEEDED(m_hrCoInitialize)) { qWarning() << "Cannot reopen MediaFoundation file" << getUrlString(); return ERR; @@ -156,7 +156,7 @@ Result SoundSourceMediaFoundation::tryOpen(SINT channelCountHint) { return ERR; } - if (!configureAudioStream(channelCountHint)) { + if (!configureAudioStream(audioSrcCfg)) { qWarning() << "SSMF: Error configuring audio stream."; return ERR; } @@ -434,7 +434,7 @@ SINT SoundSourceMediaFoundation::readSampleFrames( If anything in here fails, just bail. I'm not going to decode HRESULTS. -- Bill */ -bool SoundSourceMediaFoundation::configureAudioStream(SINT channelCountHint) { +bool SoundSourceMediaFoundation::configureAudioStream(const Mixxx::AudioSourceConfig& audioSrcCfg) { HRESULT hr(S_OK); // deselect all streams, we only want the first @@ -500,8 +500,8 @@ bool SoundSourceMediaFoundation::configureAudioStream(SINT channelCountHint) { return false; } - if (kChannelCountZero < channelCountHint) { - hr = m_pAudioType->SetUINT32(MF_MT_AUDIO_NUM_CHANNELS, channelCountHint); + if (kChannelCountZero < audioSrcCfg.channelCountHint) { + hr = m_pAudioType->SetUINT32(MF_MT_AUDIO_NUM_CHANNELS, audioSrcCfg.channelCountHint); if (FAILED(hr)) { qWarning() << "SSMF: failed to set number of channels"; return false; diff --git a/plugins/soundsourcemediafoundation/soundsourcemediafoundation.h b/plugins/soundsourcemediafoundation/soundsourcemediafoundation.h index c0857318e42..afb84e9733d 100644 --- a/plugins/soundsourcemediafoundation/soundsourcemediafoundation.h +++ b/plugins/soundsourcemediafoundation/soundsourcemediafoundation.h @@ -48,9 +48,9 @@ class SoundSourceMediaFoundation : public Mixxx::SoundSourcePlugin { SINT readSampleFrames(SINT numberOfFrames, CSAMPLE* sampleBuffer) /*override*/; private: - Result tryOpen(SINT channelCountHint) /*override*/; + Result tryOpen(const Mixxx::AudioSourceConfig& audioSrcCfg) /*override*/; - bool configureAudioStream(SINT channelCountHint); + bool configureAudioStream(const Mixxx::AudioSourceConfig& audioSrcCfg); void copyFrames(CSAMPLE *dest, SINT *destFrames, const CSAMPLE *src, SINT srcFrames); diff --git a/plugins/soundsourcewv/soundsourcewv.cpp b/plugins/soundsourcewv/soundsourcewv.cpp index 18f5f894a41..020e136fab3 100644 --- a/plugins/soundsourcewv/soundsourcewv.cpp +++ b/plugins/soundsourcewv/soundsourcewv.cpp @@ -18,12 +18,12 @@ SoundSourceWV::~SoundSourceWV() { close(); } -Result SoundSourceWV::tryOpen(SINT channelCountHint) { +Result SoundSourceWV::tryOpen(const AudioSourceConfig& audioSrcCfg) { DEBUG_ASSERT(!m_wpc); char msg[80]; // hold possible error message int openFlags = OPEN_WVC | OPEN_NORMALIZE; - if ((kChannelCountZero < channelCountHint) && (2 >= channelCountHint)) { - // mono or stereo + if ((1 == audioSrcCfg.channelCountHint) || (2 == audioSrcCfg.channelCountHint)) { + // mono or stereo requested openFlags |= OPEN_2CH_MAX; } m_wpc = WavpackOpenFileInput( diff --git a/plugins/soundsourcewv/soundsourcewv.h b/plugins/soundsourcewv/soundsourcewv.h index b501d0e4ac0..e3c6bf2c5df 100644 --- a/plugins/soundsourcewv/soundsourcewv.h +++ b/plugins/soundsourcewv/soundsourcewv.h @@ -28,7 +28,7 @@ class SoundSourceWV: public SoundSourcePlugin { CSAMPLE* sampleBuffer) /*override*/; private: - Result tryOpen(SINT channelCountHint) /*override*/; + Result tryOpen(const AudioSourceConfig& audioSrcCfg) /*override*/; WavpackContext* m_wpc; diff --git a/src/analyserqueue.cpp b/src/analyserqueue.cpp index 35ab4d9e613..c4d32b8e23c 100644 --- a/src/analyserqueue.cpp +++ b/src/analyserqueue.cpp @@ -309,7 +309,9 @@ void AnalyserQueue::run() { // Get the audio SoundSourceProxy soundSourceProxy(nextTrack); - Mixxx::AudioSourcePointer pAudioSource(soundSourceProxy.openAudioSource(kAnalysisChannels)); + Mixxx::AudioSourceConfig audioSrcCfg; + audioSrcCfg.channelCountHint = kAnalysisChannels; + Mixxx::AudioSourcePointer pAudioSource(soundSourceProxy.openAudioSource(audioSrcCfg)); if (!pAudioSource) { qWarning() << "Failed to open file for analyzing:" << nextTrack->getLocation(); continue; diff --git a/src/cachingreaderworker.cpp b/src/cachingreaderworker.cpp index 1e5a9b0c890..9b11396f969 100644 --- a/src/cachingreaderworker.cpp +++ b/src/cachingreaderworker.cpp @@ -134,9 +134,9 @@ void CachingReaderWorker::run() { namespace { - Mixxx::AudioSourcePointer openAudioSourceForReading(const TrackPointer& pTrack, SINT channelCountHint) { + Mixxx::AudioSourcePointer openAudioSourceForReading(const TrackPointer& pTrack, const Mixxx::AudioSourceConfig& audioSrcCfg) { SoundSourceProxy soundSourceProxy(pTrack); - Mixxx::AudioSourcePointer pAudioSource(soundSourceProxy.openAudioSource(channelCountHint)); + Mixxx::AudioSourcePointer pAudioSource(soundSourceProxy.openAudioSource(audioSrcCfg)); if (pAudioSource.isNull()) { qWarning() << "Failed to open file:" << pTrack->getLocation(); return Mixxx::AudioSourcePointer(); @@ -169,7 +169,9 @@ void CachingReaderWorker::loadTrack(const TrackPointer& pTrack) { return; } - m_pAudioSource = openAudioSourceForReading(pTrack, kChunkChannels); + Mixxx::AudioSourceConfig audioSrcCfg; + audioSrcCfg.channelCountHint = kChunkChannels; + m_pAudioSource = openAudioSourceForReading(pTrack, audioSrcCfg); if (m_pAudioSource.isNull()) { // Must unlock before emitting to avoid deadlock qDebug() << m_group << "CachingReaderWorker::loadTrack() load failed for\"" diff --git a/src/musicbrainz/chromaprinter.cpp b/src/musicbrainz/chromaprinter.cpp index f6b01653ebc..ba37a780bac 100644 --- a/src/musicbrainz/chromaprinter.cpp +++ b/src/musicbrainz/chromaprinter.cpp @@ -99,7 +99,9 @@ ChromaPrinter::ChromaPrinter(QObject* parent) QString ChromaPrinter::getFingerprint(TrackPointer pTrack) { SoundSourceProxy soundSourceProxy(pTrack); - Mixxx::AudioSourcePointer pAudioSource(soundSourceProxy.openAudioSource(kFingerprintChannels)); + Mixxx::AudioSourceConfig audioSrcCfg; + audioSrcCfg.channelCountHint = kFingerprintChannels; + Mixxx::AudioSourcePointer pAudioSource(soundSourceProxy.openAudioSource(audioSrcCfg)); if (pAudioSource.isNull()) { qDebug() << "Skipping invalid file:" << pTrack->getLocation(); return QString(); diff --git a/src/soundsourceproxy.cpp b/src/soundsourceproxy.cpp index 33b41d91b22..8ba87fcf32c 100644 --- a/src/soundsourceproxy.cpp +++ b/src/soundsourceproxy.cpp @@ -312,7 +312,7 @@ QLibrary* SoundSourceProxy::getPlugin(QString lib_filename) return pPlugin; } -Mixxx::AudioSourcePointer SoundSourceProxy::openAudioSource(SINT channelCountHint) { +Mixxx::AudioSourcePointer SoundSourceProxy::openAudioSource(const Mixxx::AudioSourceConfig& audioSrcCfg) { if (m_pAudioSource) { qDebug() << "AudioSource is already open"; return m_pAudioSource; @@ -323,7 +323,7 @@ Mixxx::AudioSourcePointer SoundSourceProxy::openAudioSource(SINT channelCountHin return m_pAudioSource; } - if (OK != m_pSoundSource->open(channelCountHint)) { + if (OK != m_pSoundSource->open(audioSrcCfg)) { qWarning() << "Failed to open SoundSource"; return m_pAudioSource; } diff --git a/src/soundsourceproxy.h b/src/soundsourceproxy.h index f10bb020c63..1c50a48d861 100644 --- a/src/soundsourceproxy.h +++ b/src/soundsourceproxy.h @@ -59,7 +59,7 @@ class SoundSourceProxy: public Mixxx::MetadataSource { // Opening the audio data through the proxy will // update the some metadata of the track object. // Returns a null pointer on failure. - Mixxx::AudioSourcePointer openAudioSource(SINT channelCountHint = Mixxx::AudioSource::kChannelCountDefault); + Mixxx::AudioSourcePointer openAudioSource(const Mixxx::AudioSourceConfig& audioSrcCfg = Mixxx::AudioSourceConfig()); void closeAudioSource(); diff --git a/src/sources/audiosource.h b/src/sources/audiosource.h index 8b959d9a3a1..641746378f0 100644 --- a/src/sources/audiosource.h +++ b/src/sources/audiosource.h @@ -256,6 +256,17 @@ class AudioSource: public UrlResource { SINT m_bitrate; }; +// Parameters for configuring audio sources +struct AudioSourceConfig { + AudioSourceConfig() + : channelCountHint(AudioSource::kChannelCountDefault), + frameRateHint(AudioSource::kFrameRateDefault){ + } + + SINT channelCountHint; + SINT frameRateHint; +}; + typedef QSharedPointer AudioSourcePointer; } // namespace Mixxx diff --git a/src/sources/soundsource.cpp b/src/sources/soundsource.cpp index ff0b658d678..9f166868e2f 100644 --- a/src/sources/soundsource.cpp +++ b/src/sources/soundsource.cpp @@ -20,11 +20,11 @@ SoundSource::SoundSource(QUrl url, QString type) DEBUG_ASSERT(getUrl().isValid()); } -Result SoundSource::open(SINT channelCountHint) { +Result SoundSource::open(const AudioSourceConfig& audioSrcCfg) { close(); // reopening is not supported Result result; try { - result = tryOpen(channelCountHint); + result = tryOpen(audioSrcCfg); } catch (...) { close(); throw; diff --git a/src/sources/soundsource.h b/src/sources/soundsource.h index 6f94d7cf227..46a3e4bf110 100644 --- a/src/sources/soundsource.h +++ b/src/sources/soundsource.h @@ -34,7 +34,7 @@ class SoundSource: public MetadataSource, public AudioSource { // // Since reopening is not supported close() will be called // implicitly before the AudioSource is actually opened. - Result open(SINT channelCountHint = kChannelCountDefault); + Result open(const AudioSourceConfig& audioSrcCfg = AudioSourceConfig()); // Closes the AudioSource and frees all resources. // @@ -54,7 +54,7 @@ class SoundSource: public MetadataSource, public AudioSource { // need to free resources in tryOpen() themselves, but // should instead be prepared for the following invocation // of close(). - virtual Result tryOpen(SINT channelCountHint) = 0; + virtual Result tryOpen(const AudioSourceConfig& audioSrcCfg) = 0; const QString m_type; }; diff --git a/src/sources/soundsourcecoreaudio.cpp b/src/sources/soundsourcecoreaudio.cpp index 19b2dd54dbd..a6a331d0f79 100644 --- a/src/sources/soundsourcecoreaudio.cpp +++ b/src/sources/soundsourcecoreaudio.cpp @@ -25,7 +25,7 @@ SoundSourceCoreAudio::~SoundSourceCoreAudio() { } // soundsource overrides -Result AudioSourceCoreAudio::tryOpen(SINT channelCountHint) { +Result AudioSourceCoreAudio::tryOpen(const AudioSourceConfig& audioSrcCfg) { const QString fileName(getLocalFileName()); //Open the audio file. @@ -66,7 +66,7 @@ Result AudioSourceCoreAudio::tryOpen(SINT channelCountHint) { // create the output format const UInt32 numChannels = - (channelCountZero < channelCountHint) ? channelCountHint : 2; + (channelCountZero < audioSrcCfg.channelCountHint) ? audioSrcCfg.channelCountHint : 2; m_outputFormat = CAStreamBasicDescription(m_inputFormat.mSampleRate, numChannels, CAStreamBasicDescription::kPCMFormatFloat32, true); diff --git a/src/sources/soundsourcecoreaudio.h b/src/sources/soundsourcecoreaudio.h index 7dbb2d4afaa..afe858bcbfd 100644 --- a/src/sources/soundsourcecoreaudio.h +++ b/src/sources/soundsourcecoreaudio.h @@ -33,7 +33,7 @@ class SoundSourceCoreAudio : public Mixxx::SoundSource { CSAMPLE* sampleBuffer) /*override*/; private: - Result tryOpen(SINT channelCountHint) /*override*/; + Result tryOpen(const AudioSourceConfig& audioSrcCfg) /*override*/; ExtAudioFileRef m_audioFile; CAStreamBasicDescription m_inputFormat; diff --git a/src/sources/soundsourceffmpeg.cpp b/src/sources/soundsourceffmpeg.cpp index 87c365bc238..dccc6c1d8df 100644 --- a/src/sources/soundsourceffmpeg.cpp +++ b/src/sources/soundsourceffmpeg.cpp @@ -60,12 +60,12 @@ SoundSourceFFmpeg::~SoundSourceFFmpeg() { close(); } -Result SoundSourceFFmpeg::tryOpen(SINT channelCountHint) { +Result SoundSourceFFmpeg::tryOpen(const AudioSourceConfig& /*audioSrcCfg*/) { unsigned int i; AVDictionary *l_iFormatOpts = NULL; const QByteArray qBAFilename(getLocalFileNameBytes()); - qDebug() << "New SoundSourceFFmpeg :" << qBAFilename << "(channelCountHint:" << channelCountHint << ")"; + qDebug() << "New SoundSourceFFmpeg :" << qBAFilename; DEBUG_ASSERT(!m_pFormatCtx); m_pFormatCtx = avformat_alloc_context(); diff --git a/src/sources/soundsourceffmpeg.h b/src/sources/soundsourceffmpeg.h index a5008da71d3..3f1866950a7 100644 --- a/src/sources/soundsourceffmpeg.h +++ b/src/sources/soundsourceffmpeg.h @@ -54,7 +54,7 @@ class SoundSourceFFmpeg : public SoundSource { SINT readSampleFrames(SINT numberOfFrames, CSAMPLE* sampleBuffer) /*override*/; private: - Result tryOpen(SINT channelCountHint) /*override*/; + Result tryOpen(const AudioSourceConfig& audioSrcCfg) /*override*/; bool readFramesToCache(unsigned int count, SINT offset); bool getBytesFromCache(char *buffer, SINT offset, SINT size); diff --git a/src/sources/soundsourceflac.cpp b/src/sources/soundsourceflac.cpp index 85f4018d4b6..598b146f4e3 100644 --- a/src/sources/soundsourceflac.cpp +++ b/src/sources/soundsourceflac.cpp @@ -80,7 +80,7 @@ SoundSourceFLAC::~SoundSourceFLAC() { close(); } -Result SoundSourceFLAC::tryOpen(SINT /*channelCountHint*/) { +Result SoundSourceFLAC::tryOpen(const AudioSourceConfig& /*audioSrcCfg*/) { DEBUG_ASSERT(!m_file.isOpen()); if (!m_file.open(QIODevice::ReadOnly)) { qWarning() << "Failed to open FLAC file:" << m_file.fileName(); diff --git a/src/sources/soundsourceflac.h b/src/sources/soundsourceflac.h index ec66b1f6f57..fb46f387a7e 100644 --- a/src/sources/soundsourceflac.h +++ b/src/sources/soundsourceflac.h @@ -39,7 +39,7 @@ class SoundSourceFLAC: public SoundSource { void flacError(FLAC__StreamDecoderErrorStatus status); private: - Result tryOpen(SINT channelCountHint) /*override*/; + Result tryOpen(const AudioSourceConfig& audioSrcCfg) /*override*/; SINT readSampleFrames(SINT numberOfFrames, CSAMPLE* sampleBuffer, SINT sampleBufferSize, diff --git a/src/sources/soundsourcemodplug.cpp b/src/sources/soundsourcemodplug.cpp index cc77a5af04f..3f5df31d694 100644 --- a/src/sources/soundsourcemodplug.cpp +++ b/src/sources/soundsourcemodplug.cpp @@ -102,7 +102,7 @@ QImage SoundSourceModPlug::parseCoverArt() const { return QImage(); } -Result SoundSourceModPlug::tryOpen(SINT /*channelCountHint*/) { +Result SoundSourceModPlug::tryOpen(const AudioSourceConfig& /*audioSrcCfg*/) { ScopedTimer t("SoundSourceModPlug::open()"); // read module file to byte array diff --git a/src/sources/soundsourcemodplug.h b/src/sources/soundsourcemodplug.h index 0cb18ec991f..d81970650e6 100644 --- a/src/sources/soundsourcemodplug.h +++ b/src/sources/soundsourcemodplug.h @@ -41,7 +41,7 @@ class SoundSourceModPlug: public Mixxx::SoundSource { CSAMPLE* sampleBuffer) /*override*/; private: - Result tryOpen(SINT channelCountHint) /*override*/; + Result tryOpen(const AudioSourceConfig& audioSrcCfg) /*override*/; static unsigned int s_bufferSizeLimit; // max track buffer length (bytes) diff --git a/src/sources/soundsourcemp3.cpp b/src/sources/soundsourcemp3.cpp index ee63b248e40..2dc11bb1df4 100644 --- a/src/sources/soundsourcemp3.cpp +++ b/src/sources/soundsourcemp3.cpp @@ -120,7 +120,7 @@ SoundSourceMp3::~SoundSourceMp3() { close(); } -Result SoundSourceMp3::tryOpen(SINT /*channelCountHint*/) { +Result SoundSourceMp3::tryOpen(const AudioSourceConfig& /*audioSrcCfg*/) { DEBUG_ASSERT(!isChannelCountValid()); DEBUG_ASSERT(!isFrameRateValid()); diff --git a/src/sources/soundsourcemp3.h b/src/sources/soundsourcemp3.h index 2bd8ef32316..d29616f8981 100644 --- a/src/sources/soundsourcemp3.h +++ b/src/sources/soundsourcemp3.h @@ -38,7 +38,7 @@ class SoundSourceMp3: public SoundSource { bool readStereoSamples); private: - Result tryOpen(SINT channelCountHint) /*override*/; + Result tryOpen(const AudioSourceConfig& audioSrcCfg) /*override*/; QFile m_file; quint64 m_fileSize; diff --git a/src/sources/soundsourceoggvorbis.cpp b/src/sources/soundsourceoggvorbis.cpp index 463b45eb55c..78ae0494b2e 100644 --- a/src/sources/soundsourceoggvorbis.cpp +++ b/src/sources/soundsourceoggvorbis.cpp @@ -30,7 +30,7 @@ SoundSourceOggVorbis::~SoundSourceOggVorbis() { close(); } -Result SoundSourceOggVorbis::tryOpen(SINT /*channelCountHint*/) { +Result SoundSourceOggVorbis::tryOpen(const AudioSourceConfig& /*audioSrcCfg*/) { const QByteArray qbaFilename(getLocalFileNameBytes()); if (0 != ov_fopen(qbaFilename.constData(), &m_vf)) { qWarning() << "Failed to open OggVorbis file:" << getUrlString(); diff --git a/src/sources/soundsourceoggvorbis.h b/src/sources/soundsourceoggvorbis.h index b8acc2b23da..e79336dd695 100644 --- a/src/sources/soundsourceoggvorbis.h +++ b/src/sources/soundsourceoggvorbis.h @@ -25,7 +25,7 @@ class SoundSourceOggVorbis: public SoundSource { CSAMPLE* sampleBuffer, SINT sampleBufferSize) /*override*/; private: - Result tryOpen(SINT channelCountHint) /*override*/; + Result tryOpen(const AudioSourceConfig& audioSrcCfg) /*override*/; SINT readSampleFrames(SINT numberOfFrames, CSAMPLE* sampleBuffer, SINT sampleBufferSize, diff --git a/src/sources/soundsourceopus.cpp b/src/sources/soundsourceopus.cpp index dcdb8495fc9..e76c61bc852 100644 --- a/src/sources/soundsourceopus.cpp +++ b/src/sources/soundsourceopus.cpp @@ -119,7 +119,7 @@ Result SoundSourceOpus::parseTrackMetadata(Mixxx::TrackMetadata* pMetadata) cons return OK; } -Result SoundSourceOpus::tryOpen(SINT /*channelCountHint*/) { +Result SoundSourceOpus::tryOpen(const AudioSourceConfig& /*audioSrcCfg*/) { const QByteArray qbaFilename(getLocalFileNameBytes()); int errorCode = 0; diff --git a/src/sources/soundsourceopus.h b/src/sources/soundsourceopus.h index a879b44320e..6c0ae382cb3 100644 --- a/src/sources/soundsourceopus.h +++ b/src/sources/soundsourceopus.h @@ -29,7 +29,7 @@ class SoundSourceOpus: public Mixxx::SoundSource { CSAMPLE* sampleBuffer, SINT sampleBufferSize) /*override*/; private: - Result tryOpen(SINT channelCountHint) /*override*/; + Result tryOpen(const AudioSourceConfig& audioSrcCfg) /*override*/; OggOpusFile *m_pOggOpusFile; diff --git a/src/sources/soundsourcesndfile.cpp b/src/sources/soundsourcesndfile.cpp index fa1ad2ed773..efa04cdfb2e 100644 --- a/src/sources/soundsourcesndfile.cpp +++ b/src/sources/soundsourcesndfile.cpp @@ -20,7 +20,7 @@ SoundSourceSndFile::~SoundSourceSndFile() { close(); } -Result SoundSourceSndFile::tryOpen(SINT /*channelCountHint*/) { +Result SoundSourceSndFile::tryOpen(const AudioSourceConfig& /*audioSrcCfg*/) { DEBUG_ASSERT(!m_pSndFile); memset(&m_sfInfo, 0, sizeof(m_sfInfo)); #ifdef __WINDOWS__ diff --git a/src/sources/soundsourcesndfile.h b/src/sources/soundsourcesndfile.h index eda5f78377b..81e8824fe78 100644 --- a/src/sources/soundsourcesndfile.h +++ b/src/sources/soundsourcesndfile.h @@ -28,7 +28,7 @@ class SoundSourceSndFile: public Mixxx::SoundSource { CSAMPLE* sampleBuffer) /*override*/; private: - Result tryOpen(SINT channelCountHint) /*override*/; + Result tryOpen(const AudioSourceConfig& audioSrcCfg) /*override*/; SNDFILE* m_pSndFile; SF_INFO m_sfInfo;