Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Member Functions | List of all members
Phonon::AudioOutputInterface42 Class Referenceabstract
Inheritance diagram for Phonon::AudioOutputInterface42:
Phonon::AudioOutputInterface40 Phonon::AudioOutputInterface47

Public Member Functions

virtual bool setOutputDevice (const Phonon::AudioOutputDevice &)=0
 
PHONON_EXPORT QList< QPair
< QByteArray, QString > > 
deviceAccessListFor (const Phonon::AudioOutputDevice &) const
 
- Public Member Functions inherited from Phonon::AudioOutputInterface40
virtual qreal volume () const =0
 
virtual void setVolume (qreal)=0
 
virtual int outputDevice () const =0
 
virtual bool setOutputDevice (int)=0
 

Member Function Documentation

QList< QPair< QByteArray, QString > > Phonon::AudioOutputInterface42::deviceAccessListFor ( const Phonon::AudioOutputDevice deviceDesc) 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)
virtual bool Phonon::AudioOutputInterface42::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.

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