Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.phonon
Class AudioOutput

    java.lang.Object
      com.trolltech.qt.internal.QSignalEmitterInternal
          com.trolltech.qt.QSignalEmitter
              com.trolltech.qt.QtJambiObject
                  com.trolltech.qt.core.QObject
                      com.trolltech.qt.phonon.AbstractAudioOutput
                          com.trolltech.qt.phonon.AudioOutput

All Implemented Interfaces:
  QtJambiInterface

    public class AudioOutput

extends AbstractAudioOutput

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.

        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` .

See also:
  `Phonon::VolumeSlider`, Music Player Example, BackendCapabilities, and Phonon Module.

Nested Class Summary

Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
`QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9`

Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal`

Field Summary
`QSignalEmitter.Signal1` | `mutedChanged` This signal takes 1 generic argument(s).
`QSignalEmitter.Signal1` | `outputDeviceChanged` This signal takes 1 generic argument(s).
`QSignalEmitter.Signal1` | `volumeChanged` This signal takes 1 generic argument(s).

Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`currentSender`

Constructor Summary
`AudioOutput()` Creates a new AudioOutput that defines output to the system default device with the {Phonon.:Category::}{`NoCategory` } category
`AudioOutput(Phonon.Category category)` Creates a new AudioOutput with the given `parent` that defines output to a physical device.
`AudioOutput(Phonon.Category category, QObject parent)` Creates a new AudioOutput with the given `parent` that defines output to a physical device.
`AudioOutput(QObject parent)` Creates a new AudioOutput that defines output to the system default device with the {Phonon.:Category::}{`NoCategory` } category

Method Summary
`Phonon.Category` | `category()` Returns the category of this output.
`boolean` | `isMuted()` This property tells whether the output is muted.
`java.lang.String` | `name()` This is the name that appears in Mixer applications that control the volume of this output.
`AudioOutputDevice` | `outputDevice()` This property holds the (hardware) destination for the output.
`void` | `setMuted(boolean mute)` This property tells whether the output is muted.
`void` | `setName(java.lang.String newName)` This is the name that appears in Mixer applications that control the volume of this output.
`boolean` | `setOutputDevice(AudioOutputDevice newAudioOutputDevice)` This property holds the (hardware) destination for the output.
`void` | `setVolume(double newVolume)` This is the current loudness of the output.
`void` | `setVolumeDecibel(double newVolumeDecibel)` This is the current volume of the output in decibel.
`double` | `volume()` This is the current loudness of the output.
`double` | `volumeDecibel()` This is the current volume of the output in decibel.

Methods inherited from class com.trolltech.qt.phonon.AbstractAudioOutput
`__qt_cast_to_MediaNode, fromNativePointer, inputPaths, isValid, outputPaths`

Methods inherited from class com.trolltech.qt.core.QObject
`childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty`

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 com.trolltech.qt.internal.QSignalEmitterInternal
`__qt_signalInitialization`

Methods inherited from class java.lang.Object
`clone, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.trolltech.qt.QtJambiInterface
`disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership`

Field Detail

### mutedChanged

    public final QSignalEmitter.Signal1 mutedChanged

  This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Boolean(named: muted)>:

  This signal is emitted when the muted property has changed. The `muted` value passed by the signal indicates the state of the muted property. As this property can change by IPC (DBus) calls a UI element showing the muted property should listen to this signal.

### outputDeviceChanged

    public final QSignalEmitter.Signal1 outputDeviceChanged

  This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.phonon.AudioOutputDevice(named: newAudioOutputDevice)>:

  This signal is emitted when the (hardware) device for the output has changed. `newAudioOutputDevice` is the new device.

  The change can happen either through setOutputDevice or if the global configuration for the used category has changed.

See also:
  outputDevice.

### volumeChanged

    public final QSignalEmitter.Signal1 volumeChanged

  This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Double(named: newVolume)>:

  This signal is emitted whenever the volume has changed. As the volume can change without a call to setVolume (calls over dbus) this is important to keep a widget showing the current volume up to date.

  `newVolume` is the new volume level.

See also:
  `setVolume()`, and `volume()`.

Constructor Detail

### AudioOutput

    public AudioOutput(Phonon.Category category)

  Creates a new AudioOutput with the given `parent` that defines output to a physical device.

  The `category` 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 also:
  `Phonon::categoryToString()`, and outputDevice.

### AudioOutput

    public AudioOutput(Phonon.Category category,
                       QObject parent)

  Creates a new AudioOutput with the given `parent` that defines output to a physical device.

  The `category` 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 also:
  `Phonon::categoryToString()`, and outputDevice.

### AudioOutput

    public AudioOutput()

  Creates a new AudioOutput that defines output to the system default device with the {Phonon.:Category::}{`NoCategory` } category

See also:
  `Phonon::categoryToString()`, and outputDevice.

### AudioOutput

    public AudioOutput(QObject parent)

  Creates a new AudioOutput that defines output to the system default device with the {Phonon.:Category::}{`NoCategory` } category

See also:
  `Phonon::categoryToString()`, and outputDevice.

Method Detail

### category

    public final Phonon.Category category()

  Returns the category of this output.

See also:
  Phonon::AudioOutput::AudioOutput().

### isMuted

    public final boolean isMuted()

  This property tells whether the output is muted.

  Muting the output has the same effect as calling setVolume(0.0).

### name

    public final java.lang.String name()

  This is the name that appears in Mixer applications that control the volume of this output.

### outputDevice

    public final AudioOutputDevice outputDevice()

  This property holds the (hardware) destination for the output.

  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.

See also:
  `outputDeviceChanged()` .

### setMuted

    public final void setMuted(boolean mute)

  This property tells whether the output is muted.

  Muting the output has the same effect as calling setVolume(0.0).

### setName

    public final void setName(java.lang.String newName)

  This is the name that appears in Mixer applications that control the volume of this output.

### setOutputDevice

    public final boolean setOutputDevice(AudioOutputDevice newAudioOutputDevice)

  This property holds the (hardware) destination for the output.

  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.

See also:
  `outputDeviceChanged()` .

### setVolume

    public final void setVolume(double newVolume)

  This is the current loudness of the output.

  (it is using Stevens' law to calculate the change in voltage internally).

See also:
  volumeDecibel.

### setVolumeDecibel

    public final void setVolumeDecibel(double newVolumeDecibel)

  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.

See also:
  volume.

### volume

    public final double volume()

  This is the current loudness of the output.

  (it is using Stevens' law to calculate the change in voltage internally).

See also:
  volumeDecibel.

### volumeDecibel

    public final double volumeDecibel()

  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.

See also:
  volume.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD