begin switch to portaudio
Qt's audio system has served us well, but it's a little limited moving forward. PortAudio is a mature and versatile library that will allow for better audio for users.
This commit is contained in:
@@ -29,7 +29,7 @@ class PreviewAudioDevice : public QIODevice
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PreviewAudioDevice(QObject *parent = nullptr);
|
||||
PreviewAudioDevice(int bytes_per_frame, QObject *parent = nullptr);
|
||||
|
||||
virtual ~PreviewAudioDevice() override;
|
||||
|
||||
@@ -39,9 +39,20 @@ public:
|
||||
|
||||
virtual qint64 readData(char *data, qint64 maxSize) override;
|
||||
|
||||
virtual qint64 writeData(const char *, qint64) override;
|
||||
virtual qint64 writeData(const char *data, qint64 length) override;
|
||||
|
||||
void Push(const QByteArray &b);
|
||||
int bytes_per_frame() const
|
||||
{
|
||||
return bytes_per_frame_;
|
||||
}
|
||||
|
||||
void set_notify_interval(qint64 i)
|
||||
{
|
||||
notify_interval_ = i;
|
||||
}
|
||||
|
||||
signals:
|
||||
void Notify();
|
||||
|
||||
private:
|
||||
enum LockMethod {
|
||||
@@ -61,6 +72,12 @@ private:
|
||||
|
||||
QAtomicInt swap_requested_;
|
||||
|
||||
int bytes_per_frame_;
|
||||
|
||||
qint64 notify_interval_;
|
||||
|
||||
qint64 bytes_read_;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user