diff --git a/interface.c b/interface.c index 1347ce2a7b3b932f8e36bc5ed69bcb9149826253..867bd1e7e698b8ba6206d662d7d31f00ae031ceb 100644 --- a/interface.c +++ b/interface.c @@ -56,7 +56,7 @@ ret = tb_init(); 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 @@ 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. diff --git a/main.c b/main.c index 61f01f2586325190ac96efd798bddad5f68c154d..fabe84f0cdd2d23bd0b705b5e41b5303bfeccd0f 100644 --- a/main.c +++ b/main.c @@ -85,10 +85,10 @@ fprintf(stdout, "Port, soundfile and preset are required fields.\n"); 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(); diff --git a/midi.c b/midi.c index 341df155512bba18e97121ecddceb2cac76ffaa4..e0ef9b5cd77318208bd413c10f835fcf55fb9fed 100644 --- a/midi.c +++ b/midi.c @@ -60,7 +60,6 @@ fprintf(stderr, "Set nonblock mode failed."); exit(1); } - // Reading MIDI device. struct pollfd *pfds; size_t npfds; @@ -88,8 +87,8 @@ case SND_SEQ_EVENT_NOTEON: 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, */