Mpris and prev/next playlist functions
This commit is contained in:
@@ -15,8 +15,8 @@ MprisPlayer {
|
||||
|
||||
canControl: true
|
||||
|
||||
canGoNext: false //appstate.playlistIndex < appstate.playlist.count
|
||||
canGoPrevious: false // appstate.playlistIndex > 0
|
||||
canGoNext: radioPlayer.playlistIndex < radioPlayer.playlist.count //true //appstate.playlistIndex < appstate.playlist.count
|
||||
canGoPrevious: radioPlayer.playlistIndex > 0 // appstate.playlistIndex > 0
|
||||
canPause: radioPlayer.isPlaying ? true : false
|
||||
canPlay: radioPlayer.isPaused ? true : false
|
||||
|
||||
@@ -32,23 +32,18 @@ MprisPlayer {
|
||||
if (radioPlayer.isPlaying) Mpris.Playing;
|
||||
else if (radioPlayer.isPaused) Mpris.Paused;
|
||||
else Mpris.Stopped;
|
||||
/* switch (radioPlayer.playbackState) {
|
||||
case Audio.PlayingState:
|
||||
return Mpris.Playing
|
||||
case Audio.PausedState:
|
||||
return Mpris.Paused
|
||||
default:
|
||||
return Mpris.Stopped
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
metaData {
|
||||
url: radioPlayer.source
|
||||
contributingArtist: radioPlayer.metaInfo
|
||||
contributingArtist: radioPlayer.metaData.title
|
||||
title: radioPlayer._name
|
||||
}
|
||||
|
||||
onNextRequested: radioPlayer.playNext()
|
||||
|
||||
onPreviousRequested: radioPlayer.playPrev()
|
||||
|
||||
onPauseRequested:{
|
||||
radioPlayer.pauseStream();
|
||||
}
|
||||
@@ -57,7 +52,7 @@ MprisPlayer {
|
||||
radioPlayer.resumeStream();
|
||||
}
|
||||
onPlayPauseRequested: {
|
||||
radioPlayer.pauseStream();
|
||||
radioPlayer.isPaused ? radioPlayer.playStream() : radioPlayer.pauseStream();
|
||||
}
|
||||
onStopRequested: {
|
||||
radioPlayer.pauseStream();
|
||||
|
||||
@@ -144,6 +144,17 @@ MediaPlayer {
|
||||
}
|
||||
|
||||
|
||||
function playNext() {
|
||||
playlistIndex < playlistCount && playlistIndex > -1 ? playlistIndex = playlistIndex + 1 : playlistIndex = 0
|
||||
loadPlaylistSelected()
|
||||
}
|
||||
|
||||
function playPrev() {
|
||||
playlistIndex < playlistCount && playlistIndex > 0 ? playlistIndex = playlistIndex - 1 : playlistIndex = 0
|
||||
loadPlaylistSelected()
|
||||
}
|
||||
|
||||
|
||||
function videoPause() {
|
||||
source = ""
|
||||
stop()
|
||||
|
||||
Reference in New Issue
Block a user