1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/audiobuffer.h

27 lines
493 B
C
Raw Normal View History

#ifndef AUDIOBUFFER_H
#define AUDIOBUFFER_H
#include <QIODevice>
#include <QByteArray>
2014-07-02 04:04:19 +08:00
#include <QMutex>
class AudioBuffer : public QIODevice
{
Q_OBJECT
public:
explicit AudioBuffer();
~AudioBuffer();
qint64 readData(char *data, qint64 maxlen);
qint64 writeData(const char *data, qint64 len);
qint64 bytesAvailable() const;
qint64 bufferSize() const;
void clear();
private:
QByteArray buffer;
2014-07-02 04:04:19 +08:00
mutable QMutex bufferMutex;
};
#endif // AUDIOBUFFER_H