Browse Source

Cleanup

master
cancel 5 years ago
parent
commit
82bd77c607
  1. 36
      tui_main.c

36
tui_main.c

@ -2509,6 +2509,8 @@ staticni void try_send_to_gui_clipboard(Ged const *a,
} }
} }
#define CONFOPT_STRING(x) #x,
#define CONFOPT_ENUM(x) Confopt_##x,
#define CONFOPTS(_) \ #define CONFOPTS(_) \
_(portmidi_output_device) \ _(portmidi_output_device) \
_(osc_output_address) \ _(osc_output_address) \
@ -2518,8 +2520,6 @@ staticni void try_send_to_gui_clipboard(Ged const *a,
_(margins) \ _(margins) \
_(grid_dot_type) \ _(grid_dot_type) \
_(grid_ruler_type) _(grid_ruler_type)
#define CONFOPT_STRING(x) #x,
#define CONFOPT_ENUM(x) Confopt_##x,
char const *const confopts[] = {CONFOPTS(CONFOPT_STRING)}; char const *const confopts[] = {CONFOPTS(CONFOPT_STRING)};
enum { Confoptslen = ORCA_ARRAY_COUNTOF(confopts) }; enum { Confoptslen = ORCA_ARRAY_COUNTOF(confopts) };
enum { CONFOPTS(CONFOPT_ENUM) }; enum { CONFOPTS(CONFOPT_ENUM) };
@ -2729,27 +2729,17 @@ staticni void tui_save_prefs(Tui *t) {
} }
#endif #endif
} }
// TODO ok, this is redundant now // Add all conf items touched by user that we want to write to config file.
if (t->prefs_touched & TOUCHFLAG(Confopt_osc_output_address)) // "Touched" items include conf items that were present on disk when we first
ezconf_w_addopt(&ez, confopts[Confopt_osc_output_address], // loaded the config file, plus the items that the user has modified by
Confopt_osc_output_address); // interacting with the menus.
if (t->prefs_touched & TOUCHFLAG(Confopt_osc_output_port)) for (int i = 0; i < Confoptslen; i++) {
ezconf_w_addopt(&ez, confopts[Confopt_osc_output_port], if (i == Confopt_portmidi_output_device)
Confopt_osc_output_port); // This has its own special logic
if (t->prefs_touched & TOUCHFLAG(Confopt_osc_output_enabled)) continue;
ezconf_w_addopt(&ez, confopts[Confopt_osc_output_enabled], if (t->prefs_touched & TOUCHFLAG(i))
Confopt_osc_output_enabled); ezconf_w_addopt(&ez, confopts[i], i);
if (t->prefs_touched & TOUCHFLAG(Confopt_midi_beat_clock)) }
ezconf_w_addopt(&ez, confopts[Confopt_midi_beat_clock],
Confopt_midi_beat_clock);
if (t->prefs_touched & TOUCHFLAG(Confopt_margins))
ezconf_w_addopt(&ez, confopts[Confopt_margins], Confopt_margins);
if (t->prefs_touched & TOUCHFLAG(Confopt_grid_dot_type))
ezconf_w_addopt(&ez, confopts[Confopt_grid_dot_type],
Confopt_grid_dot_type);
if (t->prefs_touched & TOUCHFLAG(Confopt_grid_ruler_type))
ezconf_w_addopt(&ez, confopts[Confopt_grid_ruler_type],
Confopt_grid_ruler_type);
while (ezconf_w_step(&ez)) { while (ezconf_w_step(&ez)) {
switch (ez.optid) { switch (ez.optid) {
case Confopt_osc_output_address: case Confopt_osc_output_address:

Loading…
Cancel
Save