live editing

This commit is contained in:
Peter Slattery 2021-04-09 22:15:59 -04:00
parent fae031b746
commit 14ded0bbe6
6 changed files with 23 additions and 16 deletions

View File

@ -43,6 +43,6 @@ blocks:{
max: 3600; max: 3600;
}; };
layer_index: 0; layer_index: 0;
animation_name: "Pattern_Rotary"; animation_name: "Pattern_VerticalLines";
}; };
}; };

View File

@ -1,10 +1,10 @@
lumenarium_animation_file; lumenarium_animation_file;
animation_name: "rainbow"; animation_name: "rainbow";
layers_count: 2; layers_count: 3;
blocks_count: 1; blocks_count: 1;
playable_range:{ playable_range:{
min: 0; min: 0;
max: 360; max: 3600;
}; };
layers:{ layers:{
layer:{ layer:{
@ -15,12 +15,16 @@ layers:{
name: "Color"; name: "Color";
blend: "Add"; blend: "Add";
}; };
layer:{
name: "[New Layer]";
blend: "Add";
};
}; };
blocks:{ blocks:{
block:{ block:{
frame_range:{ frame_range:{
min: 0; min: 0;
max: 360; max: 3600;
}; };
layer_index: 1; layer_index: 1;
animation_name: "Pattern_Rainbow"; animation_name: "Pattern_Rainbow";

View File

@ -517,7 +517,7 @@ ui_GetRetainedState(ui_interface* Interface, ui_widget_id Id)
{ {
// NOTE(PS): If we are accessing a retained state, it shouldn't // NOTE(PS): If we are accessing a retained state, it shouldn't
// have been accessed longer ago than the last frame // have been accessed longer ago than the last frame
Assert(Interface->RetainedState[i].FramesSinceAccess <= 2); //Assert(Interface->RetainedState[i].FramesSinceAccess <= 2);
Interface->RetainedState[i].FramesSinceAccess = 0; Interface->RetainedState[i].FramesSinceAccess = 0;
Result = Interface->RetainedState + i; Result = Interface->RetainedState + i;
break; break;

View File

@ -414,7 +414,7 @@ Pattern_VerticalLines(led_buffer* Leds, led_buffer_range Range, assembly Assembl
r32 LightSpeedMin = 1; r32 LightSpeedMin = 1;
r32 LightSpeedMax = 5; r32 LightSpeedMax = 5;
s32 LightTailLength = 10; s32 LightTailLength = 60;
for (u32 StripIndex = 0; StripIndex < Assembly.StripCount; StripIndex++) for (u32 StripIndex = 0; StripIndex < Assembly.StripCount; StripIndex++)
{ {
v2_strip Strip = Assembly.Strips[StripIndex]; v2_strip Strip = Assembly.Strips[StripIndex];
@ -503,7 +503,7 @@ Pattern_Rotary(led_buffer* Leds, led_buffer_range Range, assembly Assembly, r32
blumen_lumen_state* BLState = (blumen_lumen_state*)UserData; blumen_lumen_state* BLState = (blumen_lumen_state*)UserData;
Time = Time * BLState->PatternSpeed; Time = Time * BLState->PatternSpeed;
Pattern_RotaryOptions(Leds, Range, Assembly, Time, Transient, UserData, 2, BlackV4, WhiteV4); Pattern_RotaryOptions(Leds, Range, Assembly, Time, Transient, UserData, .25f, BlackV4, WhiteV4);
} }
internal void internal void

View File

@ -257,6 +257,7 @@ BlumenLumen_GetCurrentHue(blumen_lumen_state* BLState, assembly Assembly)
switch (BLState->PatternMode) switch (BLState->PatternMode)
{ {
case BlumenPattern_NoControl:
case BlumenPattern_Standard: case BlumenPattern_Standard:
{ {
Result = BLState->StandardPatternHues; Result = BLState->StandardPatternHues;

View File

@ -16,7 +16,7 @@ gs_const_string Flower2AssemblyPath = ConstString("data/ss_blumen_three.fold");
// The path to the phrase map CSV. Can be an absolute path, or relative // The path to the phrase map CSV. Can be an absolute path, or relative
// to the app_run_tree folder // to the app_run_tree folder
gs_const_string PhraseMapCSVPath = ConstString("data/flower_codes.tsv"); gs_const_string PhraseMapCSVPath = ConstString("C:/projects/flowers-sound/flower_codes.tsv");
char PhraseMapCSVSeparator = '\t'; char PhraseMapCSVSeparator = '\t';
// Search Strings for which folders to find ambient animation files and // Search Strings for which folders to find ambient animation files and
@ -36,21 +36,23 @@ gs_const_string VoicePatternFolder = ConstString("data/blumen_animations/audio_r
// NOTE: There is no need to modify the MotorOpenTimesCount variable - // NOTE: There is no need to modify the MotorOpenTimesCount variable -
// it is a compile time constant that gets calculated automatically // it is a compile time constant that gets calculated automatically
global time_range MotorOpenTimes[] = { global time_range MotorOpenTimes[] = {
{ 12, 45, 17, 45 }, // 12:45pm to 5:45pm { 8, 00, 12, 00 },
{ 19, 00, 23, 00 }, // 7:00pm to 11:00pm { 12, 30, 13, 00 },
{ 18, 00, 22, 00 }, // 7:00pm to 11:00pm
}; };
global u32 MotorOpenTimesCount = CArrayLength(MotorOpenTimes); // do not edit global u32 MotorOpenTimesCount = CArrayLength(MotorOpenTimes); // do not edit
// The times of day when the leds should be on // The times of day when the leds should be on
// Search for @TimeFormat to find documentation // Search for @TimeFormat to find documentation
global time_range LedOnTimes[] = { global time_range LedOnTimes[] = {
{ 00, 00, 23, 59 }, // literally always { 17, 00, 23, 59 },
{ 00, 00, 06, 30 },
}; };
global u32 LedOnTimesCount = CArrayLength(LedOnTimes); // do not edit global u32 LedOnTimesCount = CArrayLength(LedOnTimes); // do not edit
// How long it takes to fade from the default pattern to the // How long it takes to fade from the default pattern to the
// voice activated pattern // voice activated pattern
r32 VoiceCommandFadeDuration = 0.0f; // in seconds r32 VoiceCommandFadeDuration = 0.5f; // in seconds
// How long the voice activated pattern will remain active // How long the voice activated pattern will remain active
// without additional voice commands, before fading back to // without additional voice commands, before fading back to
@ -88,14 +90,14 @@ r64 TurnUpperLedsOffAfterMotorCloseCommandDelay = 120.0; // in seconds
// NOTE: this is an 8bit signed integer so its range is // NOTE: this is an 8bit signed integer so its range is
// -128 to 127, not that we should need either of those extremes for // -128 to 127, not that we should need either of those extremes for
// this, but just a note that you can't just put anything in here. // this, but just a note that you can't just put anything in here.
s8 MinHighTemperature = 0; s8 MinHighTemperature = 26;
// The percent brightness we set leds to during high temperatures. // The percent brightness we set leds to during high temperatures.
// A value in the range 0:1 inclusive // A value in the range 0:1 inclusive
// This is multiplied by each pixels R, G, & B channels before being // This is multiplied by each pixels R, G, & B channels before being
// sent. So if it is set to .1f, then the maximum brightness value sent // sent. So if it is set to .1f, then the maximum brightness value sent
// to any channel of any pixel will be 25 (255 * .1 = 25). // to any channel of any pixel will be 25 (255 * .1 = 25).
r32 HighTemperatureBrightnessPercent = 1.0f; r32 HighTemperatureBrightnessPercent = 0.7f;
// The percent brightness we set leds to when no other conditions apply // The percent brightness we set leds to when no other conditions apply
// A value in the range 0:1 inclusive. // A value in the range 0:1 inclusive.
@ -116,9 +118,9 @@ r32 GlobalAnimSpeed = 1.0f;
r32 GlobalAnimTransitionSpeed = 0.0f; r32 GlobalAnimTransitionSpeed = 0.0f;
// how long it takes to fade from the old voice hue to the new one // how long it takes to fade from the old voice hue to the new one
r32 PhraseHueFadeInDuration = 2.0f; // seconds r32 PhraseHueFadeInDuration = 0.01f; // seconds
r64 PhrasePriorityMessageGroupingTime = 0.0f; r64 PhrasePriorityMessageGroupingTime = 0.1f;
// How often should Lumenarium send its status to the python server? // How often should Lumenarium send its status to the python server?
// //