diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-12 18:20:45 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-12 18:20:45 +0200 |
| commit | 11016b0c2094cbc9918ab613dcf73aeaff9e6768 (patch) | |
| tree | 9abf2b75109052e242b3f0b2ea48b86345c79e8b | |
| parent | 39bd41ad4d4832d4022a99e3cfcc49409f8b2da6 (diff) | |
| download | ttdaw-11016b0c2094cbc9918ab613dcf73aeaff9e6768.tar.gz | |
Added some interface changes
| -rw-r--r-- | interface.c | 7 | ||||
| -rw-r--r-- | main.c | 8 | ||||
| -rw-r--r-- | midi.c | 5 |
3 files changed, 11 insertions, 9 deletions
diff --git a/interface.c b/interface.c index 1347ce2..867bd1e 100644 --- a/interface.c +++ b/interface.c @@ -56,7 +56,7 @@ void *interface(void *arg) { if (ret) { fprintf(stderr, "tb_init() failed with error code %d\n", ret); exit(1); - } + tb_set_input_mode(TB_INPUT_ESC | TB_INPUT_MOUSE); struct tb_event ev; @@ -64,9 +64,12 @@ void *interface(void *arg) { tb_clear(); tb_present(); + tb_set_cursor(0, tb_height()-1); + tb_hide_cursor(); + // Show currently selected soundfont. tb_printf(0, 0, TB_GREEN, 0, "Soundfont: %s", args->soundfont_file); - tb_printf(0, 1, TB_GREEN, 0, "Preset: %s", args->soundfont_preset); + tb_printf(0, 1, TB_GREEN, 0, "Preset: %d", args->soundfont_preset); tb_present(); // Draw interface. @@ -85,10 +85,10 @@ int main(int argc, char *argv[]) { return 1; } - /* fprintf(stdout, "> Device port: %s\n", port_name); */ - /* fprintf(stdout, "> Soundfont: %s\n", soundfont_file); */ - /* fprintf(stdout, "> SF preset: %d\n", soundfont_preset); */ - /* fprintf(stdout, "> Song name: %s\n", new_song_name); */ + fprintf(stdout, "> Device port: %s\n", port_name); + fprintf(stdout, "> Soundfont: %s\n", soundfont_file); + fprintf(stdout, "> SF preset: %d\n", soundfont_preset); + fprintf(stdout, "> Song name: %s\n", new_song_name); // Create mutex. initialize_mutex(); @@ -60,7 +60,6 @@ void *midi(void *arg) { exit(1); } - // Reading MIDI device. struct pollfd *pfds; size_t npfds; @@ -88,8 +87,8 @@ void *midi(void *arg) { shared_data.note = ev->data.note.note; shared_data.state = 1; shared_data.velocity = ev->data.note.velocity; - tb_printf(0, 3, TB_CYAN, 0, "Note: %3d", ev->data.note.note); - tb_printf(0, 4, TB_CYAN, 0, "Velocity: %3d", ev->data.note.velocity); + tb_printf(0, 3, TB_CYAN, 0, "Note: %-3d", ev->data.note.note); + tb_printf(0, 4, TB_CYAN, 0, "Velocity: %-3d", ev->data.note.velocity); tb_present(); /* printf("%3d:%-3dNote on %2d, note %d, velocity: %3d\n", */ /* ev->source.client, ev->source.port, */ |
