AudioOutputInterface42 Class Reference

AudioOutputInterface42 Class Referenceabstract

#include <audiooutputinterface.h>

Class Description

Definition at line 91 of file audiooutputinterface.h.

+ Inheritance diagram for AudioOutputInterface42:

Public Member Functions

virtual bool setOutputDevice (const Phonon::AudioOutputDevice &)=0
 Requests to change the current output device. More...
 
PHONON_EXPORT QList< QPair< QByteArray, QString > > deviceAccessListFor (const Phonon::AudioOutputDevice &) const
 Helper function for backends to get a list of (driver, handle) pairs for AudioOutputDevice objects that are listed by the platform plugin. More...
 
- Public Member Functions inherited from AudioOutputInterface40
virtual ~AudioOutputInterface40 ()
 
virtual qreal volume () const =0
 Returns the current software volume. More...
 
virtual void setVolume (qreal)=0
 Sets the new current software volume. More...
 
virtual int outputDevice () const =0
 Returns the index of the device that is used. More...
 
virtual bool setOutputDevice (int)=0
 

Member Function Documentation

virtual bool setOutputDevice ( const Phonon::AudioOutputDevice )
pure virtual

Requests to change the current output device.

Returns
true if the requested device works and is used after this call.
false if something failed and the device is not used after this call.
PHONON_EXPORT QList<QPair<QByteArray, QString> > deviceAccessListFor ( const Phonon::AudioOutputDevice ) const

Helper function for backends to get a list of (driver, handle) pairs for AudioOutputDevice objects that are listed by the platform plugin.

Example:

typedef QPair<QByteArray, QString> PhononDeviceAccess;
const QList<PhononDeviceAccess> &deviceAccessList = deviceAccessListFor(deviceDesc);
foreach (const PhononDeviceAccess &access, deviceAccessList) {
const QByteArray &driver = access.first;
const QString &handle = access.second;
if (openDevice(driver, handle)) {
// we found the first pair in the list that works. done.
return;
}
// continue trying the other (driver, handle) pairs
}
// none of the (driver, handle) pairs worked, that means the whole AudioOutputDevice is
// inaccessible and the frontend needs to know (either by emitting audioDeviceFailed or
// returning false when called from setOutputDevice)

At the time of this writing the following driver strings are known to be in use:

  • alsa: The handle is the string to pass to snd_pcm_open (e.g. "dmix:CARD=0,DEV=1")
  • oss: The handle is the device file (e.g. "/dev/dsp")
  • pulseaudio: The handle contains the server string and the sink/source name separated by a newline character. (e.g. unix:/tmp/pulse-mkretz/native.pci_8086_293e_sound_card_0_alsa_playback_0)

The documentation for this class was generated from the following file: