summaryrefslogtreecommitdiff
path: root/Audio/soundout.h
diff options
context:
space:
mode:
Diffstat (limited to 'Audio/soundout.h')
-rw-r--r--Audio/soundout.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/Audio/soundout.h b/Audio/soundout.h
index 1e4b3a94..76711660 100644
--- a/Audio/soundout.h
+++ b/Audio/soundout.h
@@ -7,6 +7,7 @@
#include <QAudioOutput>
#include <QAudioDeviceInfo>
+class QIODevice;
class QAudioDeviceInfo;
// An instance of this sends audio data to a specified soundcard.
@@ -18,15 +19,16 @@ class SoundOutput
public:
SoundOutput ()
- : m_msBuffered {0u}
+ : m_framesBuffered {0}
, m_volume {1.0}
+ , error_ {false}
{
}
qreal attenuation () const;
public Q_SLOTS:
- void setFormat (QAudioDeviceInfo const& device, unsigned channels, unsigned msBuffered = 0u);
+ void setFormat (QAudioDeviceInfo const& device, unsigned channels, int frames_buffered = 0);
void restart (QIODevice *);
void suspend ();
void resume ();
@@ -40,15 +42,18 @@ Q_SIGNALS:
void status (QString message) const;
private:
- bool audioError () const;
+ bool checkStream () const;
private Q_SLOTS:
void handleStateChanged (QAudio::State);
private:
+ QAudioDeviceInfo m_device;
+ unsigned m_channels;
QScopedPointer<QAudioOutput> m_stream;
- unsigned m_msBuffered;
+ int m_framesBuffered;
qreal m_volume;
+ bool error_;
};
#endif