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 acc5b30
Show file tree
Hide file tree
Showing 2 changed files with 8 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 @@ -136,4 +136,8 @@ class ReadoutView(state: RHMIState.ToolbarState, val controller: ReadoutControll
}
}
}

override suspend fun onFocus() {
controller.play()
}
}

0 comments on commit acc5b30

Please sign in to comment.