Documentation
¶
Overview ¶
Package preview provides preview session management.
Index ¶
- type ChannelUpdate
- type DMXOutput
- type Service
- func (s *Service) CancelAllProjectSessions(ctx context.Context, projectID string)
- func (s *Service) CancelSession(ctx context.Context, sessionID string) (bool, error)
- func (s *Service) CommitSession(ctx context.Context, sessionID string) (bool, error)
- func (s *Service) GetDMXOutput(sessionID string) []DMXOutput
- func (s *Service) GetProjectSession(projectID string) *Session
- func (s *Service) GetSession(sessionID string) *Session
- func (s *Service) InitializeWithLook(ctx context.Context, sessionID string, lookID string) (bool, error)
- func (s *Service) SetSessionUpdateCallback(callback func(session *Session, dmxOutput []DMXOutput))
- func (s *Service) StartSession(ctx context.Context, projectID string, userID *string) (*Session, error)
- func (s *Service) UpdateChannelValue(ctx context.Context, sessionID string, fixtureID string, channelIndex int, ...) (bool, error)
- func (s *Service) UpdateChannelValues(ctx context.Context, sessionID string, updates []ChannelUpdate) (bool, error)
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelUpdate ¶ added in v0.2.31
ChannelUpdate represents a single channel update.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles preview session operations.
func NewService ¶
func NewService( fixtureRepo *repositories.FixtureRepository, lookRepo *repositories.LookRepository, dmxService *dmx.Service, ) *Service
NewService creates a new preview service.
func (*Service) CancelAllProjectSessions ¶ added in v0.2.23
CancelAllProjectSessions cancels all active preview sessions for a project. This should be called when activating looks or starting cue playback to ensure preview overrides don't interfere with look output. Preview mode uses channel overrides that take precedence over base look values, so if not cleared, stale preview values would override the newly activated look.
The ctx parameter is included for API consistency and future cancellation support, but is currently unused as the operation completes synchronously.
func (*Service) CancelSession ¶
CancelSession cancels a preview session and removes its overrides.
func (*Service) CommitSession ¶
CommitSession commits a preview session (keeps changes, cleans up session).
func (*Service) GetDMXOutput ¶
GetDMXOutput returns the current DMX output for a session.
func (*Service) GetProjectSession ¶
GetProjectSession returns the active session for a project.
func (*Service) GetSession ¶
GetSession returns a session by ID.
func (*Service) InitializeWithLook ¶ added in v0.2.30
func (s *Service) InitializeWithLook(ctx context.Context, sessionID string, lookID string) (bool, error)
InitializeWithLook initializes a preview session with values from a look.
func (*Service) SetSessionUpdateCallback ¶
SetSessionUpdateCallback sets the callback for session updates (for subscriptions).
func (*Service) StartSession ¶
func (s *Service) StartSession(ctx context.Context, projectID string, userID *string) (*Session, error)
StartSession starts a new preview session for a project.
func (*Service) UpdateChannelValue ¶
func (s *Service) UpdateChannelValue(ctx context.Context, sessionID string, fixtureID string, channelIndex int, value int) (bool, error)
UpdateChannelValue updates a channel value in a preview session.
func (*Service) UpdateChannelValues ¶ added in v0.2.31
func (s *Service) UpdateChannelValues(ctx context.Context, sessionID string, updates []ChannelUpdate) (bool, error)
UpdateChannelValues updates multiple channel values in a preview session atomically.