Jamoma API  0.6.0.a19
MIDIOutput.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularMIDI
4  *
5  * @brief bind to an external device destination
6  *
7  * @details MidiOutput sends messages to one external device. @n
8  * It is a wrapper around the PortMidi library. @n
9  *
10  * @author Theo Delahogue
11  *
12  * @copyright © 2014, GMEA (http://www.gmea.net) @n
13  * This code is licensed under the terms of the "New BSD License" @n
14  * http://creativecommons.org/licenses/BSD/
15  */
16 
17 #ifndef __MIDI_OUTPUT_H__
18 #define __MIDI_OUTPUT_H__
19 
20 #include "MIDIInclude.h"
21 #include "MIDI.h"
22 #include "MIDIParserTo.h"
23 
24 class MIDI;
25 typedef MIDI* MIDIPtr;
26 
27 class MIDIOutput
28 {
29  MIDIPtr mProtocol; ///< The MIDI protocol object which manages all MIDI communications
30 
31  PortMidiStream* mStream; ///< a descriptor for a MIDI device that is opened when the device is set
32  TTBoolean mRunning; ///< should the output send messages ?
33 
34 public:
35 
36  TTSymbol mApplication; ///< the application name this device handles
37  TTSymbol mName; ///< selected existing output name
38 
39  /** Constructor
40  @param protocol #MIDI protocol object pointer
41  @param application #TTSymbol application name to handle */
42  MIDIOutput(MIDIPtr protocol, TTSymbol& application);
43 
44  /** Destructor */
45  virtual ~MIDIOutput();
46 
47  /** Set device name
48  @param newName #TTSymbol for the MIDI device name to select
49  @return #TTErr error code */
50  TTErr setName(TTSymbol& newName);
51 
52  /** Set running state
53  @param running #TTBoolean to enable disable midi message sending
54  @return #TTErr error code */
55  TTErr setRunning(TTBoolean running);
56 
57  /** Send MIDI message using an address and a value
58  @param address #TTAddress like /channel.N/command.M
59  @param value #TTValue
60  @return #TTErr error code */
61  TTErr sendMessage(TTAddress& address, const TTValue& value);
62 };
63 typedef MIDIOutput* MIDIOutputPtr;
64 
65 #endif // __MIDI_OUTPUT_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 TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
the MIDI protocol for Jamoma Modular
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
edit bytes from /channel.N/command.M TTAddress and a TTValue
Includes and definitions for the MIDI protocol for Jamoma Modular.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34