22 #ifndef QAV_AUDIOOUTPUT_H 23 #define QAV_AUDIOOUTPUT_H 25 #include <QtCore/QObject> 26 #include <QtCore/QStringList> 44 class AudioOutputPrivate;
50 Q_FLAGS(DeviceFeatures)
51 Q_PROPERTY(qreal volume READ volume WRITE setVolume NOTIFY volumeChanged)
52 Q_PROPERTY(
bool mute READ isMute WRITE setMute NOTIFY muteChanged)
53 Q_PROPERTY(DeviceFeatures deviceFeatures READ deviceFeatures WRITE setDeviceFeatures NOTIFY deviceFeaturesChanged)
54 Q_PROPERTY(QStringList backends READ backends WRITE setBackends NOTIFY backendsChanged)
64 SetSampleRate = 1 << 2,
72 static QStringList backendsAvailable();
84 void setBackends(const QStringList &backendNames = QStringList());
85 QStringList backends() const;
90 QString backend() const;
113 bool play(const QByteArray& data, qreal pts = 0.0);
119 void setSampleRate(
int rate);
120 int sampleRate() const;
121 void setChannels(
int channels);
122 int channels() const;
130 void setVolume(qreal value);
131 qreal volume() const;
137 void setMute(
bool value = true);
148 void setSpeed(qreal speed);
157 bool isSupported(
AudioFormat::SampleFormat sampleFormat) const;
158 bool isSupported(
AudioFormat::ChannelLayout channelLayout) const;
164 AudioFormat::SampleFormat preferredSampleFormat() const;
169 AudioFormat::ChannelLayout preferredChannelLayout() const;
176 int bufferSamples() const;
177 void setBufferSamples(
int value);
178 int bufferSize() const;
185 int bufferCount() const;
186 void setBufferCount(
int value);
187 int bufferSizeTotal()
const {
return bufferCount() * bufferSize();}
193 void setDeviceFeatures(DeviceFeatures value);
198 DeviceFeatures deviceFeatures()
const;
203 DeviceFeatures supportedDeviceFeatures()
const;
204 qreal timestamp()
const;
207 void volumeChanged(qreal);
208 void muteChanged(
bool);
209 void deviceFeaturesChanged();
210 void backendsChanged();
213 bool receiveData(
const QByteArray &data, qreal pts = 0.0);
218 virtual bool waitForNextBuffer();
220 void reportVolume(qreal value);
221 void reportMute(
bool value);
229 #endif // QAV_AUDIOOUTPUT_H
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
DeviceFeature
DeviceFeature Feature enum features supported by the audio playback api (we call device or backend he...
Definition: AudioOutput.h:60
#define DPTR_DECLARE_PRIVATE(Class)
Definition: dptr.h:107
Definition: AudioOutput.h:45
Definition: AudioOutputBackend.h:32
Definition: AVOutput.h:39
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31