Documentation ¶
Index ¶
- Constants
- func NormalizeVolume(volume int) int
- func ParsePresetsCount(presetsCount int) (int, error)
- func ValidAudioSource(s *State, audioSource string) error
- func ValidPresetNumber(s *State, preset int) error
- type Changed
- type Partial
- type Preset
- type State
- func (s *State) SetAudioSource(audioSource string) (Changed, error)
- func (s *State) SetIsMuted(isMuted bool) Changed
- func (s *State) SetMetadata(metadata string) Changed
- func (s *State) SetPower(power bool) Changed
- func (s *State) SetPresets(presets []Preset) Changed
- func (s *State) SetStatus(status Status) Changed
- func (s *State) SetTitle(title string) Changed
- func (s *State) SetTitleNew(titleNew string) Changed
- func (s *State) SetURL(url string) Changed
- func (s *State) SetURLNew(urlNew string) Changed
- func (s *State) SetVolume(volume int) Changed
- type Status
Constants ¶
View Source
const AudioSourceInternetRadio = "Internet radio"
Variables ¶
This section is empty.
Functions ¶
func NormalizeVolume ¶
func ParsePresetsCount ¶
func ValidAudioSource ¶
func ValidPresetNumber ¶
Types ¶
type Partial ¶
type Partial struct { AudioSource *string `json:"audio_source,omitempty"` IsMuted *bool `json:"is_muted,omitempty"` Metadata *string `json:"metadata,omitempty"` Power *bool `json:"power,omitempty"` PresetNumber *int `json:"preset_number,omitempty"` Presets []Preset `json:"presets,omitempty"` Status *Status `json:"status,omitempty"` Title *string `json:"title,omitempty"` TitleNew *string `json:"title_new,omitempty"` URL *string `json:"url,omitempty"` URLNew *string `json:"url_new,omitempty"` UUID string `json:"uuid"` Volume *int `json:"volume,omitempty"` }
func GetPartial ¶
func NewPartial ¶
type Preset ¶
type Preset struct { Number int `json:"number" validate:"required"` // Number is the preset number. Title string `json:"title" validate:"required"` // Title of the preset. TitleNew string `json:"title_new" validate:"required"` // TitleNew is the overridden title. URL string `json:"url" validate:"required"` // URL of the preset. URLNew string `json:"url_new" validate:"required"` // URLNew is the overridden URL. } // @name state.Preset
type State ¶
type State struct { AudioSource string `json:"audio_source" validate:"required"` // AudioSource is the audio source. AudioSources []string `json:"audio_sources" validate:"required"` // AudioSources is the list of available audio sources. IsMuted bool `json:"is_muted" validate:"required"` // IsMuted represents if the radio is muted. Metadata string `json:"metadata" validate:"required"` // Metadata of the current playing stream. ModelName string `json:"model_name" validate:"required"` // ModelName is the model name of the device. ModelNumber string `json:"model_number" validate:"required"` // ModelNumber is the model number of the device. Name string `json:"name" validate:"required"` // Name of the radio. Power bool `json:"power" validate:"required"` // Power represents if the radio is not in standby. PresetNumber int `json:"preset_number" validate:"required"` // PresetNumber is the current preset that is playing. Presets []Preset `json:"presets" validate:"required"` // Presets of the radio. Status Status `json:"status" validate:"required"` // Status is either playing, connecting, or stopped. Title string `json:"title" validate:"required"` // Title of the current playing stream. TitleNew string `json:"title_new" validate:"required"` // TitleNew is the overridden title. URL string `json:"url" validate:"required"` // URL of the stream that is currently selected. URLNew string `json:"url_new" validate:"required"` // URLNew is the overridden URL. UUID string `json:"uuid" validate:"required"` // UUID of the radio. Volume int `json:"volume" validate:"required"` // Volume of the radio. } // @name state.State
func (*State) SetIsMuted ¶
func (*State) SetMetadata ¶
func (*State) SetPresets ¶
func (*State) SetTitleNew ¶
Click to show internal directories.
Click to hide internal directories.