Commit 22afc8cb authored by Carlos Jose Mazieri's avatar Carlos Jose Mazieri Committed by Kempe
Browse files

[FEATURE] Set a delay before starting playback

navigation using buttons 'next' and 'prev' adds a delay before playback is started.
To be able to switch stations to de desired one before before stoping the current station
parent 7e39f930
......@@ -28,6 +28,17 @@ DockedPanel {
// This timer is used when pushing 'next' or 'prev' buttons,
// it does not try to play immediately, instead wait some time to allow the user
// keep pushing, it is good for Bluetooth navigation inside cars
Timer {
id: navigation_timer
interval: 1400
running: false
repeat: false
onTriggered: playCurrentStation();
Component.onCompleted: {
......@@ -42,18 +53,28 @@ DockedPanel {
open = true
app.stationData = JSON.parse(JSON.stringify(station));
if (navigation_timer.running == false) {
function playNext() {
var nextStation = FavoritesUtils.getNextFavorite(app.stationData);
console.debug("Playing next favorite", JSON.stringify(nextStation));
console.debug("Playing next favorite", JSON.stringify(nextStation));
navigation_timer.restart(); // allows keep pushing
function playPrev() {
var prevStation = FavoritesUtils.getPrevFavorite(app.stationData);
console.debug("Playing prev favorite", JSON.stringify(prevStation));
navigation_timer.restart(); // allows keep pushing
function playCurrentStation() {
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