SystemSound
#include <bb/multimedia/SystemSound>
To link against this class, add the following line to your .pro file: LIBS += -lbbmultimedia
The SystemSound class provides access to play system-defined sounds.
This class is targeted at GUI applications that wish to play asynchronous sounds as the platform does, for example a camera 'shutter' sound when a picture is taken with the device camera.
A static play() method is provided to asynchronously play a system-defined sound file.
SystemSound::play(SystemSound::CameraShutterEvent);
Use this method when a single 'one-off' sound is needed, such as an alert when presenting an informational dialog. In this case the sound is automatically prepared and played.
Secondly, a SystemSound instance can be created to play a sound several times repeatedly.
SystemSound keypress(SystemSound::InputKeypress); keypress.play(); keypress.play(); // again
Thirdly, a SystemSound instance can be used from QML.
import bb.multimedia 1.0
...
attachedObjects: [
SystemSound {
id: sound
sound: SystemSound.CameraShutterEvent
}
]
...
onClicked: {
sound.play();
}
BlackBerry 10.0.0
Public Types Index
enum TypeNone = 0, BatteryAlarm = 1, BrowserStartEvent = 2, CameraShutterEvent = 3, DeviceLockEvent = 4, DeviceUnlockEvent = 5, DeviceTetherEvent = 6, DeviceUntetherEvent = 7, GeneralNotification = 8, InputKeypress = 9, RecordingStartEvent = 10, RecordingStopEvent = 11, SapphireNotification = 12, SystemMasterVolumeReference = 13, VideoCallEvent = 14, VideoCallOutgoingEvent = 15, CameraBurstEvent = 16 |
Properties Index
Public Functions Index
| SystemSound (SystemSound::Type sound, QObject *parent=0) | |
| SystemSound (QObject *parent=0) | |
| virtual | ~SystemSound () |
| bool | setSound (SystemSound::Type sound) |
| SystemSound::Type | sound () const |
Static Public Functions Index
| void | play (const SystemSound::Type sound) |
Public Slots Index
| void | play () |
Public Types
Represents various platform system sounds.
BlackBerry 10.0.0
- None = 0
Default sound state when no sound has been set.
- BatteryAlarm = 1
Battery alarm sound.
- BrowserStartEvent = 2
Browser startup sound.
- CameraShutterEvent = 3
Camera shutter sound when taking a still photograph.
- DeviceLockEvent = 4
Device has been locked sound.
- DeviceUnlockEvent = 5
Device has been unlocked sound.
- DeviceTetherEvent = 6
Device has been tethered with another device sound.
- DeviceUntetherEvent = 7
Device has been untethered with another device sound.
- GeneralNotification = 8
General notification dialog sound.
- InputKeypress = 9
A Virtual Keyboard key press sound.
- RecordingStartEvent = 10
Start of a recording sound.
- RecordingStopEvent = 11
End of a recording sound.
- SapphireNotification = 12
BlackBerry Bridge notification sound.
- SystemMasterVolumeReference = 13
The sound played when master volume is changed.
- VideoCallEvent = 14
Incoming video call notification sound.
- VideoCallOutgoingEvent = 15
Outgoing video call notification sound.
- CameraBurstEvent = 16
Camera burst sound when taking multiple still photographs.
Properties
bb::multimedia::SystemSound::Type
Sounds represents any of the enumerated Sound types.
Allows the user to change the system sound played when play() is called.
BlackBerry 10.0.0
Public Functions
Constructs a new SystemSound object to play a system-defined sound.
The sound parameter is one of the SystemSound::Type enum values. An example of a system-defined sound is the sound heard when a system notification dialog appears.
| Parameters | |
|---|---|
| sound |
A SystemSound::Type enum value denoting the sound to play. |
| parent |
An optional parameter to specify the parent of this QObject. |
BlackBerry 10.0.0
Constructs a new SystemSound object.
virtual
Destructor.
BlackBerry 10.0.0
bool
Associates a new sound.
| Parameters | |
|---|---|
| sound |
A SystemSound::Type enum value denoting the sound to play. |
true if the new sound was set and loaded, false otherwise
BlackBerry 10.0.0
SystemSound::Type
the sound associated with this object.
BlackBerry 10.0.0
Static Public Functions
void
Plays the default system-defined sound specified by the given SystemSound::Type value.
| Parameters | |
|---|---|
| sound |
A SystemSound::Type enum value denoting the sound to play. |
BlackBerry 10.0.0
Public Slots
void
Plays the default system-defined sound specified by the given SystemSound::Type value.
BlackBerry 10.0.0