Documentation ¶
Index ¶
- Constants
- type Client
- type ClientOptions
- type CountMessage
- type CountdownMessage
- type DisplayMessage
- type Engine
- func (engine *Engine) Kill()
- func (engine *Engine) ModifyCountdown(delta time.Duration)
- func (engine *Engine) ModifyCountdown2(delta time.Duration)
- func (engine *Engine) Normal()
- func (engine *Engine) Pause()
- func (engine *Engine) Resume()
- func (engine *Engine) StartCountdown(timer time.Duration)
- func (engine *Engine) StartCountdown2(timer time.Duration)
- func (engine *Engine) StartCountup()
- func (engine *Engine) StopCountdown()
- func (engine *Engine) StopCountdown2()
- func (engine *Engine) Update()
- type EngineOptions
- type Message
- type Server
- type TimeMessage
Constants ¶
const ( Normal = iota // Display current time Countdown = iota // Display countdown timer only Countup = iota // Count time up Off = iota // (Mostly) blank screen Paused = iota // Paused countdown timer(s) )
Clock engine state constants
const Version = "3.0.0"
Version is the current clock engine version
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client A clock osc client
func (*Client) SendCount ¶
func (client *Client) SendCount(message CountMessage) error
SendCount Send a /clock/count message
func (*Client) SendDisplay ¶
func (client *Client) SendDisplay(message DisplayMessage) error
SendDisplay Send a /clock/display message
func (*Client) SendStart ¶
func (client *Client) SendStart(message CountdownMessage) error
SendStart Send a /clock/countdown/start message
type ClientOptions ¶
type ClientOptions struct {
Connect string `long:"clock-client-connect" description:"Address to send clock osc messages to" default:"255.255.255.255:1245"` // Address to connect to with OSC
}
ClientOptions common options for client instances
func (ClientOptions) MakeClient ¶
func (options ClientOptions) MakeClient() (*Client, error)
MakeClient Create a clock OSC client
type CountMessage ¶
type CountMessage struct { ColorRed float32 ColorGreen float32 ColorBlue float32 Symbol string Count int32 Unit string }
CountMessage is a legacy message format for /qmsk/clock/count
func (CountMessage) MarshalOSC ¶
func (message CountMessage) MarshalOSC(addr string) *osc.Message
MarshalOSC converts a CountMessage to osc.Message
func (*CountMessage) SetTimeRemaining ¶
func (message *CountMessage) SetTimeRemaining(seconds float32)
SetTimeRemaining sets the remaining time for CountMessage and formats the unit
func (*CountMessage) UnmarshalOSC ¶
func (message *CountMessage) UnmarshalOSC(msg *osc.Message) error
UnmarshalOSC converts a osc.Message to CountMessage
type CountdownMessage ¶
type CountdownMessage struct {
Seconds int32
}
CountdownMessage is for /clock/countdown/start
func (CountdownMessage) MarshalOSC ¶
func (message CountdownMessage) MarshalOSC(addr string) *osc.Message
MarshalOSC converts a CountdownMessage to osc.Message
func (*CountdownMessage) UnmarshalOSC ¶
func (message *CountdownMessage) UnmarshalOSC(msg *osc.Message) error
UnmarshalOSC converts a osc.Message to CountdownMessage
type DisplayMessage ¶
DisplayMessage is for /clock/display
func (DisplayMessage) MarshalOSC ¶
func (message DisplayMessage) MarshalOSC(addr string) *osc.Message
MarshalOSC converts a DisplayMessage to osc.Message
func (*DisplayMessage) UnmarshalOSC ¶
func (message *DisplayMessage) UnmarshalOSC(msg *osc.Message) error
UnmarshalOSC converts a osc.Message to DisplayMessage
type Engine ¶
type Engine struct { Hours string Minutes string Seconds string Tally string TallyRed uint8 TallyGreen uint8 TallyBlue uint8 Leds int Dots bool // contains filtered or unexported fields }
Engine contains the state machine for clock-8001
func MakeEngine ¶
func MakeEngine(options *EngineOptions) (*Engine, error)
MakeEngine creates a clock engine
func (*Engine) ModifyCountdown ¶
ModifyCountdown adds or removes time from primary countdown
func (*Engine) ModifyCountdown2 ¶
ModifyCountdown2 adds or removes time from primary countdown
func (*Engine) Resume ¶
func (engine *Engine) Resume()
Resume resumes both countdowns if they have been paused
func (*Engine) StartCountdown ¶
StartCountdown starts a primary countdown timer
func (*Engine) StartCountdown2 ¶
StartCountdown2 starts a secondary countdown timer
func (*Engine) StartCountup ¶
func (engine *Engine) StartCountup()
StartCountup starts counting time up from this moment
func (*Engine) StopCountdown ¶
func (engine *Engine) StopCountdown()
StopCountdown stops the primary countdown
func (*Engine) StopCountdown2 ¶
func (engine *Engine) StopCountdown2()
StopCountdown2 stops the secondary countdown
type EngineOptions ¶
type EngineOptions struct { Flash int `long:"flash" description:"Flashing interval when countdown reached zero (ms), 0 disables" default:"500"` Timezone string `short:"t" long:"local-time" description:"Local timezone" default:"Europe/Helsinki"` ListenAddr string `long:"osc-listen" description:"Address to listen for incoming osc messages" default:"0.0.0.0:1245"` Timeout int `short:"d" long:"timeout" description:"Timeout for OSC message updates in milliseconds" default:"1000"` Connect string `short:"o" long:"osc-dest" description:"Address to send OSC feedback to" default:"255.255.255.255:1245"` CountdownRed uint8 `long:"cd-red" description:"Red component of secondary countdown color" default:"255"` CountdownGreen uint8 `long:"cd-green" description:"Green component of secondary countdown color" default:"0"` CountdownBlue uint8 `long:"cd-blue" description:"Blue component of secondary countdown color" default:"0"` DisableOSC bool `long:"disable-osc" description:"Disable OSC control and feedback"` DisableFeedback bool `long:"disable-feedback" description:"Disable OSC feedback"` }
EngineOptions contains all common options for clock.Engines
type Message ¶
type Message struct { Type string Data string CountMessage *CountMessage CountdownMessage *CountdownMessage DisplayMessage *DisplayMessage }
Message is a generic clock message for decoded osc data
type Server ¶
type Server struct { Debug bool // contains filtered or unexported fields }
Server is a clock osc server and listens for incoming osc messages
func MakeServer ¶
MakeServer creates a clock.Server instance from osc.Server instance
type TimeMessage ¶
type TimeMessage struct {
Time string
}
TimeMessage is for /clock/settime
func (TimeMessage) MarshalOSC ¶
func (message TimeMessage) MarshalOSC(addr string) *osc.Message
MarshalOSC converts a TimeMessage to osc.Message
func (*TimeMessage) UnmarshalOSC ¶
func (message *TimeMessage) UnmarshalOSC(msg *osc.Message) error
UnmarshalOSC converts a osc.Message to TimeMessage