Instead of "injecting" characters into the input stream, the input stream is now forwarded to the `musicplayer`. It has will have to decide what to do with the stream, e.g. by setting the "mode" to something that captures the input stream and acts upon it
21 lines
519 B
Gleam
21 lines
519 B
Gleam
import gleam/erlang/process.{type Name}
|
|
|
|
import musicplayer/input/input
|
|
import musicplayer/input/key.{type Key}
|
|
import musicplayer/mpv/mpv
|
|
import musicplayer/musicplayer
|
|
import musicplayer/ui/ui
|
|
|
|
pub fn main() -> Nil {
|
|
let input_keys_name: Name(Key) = process.new_name("input_keys")
|
|
|
|
input.new(input_keys_name)
|
|
|
|
let assert Ok(ui) = ui.new()
|
|
let assert Ok(mpv) = mpv.new()
|
|
|
|
let exit = process.new_subject()
|
|
let assert Ok(_) = musicplayer.new(ui, mpv, input_keys_name, exit)
|
|
process.receive_forever(exit)
|
|
}
|