fix: correct compilation errors in gui.c
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
9
gui.c
9
gui.c
@@ -4,6 +4,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <jack/jack.h>
|
#include <jack/jack.h>
|
||||||
#include <ncurses.h>
|
#include <ncurses.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
|
||||||
@@ -81,12 +82,12 @@ static void gui_update(void)
|
|||||||
/* BPM slider */
|
/* BPM slider */
|
||||||
mu_layout_row(ctx, 2, (int[]) { 60, -1 }, 0);
|
mu_layout_row(ctx, 2, (int[]) { 60, -1 }, 0);
|
||||||
mu_label(ctx, "BPM:");
|
mu_label(ctx, "BPM:");
|
||||||
mu_slider(ctx, &bpm, 20.0f, 300.0f, 0, "%.0f", 0);
|
mu_slider_ex(ctx, &bpm, 20.0f, 300.0f, 0, "%.0f", 0);
|
||||||
|
|
||||||
/* loop length */
|
/* loop length */
|
||||||
mu_layout_row(ctx, 2, (int[]) { 60, -1 }, 0);
|
mu_layout_row(ctx, 2, (int[]) { 60, -1 }, 0);
|
||||||
mu_label(ctx, "Length:");
|
mu_label(ctx, "Length:");
|
||||||
mu_slider(ctx, (float*)&loop_length, 1.0f, 64.0f, 0, "%.0f", 0);
|
mu_slider_ex(ctx, (float*)&loop_length, 1.0f, 64.0f, 0, "%.0f", 0);
|
||||||
|
|
||||||
/* beat indicator */
|
/* beat indicator */
|
||||||
mu_layout_row(ctx, 1, (int[]) { -1 }, 0);
|
mu_layout_row(ctx, 1, (int[]) { -1 }, 0);
|
||||||
@@ -174,7 +175,7 @@ int gui_main(Engine *engine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* update engine state */
|
/* update engine state */
|
||||||
current_beat = engine_get_current_beat(g_engine);
|
current_beat = g_engine->transport.bar_position * 4 + g_engine->transport.beat_position;
|
||||||
|
|
||||||
/* render GUI */
|
/* render GUI */
|
||||||
gui_update();
|
gui_update();
|
||||||
@@ -184,7 +185,7 @@ int gui_main(Engine *engine)
|
|||||||
while (mu_next_command(ctx, &cmd)) {
|
while (mu_next_command(ctx, &cmd)) {
|
||||||
if (cmd->type == MU_COMMAND_TEXT) {
|
if (cmd->type == MU_COMMAND_TEXT) {
|
||||||
mvprintw(cmd->text.pos.y / 18, cmd->text.pos.x / 8, "%.*s",
|
mvprintw(cmd->text.pos.y / 18, cmd->text.pos.x / 8, "%.*s",
|
||||||
cmd->text.len, cmd->text.text);
|
(int)strlen(cmd->text.str), cmd->text.str);
|
||||||
}
|
}
|
||||||
if (cmd->type == MU_COMMAND_RECT) {
|
if (cmd->type == MU_COMMAND_RECT) {
|
||||||
/* simple rectangle rendering using ncurses */
|
/* simple rectangle rendering using ncurses */
|
||||||
|
|||||||
Reference in New Issue
Block a user