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:
itsmattkc
2021-10-01 15:41:24 -07:00
parent 06066c279b
commit ee81a47f2e
15 changed files with 224 additions and 546 deletions
+20 -3
View File
@@ -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_;
};
}