hathoris/inputs/interfaces.go

36 lines
706 B
Go
Raw Permalink Normal View History

2023-11-13 17:50:42 +00:00
package inputs
import ()
var SoundInputs = map[string]SoundInput{}
2023-11-15 10:31:48 +00:00
type InputMixer struct {
Volume uint `json:"volume"`
VolumePercent string `json:"volume_percent"`
VolumeDB string `json:"volume_db"`
Mute bool `json:"mute"`
Balance float64 `json:"balance"`
}
2023-11-13 17:50:42 +00:00
type SoundInput interface {
GetName() string
IsActive() bool
2023-11-13 19:00:28 +00:00
CurrentlyPlaying() map[string]string
2023-11-13 17:50:42 +00:00
}
type ControlableInput interface {
2023-11-13 19:00:28 +00:00
TogglePause(string) error
2023-11-13 17:50:42 +00:00
}
2023-11-15 10:31:48 +00:00
2024-01-07 14:01:03 +00:00
type PlaylistInput interface {
HasPlaylist() bool
NextTrack() error
NextRandomTrack() error
2024-01-07 14:01:03 +00:00
PreviousTrack() error
}
2023-11-15 10:31:48 +00:00
type MixableInput interface {
GetMixers() (map[string]*InputMixer, error)
SetMixer(string, *InputMixer) error
}