Documentation
¶
Overview ¶
Package export provides project export functionality.
Index ¶
- type ExportMetadata
- type ExportOptions
- type ExportProjectInfo
- type ExportStats
- type ExportedChannelDefinition
- type ExportedChannelValue
- type ExportedCue
- type ExportedCueList
- type ExportedFixtureDefinition
- type ExportedFixtureInstance
- type ExportedFixtureMode
- type ExportedFixtureValue
- type ExportedInstanceChannel
- type ExportedLook
- type ExportedLookBoard
- type ExportedLookBoardButton
- type ExportedModeChannel
- type ExportedProject
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExportMetadata ¶ added in v0.2.0
type ExportMetadata struct {
ExportedAt string `json:"exportedAt"`
LacyLightsVersion string `json:"lacyLightsVersion"`
Description *string `json:"description,omitempty"`
}
ExportMetadata contains export metadata.
type ExportOptions ¶ added in v0.2.4
type ExportOptions struct {
IncludeFixtures bool // Include fixture definitions and instances
IncludeLooks bool // Include looks with fixture values
IncludeScenes bool // Deprecated: use IncludeLooks
IncludeCueLists bool // Include cue lists with cues
IncludeLookBoards bool // Include look boards with buttons (defaults to true)
IncludeSceneBoards bool // Deprecated: use IncludeLookBoards
}
ExportOptions contains options for project export.
func DefaultExportOptions ¶ added in v0.2.4
func DefaultExportOptions() ExportOptions
DefaultExportOptions returns the default export options (all true).
type ExportProjectInfo ¶ added in v0.2.0
type ExportProjectInfo struct {
OriginalID string `json:"originalId"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
ExportProjectInfo contains project information.
type ExportStats ¶
type ExportStats struct {
FixtureDefinitionsCount int
FixtureInstancesCount int
LooksCount int
ScenesCount int // Deprecated: use LooksCount
CueListsCount int
CuesCount int
LookBoardsCount int
SceneBoardsCount int // Deprecated: use LookBoardsCount
}
ExportStats contains statistics about an export.
type ExportedChannelDefinition ¶
type ExportedChannelDefinition struct {
RefID string `json:"refId,omitempty"`
Name string `json:"name"`
Type string `json:"type"`
Offset int `json:"offset"`
MinValue int `json:"minValue"`
MaxValue int `json:"maxValue"`
DefaultValue int `json:"defaultValue"`
FadeBehavior string `json:"fadeBehavior,omitempty"` // FADE, SNAP, SNAP_END
IsDiscrete bool `json:"isDiscrete,omitempty"`
}
ExportedChannelDefinition represents an exported channel definition.
type ExportedChannelValue ¶ added in v0.2.0
ExportedChannelValue represents a single channel value in sparse format.
type ExportedCue ¶
type ExportedCue struct {
OriginalID string `json:"originalId,omitempty"`
Name string `json:"name"`
CueNumber float64 `json:"cueNumber"`
LookRefID string `json:"lookRefId"`
SceneRefID string `json:"sceneRefId,omitempty"` // Deprecated: backward compatibility, use LookRefID
FadeInTime float64 `json:"fadeInTime"`
FadeOutTime float64 `json:"fadeOutTime"`
FollowTime *float64 `json:"followTime,omitempty"`
EasingType *string `json:"easingType,omitempty"`
Notes *string `json:"notes,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
ExportedCue represents an exported cue.
type ExportedCueList ¶
type ExportedCueList struct {
RefID string `json:"refId"`
OriginalID string `json:"originalId,omitempty"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Loop bool `json:"loop"`
Cues []ExportedCue `json:"cues"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
ExportedCueList represents an exported cue list.
type ExportedFixtureDefinition ¶
type ExportedFixtureDefinition struct {
RefID string `json:"refId"`
Manufacturer string `json:"manufacturer"`
Model string `json:"model"`
Type string `json:"type"`
IsBuiltIn bool `json:"isBuiltIn"`
Modes []ExportedFixtureMode `json:"modes,omitempty"`
Channels []ExportedChannelDefinition `json:"channels"`
}
ExportedFixtureDefinition represents an exported fixture definition.
type ExportedFixtureInstance ¶
type ExportedFixtureInstance struct {
RefID string `json:"refId"`
OriginalID string `json:"originalId,omitempty"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
DefinitionRefID string `json:"definitionRefId"`
ModeName *string `json:"modeName,omitempty"`
ModeRefID *string `json:"modeRefId,omitempty"`
ChannelCount *int `json:"channelCount,omitempty"`
Universe int `json:"universe"`
StartChannel int `json:"startChannel"`
Tags []string `json:"tags,omitempty"`
ProjectOrder *int `json:"projectOrder,omitempty"`
LayoutX *float64 `json:"layoutX,omitempty"`
LayoutY *float64 `json:"layoutY,omitempty"`
LayoutRotation *float64 `json:"layoutRotation,omitempty"`
InstanceChannels []ExportedInstanceChannel `json:"instanceChannels,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
ExportedFixtureInstance represents an exported fixture instance.
type ExportedFixtureMode ¶ added in v0.2.0
type ExportedFixtureMode struct {
RefID string `json:"refId"`
Name string `json:"name"`
ShortName *string `json:"shortName,omitempty"`
ChannelCount int `json:"channelCount"`
ModeChannels []ExportedModeChannel `json:"modeChannels"`
}
ExportedFixtureMode represents a fixture mode in export.
type ExportedFixtureValue ¶
type ExportedFixtureValue struct {
FixtureRefID string `json:"fixtureRefId"`
Channels []ExportedChannelValue `json:"channels"`
ChannelValues []int `json:"channelValues,omitempty"` // Read-only: used to import legacy dense array format, not populated on export
LookOrder *int `json:"lookOrder,omitempty"`
SceneOrder *int `json:"sceneOrder,omitempty"` // Deprecated: backward compatibility, use LookOrder
}
ExportedFixtureValue represents exported fixture values in a look.
type ExportedInstanceChannel ¶ added in v0.2.0
type ExportedInstanceChannel struct {
Name string `json:"name"`
Type string `json:"type"`
Offset int `json:"offset"`
MinValue int `json:"minValue"`
MaxValue int `json:"maxValue"`
DefaultValue int `json:"defaultValue"`
FadeBehavior string `json:"fadeBehavior,omitempty"` // FADE, SNAP, SNAP_END
IsDiscrete bool `json:"isDiscrete,omitempty"`
}
ExportedInstanceChannel represents an instance-specific channel.
type ExportedLook ¶ added in v0.2.30
type ExportedLook struct {
RefID string `json:"refId"`
OriginalID string `json:"originalId,omitempty"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
FixtureValues []ExportedFixtureValue `json:"fixtureValues"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
ExportedLook represents an exported look.
type ExportedLookBoard ¶ added in v0.2.30
type ExportedLookBoard struct {
RefID string `json:"refId"`
OriginalID string `json:"originalId,omitempty"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
DefaultFadeTime float64 `json:"defaultFadeTime"`
GridSize *int `json:"gridSize,omitempty"`
CanvasWidth int `json:"canvasWidth"`
CanvasHeight int `json:"canvasHeight"`
Buttons []ExportedLookBoardButton `json:"buttons,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
ExportedLookBoard represents an exported look board.
type ExportedLookBoardButton ¶ added in v0.2.30
type ExportedLookBoardButton struct {
OriginalID string `json:"originalId,omitempty"`
LookRefID string `json:"lookRefId"`
SceneRefID string `json:"sceneRefId,omitempty"` // Deprecated: backward compatibility, use LookRefID
LayoutX int `json:"layoutX"`
LayoutY int `json:"layoutY"`
Width *int `json:"width,omitempty"`
Height *int `json:"height,omitempty"`
Color *string `json:"color,omitempty"`
Label *string `json:"label,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
ExportedLookBoardButton represents an exported look board button.
type ExportedModeChannel ¶ added in v0.2.0
type ExportedModeChannel struct {
ChannelRefID string `json:"channelRefId"`
Offset int `json:"offset"`
}
ExportedModeChannel represents a mode-specific channel mapping.
type ExportedProject ¶
type ExportedProject struct {
Version string `json:"version"`
Metadata *ExportMetadata `json:"metadata,omitempty"`
Project *ExportProjectInfo `json:"project,omitempty"`
FixtureDefinitions []ExportedFixtureDefinition `json:"fixtureDefinitions"`
FixtureInstances []ExportedFixtureInstance `json:"fixtureInstances"`
Looks []ExportedLook `json:"looks"`
Scenes []ExportedLook `json:"scenes,omitempty"` // Deprecated: backward compatibility, use Looks
CueLists []ExportedCueList `json:"cueLists"`
LookBoards []ExportedLookBoard `json:"lookBoards,omitempty"`
SceneBoards []ExportedLookBoard `json:"sceneBoards,omitempty"` // Deprecated: backward compatibility, use LookBoards
}
ExportedProject represents a full project export. Matches the LacyLights Node.js export format.
func ParseExportedProject ¶
func ParseExportedProject(jsonContent string) (*ExportedProject, error)
ParseExportedProject parses JSON into an ExportedProject. Handles backward compatibility for legacy "scenes" and "sceneBoards" JSON keys.
func (*ExportedProject) GetProjectDescription ¶ added in v0.2.0
func (e *ExportedProject) GetProjectDescription() *string
GetProjectDescription returns the project description from the exported data.
func (*ExportedProject) GetProjectName ¶ added in v0.2.0
func (e *ExportedProject) GetProjectName() string
GetProjectName returns the project name from the exported data.
func (*ExportedProject) ToJSON ¶
func (e *ExportedProject) ToJSON() (string, error)
ToJSON converts an exported project to JSON string.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles project export operations.
func NewService ¶
func NewService( projectRepo *repositories.ProjectRepository, fixtureRepo *repositories.FixtureRepository, lookRepo *repositories.LookRepository, cueListRepo *repositories.CueListRepository, cueRepo *repositories.CueRepository, ) *Service
NewService creates a new export service.
func NewServiceWithLookBoards ¶ added in v0.2.30
func NewServiceWithLookBoards( projectRepo *repositories.ProjectRepository, fixtureRepo *repositories.FixtureRepository, lookRepo *repositories.LookRepository, cueListRepo *repositories.CueListRepository, cueRepo *repositories.CueRepository, lookBoardRepo *repositories.LookBoardRepository, ) *Service
NewServiceWithLookBoards creates a new export service with look board support.
func (*Service) ExportProject ¶
func (s *Service) ExportProject(ctx context.Context, projectID string, includeFixtures, includeLooks, includeCueLists bool, includeLookBoards ...bool) (*ExportedProject, *ExportStats, error)
ExportProject exports a project to JSON. Deprecated: Use ExportProjectWithOptions for cleaner API.
func (*Service) ExportProjectWithOptions ¶ added in v0.2.4
func (s *Service) ExportProjectWithOptions(ctx context.Context, projectID string, opts ExportOptions) (*ExportedProject, *ExportStats, error)
ExportProjectWithOptions exports a project to JSON using an options struct.