|
diff --git a/interface.c b/interface.c
|
| ... |
| 56 |
if (ret) { |
56 |
if (ret) { |
| 57 |
fprintf(stderr, "tb_init() failed with error code %d\n", ret); |
57 |
fprintf(stderr, "tb_init() failed with error code %d\n", ret); |
| 58 |
exit(1); |
58 |
exit(1); |
| 59 |
} |
59 |
|
| 60 |
|
60 |
|
| 61 |
tb_set_input_mode(TB_INPUT_ESC | TB_INPUT_MOUSE); |
61 |
tb_set_input_mode(TB_INPUT_ESC | TB_INPUT_MOUSE); |
| 62 |
struct tb_event ev; |
62 |
struct tb_event ev; |
| ... |
| 64 |
tb_clear(); |
64 |
tb_clear(); |
| 65 |
tb_present(); |
65 |
tb_present(); |
| 66 |
|
66 |
|
|
|
67 |
tb_set_cursor(0, tb_height()-1); |
|
|
68 |
tb_hide_cursor(); |
|
|
69 |
|
| 67 |
// Show currently selected soundfont. |
70 |
// Show currently selected soundfont. |
| 68 |
tb_printf(0, 0, TB_GREEN, 0, "Soundfont: %s", args->soundfont_file); |
71 |
tb_printf(0, 0, TB_GREEN, 0, "Soundfont: %s", args->soundfont_file); |
| 69 |
tb_printf(0, 1, TB_GREEN, 0, "Preset: %s", args->soundfont_preset); |
72 |
tb_printf(0, 1, TB_GREEN, 0, "Preset: %d", args->soundfont_preset); |
| 70 |
tb_present(); |
73 |
tb_present(); |
| 71 |
|
74 |
|
| 72 |
// Draw interface. |
75 |
// Draw interface. |
| ... |
|
diff --git a/main.c b/main.c
|
| ... |
| 85 |
return 1; |
85 |
return 1; |
| 86 |
} |
86 |
} |
| 87 |
|
87 |
|
| 88 |
/* fprintf(stdout, "> Device port: %s\n", port_name); */ |
88 |
fprintf(stdout, "> Device port: %s\n", port_name); |
| 89 |
/* fprintf(stdout, "> Soundfont: %s\n", soundfont_file); */ |
89 |
fprintf(stdout, "> Soundfont: %s\n", soundfont_file); |
| 90 |
/* fprintf(stdout, "> SF preset: %d\n", soundfont_preset); */ |
90 |
fprintf(stdout, "> SF preset: %d\n", soundfont_preset); |
| 91 |
/* fprintf(stdout, "> Song name: %s\n", new_song_name); */ |
91 |
fprintf(stdout, "> Song name: %s\n", new_song_name); |
| 92 |
|
92 |
|
| 93 |
// Create mutex. |
93 |
// Create mutex. |
| 94 |
initialize_mutex(); |
94 |
initialize_mutex(); |
| ... |
|
diff --git a/midi.c b/midi.c
|
| ... |
| 60 |
exit(1); |
60 |
exit(1); |
| 61 |
} |
61 |
} |
| 62 |
|
62 |
|
| 63 |
|
|
|
| 64 |
// Reading MIDI device. |
63 |
// Reading MIDI device. |
| 65 |
struct pollfd *pfds; |
64 |
struct pollfd *pfds; |
| 66 |
size_t npfds; |
65 |
size_t npfds; |
| ... |
| 88 |
shared_data.note = ev->data.note.note; |
87 |
shared_data.note = ev->data.note.note; |
| 89 |
shared_data.state = 1; |
88 |
shared_data.state = 1; |
| 90 |
shared_data.velocity = ev->data.note.velocity; |
89 |
shared_data.velocity = ev->data.note.velocity; |
| 91 |
tb_printf(0, 3, TB_CYAN, 0, "Note: %3d", ev->data.note.note); |
90 |
tb_printf(0, 3, TB_CYAN, 0, "Note: %-3d", ev->data.note.note); |
| 92 |
tb_printf(0, 4, TB_CYAN, 0, "Velocity: %3d", ev->data.note.velocity); |
91 |
tb_printf(0, 4, TB_CYAN, 0, "Velocity: %-3d", ev->data.note.velocity); |
| 93 |
tb_present(); |
92 |
tb_present(); |
| 94 |
/* printf("%3d:%-3dNote on %2d, note %d, velocity: %3d\n", */ |
93 |
/* printf("%3d:%-3dNote on %2d, note %d, velocity: %3d\n", */ |
| 95 |
/* ev->source.client, ev->source.port, */ |
94 |
/* ev->source.client, ev->source.port, */ |
| ... |