mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
Ref T730, code style, adding namespaces
This commit is contained in:
committed by
Mat Sutcliffe
parent
329b1e8c9a
commit
99edc9cb13
@@ -1,3 +1,13 @@
|
||||
/* Copyright (C) 2019
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated,
|
||||
* or distributed except according to the terms contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSOUND_BUFFEREDWAVEPROVIDER_H
|
||||
#define BLACKSOUND_BUFFEREDWAVEPROVIDER_H
|
||||
|
||||
@@ -8,23 +18,31 @@
|
||||
#include <QByteArray>
|
||||
#include <QVector>
|
||||
|
||||
class BLACKSOUND_EXPORT BufferedWaveProvider : public ISampleProvider
|
||||
namespace BlackSound
|
||||
{
|
||||
Q_OBJECT
|
||||
namespace SampleProvider
|
||||
{
|
||||
//! Buffered wave generator
|
||||
class BLACKSOUND_EXPORT CBufferedWaveProvider : public ISampleProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BufferedWaveProvider(const QAudioFormat &format, QObject *parent = nullptr);
|
||||
public:
|
||||
//! Ctor
|
||||
CBufferedWaveProvider(const QAudioFormat &format, QObject *parent = nullptr);
|
||||
|
||||
void addSamples(const QVector<qint16> &samples);
|
||||
virtual int readSamples(QVector<qint16> &samples, qint64 count) override;
|
||||
void addSamples(const QVector<qint16> &samples);
|
||||
virtual int readSamples(QVector<qint16> &samples, qint64 count) override;
|
||||
|
||||
int getBufferedBytes() const { return m_audioBuffer.size(); }
|
||||
int getBufferedBytes() const { return m_audioBuffer.size(); }
|
||||
|
||||
void clearBuffer();
|
||||
void clearBuffer();
|
||||
|
||||
private:
|
||||
QVector<qint16> m_audioBuffer;
|
||||
qint32 m_maxBufferSize;
|
||||
};
|
||||
private:
|
||||
QVector<qint16> m_audioBuffer;
|
||||
qint32 m_maxBufferSize;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BUFFEREDWAVEPROVIDER_H
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user