Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QSoundControl class extends the functionality of the QSound class. More...
#include <QSoundControl>
Inherits QObject.
The QSoundControl class extends the functionality of the QSound class.
The QSoundControl class can be used to control the volume, priority and provide the status for a QSound object.
Construct a QSoundControl object with an exising QSound object.
QSoundControl *control = new QSoundControl( new QSound( "test.wav" ) );
The control may now be used to alter the behavior of the sound object.
control->setVolume( 50 ); control->setPriority( QSoundControl::RingTone );
In additon the control may be used to listen for when the sound object finishes playback.
connect( control, SIGNAL(done()), this, SLOT(doSomething()) );
The control object does not take owenership of the sound object. Care must be taken to ensure the sound object remains valid for the life of the control object.
delete control->sound(); delete control;
See also QSound.
This enum type specifies the different priorities available for QSound objects.
Constant | Value | Description |
---|---|---|
QSoundControl::Default | 0 | This is the lowest priority. |
QSoundControl::RingTone | 1 | This is the highest priority. Sounds with this priority will be played in preference to all other sounds. |
Constructs a sound control for the given sound object and a parent. Ownership of the sound object is not taken.
This signal is emitted when the sound object finishes playing. For looped sound object this signal will only be emitted once all loops have played through.
Returns the current priority of the sound object.
See also setPriority().
Sets the priority of the sound object to priority.
See also priority().
Adjusts the volume of the sound object to volume. The given value should be between 0 and 100.
See also volume().
Returns the sound object the control is associated with.
Returns the current volume of the sound object.
See also setVolume().
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |