WSJT-X/soundout.h
Bill Somerville db0ba3940d Squashed yet more compiler warnings.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3979 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2014-04-03 20:06:30 +00:00

46 lines
901 B
C++

// -*- Mode: C++ -*-
#ifndef SOUNDOUT_H__
#define SOUNDOUT_H__
#include <QObject>
#include <QString>
#include <QAudioOutput>
#include <QAudioDeviceInfo>
class QAudioDeviceInfo;
// An instance of this sends audio data to a specified soundcard.
class SoundOutput
: public QObject
{
Q_OBJECT;
public:
qreal attenuation () const;
QAudioOutput * stream () {return m_stream.data ();}
public Q_SLOTS:
void setFormat (QAudioDeviceInfo const& device, unsigned channels, unsigned msBuffered = 0u);
void suspend ();
void resume ();
void setAttenuation (qreal); /* unsigned */
void resetAttenuation (); /* to zero */
Q_SIGNALS:
void error (QString message) const;
void status (QString message) const;
private:
bool audioError () const;
private Q_SLOTS:
void handleStateChanged (QAudio::State);
private:
QScopedPointer<QAudioOutput> m_stream;
qreal m_volume;
};
#endif