Working on some kind of playlist management
This commit is contained in:
@@ -45,7 +45,7 @@ MediaPlayer {
|
||||
property int stationOk: 3
|
||||
property int maxTagClicks: 0
|
||||
property int playlistCount: playlist.count - 1
|
||||
property int playlistIndex: allradioSettings.value("currentFavorite",-1)
|
||||
property int playlistIndex: Favorites.getSetting("playlistIndex",-1)
|
||||
property QDtimer timer: QDtimer {
|
||||
id: qdTimer
|
||||
interval: 200; running: false; repeat: false
|
||||
@@ -63,6 +63,7 @@ MediaPlayer {
|
||||
autoPlay: false
|
||||
autoLoad: true
|
||||
|
||||
onPlaylistIndexChanged: console.log("INDEX: "+playlistIndex)
|
||||
|
||||
//on_FavoriteChanged: {setStationFavorite(_stationuuid,_name,_countrycode,_homepage,_url_resolved,_favicon,_tags,_codec,_bitrate,_hls,_favorite);Favorites.getMostPlayedFavorites(mostPlayedFavorites,15)}
|
||||
onPlaying: if (!playerPageOpen) pageStack.push("../pages/RadioPlayerPage.qml")
|
||||
@@ -93,7 +94,7 @@ MediaPlayer {
|
||||
playStream()
|
||||
stationOk === 0
|
||||
reloadDbData()
|
||||
if (_favorite) allradioSettings.setValue("currentFavorite",playlistIndex)
|
||||
//if (_favorite) allradioSettings.setValue("currentFavorite",playlistIndex)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,6 +125,8 @@ MediaPlayer {
|
||||
onHasVideoChanged: if (hasVideo) radioVideo = true
|
||||
onHasAudioChanged: if (hasAudio) radioAudio = true
|
||||
|
||||
|
||||
|
||||
function stopStream() { // stop and clear stream
|
||||
source = ""
|
||||
isPaused = false
|
||||
@@ -147,6 +150,9 @@ MediaPlayer {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function playNext() {
|
||||
if (playlistIndex < playlistCount && playlistIndex < playlist.count) playlistIndex = playlistIndex + 1
|
||||
loadPlaylistSelected()
|
||||
@@ -161,7 +167,6 @@ MediaPlayer {
|
||||
function videoPause() {
|
||||
source = ""
|
||||
stop()
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -185,15 +190,12 @@ MediaPlayer {
|
||||
|
||||
|
||||
function playStream() { // resume paused stream
|
||||
//radioSource = ""
|
||||
|
||||
|
||||
source = _url_resolved
|
||||
play()
|
||||
isPlaying = true
|
||||
isPaused = false
|
||||
qdTimer.start()
|
||||
// play()
|
||||
Favorites.setSetting("playlistIndex",playlistIndex)
|
||||
}
|
||||
|
||||
onError: {
|
||||
@@ -339,6 +341,7 @@ MediaPlayer {
|
||||
function reloadDbData() {
|
||||
Favorites.getStationRecentClicked(playHistory,15)
|
||||
Favorites.getFavorites(playlist,"myclickcount",10000)
|
||||
|
||||
//Favorites.getStationMostClickedFav(radioPlayermostPlayed,settings._nrOfFavoritePreview)
|
||||
//Favorites.getCountryRecentClicked(playedCountries,2)
|
||||
//Favorites.getTagsRecentClicked(playedTags,10)
|
||||
@@ -359,6 +362,7 @@ MediaPlayer {
|
||||
_favorite = playlist.get(playlistIndex).favorite
|
||||
isPlaying = true
|
||||
isPaused = false
|
||||
|
||||
playStream()
|
||||
// pageStack.push("RadioPlayerPage.qml")
|
||||
}
|
||||
@@ -378,6 +382,7 @@ MediaPlayer {
|
||||
_favorite = playHistory.get(0).favorite
|
||||
isPlaying = false
|
||||
isPaused = true
|
||||
//playlistIndex = allradioSettings.value("currentFavorite",-1)
|
||||
// pageStack.push("RadioPlayerPage.qml")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user