History

Cleanup

cancel committed 6 years ago

Commit 0ee76d01 parent 08f1d651 file · +17 −18Browse files

Unified · Split

tui_main.c+17−18
@@ -1055,7 +1055,7 @@ staticni void apply_time_to_sustained_notes(Oosc_dev *oosc_dev, · 1054 unmodified lines
1055 }1055 }
1056}1056}
1057 1057
1058void ged_stop_all_sustained_notes(Ged *a) {1058staticni void ged_stop_all_sustained_notes(Ged *a) {
1059 Susnote_list *sl = &a->susnote_list;1059 Susnote_list *sl = &a->susnote_list;
1060 send_midi_note_offs(a->oosc_dev, &a->midi_mode, sl->buffer,1060 send_midi_note_offs(a->oosc_dev, &a->midi_mode, sl->buffer,
1061 sl->buffer + sl->count);1061 sl->buffer + sl->count);
@@ -1070,9 +1070,9 @@ void ged_stop_all_sustained_notes(Ged *a) { · 8 unmodified lines
1070// seems redundant/weird", that's because it is, not because there's a good1070// seems redundant/weird", that's because it is, not because there's a good
1071// reason.1071// reason.
1072 1072
1073void send_output_events(Oosc_dev *oosc_dev, Midi_mode *midi_mode, Usz bpm,1073staticni void send_output_events(Oosc_dev *oosc_dev, Midi_mode *midi_mode,
1074 Susnote_list *susnote_list, Oevent const *events,1074 Usz bpm, Susnote_list *susnote_list,
1075 Usz count) {1075 Oevent const *events, Usz count) {
1076 enum { Midi_on_capacity = 512 };1076 enum { Midi_on_capacity = 512 };
1077 typedef struct {1077 typedef struct {
1078 U8 channel;1078 U8 channel;
@@ -1213,7 +1213,7 @@ do_note_ons: · 134 unmodified lines
1213 }1213 }
1214}1214}
1215 1215
1216void ged_clear_osc_udp(Ged *a) {1216staticni void ged_clear_osc_udp(Ged *a) {
1217 if (a->oosc_dev) {1217 if (a->oosc_dev) {
1218 if (a->midi_mode.any.type == Midi_mode_type_osc_bidule) {1218 if (a->midi_mode.any.type == Midi_mode_type_osc_bidule) {
1219 ged_stop_all_sustained_notes(a);1219 ged_stop_all_sustained_notes(a);
@@ -1222,8 +1222,9 @@ void ged_clear_osc_udp(Ged *a) { · 2 unmodified lines
1222 a->oosc_dev = NULL;1222 a->oosc_dev = NULL;
1223 }1223 }
1224}1224}
1225bool ged_is_using_osc_udp(Ged *a) { return (bool)a->oosc_dev; }1225static bool ged_is_using_osc_udp(Ged *a) { return (bool)a->oosc_dev; }
1226bool ged_set_osc_udp(Ged *a, char const *dest_addr, char const *dest_port) {1226static bool ged_set_osc_udp(Ged *a, char const *dest_addr,
1227 char const *dest_port) {
1227 ged_clear_osc_udp(a);1228 ged_clear_osc_udp(a);
1228 if (dest_port) {1229 if (dest_port) {
1229 Oosc_udp_create_error err =1230 Oosc_udp_create_error err =
@@ -1256,17 +1257,15 @@ static double ged_secs_to_deadline(Ged const *a) { · 26 unmodified lines
1256 return rem;1257 return rem;
1257}1258}
1258 1259
1259void ged_reset_clock(Ged *a) { a->clock = stm_now(); }1260staticni void clear_and_run_vm(Glyph *restrict gbuf, Mark *restrict mbuf,
1260 1261 Usz height, Usz width, Usz tick_number,
1261void clear_and_run_vm(Glyph *restrict gbuf, Mark *restrict mbuf, Usz height,1262 Oevent_list *oevent_list, Usz random_seed) {
1262 Usz width, Usz tick_number, Oevent_list *oevent_list,
1263 Usz random_seed) {
1264 mbuffer_clear(mbuf, height, width);1263 mbuffer_clear(mbuf, height, width);
1265 oevent_list_clear(oevent_list);1264 oevent_list_clear(oevent_list);
1266 orca_run(gbuf, mbuf, height, width, tick_number, oevent_list, random_seed);1265 orca_run(gbuf, mbuf, height, width, tick_number, oevent_list, random_seed);
1267}1266}
1268 1267
1269void ged_do_stuff(Ged *a) {1268staticni void ged_do_stuff(Ged *a) {
1270 if (!a->is_playing)1269 if (!a->is_playing)
1271 return;1270 return;
1272 double secs_span = 60.0 / (double)a->bpm / 4.0;1271 double secs_span = 60.0 / (double)a->bpm / 4.0;
@@ -1341,9 +1340,9 @@ static inline Isz isz_clamp(Isz x, Isz low, Isz high) { · 68 unmodified lines
1341}1340}
1342 1341
1343// todo cleanup to use proper unsigned/signed w/ overflow check1342// todo cleanup to use proper unsigned/signed w/ overflow check
1344Isz scroll_offset_on_axis_for_cursor_pos(Isz win_len, Isz cont_len,1343staticni Isz scroll_offset_on_axis_for_cursor_pos(Isz win_len, Isz cont_len,
1345 Isz cursor_pos, Isz pad,1344 Isz cursor_pos, Isz pad,
1346 Isz cur_scroll) {1345 Isz cur_scroll) {
1347 if (win_len <= 0 || cont_len <= 0)1346 if (win_len <= 0 || cont_len <= 0)
1348 return 0;1347 return 0;
1349 if (cont_len <= win_len)1348 if (cont_len <= win_len)
@@ -1363,7 +1362,7 @@ Isz scroll_offset_on_axis_for_cursor_pos(Isz win_len, Isz cont_len, · 13 unmodified lines
1363 return isz_clamp(new_scroll, 0, cont_len - win_len);1362 return isz_clamp(new_scroll, 0, cont_len - win_len);
1364}1363}
1365 1364
1366void ged_make_cursor_visible(Ged *a) {1365staticni void ged_make_cursor_visible(Ged *a) {
1367 int grid_h = a->grid_h;1366 int grid_h = a->grid_h;
1368 int cur_scr_y = a->grid_scroll_y;1367 int cur_scr_y = a->grid_scroll_y;
1369 int cur_scr_x = a->grid_scroll_x;1368 int cur_scr_x = a->grid_scroll_x;
@@ -1380,7 +1379,7 @@ void ged_make_cursor_visible(Ged *a) { · 10 unmodified lines
1380 1379
1381enum { Hud_height = 2 };1380enum { Hud_height = 2 };
1382 1381
1383void ged_update_internal_geometry(Ged *a) {1382staticni void ged_update_internal_geometry(Ged *a) {
1384 int win_h = a->win_h;1383 int win_h = a->win_h;
1385 int softmargin_y = a->softmargin_y;1384 int softmargin_y = a->softmargin_y;
1386 bool show_hud = win_h > Hud_height + 1;1385 bool show_hud = win_h > Hud_height + 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t