showtime

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// CueNotification indicates that a specific cue has been triggered.
	CueNotification = "cue"

	// PeriodicNotification indicates that the periodic timer has elapsed.
	PeriodicNotification = "periodic"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Announcement

type Announcement struct {

	// Cause indicates the reason for the announcement.  Valid reasons are "periodic" and "cue"
	Cause string `json:"cause"`

	// TimePoints lists the TimePoints (cues and their time offsets) which have been received so far, in order of appearance.
	TimePoints []*TimePoint `json:"time_points"`
}

An Announcement is a notification of a change in the showtime. It can be an incremental time notification or a cue notification

type Service

type Service struct {
	Echo *echo.Echo

	// Times records the Cues as they are received
	Times []*Time
	// contains filtered or unexported fields
}

Service describes a live performance time service

func (*Service) Run

func (s *Service) Run(qlabAddr string) error

Run executes the showtime service

func (*Service) Subscribe

func (s *Service) Subscribe() *Subscription

Subscribe registers a subscription to receive showtime announcements

func (*Service) Trigger

func (s *Service) Trigger(cue string)

Trigger activates the given cue

type Subscription

type Subscription struct {
	C chan *Announcement
	// contains filtered or unexported fields
}

Subscription represents a subscription to showtime announcements

func (*Subscription) Cancel

func (s *Subscription) Cancel()

Cancel cancels the subscription and removes it from the service

type Time

type Time struct {

	// Cue indicates the last-triggered performance cue
	Cue string

	// Received indicates the timestamp at which the last-triggered cue was received
	Received time.Time
}

Time describes the time at which the last Cue occurred

func (*Time) Now

func (t *Time) Now() *TimePoint

Now returns the current point in performance time

func (*Time) OffsetSeconds

func (t *Time) OffsetSeconds() float64

OffsetSeconds returns the time elapsed since the associated cue was triggered.

type TimePoint

type TimePoint struct {

	// Cue indicates the last-triggered performance cue
	Cue string `json:"cue"`

	// Offset indicates the number of seconds since the last cue was triggered
	Offset float64 `json:"offset"`
}

TimePoint describes a point in performance time, which can be exported to the web clients. It uses an offset rather than a timestamp so that web clients need not be time-synchronized to the server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL