summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/MediaPlayer.qml22
-rw-r--r--app/main.cpp2
2 files changed, 3 insertions, 21 deletions
diff --git a/app/MediaPlayer.qml b/app/MediaPlayer.qml
index 7dfaf06..99ed3ea 100644
--- a/app/MediaPlayer.qml
+++ b/app/MediaPlayer.qml
@@ -133,20 +133,6 @@ ApplicationWindow {
Connections {
target: mediaplayer
- onPlaylistChanged: {
- playlist_model.clear();
-
- for (var i = 0; i < playlist.list.length; i++) {
- var item = playlist.list[i]
-
- playlist_model.append({ "index": item.index, "artist": item.artist ? item.artist : '', "title": item.title ? item.title : '' })
-
- if (item.selected) {
- playlistview.currentIndex = i
- }
- }
- }
-
onMetadataChanged: {
player.title = metadata.title
player.album = metadata.album
@@ -182,10 +168,6 @@ ApplicationWindow {
}
}
- ListModel {
- id: playlist_model
- }
-
ColumnLayout {
anchors.fill: parent
Item {
@@ -392,7 +374,7 @@ ApplicationWindow {
text: 'PLAYLIST'
opacity: 0.5
}
- model: playlist_model
+ model: MediaplayerModel
currentIndex: -1
delegate: MouseArea {
@@ -423,7 +405,7 @@ ApplicationWindow {
//}
}
onClicked: {
- mediaplayer.picktrack(playlistview.model.get(index).index)
+ mediaplayer.picktrack(playlistview.model[index].index)
}
}
diff --git a/app/main.cpp b/app/main.cpp
index 4713fdb..67bbab4 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
}
});
- context->setContextProperty("mediaplayer", new Mediaplayer(bindingAddress));
+ context->setContextProperty("mediaplayer", new Mediaplayer(bindingAddress, context));
context->setContextProperty("bluetooth_connection", new Bluetooth(bindingAddress));
usleep(300000);