1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/audiobuffer.h
Tux3 / Mlkj / !Lev.uXFMLA f5793b0db8 Add mutexes to AudioBuffer
2014-07-01 22:04:19 +02:00

27 lines
493 B
C++

#ifndef AUDIOBUFFER_H
#define AUDIOBUFFER_H
#include <QIODevice>
#include <QByteArray>
#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;
mutable QMutex bufferMutex;
};
#endif // AUDIOBUFFER_H