comparison include/Midi.h @ 199:b128e3ea84ff

Fixed midi docs, implentation and example
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 05 Feb 2016 06:49:33 +0000
parents 265a527f8be8
children 869f5e703844
comparison
equal deleted inserted replaced
198:62f6269f4b3e 199:b128e3ea84ff
145 return num; 145 return num;
146 } 146 }
147 /** 147 /**
148 * Get the oldest channel message in the buffer. 148 * Get the oldest channel message in the buffer.
149 * 149 *
150 * You should not call this function when numAvailableMessages() returns 0. 150 * If this method is called when numAvailableMessages()==0, then
151 * a message with all fields set to zero is returned.
151 * @param type the type of the message to retrieve 152 * @param type the type of the message to retrieve
152 * @return a copy of the oldest message of the give type in the buffer 153 * @return a copy of the oldest message of the give type in the buffer
153 */ 154 */
154 MidiChannelMessage getNextChannelMessage(/*MidiMessageType type*/){ 155 MidiChannelMessage getNextChannelMessage(/*MidiMessageType type*/){
155 MidiChannelMessage message; 156 MidiChannelMessage message;
185 Midi(); 186 Midi();
186 187
187 /** 188 /**
188 * Enable the input MidiParser. 189 * Enable the input MidiParser.
189 * 190 *
190 * If the parser is enabled, readFrom() will return an error code. 191 * If the parser is enabled, getInput() will return an error code.
191 * Midi messages should instead be retrieved via, e.g.: getMidiParser()->getNextChannelMessage(); 192 * Midi messages should instead be retrieved via, e.g.: getMidiParser()->getNextChannelMessage();
192 * 193 *
193 * @param enable true to enable the input MidiParser, false to disable it. 194 * @param enable true to enable the input MidiParser, false to disable it.
194 */ 195 */
195 void enableParser(bool enable); 196 void enableParser(bool enable);
245 static void midiInputLoop(); 246 static void midiInputLoop();
246 static void midiOutputLoop(); 247 static void midiOutputLoop();
247 static bool staticConstructed; 248 static bool staticConstructed;
248 static void staticConstructor(); 249 static void staticConstructor();
249 private: 250 private:
251 int _getInput();
250 void readInputLoop(); 252 void readInputLoop();
251 void writeOutputLoop(); 253 void writeOutputLoop();
252 int outputPort; 254 int outputPort;
253 int inputPort; 255 int inputPort;
254 std::vector<midi_byte_t> inputBytes; 256 std::vector<midi_byte_t> inputBytes;