Commit 77450b4f authored by Camilo Higuita's avatar Camilo Higuita

fix playback issues

parent 86ee28f0
......@@ -42,7 +42,7 @@ Kirigami.ApplicationWindow
property alias mainPlaylist : mainPlaylist
/*PLAYBACK*/
property bool shuffle : false
property bool isShuffle : false
property var currentTrack : ({babe: "0", stars: "0"})
property int currentTrackIndex : 0
property int prevTrackIndex : 0
......@@ -113,7 +113,7 @@ Kirigami.ApplicationWindow
/*PROPS*/
property int toolBarIconSize: bae.loadSetting("ICON_SIZE", "BABE", iconSizes.medium)
property int toolBarHeight : isMobile ? 48 : toolBarIconSize *2
property int miniArtSize : isMobile ? 40 : 34
property int miniArtSize : isMobile ? 36 : 30
property int columnWidth: Kirigami.Units.gridUnit * 15
property int coverSize: isMobile ? Math.sqrt(root.width*root.height)*0.4 : columnWidth * 0.8
......@@ -512,8 +512,8 @@ Kirigami.ApplicationWindow
id: shuffleBtn
iconColor: darkForegroundColor
iconName: shuffle ? "media-playlist-shuffle" : "media-playlist-repeat"
onClicked: shuffle = !shuffle
iconName: isShuffle ? "media-playlist-shuffle" : "media-playlist-repeat"
onClicked: isShuffle = !isShuffle
}
}
......@@ -828,7 +828,9 @@ Kirigami.ApplicationWindow
onFinished: if(!mainlistEmpty)
{
bae.playedTrack(currentTrack.url)
if(currentTrack.url)
bae.playedTrack(currentTrack.url)
Player.nextTrack()
}
......
......@@ -57,7 +57,9 @@ void Player::stop()
this->player->setMedia(QMediaContent());
}
// this->updater->stop();
emit this->isPlaying(false);
this->updater->stop();
}
void Player::seek(const int &pos)
......@@ -92,7 +94,7 @@ void Player::update()
}
emit this->isPlaying(this->player->state() == QMediaPlayer::PlayingState ? true : false);
if(this->player->state() == QMediaPlayer::StoppedState)
if(this->player->state() == QMediaPlayer::StoppedState && this->updater->isActive())
emit this->finished();
}
......@@ -82,7 +82,7 @@ function nextTrack()
if(!mainlistEmpty)
{
var next = 0
if(shuffle && onQueue === 0)
if(isShuffle && onQueue === 0)
next = shuffle()
else
next = currentTrackIndex+1 >= mainPlaylist.list.count? 0 : currentTrackIndex+1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment