PlayerPage.qml Example File
dictaphone/assets/PlayerPage.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/sheet_background.png"
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
leftPadding: 30
topPadding: 30
rightPadding: 30
bottomPadding: 30
Label {
horizontalAlignment: HorizontalAlignment.Center
text: qsTr ("Recorded Tracks")
textStyle {
base: SystemDefaults.TextStyles.BigText
color: Color.White
}
}
ListView {
id: listView
horizontalAlignment: HorizontalAlignment.Center
topMargin: 50
dataModel: _trackManager.model
listItemComponents: ListItemComponent {
type: "item"
StandardListItem {
title: ListItemData.name
}
}
onTriggered: {
clearSelection()
select(indexPath)
}
}
Button {
horizontalAlignment: HorizontalAlignment.Center
topMargin: 50
text: qsTr ("Play")
onClicked: {
player.sourceUrl = ""
player.sourceUrl = "file://" + listView.dataModel.data(listView.selected()).url
player.play()
}
}
}
}
actions: [
ActionItem {
title: qsTr ("Clear All Tracks")
ActionBar.placement: ActionBarPlacement.OnBar
imageSource: "asset:///images/delete.png"
onTriggered: {
_trackManager.clearAllTracks()
navigationPane.pop()
}
}
]
attachedObjects: [
MediaPlayer {
id: player
}
]
}