Documentation ¶
Index ¶
- type AudioPanel
- func (ap *AudioPanel) AttachLogger(logger *log.Logger) *AudioPanel
- func (ap *AudioPanel) AudioRequest(url string) (io.ReadCloser, error)
- func (ap *AudioPanel) Duration(e clients.Enclosure) time.Duration
- func (ap *AudioPanel) GetPlayerState() PlayerState
- func (ap *AudioPanel) NoBufferPlayFromUrl(url string)
- func (ap *AudioPanel) PlayFromUrl(url string, logger *log.Logger, cachePath string)
- func (ap *AudioPanel) PlayPause()
- func (ap *AudioPanel) SetPublishCallback(callback func(func()))
- func (ap *AudioPanel) SetStreamer(format beep.Format, streamer beep.StreamSeekCloser)
- func (ap *AudioPanel) SpawnPublisher()
- func (ap *AudioPanel) SubscribeToState(subscriber PlayerStateSubscriber)
- type PlayerState
- type PlayerStateSubscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AudioPanel ¶
AudioPanel contains properties for manipulating an audio stream & drawing info to the terminal. eg. volume / seeking & position
func FetchAudioPanel ¶
func FetchAudioPanel() *AudioPanel
FetchAudioPanel will return the already initialised panel pointer.
func (*AudioPanel) AttachLogger ¶
func (ap *AudioPanel) AttachLogger(logger *log.Logger) *AudioPanel
AttachLogger implements setter injection of a log.Logger
func (*AudioPanel) AudioRequest ¶
func (ap *AudioPanel) AudioRequest(url string) (io.ReadCloser, error)
AudioRequest is the bare minimum HTTP request function to get an audio stream. io.ReadCloser is the interface required by mp3.Decode in StreamAudio() resp.Body is of this type so can simply be returned following the request.
func (*AudioPanel) GetPlayerState ¶
func (ap *AudioPanel) GetPlayerState() PlayerState
GetPlayerState returns a PlayerState value that represents a snapshot of the user relevant player state at the time this method was called
func (*AudioPanel) NoBufferPlayFromUrl ¶
func (ap *AudioPanel) NoBufferPlayFromUrl(url string)
func (*AudioPanel) PlayFromUrl ¶
func (ap *AudioPanel) PlayFromUrl(url string, logger *log.Logger, cachePath string)
func (*AudioPanel) PlayPause ¶
func (ap *AudioPanel) PlayPause()
func (*AudioPanel) SetPublishCallback ¶
func (ap *AudioPanel) SetPublishCallback(callback func(func()))
SetPublishCallback is where the function to update on publish should be supplied Probably don't pass anything other than QueueUpdateDraw
func (*AudioPanel) SetStreamer ¶
func (ap *AudioPanel) SetStreamer(format beep.Format, streamer beep.StreamSeekCloser)
func (*AudioPanel) SpawnPublisher ¶
func (ap *AudioPanel) SpawnPublisher()
func (*AudioPanel) SubscribeToState ¶
func (ap *AudioPanel) SubscribeToState(subscriber PlayerStateSubscriber)
type PlayerState ¶
PlayerState is a snapshot of the current player state
type PlayerStateSubscriber ¶
type PlayerStateSubscriber interface {
OnUpdate()
}