Description
The MusicPicker provides a modal dialog in which the user can choose an album, playlist or single song. The 'OK' button is disabled until a selection was made. On 'OK'-clicked the signal albumOrPlaylistSelected is emitted which provides the selected item's data. Multiselection of items is possible by setting set multiSelection: true (though disabled due to missing design for multiple song selection).
API Properties
- bool showAlbums
- Property which enables the albums in the picker.
- bool showPlaylists
- Property which enables the playlist in the picker.
- bool multiSelection
- Property which sets the multi-selection of the media grid.
- bool selectSongs
- Property which sets the selection of songs in the media list
Signals
- albumOrPlaylistSelected
- Signal which returns the selected albums and/or playlist if the dialog was accepted.
- Parameter:
- string title, title of the selected item.
- string uri, path to the album or playlist.
- string thumbUri, path to the thumbnail of the album or playlist.
- int type, type of the item.
- multipleAlbumsOrPlaylistsSelected
- Signal which returns the selected albums and/or playlists if the dialog was accepted.
- Parameter:
- string titles, title of the selected items.
- string uris, path to the albums or playlists.
- string thumbUris, path to the thumbnails of the albums or playlists.
- int types, type of the items.
- songSelected
- Signal which returns the selected song if the dialog was accepted.
- Parameter:
- string title, title of the selected item.
- string uri, path to the song.
- string thumbUri, path to the thumbnail of the song.
- string album, title of the selected album.
- int type, type of the item.
- multipleSongsSelected
- Signal which returns the selected songs if the dialog was accepted.
- Parameter:
- string titles, titles of the selected items.
- string uris, paths to the songs.
- string thumbUris, paths to the thumbnails of the songs.
- string album, title of the selected album.
- int types, types of the items.
- accepted
- Emitted on 'OK' clicked.
- rejected
- Emitted on 'Cancel' clicked.
- showCalled
- Notifies the children that the ModalFog is about to show up.
Functions
- show
- Fades the picker in, inherited from ModalFog.
- hide
- Fades the picker out, inherited from ModalFog.
Example
AppPage{
MusicPicker {
id: myMusicPicker
showAlbums: true
showPlayList: false
onAlbumOrPlaylistSelected: {
// handle the given data
}
onRejected: {
// handle the rejection
}
}
Component.onCompleted: {
myMusicPicker.show();
}
}