Qt Components Hildon  0.20
QML components for Maemo5 with Hildon styling.
 All Classes Functions Properties Groups Pages
Public Slots | Signals | Properties | List of all members
Audio Class Reference

Provides audio playback features. More...

Public Slots

void pause ()
 Pauses audio playback.
void play ()
 Starts or resumes audio playback.
void stop ()
 Stops audio playback.

Signals

void error (string errorString)
 This signal is emitted when an error occurs.
void resumed ()
 This signal is emitted when audio playback is resumed, i.e the previous status will be Paused.
void started ()
 This signal is emitted when audio playback is started, i.e the previous status will be Audio.Stopped.
void stopped ()
 This signal is emitted when audio playback is stopped.

Properties

bool autoLoad
 Whether the source is set immediately.
real bufferProgress
 The current progress of audio buffering.
int duration
 The duration of the audio stream, in seconds.
string errorString
 A description of the error that last occurred.
variant metaData
 The metadata associated with the audio stream.
bool muted
 Whether the audio output is muted.
bool paused
 Whether the audio playback is paused.
bool playing
 Whether the audio is playing.
int position
 The current position in the audio stream, in seconds.
bool seekable
 Whether seeking in the audio stream is enabled.
string source
 The source of the audio stream.
enumeration status
 The current status of the audio stream.
int tickInterval
 The frequency of position updates, in milliseconds.
int volume
 The current audio output volume.

Detailed Description

Provides audio playback features.

The Audio component is suitable for playback of audio streams, such as music files and internet radio.

import QtQuick 1.0
import org.hildon.components 1.0
import org.hildon.multimedia 1.0
Window {
id: window
title: qsTr("Audio Example")
visible: true
id: player
}
Column {
id: column
anchors.centerIn: parent
width: 300
Button {
id: playButton
width: parent.width
text: player.playing ? qsTr("Pause") : qsTr("Play")
shortcut: "Space"
enabled: player.source != ""
onClicked: player.playing = !player.playing
}
Button {
id: fileButton
width: parent.width
text: qsTr("Open file")
shortcut: "Ctrl+O"
onClicked: fileDialog.open()
}
}
id: fileDialog
onAccepted: {
player.source = filePath;
player.play();
}
}
}
See Also
NowPlayingModel
Examples:
audio.qml.

Member Function Documentation

void Audio::error ( string  errorString)
signal

This signal is emitted when an error occurs.

errorString provides a description of the error.

void Audio::pause ( )
slot

Pauses audio playback.

See Also
paused, paused()
void Audio::play ( )
slot

Starts or resumes audio playback.

See Also
playing, started(), resumed()
void Audio::stop ( )
slot

Stops audio playback.

See Also
stopped()

Property Documentation

bool Audio::autoLoad
readwrite

Whether the source is set immediately.

The default value is true.

variant Audio::metaData
read

The metadata associated with the audio stream.

Available properties are:

Name
metaData.albumArtist
metaData.albumTitle
metaData.artist
metaData.audioBitRate
metaData.audioCodec
metaData.comment
metaData.composer
metaData.copyright
metaData.coverArtUrl
metaData.date
metaData.description
metaData.genre
metaData.keywords
metaData.lastPlayed
metaData.lyrics
metaData.mimeType
metaData.playCount
metaData.size
metaData.title
metaData.trackNumber
metaData.year
bool Audio::muted
readwrite

Whether the audio output is muted.

The default value is false.

See Also
volume
void Audio::paused
readwrite

Whether the audio playback is paused.

This signal is emitted when audio playback is paused.

The default value is false.

See Also
pause(), paused()
bool Audio::playing
readwrite

Whether the audio is playing.

The default value is false.

See Also
play(), started(), resumed()
bool Audio::seekable
read

Whether seeking in the audio stream is enabled.

See Also
position
enumeration Audio::status
read

The current status of the audio stream.

Possible values are:

Value Description
Audio.Stopped The audio stream is stopped (default).
Audio.Loading The audio stream is being loaded.
Audio.Playing The audio stream is being played.
Audio.Paused The audio stream is paused.
Audio.EndOfMedia The end of the audio stream has been reached.
Audio.Error An error occured when playing the audio stream.
int Audio::tickInterval
readwrite

The frequency of position updates, in milliseconds.

Setting this property to 0 will suspend updates.

The default value is 1000.

int Audio::volume
readwrite

The current audio output volume.

The available range is 0-100.