Move all code into musicplayer module
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import gleam/erlang/process.{type Name}
|
import gleam/erlang/process.{type Name}
|
||||||
|
|
||||||
import input/input.{type Listener}
|
import musicplayer/input/input.{type Listener}
|
||||||
import input/key.{type Key}
|
import musicplayer/input/key.{type Key}
|
||||||
import mpv/mpv
|
import musicplayer/mpv/mpv
|
||||||
|
|
||||||
pub fn main() -> Nil {
|
pub fn main() -> Nil {
|
||||||
let exit = process.new_subject()
|
let exit = process.new_subject()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import gleam/erlang/process.{type Name, type Subject}
|
|||||||
import gleam/list
|
import gleam/list
|
||||||
import gleam/option.{type Option, None, Some}
|
import gleam/option.{type Option, None, Some}
|
||||||
|
|
||||||
import input/key.{type Key}
|
import musicplayer/input/key.{type Key}
|
||||||
|
|
||||||
pub type Listener {
|
pub type Listener {
|
||||||
InputListener(final: Subject(Key), tap: Option(Subject(List(String))))
|
InputListener(final: Subject(Key), tap: Option(Subject(List(String))))
|
||||||
@@ -3,7 +3,7 @@ import gleam/erlang/process.{type Subject}
|
|||||||
import gleam/list
|
import gleam/list
|
||||||
import gleam/string
|
import gleam/string
|
||||||
|
|
||||||
import input/internal as internal_input
|
import musicplayer/input/internal as internal_input
|
||||||
|
|
||||||
pub type Key {
|
pub type Key {
|
||||||
Char(String)
|
Char(String)
|
||||||
@@ -2,10 +2,10 @@ import gleam/json
|
|||||||
import gleam/result
|
import gleam/result
|
||||||
import gleam/string
|
import gleam/string
|
||||||
|
|
||||||
import input/key.{type Key}
|
import musicplayer/input/key.{type Key}
|
||||||
import mpv/internal as internal_control
|
import musicplayer/mpv/internal as internal_control
|
||||||
import tcp/reason.{type Reason}
|
import musicplayer/tcp/reason.{type Reason}
|
||||||
import tcp/tcp.{type Socket}
|
import musicplayer/tcp/tcp.{type Socket}
|
||||||
|
|
||||||
pub type Control {
|
pub type Control {
|
||||||
TogglePlayPause
|
TogglePlayPause
|
||||||
@@ -5,11 +5,11 @@ import gleam/otp/actor
|
|||||||
import gleam/result
|
import gleam/result
|
||||||
import gleam/string
|
import gleam/string
|
||||||
|
|
||||||
import input/input.{type Listener, InputListener}
|
import musicplayer/input/input.{type Listener, InputListener}
|
||||||
import input/key.{type Key}
|
import musicplayer/input/key.{type Key}
|
||||||
import mpv/control.{type Control}
|
import musicplayer/mpv/control.{type Control}
|
||||||
import tcp/reason
|
import musicplayer/tcp/reason
|
||||||
import tcp/tcp.{type Socket}
|
import musicplayer/tcp/tcp.{type Socket}
|
||||||
|
|
||||||
type State(socket, exit) {
|
type State(socket, exit) {
|
||||||
State(socket: Socket, exit: Subject(Nil))
|
State(socket: Socket, exit: Subject(Nil))
|
||||||
@@ -2,7 +2,7 @@ import gleam/bit_array
|
|||||||
import gleam/erlang/atom
|
import gleam/erlang/atom
|
||||||
import gleam/result
|
import gleam/result
|
||||||
|
|
||||||
import tcp/reason.{type Reason}
|
import musicplayer/tcp/reason.{type Reason}
|
||||||
|
|
||||||
pub type Socket
|
pub type Socket
|
||||||
|
|
||||||
@@ -4,8 +4,8 @@ import gleam/otp/actor
|
|||||||
import gleam/result
|
import gleam/result
|
||||||
import gleam/string
|
import gleam/string
|
||||||
|
|
||||||
import tcp/reason.{type Reason}
|
import musicplayer/tcp/reason.{type Reason}
|
||||||
import tcp/tcp
|
import musicplayer/tcp/tcp
|
||||||
|
|
||||||
pub type Message {
|
pub type Message {
|
||||||
Shutdown
|
Shutdown
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import gleam/list
|
import gleam/list
|
||||||
import gleeunit
|
import gleeunit
|
||||||
|
|
||||||
import input/key.{type Key, Char, csi, esc, input_introducer as ii}
|
import musicplayer/input/key.{type Key, Char, csi, esc, input_introducer as ii}
|
||||||
|
|
||||||
pub fn main() -> Nil {
|
pub fn main() -> Nil {
|
||||||
gleeunit.main()
|
gleeunit.main()
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import gleam/list
|
import gleam/list
|
||||||
import gleeunit
|
import gleeunit
|
||||||
|
|
||||||
import input/key.{type Key, Char}
|
import musicplayer/input/key.{type Key, Char}
|
||||||
import mpv/control.{type Control}
|
import musicplayer/mpv/control.{type Control}
|
||||||
import mpv/internal as control_internal
|
import musicplayer/mpv/internal as control_internal
|
||||||
|
|
||||||
pub fn main() -> Nil {
|
pub fn main() -> Nil {
|
||||||
gleeunit.main()
|
gleeunit.main()
|
||||||
@@ -3,7 +3,7 @@ import gleeunit
|
|||||||
import simplifile
|
import simplifile
|
||||||
|
|
||||||
import echo_server
|
import echo_server
|
||||||
import tcp/tcp
|
import musicplayer/tcp/tcp
|
||||||
|
|
||||||
pub fn main() -> Nil {
|
pub fn main() -> Nil {
|
||||||
gleeunit.main()
|
gleeunit.main()
|
||||||
Reference in New Issue
Block a user