I am making a simple music player for Symbian that uses FolderListModel and a Listview to select a file to be played. The problem is I don't know how to access delegates by index, directly from the Listview.
On clicking a file, the file is played using the Audio element. I also want to show some text in the Listview row that the file is playing e.g. "Playing" When another file is clicked, the "Playing" label of the currently playing file should disappear, and the new file should have its "Playing" label shown.
Is it possible to do this:
Listview.delegate.item[index].property = value
This is the delegate I'm using:
Component {
id: songviewComponent
ListItem {
id: songItem
Text {
id: filename
text: fileName
color: "white"
font.pixelSize: 22
}
Text {
id: songStatus
text: "Playing"
color: "red"
visible: false
}
onClicked: {
// play file that is clicked
// set playing label of current index to visible
// remove other playing label
}
}
Component {
id: songviewComponent
ListItem {
id: songItem
Text {
id: filename
text: fileName
color: "white"
font.pixelSize: 22
}
Text {
id: songStatus
text: "Playing"
color: "red"
visible: false
}
onClicked: {
// play file that is clicked
// set playing label of current index to visible
// remove other playing label
}
}
To copy to clipboard, switch view to plain text mode
Screen shot 2012-06-20 at 5.07.28 PM.jpg
Here is my mockup from the simulator. If I click on Sweetest Perfection.mp3 the "Playing" label should appear for that file only. If click on Waiting for the Night.mp3, the "Playing" label for other files should disappear, and only the label for that file should be visible. Also, when I click the stop button on the toolbar, all "Playing" labels should disappear.
Bookmarks