summaryrefslogtreecommitdiffstats
path: root/src/soundio
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-09-24 22:31:38 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-09-24 23:04:46 +0200
commitf1eeea4208a3e4db14f432782d262d8884d71475 (patch)
tree32fcdc9e27faa107e8d4ad4e0e47f98b494d7079 /src/soundio
parentb3efdbd0492ce1ca7229b1bf05a3c3441ea31d09 (diff)
soundio/soundmanager: Use mixxx::audio::SampleRate type for JACK API
Diffstat (limited to 'src/soundio')
-rw-r--r--src/soundio/soundmanager.cpp9
-rw-r--r--src/soundio/soundmanager.h40
2 files changed, 16 insertions, 33 deletions
diff --git a/src/soundio/soundmanager.cpp b/src/soundio/soundmanager.cpp
index 21288fc5da..d97ecd2a80 100644
--- a/src/soundio/soundmanager.cpp
+++ b/src/soundio/soundmanager.cpp
@@ -63,7 +63,6 @@ SoundManager::SoundManager(UserSettingsPointer pConfig,
: m_pMaster(pMaster),
m_pConfig(pConfig),
m_paInitialized(false),
- m_jackSampleRate(-1),
m_config(this),
m_pErrorDevice(NULL),
m_underflowHappened(0),
@@ -238,7 +237,9 @@ QList<unsigned int> SoundManager::getSampleRates(QString api) const {
// queryDevices must have been called for this to work, but the
// ctor calls it -bkgood
QList<unsigned int> samplerates;
- samplerates.append(m_jackSampleRate);
+ if (m_jackSampleRate.isValid()) {
+ samplerates.append(m_jackSampleRate);
+ }
return samplerates;
}
return m_samplerates;
@@ -319,7 +320,9 @@ void SoundManager::queryDevicesPortaudio() {
m_devices.push_back(currentDevice);
if (!strcmp(Pa_GetHostApiInfo(deviceInfo->hostApi)->name,
MIXXX_PORTAUDIO_JACK_STRING)) {
- m_jackSampleRate = deviceInfo->defaultSampleRate;
+ m_jackSampleRate = mixxx::audio::SampleRate(
+ static_cast<mixxx::audio::SampleRate::value_t>(
+ deviceInfo->defaultSampleRate));
}
}
}
diff --git a/src/soundio/soundmanager.h b/src/soundio/soundmanager.h
index ec23934c0e..2009bfc817 100644
--- a/src/soundio/soundmanager.h
+++ b/src/soundio/soundmanager.h
@@ -1,37 +1,19 @@
-/**
- * @file soundmanager.h
- * @author Albert Santoni <gamegod at users dot sf dot net>
- * @author Bill Good <bkgood at gmail dot com>
- * @date 20070815
- */
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-#ifndef SOUNDMANAGER_H
-#define SOUNDMANAGER_H
+#pragma once
-#include <memory>
-
-#include <QObject>
-#include <QString>
-#include <QList>
#include <QHash>
+#include <QList>
+#include <QObject>
#include <QSharedPointer>
+#include <QString>
+#include <memory>
-#include "preferences/usersettings.h"
+#include "audio/types.h"
#include "engine/sidechain/enginenetworkstream.h"
-#include "soundio/soundmanagerconfig.h"
+#include "preferences/usersettings.h"
#include "soundio/sounddevice.h"
-#include "util/types.h"
+#include "soundio/soundmanagerconfig.h"
#include "util/cmdlineargs.h"
-
+#include "util/types.h"
class EngineMaster;
class AudioOutput;
@@ -148,7 +130,7 @@ class SoundManager : public QObject {
EngineMaster *m_pMaster;
UserSettingsPointer m_pConfig;
bool m_paInitialized;
- unsigned int m_jackSampleRate;
+ mixxx::audio::SampleRate m_jackSampleRate;
QList<SoundDevicePointer> m_devices;
QList<unsigned int> m_samplerates;
QList<CSAMPLE*> m_inputBuffers;
@@ -167,5 +149,3 @@ class SoundManager : public QObject {
ControlProxy* m_pMasterAudioLatencyOverloadCount;
ControlProxy* m_pMasterAudioLatencyOverload;
};
-
-#endif