|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.phonon.AudioOutputInterface
public abstract class AudioOutputInterface
The AudioOutput
class is used to send data to audio output devices. The AudioOutput
class plays sound over a sound device. The audio output needs to be connected to a MediaObject
using createPath(). To start playback, you call play()
on the media object.
The following code example is written in c++.
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 the
volume()
. It is also possible to mute the sound. To find out what AudioOutputDevices are available for AudioOutput
, you can call BackendCapabilities::availableAudioDevices()
. A default device is selected by the backend, but it is possible to set the device to be used with setOutputDevice()
. The outputDeviceChanged()
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 the ErrorState
.
Author: Matthias Kretz <kretz@kde.org>
Phonon::VolumeSlider
, Music Player Example, and BackendCapabilities.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Constructor Summary | |
---|---|
AudioOutputInterface()
Creates a new AudioOutputInterface |
Method Summary | |
---|---|
static AudioOutputInterface |
fromNativePointer(QNativePointer nativePointer)
|
abstract int |
outputDevice()
This property holds the (hardware) destination for the output. |
abstract boolean |
setOutputDevice(int arg__1)
|
abstract void |
setVolume(double arg__1)
This is the current loudness of the output. |
abstract double |
volume()
This is the current loudness of the output. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public AudioOutputInterface()
Method Detail |
---|
public abstract int outputDevice()
The default device is determined by the Category
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.
outputDeviceChanged()
.
public abstract boolean setOutputDevice(int arg__1)
public abstract void setVolume(double arg__1)
(it is using Stevens' law to calculate the change in voltage internally).
public abstract double volume()
(it is using Stevens' law to calculate the change in voltage internally).
public static AudioOutputInterface fromNativePointer(QNativePointer nativePointer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |