Browse Source

Change to use oso strings for osc hostname/port

master
cancel 5 years ago
parent
commit
2ebfe03d0d
  1. 12
      tui_main.c

12
tui_main.c

@ -2548,7 +2548,7 @@ void print_loading_message(char const *s) {
typedef struct { typedef struct {
Ged ged; Ged ged;
oso *file_name; oso *file_name;
char const *osc_hostname, *osc_port; oso *osc_hostname, *osc_port;
int undo_history_limit; int undo_history_limit;
int softmargin_y, softmargin_x; int softmargin_y, softmargin_x;
int hardmargin_y, hardmargin_x; int hardmargin_y, hardmargin_x;
@ -2816,10 +2816,10 @@ int main(int argc, char **argv) {
break; break;
} }
case Argopt_osc_server: case Argopt_osc_server:
t.osc_hostname = optarg; osoput(&t.osc_hostname, optarg);
break; break;
case Argopt_osc_port: case Argopt_osc_port:
t.osc_port = optarg; osoput(&t.osc_port, optarg);
break; break;
case Argopt_osc_midi_bidule: case Argopt_osc_midi_bidule:
midi_mode_deinit(&t.midi_mode); midi_mode_deinit(&t.midi_mode);
@ -2868,8 +2868,8 @@ int main(int argc, char **argv) {
ged_deinit(&t.ged); ged_deinit(&t.ged);
exit(1); exit(1);
} }
if (t.osc_port != NULL) { if (t.osc_port) {
if (!ged_set_osc_udp(&t.ged, t.osc_hostname, t.osc_port)) { if (!ged_set_osc_udp(&t.ged, osoc(t.osc_hostname), osoc(t.osc_port))) {
fprintf(stderr, "Failed to set up OSC networking\n"); fprintf(stderr, "Failed to set up OSC networking\n");
ged_deinit(&t.ged); ged_deinit(&t.ged);
exit(1); exit(1);
@ -3828,6 +3828,8 @@ quit:
endwin(); endwin();
ged_deinit(&t.ged); ged_deinit(&t.ged);
osofree(t.file_name); osofree(t.file_name);
osofree(t.osc_hostname);
osofree(t.osc_port);
midi_mode_deinit(&t.midi_mode); midi_mode_deinit(&t.midi_mode);
#ifdef FEAT_PORTMIDI #ifdef FEAT_PORTMIDI
if (portmidi_is_initialized) if (portmidi_is_initialized)

Loading…
Cancel
Save