summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Radio.qml16
-rw-r--r--app/api/Binding.qml13
2 files changed, 22 insertions, 7 deletions
diff --git a/app/Radio.qml b/app/Radio.qml
index f812af1..7b7797a 100644
--- a/app/Radio.qml
+++ b/app/Radio.qml
@@ -30,7 +30,10 @@ ApplicationWindow {
property string title
onBandChanged: frequency = minimumFrequency
- onStationFound: title = stationId
+ onStationFound: {
+ title = stationId
+ scanLabel.color = '#FFFFFF'
+ }
onFrequencyChanged: {
title = ''
slider.value = frequency
@@ -172,6 +175,7 @@ ApplicationWindow {
Item { Layout.fillWidth: true }
Label {
+ id: scanLabel
//Layout.fillWidth: true
text: 'SCAN'
}
@@ -183,7 +187,10 @@ ApplicationWindow {
triggeredOnStart: true
interval: 100
repeat: true
- onTriggered: radio.scanDown()
+ onTriggered: {
+ radio.scanDown()
+ scanLabel.color = '#59FF7F'
+ }
}
}
@@ -194,7 +201,10 @@ ApplicationWindow {
triggeredOnStart: true
interval: 100
repeat: true
- onTriggered: radio.scanUp()
+ onTriggered: {
+ radio.scanUp()
+ scanLabel.color = '#59FF7F'
+ }
}
}
diff --git a/app/api/Binding.qml b/app/api/Binding.qml
index 3b43510..7750452 100644
--- a/app/api/Binding.qml
+++ b/app/api/Binding.qml
@@ -106,6 +106,7 @@ WebSocket {
} else if (event.event === "radio/station_found") {
if(scanningState == activeState) {
scanningState = stoppedState
+ frequency = event.data.value
stationId = freq2str(event.data.value)
root.stationFound()
}
@@ -177,13 +178,17 @@ WebSocket {
}
function scanUp() {
- scanningState = activeState
- sendSocketMessage("scan_start", { direction: "forward" })
+ if(scanningState != activeState) {
+ scanningState = activeState
+ sendSocketMessage("scan_start", { direction: "forward" })
+ }
}
function scanDown() {
- scanningState = activeState
- sendSocketMessage("scan_start", { direction: "backward" })
+ if(scanningState != activeState) {
+ scanningState = activeState
+ sendSocketMessage("scan_start", { direction: "backward" })
+ }
}
function updateFrequencyRange(band) {