From a8629e9e4b8a78c4c7c13cd6e457c49635cf4f4a Mon Sep 17 00:00:00 2001 From: Gauthier Date: Sun, 20 Mar 2022 16:05:09 +0100 Subject: [PATCH] debug --- src/voicemachine_configApp.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/voicemachine_configApp.cpp b/src/voicemachine_configApp.cpp index 87f7c74..a1c5dd0 100644 --- a/src/voicemachine_configApp.cpp +++ b/src/voicemachine_configApp.cpp @@ -63,7 +63,7 @@ struct VoiceData { ImGui::ColorEdit4( "Text Color", &_color_sel[0]); ImGui::SliderInt("Text Size", &_font_size_drag, 10, 200 ); ImGui::Combo("Font", &_font_name_sel_index, _fonts_char->data(), _fonts_char->size()); - ImGui::SliderFloat("Temperature", &_temp_sel, TEMP_MIN, TEMP_MAX ); + ImGui::SliderFloat("Temperature", &_temp_sel, TEMP_MIN, TEMP_MAX, "%0.2f"); if (ImGui::Button("Save")){ osc::Message m("/command"); @@ -174,6 +174,8 @@ class VoiceMachineClientApp : public App { std::shared_ptr _sender_machinespeak; std::atomic_bool _connected; + bool _DEBUG; + std::map _map_voices; }; @@ -249,8 +251,6 @@ void VoiceMachineClientApp::setup() { std::cout << ">" << f << "<" << std::endl; } - - for(const auto& [n, v]: _map_voices) v->setup(_sender_voicemachine,_sender_machinespeak, std::bind(&VoiceMachineClientApp::onSendError, this, std::placeholders::_1), &_connected, &_fonts_char); @@ -262,6 +262,20 @@ void VoiceMachineClientApp::update() { for(const auto& [n, v]: _map_voices) v->update(); + + static bool debug = false; + + ImGui::ScopedWindow window("DEBUG"); + ImGui::Checkbox("DEBUG?", &debug); + if(debug != _DEBUG){ + _DEBUG = debug; + osc::Message m("/command"); + m.append("DEBUG"); + m.append(_DEBUG); + _sender_voicemachine->send(m, std::bind(&VoiceMachineClientApp::onSendError, this, std::placeholders::_1)); + _sender_machinespeak->send(m, std::bind(&VoiceMachineClientApp::onSendError, this, std::placeholders::_1)); + + } } void VoiceMachineClientApp::draw()