Skip to content

Commit

Permalink
Start readout as soon as ReadoutView is opened
Browse files Browse the repository at this point in the history
  • Loading branch information
hufman committed Jan 27, 2024
1 parent 991d050 commit d26130f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ class ReadoutController(val name: String, val speechEvent: RHMIEvent.ActionEvent
}

fun play() {
desiredState = ReadoutState.ACTIVE
readLine()
if (desiredState != ReadoutState.ACTIVE) {
desiredState = ReadoutState.ACTIVE
readLine()
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import io.bimmergestalt.idriveconnectkit.rhmi.RHMIActionButtonCallback
import io.bimmergestalt.idriveconnectkit.rhmi.RHMIComponent
import io.bimmergestalt.idriveconnectkit.rhmi.RHMIProperty
import io.bimmergestalt.idriveconnectkit.rhmi.RHMIState
import io.bimmergestalt.idriveconnectkit.rhmi.VisibleCallback
import io.bimmergestalt.reader.Utils
import io.bimmergestalt.reader.carapp.CarAppSharedAssetResources
import io.bimmergestalt.reader.carapp.Model
Expand Down Expand Up @@ -135,5 +136,11 @@ class ReadoutView(state: RHMIState.ToolbarState, val controller: ReadoutControll
curLineLabel.getModel()?.asRaDataModel()?.value = it
}
}

state.visibleCallback = VisibleCallback { visible ->
if (visible) {
controller.play()
}
}
}
}

0 comments on commit d26130f

Please sign in to comment.