Fix warnings by moving class declaration into class

Original warning: <TO BE ADDED>
This commit is contained in:
Gitea
2019-09-16 18:50:37 +02:00
parent ab2853475f
commit f5d6995d98
4 changed files with 6 additions and 20 deletions

View File

@@ -4,7 +4,6 @@
#include <QIODevice>
#include <QAudioInput>
namespace {
//! private helper to allow QAudioInput to write to a io device
class AudioDeviceHelper : public QIODevice
{
@@ -18,14 +17,13 @@ private:
AudioDevice &m_audioDevice;
};
class AudioDevicePrivate {
class AudioDevice::AudioDevicePrivate {
public:
AudioDevicePrivate(AudioDevice &audioDevice, const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format);
AudioDeviceHelper helper;
QAudioInput input;
};
}
AudioDevice::AudioDevice(QObject *parent) :
BaseDevice{parent}
@@ -58,9 +56,6 @@ void AudioDevice::stop()
m_private = nullptr;
}
namespace {
AudioDeviceHelper::AudioDeviceHelper(AudioDevice &audioDevice, QObject *parent) :
QIODevice{parent}, m_audioDevice(audioDevice)
{
@@ -84,8 +79,7 @@ qint64 AudioDeviceHelper::writeData(const char *data, qint64 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}
{
}
}

View File

@@ -9,7 +9,6 @@
#include <memory>
// forward declares
namespace { class AudioDevicePrivate; }
class QAudioInput;
class AudioDevice : public BaseDevice
@@ -31,6 +30,7 @@ public:
void setDevice(const QAudioDeviceInfo &device) { Q_ASSERT(!running()); m_device = device; }
private:
class AudioDevicePrivate;
std::unique_ptr<AudioDevicePrivate> m_private;
int m_samplerate;

View File

@@ -3,8 +3,6 @@
// Qt includes
#include <QAudioOutput>
namespace
{
//! private helper to allow QAudioOutput to read from a io device
class BaseToneGeneratorHelper : public QIODevice
{
@@ -18,7 +16,7 @@ private:
BaseToneGenerator &m_generator;
};
class BaseToneGeneratorPrivate
class BaseToneGenerator::BaseToneGeneratorPrivate
{
public:
BaseToneGeneratorPrivate(BaseToneGenerator &generator, const QAudioDeviceInfo &audioDeviceInfo, const QAudioFormat &format);
@@ -28,8 +26,6 @@ public:
QAudioOutput output;
};
}
BaseToneGenerator::BaseToneGenerator() = default;
BaseToneGenerator::~BaseToneGenerator() = default;
@@ -58,7 +54,6 @@ void BaseToneGenerator::stop()
m_private = nullptr;
}
namespace {
BaseToneGeneratorHelper::BaseToneGeneratorHelper(BaseToneGenerator &generator, QObject *parent) :
QIODevice{parent}, m_generator{generator}
{
@@ -80,8 +75,7 @@ qint64 BaseToneGeneratorHelper::writeData(const char *data, qint64 len)
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}
{
}
}

View File

@@ -9,9 +9,6 @@
// local includes
#include "oscicommon.h"
// forward declares
namespace { class BaseToneGeneratorPrivate; }
class BaseToneGenerator
{
public:
@@ -31,6 +28,7 @@ public:
virtual std::size_t fill(SamplePair *begin, SamplePair *end) = 0;
private:
class BaseToneGeneratorPrivate;
std::unique_ptr<BaseToneGeneratorPrivate> m_private;
int m_samplerate;