
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheAudioOutput class is used to send data to audio output devices.More...
|
|
| AudioOutput(Phonon::Category category, QObject * parent = 0) | |
| AudioOutput(QObject * parent = 0) | |
| Phonon::Category | category() const |
| bool | isMuted() const |
| QString | name() const |
| AudioOutputDevice | outputDevice() const |
| qreal | volume() const |
| qreal | volumeDecibel() const |
| void | setMuted(bool mute) |
| void | setName(const QString & newName) |
| bool | setOutputDevice(const Phonon::AudioOutputDevice & newAudioOutputDevice) |
| void | setVolume(qreal newVolume) |
| void | setVolumeDecibel(qreal newVolumeDecibel) |
| void | mutedChanged(bool muted) |
| void | outputDeviceChanged(const Phonon::AudioOutputDevice & newAudioOutputDevice) |
| void | volumeChanged(qreal newVolume) |
TheAudioOutput class is used to send data to audio output devices.
TheAudioOutput class plays sound over a sound device. The audio output needs to be connected to aMediaObject using createPath(). To start playback, you call play() on the media object.
Phonon::MediaObject*mediaObject=new Phonon::MediaObject(this); mediaObject->setCurrentSource(Phonon::MediaSource("/mymusic/barbiegirl.wav")); Phonon::AudioOutput*audioOutput=new Phonon::AudioOutput(Phonon::MusicCategory,this); Phonon::Path path= Phonon::createPath(mediaObject, audioOutput);
The class supports changing thevolume(). It is also possible to mute the sound.
To find out whatAudioOutputDevices are available forAudioOutput, you can callBackendCapabilities::availableAudioOutputDevices(). A default device is selected by the backend, but it is possible to set the device to be used withsetOutputDevice(). TheoutputDeviceChanged() signal will be emitted if the device changes.
If an error occurs with the playback, for instance, if no valid output device is found, the media object will receive a stateChanged() signal with theErrorState.
Note that the default values of properties are dependent on the backend.
See alsoPhonon::VolumeSlider,Music Player Example,BackendCapabilities, andPhonon Module.
This property tells whether the output is muted.
Muting the output has the same effect as callingsetVolume(0.0).
Access functions:
| bool | isMuted() const |
| void | setMuted(bool mute) |
Notifier signal:
| void | mutedChanged(bool muted) |
This is the name that appears in Mixer applications that control the volume of this output.
Access functions:
| QString | name() const |
| void | setName(const QString & newName) |
This property holds the (hardware) destination for the output.
The default device is determined by theCategory and the global configuration for that category. Normally you don't need to override this setting - letting the user change the global configuration is the right choice. You can still override the device though, if you have good reasons to do so.
Access functions:
| AudioOutputDevice | outputDevice() const |
| bool | setOutputDevice(const Phonon::AudioOutputDevice & newAudioOutputDevice) |
See alsooutputDeviceChanged().
This is the current loudness of the output.
(it is using Stevens' law to calculate the change in voltage internally).
Access functions:
| qreal | volume() const |
| void | setVolume(qreal newVolume) |
Notifier signal:
| void | volumeChanged(qreal newVolume) |
See alsovolumeDecibel.
This is the current volume of the output in decibel.
0 dB means no change in volume, -6dB means an attenuation of the voltage to 50% and an attenuation of the power to 25%, -inf dB means silence.
Access functions:
| qreal | volumeDecibel() const |
| void | setVolumeDecibel(qreal newVolumeDecibel) |
See alsovolume.
Creates a newAudioOutput with the givenparent that defines output to a physical device.
Thecategory can be used by mixer applications to group volume controls of applications into categories. That makes it easier for the user to identify the programs. The category is also used for the default output device that is configured centrally. As an example: often users want to have the audio signal of a VoIP application go to their USB headset while all other sounds should go to the internal soundcard.
See alsoPhonon::categoryToString() andoutputDevice.
Creates a newAudioOutput that defines output to the system default device with the {Phonon::Category::}{NoCategory} category
See alsoPhonon::categoryToString() andoutputDevice.
Returns the category of this output.
See alsoPhonon::AudioOutput::AudioOutput().
[signal]void AudioOutput::outputDeviceChanged(constPhonon::AudioOutputDevice & newAudioOutputDevice)This signal is emitted when the (hardware) device for the output has changed.newAudioOutputDevice is the new device.
The change can happen either throughsetOutputDevice or if the global configuration for the used category has changed.
See alsooutputDevice.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.