• Skip to content
  • Skip to link menu
KDE API Documentation - GCAudio Class Reference (GCompris-qt)
  • KDE Home
  • Contact Us
 

GCompris-qt

  • View on LXR
  • Comments
Signals | Public Member Functions | Properties | List of all members
GCAudio Class Reference
Core QML Components

Inherits QtQuick.Item, and Item.

Signals

void done ()
 
void error ()
 

Public Member Functions

void append (string file)
 
void clearQueue ()
 
void play (string file)
 
void silence (int duration_ms)
 
void stop ()
 

Properties

string errorString
 
list files
 
bool muted
 
var playbackState
 
url source
 

Detailed Description

A QML component for audio playback.

Wrapper component around QtQuick's Audio element, handling all audio playback in GCompris uniformly.

It maintains a queue of audio-sources (files) that are played back sequentially, to which the user can enqueue files that should be scheduled for playback.

To make sure an audio voice will be localized, replace the locale part of the file by '$LOCALE'.

To makes sure that all audio sources are normalized with respect to ApplicationInfo.CompressedAudio replace the 'ogg' part of the file by '$CA'.

Definition at line 44 of file GCAudio.qml.

Member Function Documentation

void GCAudio::append ( string  file)

Schedules a file for audio playback.

If there is no playback currently running, the new source will be played back immediately. Otherwise it is appended to the file queue of sources.

Parameters
fileFile to the audio file to be played back.
Returns
true upon success, or false if file does not exist or audio is muted
void GCAudio::clearQueue ( )

Flushes the list of scheduled files.

See also
files
void GCAudio::done ( )
signal

Emitted when playback of all scheduled audio sources has finished.

void GCAudio::error ( )
signal

Emitted in case of error.

void GCAudio::play ( string  file)

When mute is changed we set the volume to 0 to mute a potential playing sound.

Plays back the audio resource file.

Parameters
file[optional] URL to an audio source.
Returns
true if playback has been started, false if file does not exist or audio is muted
void GCAudio::silence ( int  duration_ms)

Adds a pause of the given duration in ms before playing of the next file.

Parameters
duration_msPause in milliseconds.
void GCAudio::stop ( )

Stops audio playback.

Property Documentation

string GCAudio::errorString

Detailed error message in case of playback errors.

Definition at line 60 of file GCAudio.qml.

list GCAudio::files

Playback queue.

Definition at line 72 of file GCAudio.qml.

bool GCAudio::muted

Whether audio should be muted.

Definition at line 50 of file GCAudio.qml.

var GCAudio::playbackState

Current playback state.

Possible values taken from Audio.status

Definition at line 67 of file GCAudio.qml.

url GCAudio::source

URL to the audio source to be played back.

Definition at line 55 of file GCAudio.qml.


The documentation for this class was generated from the following file:
  • GCAudio.qml
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Tue Jun 2 2015 21:47:48 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

GCompris-qt

Skip menu "GCompris-qt"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List
  • Modules

Class Picker

Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal