main.qml Example File
systemsound/assets/main.qml
import bb.cascades 1.0
import bb.multimedia 1.0
Page {
Container {
layout: DockLayout {}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///images/background.png"
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Top
topPadding: 300
leftPadding: 30
rightPadding: 30
DropDown {
id: soundChooser
horizontalAlignment: HorizontalAlignment.Center
title: qsTr ("Sound")
Option {
text: qsTr ("Battery Alarm")
value: SystemSound.BatteryAlarm
selected: true
}
Option {
text: qsTr ("Browser Start Event")
value: SystemSound.BrowserStartEvent
}
Option {
text: qsTr ("Camera Shutter Event")
value: SystemSound.CameraShutterEvent
}
Option {
text: qsTr ("Device Lock Event")
value: SystemSound.DeviceLockEvent
}
Option {
text: qsTr ("Device Unlock Event")
value: SystemSound.DeviceUnlockEvent
}
Option {
text: qsTr ("Device Tether Event")
value: SystemSound.DeviceTetherEvent
}
Option {
text: qsTr ("Device Untether Event")
value: SystemSound.DeviceUntetherEvent
}
Option {
text: qsTr ("General Notification")
value: SystemSound.GeneralNotification
}
Option {
text: qsTr ("Input Keypress")
value: SystemSound.InputKeypress
}
Option {
text: qsTr ("Recording Start Event")
value: SystemSound.RecordingStartEvent
}
Option {
text: qsTr ("Recording Stop Event")
value: SystemSound.RecordingStopEvent
}
Option {
text: qsTr ("Sapphire Notification")
value: SystemSound.SapphireNotification
}
Option {
text: qsTr ("System Master Volume Reference")
value: SystemSound.SystemMasterVolumeReference
}
Option {
text: qsTr ("Video Call Event")
value: SystemSound.VideoCallEvent
}
Option {
text: qsTr ("Video Call Outgoing Event")
value: SystemSound.VideoCallOutgoingEvent
}
Option {
text: qsTr ("Camera Burst Event")
value: SystemSound.CameraBurstEvent
}
}
Button {
horizontalAlignment: HorizontalAlignment.Center
topMargin: 100
text: qsTr ("Play System Sound")
onClicked: systemSound.play()
}
}
}
attachedObjects: [
SystemSound {
id: systemSound
sound: soundChooser.selectedValue
}
]
}