Fix warnings by moving class declaration into class
Original warning: <TO BE ADDED>
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
#include <QAudioInput>
|
#include <QAudioInput>
|
||||||
|
|
||||||
namespace {
|
|
||||||
//! private helper to allow QAudioInput to write to a io device
|
//! private helper to allow QAudioInput to write to a io device
|
||||||
class AudioDeviceHelper : public QIODevice
|
class AudioDeviceHelper : public QIODevice
|
||||||
{
|
{
|
||||||
@@ -18,14 +17,13 @@ private:
|
|||||||
AudioDevice &m_audioDevice;
|
AudioDevice &m_audioDevice;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AudioDevicePrivate {
|
class AudioDevice::AudioDevicePrivate {
|
||||||
public:
|
public:
|
||||||
AudioDevicePrivate(AudioDevice &audioDevice, const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format);
|
AudioDevicePrivate(AudioDevice &audioDevice, const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format);
|
||||||
|
|
||||||
AudioDeviceHelper helper;
|
AudioDeviceHelper helper;
|
||||||
QAudioInput input;
|
QAudioInput input;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
AudioDevice::AudioDevice(QObject *parent) :
|
AudioDevice::AudioDevice(QObject *parent) :
|
||||||
BaseDevice{parent}
|
BaseDevice{parent}
|
||||||
@@ -58,9 +56,6 @@ void AudioDevice::stop()
|
|||||||
m_private = nullptr;
|
m_private = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
AudioDeviceHelper::AudioDeviceHelper(AudioDevice &audioDevice, QObject *parent) :
|
AudioDeviceHelper::AudioDeviceHelper(AudioDevice &audioDevice, QObject *parent) :
|
||||||
QIODevice{parent}, m_audioDevice(audioDevice)
|
QIODevice{parent}, m_audioDevice(audioDevice)
|
||||||
{
|
{
|
||||||
@@ -84,8 +79,7 @@ qint64 AudioDeviceHelper::writeData(const char *data, qint64 len)
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioDevicePrivate::AudioDevicePrivate(AudioDevice &audioDevice, const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format) :
|
AudioDevice::AudioDevicePrivate::AudioDevicePrivate(AudioDevice &audioDevice, const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format) :
|
||||||
helper{audioDevice}, input{audioDeviceInfo, format}
|
helper{audioDevice}, input{audioDeviceInfo, format}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@@ -9,7 +9,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
// forward declares
|
// forward declares
|
||||||
namespace { class AudioDevicePrivate; }
|
|
||||||
class QAudioInput;
|
class QAudioInput;
|
||||||
|
|
||||||
class AudioDevice : public BaseDevice
|
class AudioDevice : public BaseDevice
|
||||||
@@ -31,6 +30,7 @@ public:
|
|||||||
void setDevice(const QAudioDeviceInfo &device) { Q_ASSERT(!running()); m_device = device; }
|
void setDevice(const QAudioDeviceInfo &device) { Q_ASSERT(!running()); m_device = device; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
class AudioDevicePrivate;
|
||||||
std::unique_ptr<AudioDevicePrivate> m_private;
|
std::unique_ptr<AudioDevicePrivate> m_private;
|
||||||
|
|
||||||
int m_samplerate;
|
int m_samplerate;
|
||||||
|
@@ -3,8 +3,6 @@
|
|||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QAudioOutput>
|
#include <QAudioOutput>
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
//! private helper to allow QAudioOutput to read from a io device
|
//! private helper to allow QAudioOutput to read from a io device
|
||||||
class BaseToneGeneratorHelper : public QIODevice
|
class BaseToneGeneratorHelper : public QIODevice
|
||||||
{
|
{
|
||||||
@@ -18,7 +16,7 @@ private:
|
|||||||
BaseToneGenerator &m_generator;
|
BaseToneGenerator &m_generator;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BaseToneGeneratorPrivate
|
class BaseToneGenerator::BaseToneGeneratorPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BaseToneGeneratorPrivate(BaseToneGenerator &generator, const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format);
|
BaseToneGeneratorPrivate(BaseToneGenerator &generator, const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format);
|
||||||
@@ -28,8 +26,6 @@ public:
|
|||||||
QAudioOutput output;
|
QAudioOutput output;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseToneGenerator::BaseToneGenerator() = default;
|
BaseToneGenerator::BaseToneGenerator() = default;
|
||||||
|
|
||||||
BaseToneGenerator::~BaseToneGenerator() = default;
|
BaseToneGenerator::~BaseToneGenerator() = default;
|
||||||
@@ -58,7 +54,6 @@ void BaseToneGenerator::stop()
|
|||||||
m_private = nullptr;
|
m_private = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
BaseToneGeneratorHelper::BaseToneGeneratorHelper(BaseToneGenerator &generator, QObject *parent) :
|
BaseToneGeneratorHelper::BaseToneGeneratorHelper(BaseToneGenerator &generator, QObject *parent) :
|
||||||
QIODevice{parent}, m_generator{generator}
|
QIODevice{parent}, m_generator{generator}
|
||||||
{
|
{
|
||||||
@@ -80,8 +75,7 @@ qint64 BaseToneGeneratorHelper::writeData(const char *data, qint64 len)
|
|||||||
qFatal("writing is not allowed!");
|
qFatal("writing is not allowed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseToneGeneratorPrivate::BaseToneGeneratorPrivate(BaseToneGenerator &generator, const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format) :
|
BaseToneGenerator::BaseToneGeneratorPrivate::BaseToneGeneratorPrivate(BaseToneGenerator &generator, const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format) :
|
||||||
helper{generator}, output{audioDeviceInfo, format}
|
helper{generator}, output{audioDeviceInfo, format}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@@ -9,9 +9,6 @@
|
|||||||
// local includes
|
// local includes
|
||||||
#include "oscicommon.h"
|
#include "oscicommon.h"
|
||||||
|
|
||||||
// forward declares
|
|
||||||
namespace { class BaseToneGeneratorPrivate; }
|
|
||||||
|
|
||||||
class BaseToneGenerator
|
class BaseToneGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -31,6 +28,7 @@ public:
|
|||||||
virtual std::size_t fill(SamplePair *begin, SamplePair *end) = 0;
|
virtual std::size_t fill(SamplePair *begin, SamplePair *end) = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
class BaseToneGeneratorPrivate;
|
||||||
std::unique_ptr<BaseToneGeneratorPrivate> m_private;
|
std::unique_ptr<BaseToneGeneratorPrivate> m_private;
|
||||||
|
|
||||||
int m_samplerate;
|
int m_samplerate;
|
||||||
|
Reference in New Issue
Block a user