From 9ebadc543bc190f42489ddfcf914bdb7ca28a7db Mon Sep 17 00:00:00 2001 From: PS Date: Mon, 26 Apr 2021 14:17:41 -1000 Subject: [PATCH] Fix for exiting voice mode and resuming other animations --- src/app/ss_blumen_lumen/blumen_lumen.cpp | 10 +++++----- src/app/ss_blumen_lumen/blumen_lumen_settings.h | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/app/ss_blumen_lumen/blumen_lumen.cpp b/src/app/ss_blumen_lumen/blumen_lumen.cpp index ece98e7..2833d6c 100644 --- a/src/app/ss_blumen_lumen/blumen_lumen.cpp +++ b/src/app/ss_blumen_lumen/blumen_lumen.cpp @@ -290,6 +290,10 @@ BlumenLumen_UpdateLog(app_state* State, blumen_lumen_state* BLState, context Con animation* CurrAnim = AnimationSystem_GetActiveAnimation(&State->AnimationSystem); AppendPrintF(&FileStr, "Curr Animation: %S\n", CurrAnim->Name); + bool IsPlaying = State->AnimationSystem.TimelineShouldAdvance; + AppendPrintF(&FileStr, "\tIs Playing: %s\n", + IsPlaying ? "True" : "False"); + char* Connected = BLState->MicListenJobData.IsConnected ? "Connected" : "Disconnected"; AppendPrintF(&FileStr, "Connected to Python: %s\n", Connected); @@ -623,11 +627,7 @@ BlumenLumen_CustomUpdate(gs_data UserData, app_state* State, context* Context) if (SecondsSinceChange > VoiceCommandSustainDuration) { - BLState->PatternMode = BlumenPattern_Standard; - animation_handle NewAnim = BLState->ModeAnimations[BlumenPattern_Standard].Handles[0]; - AnimationFadeGroup_FadeTo(&State->AnimationSystem.ActiveFadeGroup, - NewAnim, - VoiceCommandFadeDuration); + BlumenLumen_SetPatternMode(BlumenPattern_Standard, GlobalAnimTransitionSpeed, &State->AnimationSystem, BLState); BLState->ShouldUpdateLog = true; } } diff --git a/src/app/ss_blumen_lumen/blumen_lumen_settings.h b/src/app/ss_blumen_lumen/blumen_lumen_settings.h index 2c4858c..c95029e 100644 --- a/src/app/ss_blumen_lumen/blumen_lumen_settings.h +++ b/src/app/ss_blumen_lumen/blumen_lumen_settings.h @@ -36,10 +36,9 @@ gs_const_string VoicePatternFolder = ConstString("data/blumen_animations/audio_r // NOTE: There is no need to modify the MotorOpenTimesCount variable - // it is a compile time constant that gets calculated automatically global time_range MotorOpenTimes[] = { - { 8, 00, 12, 00 }, - { 12, 30, 13, 00 }, - { 18, 00, 22, 00 }, // 6:00pm to 10:00pm - { 23, 05, 23, 53 }, + { 8, 00, 12, 00 }, // 8:00am to 12:00pm + { 12, 30, 13, 00 }, // 12:30pm to 01:00pm + { 18, 00, 22, 00 }, // 6:00pm to 10:00pm }; global u32 MotorOpenTimesCount = CArrayLength(MotorOpenTimes); // do not edit