Jamoma API  0.6.0.a19
MIDIParserTo.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularMIDI
4  *
5  * @brief edit bytes from /channel.N/command.M #TTAddress and a #TTValue
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_TO_H__
17 #define __MIDI_PARSER_TO_H__
18 
19 #include "MIDIInclude.h"
20 #include "MIDI.h"
21 
22 class MIDIParserTo
23 {
24 
25  TTBoolean sysex; ///< a flag raised when sysex message are detected
26  TTUInt32 index; ///< the index of the element to encode (useful for sysex parsing)
27 
28 public:
29 
30  TTUInt8 statusByte; ///< the parsed status byte
31  TTUInt8 dataByte1; ///< the parsed first data byte
32  TTUInt8 dataByte2; ///< the parsed second data byte
33 
34  /** Constructor */
35  MIDIParserTo();
36 
37  /** Destructor */
38  virtual ~MIDIParserTo();
39 
40  /** Parse status byte, first data byte and second data byte
41  @param statusByte #TTUInt8 status byte
42  @param statusByte #TTUInt8 first data byte
43  @param statusByte #TTUInt8 second data byte
44  @return #TTBoolean YES when the parsing is done (none sysex case), NO when the parsing is not done (sysex case) */
45  TTBoolean parse(TTAddress& address, const TTValue& value);
46 };
47 typedef MIDIParserTo* MIDIParserToPtr;
48 
49 #endif // __MIDI_PARSER_TO_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
std::uint32_t TTUInt32
32 bit unsigned integer
Definition: TTBase.h:178
Includes and definitions for the MIDI protocol for Jamoma Modular.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
unsigned char TTUInt8
8 bit unsigned integer (char)
Definition: TTBase.h:174