Changeset 2cd18e3 in buchla-emu
- Timestamp:
- 02/25/2018 03:01:24 PM (7 years ago)
- Branches:
- master
- Children:
- 25c3737
- Parents:
- 9ddbf3e
- Location:
- emu
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
emu/all.h
r9ddbf3e r2cd18e3 31 31 #include <SDL2/SDL_ttf.h> 32 32 33 // work around RtMidi's C++-isms33 // XXX - work around RtMidi's C++-isms; remove when fixed in RtMidi 34 34 35 35 #pragma GCC diagnostic push … … 76 76 extern const char *font; 77 77 78 extern int32_t mid_port;78 extern uint32_t mid_port; 79 79 80 80 extern SDL_atomic_t run; -
emu/main.c
r9ddbf3e r2cd18e3 43 43 const char *font = "ttf/vera-sans-mono.ttf"; 44 44 45 int32_t mid_port = -1;45 uint32_t mid_port = 0; 46 46 47 47 SDL_atomic_t run; … … 160 160 } 161 161 162 mid_port = ( int32_t)tmp;162 mid_port = (uint32_t)tmp; 163 163 continue; 164 164 } -
emu/mid.c
r9ddbf3e r2cd18e3 103 103 (void)data; 104 104 105 // XXX - remove length calculation once RtMidi passes the length 106 105 107 int32_t len; 106 108 … … 165 167 ver("mid init"); 166 168 167 if (mid_port < 0) {168 ver("no MIDI requested");169 return;170 }171 172 169 mid_in = rtmidi_in_create_default(); 170 mid_in->data = NULL; // XXX - remove initialization once it's added to RtMidi 173 171 174 172 if (!mid_in->ok) { … … 176 174 } 177 175 178 int32_t n_ports = (int32_t)rtmidi_get_port_count(mid_in);176 uint32_t n_ports = rtmidi_get_port_count(mid_in); 179 177 180 178 if (n_ports == 0) { … … 186 184 187 185 if (mid_port >= n_ports) { 188 fail("invalid MIDI port % d selected (%davailable)", mid_port, n_ports);189 } 190 191 const char *name = rtmidi_get_port_name(mid_in, (uint32_t)mid_port);192 rtmidi_open_port(mid_in, (uint32_t)mid_port, name);186 fail("invalid MIDI port %u selected (%u available)", mid_port, n_ports); 187 } 188 189 const char *name = rtmidi_get_port_name(mid_in, mid_port); 190 rtmidi_open_port(mid_in, mid_port, name); 193 191 194 192 if (!mid_in->ok) { 195 fail("error while opening MIDI port % d(%s): %s", mid_port, name, mid_in->msg);196 } 197 198 inf("using MIDI port % d(%s)", mid_port, name);193 fail("error while opening MIDI port %u (%s): %s", mid_port, name, mid_in->msg); 194 } 195 196 inf("using MIDI port %u (%s)", mid_port, name); 199 197 200 198 rtmidi_in_set_callback(mid_in, callback, mid_in->data); … … 294 292 { 295 293 mid_in = rtmidi_in_create_default(); 294 mid_in->data = NULL; // XXX - remove initialization once it's added to RtMidi 296 295 297 296 if (!mid_in->ok) {
Note:
See TracChangeset
for help on using the changeset viewer.