Mercurial > hg > beaglert
comparison core/Midi.cpp @ 228:a0a7f00cf98d mergingClockSync
Fixed midi-heavy: stray [spigot]
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Fri, 08 Apr 2016 22:26:44 +0100 |
parents | af1e662400fc |
children | e4392164b458 |
comparison
equal
deleted
inserted
replaced
227:97f5219429b3 | 228:a0a7f00cf98d |
---|---|
171 } | 171 } |
172 int Midi::readFrom(int port){ | 172 int Midi::readFrom(int port){ |
173 objAddrs[kMidiInput].push_back(this); | 173 objAddrs[kMidiInput].push_back(this); |
174 inputPort = open("/dev/midi1", O_RDONLY | O_NONBLOCK | O_NOCTTY); | 174 inputPort = open("/dev/midi1", O_RDONLY | O_NONBLOCK | O_NOCTTY); |
175 if(inputPort < 0){ | 175 if(inputPort < 0){ |
176 printf("Error occurred while opening midi input port %d: %d", port, inputPort); | |
177 return -1; | 176 return -1; |
178 } else { | 177 } else { |
179 printf("Reading from port %d\n", port); | 178 printf("Reading from Midi port %d\n", port); |
180 BeagleRT_scheduleAuxiliaryTask(midiInputTask); | 179 BeagleRT_scheduleAuxiliaryTask(midiInputTask); |
181 return 1; | 180 return 1; |
182 } | 181 } |
183 } | 182 } |
184 | 183 |
185 int Midi::writeTo(int port){ | 184 int Midi::writeTo(int port){ |
186 objAddrs[kMidiOutput].push_back(this); | 185 objAddrs[kMidiOutput].push_back(this); |
187 outputPort = open("/dev/midi1", O_WRONLY, 0); | 186 outputPort = open("/dev/midi1", O_WRONLY, 0); |
188 if(outputPort < 0){ | 187 if(outputPort < 0){ |
189 printf("Error occurred while opening midi output port %d: %d", port, outputPort); | |
190 return -1; | 188 return -1; |
191 } else { | 189 } else { |
192 printf("Writing to Midi port %d\n", port); | 190 printf("Writing to Midi port %d\n", port); |
193 BeagleRT_scheduleAuxiliaryTask(midiOutputTask); | 191 BeagleRT_scheduleAuxiliaryTask(midiOutputTask); |
194 return 1; | 192 return 1; |