Fix for exiting voice mode and resuming other animations

This commit is contained in:
PS 2021-04-26 14:17:41 -10:00
parent f809d670fb
commit 9ebadc543b
2 changed files with 8 additions and 9 deletions

View File

@ -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;
}
}

View File

@ -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