Added keyframes and tracks

This commit is contained in:
Maximilian Giller 2025-09-14 13:11:53 +02:00
parent 393730a2b2
commit 539e54902a

View file

@ -1,5 +1,7 @@
from dataclasses import dataclass
from enum import Enum
from decimal import Decimal
@dataclass
class SpaceVector:
@ -14,12 +16,14 @@ class SpaceVector:
fb: float
"""Front-to-Behind."""
class Capabilities(Enum):
SWITCH = "switch"
BRIGHTNESS = "brightness"
TEMPERATURE = "temperature"
COLOR = "color"
@dataclass
class Fixture:
"""Definition of a fixture that generates light, its capabilities and positioning."""
@ -45,6 +49,7 @@ class Fixture:
exposure: float
"""In range [0,1], how exposed is the light source of the fixture. 0: no exposure. 1: full exposure."""
@dataclass
class Space:
"""A space containing fixtures."""
@ -62,6 +67,37 @@ class Space:
"""A reference point in the space from which the audience perspective might be assumed."""
@dataclass
class Keyframe:
"""State description for a specified point in time."""
time: Decimal
"""Point of time of the keyframe. Stored as decimal for high precision."""
parameter: str
"""Parameter targeted by frame value."""
value: None | bool | float | int | str = None
"""Targeted state value reached by reaching the keyframe."""
@dataclass
class Track:
"""Contains a sequence of keyframes for specified fixtures."""
id: str
"""Unique identifier for track."""
name: str
"""Human readable name."""
fixture_ids: list[str]
"""Fixtures by ids targeted by track."""
keyframes: list[Keyframe]
"""Sequence of keyframes describing actions"""
@dataclass
class Sequence:
"""A sequence of light events described over fixtures."""
@ -73,8 +109,6 @@ class Sequence:
"""Human readable name."""
@dataclass
class Event:
"""A collection of sequences and spaces."""