ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #05990
[Merge] lp:~phablet-team/music-app/final-declarative-playlist-api into lp:~music-app-dev/music-app/media-hub-bg-playlists-rework
Andrew Hayzen has proposed merging lp:~phablet-team/music-app/final-declarative-playlist-api into lp:~music-app-dev/music-app/media-hub-bg-playlists-rework.
Commit message:
* Convert to new QDeclarativePlaylist QML API.
Requested reviews:
Music App Developers (music-app-dev)
For more details, see:
https://code.launchpad.net/~phablet-team/music-app/final-declarative-playlist-api/+merge/277357
* Convert to new QDeclarativePlaylist QML API.
--
Your team Music App Developers is requested to review the proposed merge of lp:~phablet-team/music-app/final-declarative-playlist-api into lp:~music-app-dev/music-app/media-hub-bg-playlists-rework.
=== modified file 'app/components/HeadState/MultiSelectHeadState.qml'
--- app/components/HeadState/MultiSelectHeadState.qml 2015-11-02 15:58:44 +0000
+++ app/components/HeadState/MultiSelectHeadState.qml 2015-11-12 14:58:42 +0000
@@ -71,7 +71,7 @@
sources.push(Qt.resolvedUrl(listview.model.get(indicies[i], listview.model.RoleModelData).filename));
}
- newPlayer.mediaPlayer.playlist.addSources(sources);
+ newPlayer.mediaPlayer.playlist.addItems(sources);
listview.closeSelection()
}
=== modified file 'app/components/Helpers/ContentHubHelper.qml'
--- app/components/Helpers/ContentHubHelper.qml 2015-11-02 15:58:44 +0000
+++ app/components/Helpers/ContentHubHelper.qml 2015-11-12 14:58:42 +0000
@@ -225,7 +225,7 @@
for (i=0; i < searchPaths.length; i++) {
model = musicStore.lookup(decodeFileURI(searchPaths[i]))
- newPlayer.mediaPlayer.playlist.addSource(Qt.resolvedUrl(decodeURIComponent(searchPaths[i])));
+ newPlayer.mediaPlayer.playlist.addItem(Qt.resolvedUrl(decodeURIComponent(searchPaths[i])));
}
trackQueueClick(0);
=== modified file 'app/components/Helpers/UriHandlerHelper.qml'
--- app/components/Helpers/UriHandlerHelper.qml 2015-11-02 15:58:44 +0000
+++ app/components/Helpers/UriHandlerHelper.qml 2015-11-12 14:58:42 +0000
@@ -64,7 +64,7 @@
}
// enqueue
- newPlayer.mediaPlayer.playlist.addSource(Qt.resolvedUrl(track.filename));
+ newPlayer.mediaPlayer.playlist.addItem(Qt.resolvedUrl(track.filename));
// play first URI
if (play) {
=== modified file 'app/components/ListItemActions/AddToQueue.qml'
--- app/components/ListItemActions/AddToQueue.qml 2015-11-02 15:58:44 +0000
+++ app/components/ListItemActions/AddToQueue.qml 2015-11-12 14:58:42 +0000
@@ -29,6 +29,6 @@
onTriggered: {
console.debug("Debug: Add track to queue: " + model)
- newPlayer.mediaPlayer.playlist.addSource(Qt.resolvedUrl(model.filename))
+ newPlayer.mediaPlayer.playlist.addItem(Qt.resolvedUrl(model.filename))
}
}
=== modified file 'app/components/MusicToolbar.qml'
--- app/components/MusicToolbar.qml 2015-11-02 15:58:44 +0000
+++ app/components/MusicToolbar.qml 2015-11-12 14:58:42 +0000
@@ -170,7 +170,7 @@
fontSize: "small"
font.weight: Font.DemiBold
text: newPlayer.currentMeta.title === ""
- ? newPlayer.mediaPlayer.playlist.currentSource
+ ? newPlayer.mediaPlayer.playlist.currentItemSource
: newPlayer.currentMeta.title
}
=== modified file 'app/components/NewPlayer.qml'
--- app/components/NewPlayer.qml 2015-11-02 17:10:45 +0000
+++ app/components/NewPlayer.qml 2015-11-12 14:58:42 +0000
@@ -26,7 +26,7 @@
Item {
objectName: "player"
- property alias count: mediaPlayerPlaylist.mediaCount
+ property alias count: mediaPlayerPlaylist.itemCount
property var currentMeta: ({})
property alias mediaPlayer: mediaPlayer
property alias repeat: settings.repeat
@@ -73,21 +73,21 @@
}
}
- readonly property int count: mediaCount // header actions etc depend on the model having 'count'
+ readonly property int count: itemCount // header actions etc depend on the model having 'count'
property int pendingCurrentIndex: -1
property var pendingCurrentState: null
property int pendingShuffle: -1
- onCurrentSourceChanged: currentMeta = metaForSource(currentSource)
- onMediaChanged: {
+ onCurrentItemSourceChanged: currentMeta = metaForSource(currentItemSource)
+ onItemChanged: {
saveQueue()
- // FIXME: shouldn't be needed? seems to be a bug where when appending currentSourceChanged is not emitted
+ // FIXME: shouldn't be needed? seems to be a bug where when appending currentItemChanged is not emitted
//if (start === currentIndex) {
// currentMeta = metaForSource(currentSource)
//}
}
- onMediaInserted: {
+ onItemInserted: {
// When add to queue is done on an empty list currentIndex needs to be set
if (start === 0 && currentIndex === -1 && pendingCurrentIndex < 1 && pendingShuffle === -1) {
currentIndex = 0;
@@ -97,7 +97,7 @@
}
// Check if the pendingCurrentIndex is now valid
- if (pendingCurrentIndex !== -1 && pendingCurrentIndex < mediaCount) {
+ if (pendingCurrentIndex !== -1 && pendingCurrentIndex < itemCount) {
currentIndex = pendingCurrentIndex;
pendingCurrentIndex = -1;
@@ -115,30 +115,30 @@
saveQueue()
- // FIXME: shouldn't be needed? seems to be a bug where when appending currentSourceChanged is not emitted
+ // FIXME: shouldn't be needed? seems to be a bug where when appending currentItemChanged is not emitted
if (start === currentIndex) {
- currentMeta = metaForSource(currentSource)
+ currentMeta = metaForSource(currentItemSource)
}
}
- onMediaRemoved: {
+ onItemRemoved: {
saveQueue()
- // FIXME: shouldn't be needed? seems to be a bug where when appending currentSourceChanged is not emitted
+ // FIXME: shouldn't be needed? seems to be a bug where when appending currentItemChanged is not emitted
if (start === currentIndex) {
- currentMeta = metaForSource(currentSource)
+ currentMeta = metaForSource(currentItemSource)
}
}
// TODO: AP needs queue length
- function addSourcesFromModel(model) {
+ function addPlaylistItems(model) {
var sources = []
for (var i=0; i < model.rowCount; i++) {
sources.push(Qt.resolvedUrl(model.get(i, model.RoleModelData).filename));
}
- addSources(sources);
+ addItems(sources);
}
function processPendingCurrentState() {
@@ -158,11 +158,11 @@
pendingCurrentState = null;
}
- function removeSources(items) {
+ function removeItems(items) {
items.sort();
for (var i=0; i < items.length; i++) {
- removeSource(items[i] - i);
+ removeItem(items[i] - i);
}
}
=== modified file 'app/components/Queue.qml'
--- app/components/Queue.qml 2015-11-03 19:36:24 +0000
+++ app/components/Queue.qml 2015-11-12 14:58:42 +0000
@@ -65,14 +65,14 @@
leadingActions: ListItemActions {
actions: [
Remove {
- onTriggered: newPlayer.mediaPlayer.playlist.removeSource(index)
+ onTriggered: newPlayer.mediaPlayer.playlist.removeItem(index)
}
]
}
multiselectable: true
objectName: "nowPlayingListItem" + index
state: ""
- reorderable: true // FIXME: needs testing, sort out reordering we need moveSource(from, to);
+ reorderable: true // FIXME: needs testing, sort out reordering we need moveItem(from, to);
trailingActions: ListItemActions {
actions: [
AddToPlaylist {
@@ -93,6 +93,6 @@
onReorder: {
console.debug("Move: ", from, to);
- newPlayer.mediaPlayer.playlist.moveSource(from, to);
+ newPlayer.mediaPlayer.playlist.moveItem(from, to);
}
}
=== modified file 'app/music-app.qml'
--- app/music-app.qml 2015-11-02 15:58:44 +0000
+++ app/music-app.qml 2015-11-12 14:58:42 +0000
@@ -240,7 +240,7 @@
// FIXME: using old queueList for now, move to load()/save() long term
if (!Library.isQueueEmpty()) {
- newPlayer.mediaPlayer.playlist.addSources(Library.getQueue());
+ newPlayer.mediaPlayer.playlist.addPlaylistItems(Library.getQueue());
newPlayer.mediaPlayer.playlist.setCurrentIndex(queueIndex);
newPlayer.mediaPlayer.playlist.setPendingCurrentState(MediaPlayer.PausedState); // TODO: confirm this works if index changes after
@@ -350,7 +350,7 @@
if (!clear) { // FIXME: is this even used anymore? trackQueueClick instead?
// If same track and on Now playing page then toggle
if ((mainPageStack.currentPage.title === i18n.tr("Now playing") || mainPageStack.currentPage.title === i18n.tr("Queue"))
- && Qt.resolvedUrl(newPlayer.mediaPlayer.playlist.currentSource) === file) {
+ && Qt.resolvedUrl(newPlayer.mediaPlayer.playlist.currentItemSource) === file) {
newPlayer.mediaPlayer.toggle()
return;
}
@@ -440,7 +440,7 @@
// If there are removed tracks then remove them from the queue and store
if (removed.length > 0) {
console.debug("Removed queue:", JSON.stringify(removed))
- newPlayer.mediaPlayer.playlist.removeSources(removed.slice());
+ newPlayer.mediaPlayer.playlist.removeItems(removed.slice());
}
// Loop through playlists, getPlaylistTracks will remove any tracks that don't exist
=== modified file 'app/ui/NowPlaying.qml'
--- app/ui/NowPlaying.qml 2015-11-02 17:10:45 +0000
+++ app/ui/NowPlaying.qml 2015-11-12 14:58:42 +0000
@@ -131,7 +131,7 @@
// Use slice() to copy the list
// so that the indexes don't change as they are removed
// TODO: test!
- newPlayer.mediaPlayer.playlist.removeSources(selectedIndices.slice());
+ newPlayer.mediaPlayer.playlist.removeItems(selectedIndices.slice());
}
}
]
=== modified file 'app/ui/Songs.qml'
--- app/ui/Songs.qml 2015-11-02 15:58:44 +0000
+++ app/ui/Songs.qml 2015-11-12 14:58:42 +0000
@@ -118,7 +118,7 @@
onItemClicked: {
if (songsPage.state === "search") { // only play single track when searching
newPlayer.mediaPlayer.playlist.clear();
- newPlayer.mediaPlayer.playlist.addSource(Qt.resolvedUrl(songsModelFilter.get(index).filename));
+ newPlayer.mediaPlayer.playlist.addItem(Qt.resolvedUrl(songsModelFilter.get(index).filename));
trackQueueClick(0)
} else {
trackClicked(songsModelFilter, index) // play track
Follow ups