Jamoma API  0.6.0.a19
MIDIParserFrom.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularMIDI
4  *
5  * @brief edit /channel.N/command.M #TTAddress and a #TTValue from incoming bytes
6  *
7  * @details it handles sysex @n
8  *
9  * @author Theo Delahogue
10  *
11  * @copyright © 2014, GMEA (http://www.gmea.net) @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 #ifndef __MIDI_PARSER_FROM_H__
17 #define __MIDI_PARSER_FROM_H__
18 
19 #include "MIDIInclude.h"
20 #include "MIDI.h"
21 
22 class MIDIParserFrom
23 {
24 
25  TTBoolean sysex; ///< a flag raised when sysex message are detected
26 
27 public:
28 
29  TTAddress address; ///< the parsed address
30  TTValue value; ///< the parsed value
31 
32  /** Constructor */
33  MIDIParserFrom();
34 
35  /** Destructor */
36  virtual ~MIDIParserFrom();
37 
38  /** Parse status byte, first data byte and second data byte
39  @param statusByte #TTUInt8 status byte
40  @param statusByte #TTUInt8 first data byte
41  @param statusByte #TTUInt8 second data byte
42  @return #TTBoolean YES when the parsing is done (none sysex case), NO when the parsing needs more bytes (sysex case) */
43  TTBoolean parse(TTUInt8 statusByte, TTUInt8 dataByte1, TTUInt8 dataByte2);
44 
45  /** internal tool to put number into a string */
46  void editAddress(TTString format, TTUInt8 i, TTAddress& returnedAddress);
47 };
48 typedef MIDIParserFrom* MIDIParserFromPtr;
49 
50 #endif // __MIDI_PARSER_FROM_H__
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
The TTAddress class is used to represent a string and efficiently pass and compare that string...
Definition: TTAddress.h:29
the MIDI protocol for Jamoma Modular
Includes and definitions for the MIDI protocol for Jamoma Modular.
The TTString class is used to represent a string.
Definition: TTString.h:34
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
unsigned char TTUInt8
8 bit unsigned integer (char)
Definition: TTBase.h:174