longer history

This commit is contained in:
Sebastien Bourdeauducq 2025-01-22 14:54:00 +08:00
parent bfb47715cc
commit 5daa4357a2

View File

@ -29,7 +29,7 @@ static std::atomic<bool> shutdown_threads;
static std::atomic<double> frequency[SND_PCHAN];
static std::atomic<double> amplitude[SND_PCHAN];
#define HIST_DEPTH 512
#define HIST_DEPTH 1024
static std::atomic<double> peak;
static std::atomic<bool> clipped;
@ -222,7 +222,7 @@ static void dsp_thread()
li_principal[j] = principal;
if(!li_hist_hold[j]) {
li_count[j]++;
if(li_count[j] == 200) {
if(li_count[j] == 600) {
li_count[j] = 0;
std::lock_guard<std::mutex> guard(li_hist_mutex);
std::memmove(&li_hist_mag[j][0], &li_hist_mag[j][1], (HIST_DEPTH-1)*sizeof(float));
@ -325,7 +325,7 @@ int main(int argc, char* argv[])
std::atexit(glfwTerminate);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
static GLFWwindow *window = glfwCreateWindow(1024, 1370, "Soundlocker", nullptr, nullptr);
static GLFWwindow *window = glfwCreateWindow(1300, 1370, "Soundlocker", nullptr, nullptr);
if(window == nullptr) {
std::cerr << "failed to create GLFW window\n";
return 1;