Metronome fix

do not call now() multiple times to avoid time difference between calls.
This commit is contained in:
Bruno Herbelin
2022-03-13 23:13:32 +01:00
parent 0b12c5a169
commit e0676c66a0
2 changed files with 26 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
/*
/*
* This file is part of vimix - video live mixer
*
* **Copyright** (C) 2019-2022 Bruno Herbelin <bruno.herbelin@gmail.com>
@@ -403,7 +403,6 @@ bool Control::init()
void Control::update()
{
// read joystick buttons
int num_buttons = 0;
const unsigned char *state_buttons = glfwGetJoystickButtons(GLFW_JOYSTICK_1, &num_buttons );
@@ -438,6 +437,21 @@ void Control::update()
}
}
// draft : react to metronome
// int p = (int) Metronome::manager().phase();
// static bool bip = false;
// static int t = 2;
// if (!bip) {
// if (p + 1 == t){
// g_print("bip");
// bip = true;
// }
// }
// else {
// if (p + 1 != t){
// bip = false;
// }
// }
}
void Control::listen()
@@ -943,7 +957,7 @@ std::string Control::inputLabel(uint id)
}
else if ( id >= INPUT_CUSTOM_FIRST && id <= INPUT_CUSTOM_LAST )
{
label = std::string( "Custom ") + std::to_string(id - INPUT_CUSTOM_FIRST);
}
return label;