From 792354e3713573a0b0afd0846fed6d1ad5056871 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Wed, 25 Sep 2019 06:09:00 +0200 Subject: [PATCH] Updated recorder to only send every 2nd frame, to clear the window when selecting a new effect, doubled the resizing factor and re-enabled gifsicle. --- include/recorder.h | 1 + src/recorder.cpp | 4 ++++ src/tools/generate_gifs.sh | 7 ++++--- src/tools/recorder.rb | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/recorder.h b/include/recorder.h index 37e14c3..d9f6d3d 100644 --- a/include/recorder.h +++ b/include/recorder.h @@ -14,6 +14,7 @@ private: size_t _buffer_len; char* _buffer; uint16_t _msgid; + boolean _skip_next_frame = false; public: Recorder(); void loop(); diff --git a/src/recorder.cpp b/src/recorder.cpp index cd886b7..8c03c7a 100644 --- a/src/recorder.cpp +++ b/src/recorder.cpp @@ -2,6 +2,7 @@ #include "my_fastled.h" #include "functions.h" #include "effects.h" +#include "Window.h" #include #ifdef RECORDER_ENABLE @@ -37,6 +38,7 @@ Recorder::Recorder() { } else if (*(char*)data == 'E') { String effect = String(((char*)(data+1))); LOGln("Recorder * Setting effect %s", effect.c_str()); + Window::getFullWindow()->clear(); change_current_effect(effect); } }, NULL); @@ -47,6 +49,8 @@ Recorder::Recorder() { void Recorder::loop() { if (_client && _client_port) { + _skip_next_frame = !_skip_next_frame; + if (_skip_next_frame == false) return; _buffer[0] = _msgid >> 8; _buffer[1] = _msgid & 0xFF; for (uint8_t y=0; y