Skip to content

Commit

Permalink
Merge pull request #113 from ReneeVandervelde/scenes
Browse files Browse the repository at this point in the history
Add Scene Structures
  • Loading branch information
ReneeVandervelde authored May 15, 2023
2 parents c6dfa38 + 45a03f7 commit e9168b9
Show file tree
Hide file tree
Showing 15 changed files with 784 additions and 0 deletions.
130 changes: 130 additions & 0 deletions lights/api/lights.api
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,38 @@ public final class inkapplications/shade/lights/structures/ColorInfo$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/ColorPalette {
public static final field Companion Linkapplications/shade/lights/structures/ColorPalette$Companion;
public synthetic fun <init> (ILinkapplications/shade/lights/structures/ColorValue;Linkapplications/shade/lights/structures/DimmingValue;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V
public fun <init> (Linkapplications/shade/lights/structures/ColorValue;Linkapplications/shade/lights/structures/DimmingValue;)V
public final fun component1 ()Linkapplications/shade/lights/structures/ColorValue;
public final fun component2 ()Linkapplications/shade/lights/structures/DimmingValue;
public final fun copy (Linkapplications/shade/lights/structures/ColorValue;Linkapplications/shade/lights/structures/DimmingValue;)Linkapplications/shade/lights/structures/ColorPalette;
public static synthetic fun copy$default (Linkapplications/shade/lights/structures/ColorPalette;Linkapplications/shade/lights/structures/ColorValue;Linkapplications/shade/lights/structures/DimmingValue;ILjava/lang/Object;)Linkapplications/shade/lights/structures/ColorPalette;
public fun equals (Ljava/lang/Object;)Z
public final fun getColor ()Linkapplications/shade/lights/structures/ColorValue;
public final fun getDimming ()Linkapplications/shade/lights/structures/DimmingValue;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final fun write$Self (Linkapplications/shade/lights/structures/ColorPalette;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
}

public final class inkapplications/shade/lights/structures/ColorPalette$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Linkapplications/shade/lights/structures/ColorPalette$$serializer;
public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Linkapplications/shade/lights/structures/ColorPalette;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Linkapplications/shade/lights/structures/ColorPalette;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/ColorPalette$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/ColorTemperatureInfo {
public static final field Companion Linkapplications/shade/lights/structures/ColorTemperatureInfo$Companion;
public synthetic fun <init> (ILinkapplications/spondee/measure/ColorTemperature;ZLinkapplications/shade/lights/structures/ColorTemperatureRange;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V
Expand Down Expand Up @@ -680,6 +712,38 @@ public final class inkapplications/shade/lights/structures/ColorTemperatureInfo$
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/ColorTemperaturePalette {
public static final field Companion Linkapplications/shade/lights/structures/ColorTemperaturePalette$Companion;
public synthetic fun <init> (ILinkapplications/shade/lights/structures/ColorTemperatureValue;Linkapplications/shade/lights/structures/DimmingValue;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V
public fun <init> (Linkapplications/shade/lights/structures/ColorTemperatureValue;Linkapplications/shade/lights/structures/DimmingValue;)V
public final fun component1 ()Linkapplications/shade/lights/structures/ColorTemperatureValue;
public final fun component2 ()Linkapplications/shade/lights/structures/DimmingValue;
public final fun copy (Linkapplications/shade/lights/structures/ColorTemperatureValue;Linkapplications/shade/lights/structures/DimmingValue;)Linkapplications/shade/lights/structures/ColorTemperaturePalette;
public static synthetic fun copy$default (Linkapplications/shade/lights/structures/ColorTemperaturePalette;Linkapplications/shade/lights/structures/ColorTemperatureValue;Linkapplications/shade/lights/structures/DimmingValue;ILjava/lang/Object;)Linkapplications/shade/lights/structures/ColorTemperaturePalette;
public fun equals (Ljava/lang/Object;)Z
public final fun getColorTemperature ()Linkapplications/shade/lights/structures/ColorTemperatureValue;
public final fun getDimming ()Linkapplications/shade/lights/structures/DimmingValue;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final fun write$Self (Linkapplications/shade/lights/structures/ColorTemperaturePalette;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
}

public final class inkapplications/shade/lights/structures/ColorTemperaturePalette$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Linkapplications/shade/lights/structures/ColorTemperaturePalette$$serializer;
public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Linkapplications/shade/lights/structures/ColorTemperaturePalette;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Linkapplications/shade/lights/structures/ColorTemperaturePalette;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/ColorTemperaturePalette$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/ColorTemperatureRange {
public fun <init> (Linkapplications/spondee/measure/ColorTemperature;Linkapplications/spondee/measure/ColorTemperature;)V
public final fun component1 ()Linkapplications/spondee/measure/ColorTemperature;
Expand Down Expand Up @@ -958,6 +1022,40 @@ public final class inkapplications/shade/lights/structures/Gradient$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/GradientMode {
public static final field Companion Linkapplications/shade/lights/structures/GradientMode$Companion;
public static final synthetic fun box-impl (Ljava/lang/String;)Linkapplications/shade/lights/structures/GradientMode;
public static fun constructor-impl (Ljava/lang/String;)Ljava/lang/String;
public fun equals (Ljava/lang/Object;)Z
public static fun equals-impl (Ljava/lang/String;Ljava/lang/Object;)Z
public static final fun equals-impl0 (Ljava/lang/String;Ljava/lang/String;)Z
public final fun getKey ()Ljava/lang/String;
public fun hashCode ()I
public static fun hashCode-impl (Ljava/lang/String;)I
public fun toString ()Ljava/lang/String;
public static fun toString-impl (Ljava/lang/String;)Ljava/lang/String;
public final synthetic fun unbox-impl ()Ljava/lang/String;
}

public final class inkapplications/shade/lights/structures/GradientMode$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Linkapplications/shade/lights/structures/GradientMode$$serializer;
public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun deserialize-gPgjCDk (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/String;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun serialize-6nhvQnw (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/String;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/GradientMode$Companion {
public final fun getInterpolatedPalette-r7z_WDs ()Ljava/lang/String;
public final fun getInterpolatedPaletteMirrored-r7z_WDs ()Ljava/lang/String;
public final fun getRandomPixelated-r7z_WDs ()Ljava/lang/String;
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/GradientPoint {
public static final field Companion Linkapplications/shade/lights/structures/GradientPoint$Companion;
public synthetic fun <init> (ILinkapplications/shade/lights/structures/ColorValue;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V
Expand Down Expand Up @@ -988,6 +1086,38 @@ public final class inkapplications/shade/lights/structures/GradientPoint$Compani
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/GradientValue {
public static final field Companion Linkapplications/shade/lights/structures/GradientValue$Companion;
public synthetic fun <init> (ILjava/util/List;Ljava/lang/String;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ljava/util/List;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ljava/util/List;
public final fun component2-r7z_WDs ()Ljava/lang/String;
public final fun copy-6nhvQnw (Ljava/util/List;Ljava/lang/String;)Linkapplications/shade/lights/structures/GradientValue;
public static synthetic fun copy-6nhvQnw$default (Linkapplications/shade/lights/structures/GradientValue;Ljava/util/List;Ljava/lang/String;ILjava/lang/Object;)Linkapplications/shade/lights/structures/GradientValue;
public fun equals (Ljava/lang/Object;)Z
public final fun getMode-r7z_WDs ()Ljava/lang/String;
public final fun getPoints ()Ljava/util/List;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
public static final fun write$Self (Linkapplications/shade/lights/structures/GradientValue;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V
}

public final class inkapplications/shade/lights/structures/GradientValue$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Linkapplications/shade/lights/structures/GradientValue$$serializer;
public static final synthetic field descriptor Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Linkapplications/shade/lights/structures/GradientValue;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Linkapplications/shade/lights/structures/GradientValue;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/GradientValue$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class inkapplications/shade/lights/structures/Light {
public static final field Companion Linkapplications/shade/lights/structures/Light$Companion;
public synthetic fun <init> (ILjava/lang/String;Linkapplications/shade/structures/ResourceReference;Linkapplications/shade/structures/PowerInfo;Ljava/lang/String;Linkapplications/shade/lights/structures/DimmingInfo;Linkapplications/shade/lights/structures/ColorTemperatureInfo;Linkapplications/shade/lights/structures/ColorInfo;Ljava/lang/String;Linkapplications/shade/lights/structures/LightDynamics;Linkapplications/shade/lights/structures/AlertInfo;Linkapplications/shade/lights/structures/Gradient;Linkapplications/shade/lights/structures/LightingEffectInfo;Linkapplications/shade/lights/structures/TimedLightingEffectInfo;Linkapplications/shade/lights/structures/LightSignaling;Linkapplications/shade/lights/structures/LightPowerup;Lkotlinx/serialization/internal/SerializationConstructorMarker;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package inkapplications.shade.lights.structures

import kotlinx.serialization.Serializable

/**
* Color/brightness pair reference.
*/
@Serializable
data class ColorPalette(
val color: ColorValue,
val dimming: DimmingValue,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package inkapplications.shade.lights.structures

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Color temperature/brightness pair reference.
*/
@Serializable
data class ColorTemperaturePalette(
@SerialName("color_temperature")
val colorTemperature: ColorTemperatureValue,
val dimming: DimmingValue,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package inkapplications.shade.lights.structures

import kotlinx.serialization.Serializable
import kotlin.jvm.JvmInline

/**
* Mode in which gradient points are currently being deployed.
*/
@JvmInline
@Serializable
value class GradientMode(val key: String) {
companion object {
val InterpolatedPalette = GradientMode("interpolated_palette")
val InterpolatedPaletteMirrored = GradientMode("interpolated_palette_mirrored")
val RandomPixelated = GradientMode("random_pixelated")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package inkapplications.shade.lights.structures

import kotlinx.serialization.Serializable

/**
* Basic feature containing gradient properties.
*/
@Serializable
data class GradientValue(
/**
* Collection of gradients points.
*/
val points: List<GradientPoint>,

/**
* Mode in which the points are currently being deployed.
*/
val mode: GradientMode,
) {
init {
if (points.size > 5) throw IllegalArgumentException("Gradient cannot contain more than 5 points")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ value class LightEffect(val key: String) {
fun valueOf(key: String) = values().single { it.key == key }
}
}

Loading

0 comments on commit e9168b9

Please sign in to comment.