mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
AFV initial commit
This commit is contained in:
committed by
Mat Sutcliffe
parent
7030302e73
commit
b5a2f2ad13
30
src/blacksound/sampleprovider/bufferedwaveprovider.h
Normal file
30
src/blacksound/sampleprovider/bufferedwaveprovider.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef BLACKSOUND_BUFFEREDWAVEPROVIDER_H
|
||||
#define BLACKSOUND_BUFFEREDWAVEPROVIDER_H
|
||||
|
||||
#include "blacksound/blacksoundexport.h"
|
||||
#include "blacksound/sampleprovider/sampleprovider.h"
|
||||
|
||||
#include <QAudioFormat>
|
||||
#include <QByteArray>
|
||||
#include <QVector>
|
||||
|
||||
class BLACKSOUND_EXPORT BufferedWaveProvider : public ISampleProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BufferedWaveProvider(const QAudioFormat &format, QObject *parent = nullptr);
|
||||
|
||||
void addSamples(const QVector<qint16> &samples);
|
||||
virtual int readSamples(QVector<qint16> &samples, qint64 count) override;
|
||||
|
||||
int getBufferedBytes() const { return m_audioBuffer.size(); }
|
||||
|
||||
void clearBuffer();
|
||||
|
||||
private:
|
||||
QVector<qint16> m_audioBuffer;
|
||||
qint32 m_maxBufferSize;
|
||||
};
|
||||
|
||||
#endif // BUFFEREDWAVEPROVIDER_H
|
||||
Reference in New Issue
Block a user