CLAM-Development  1.4.0
MIDIKeyboard.hxx
Go to the documentation of this file.
1 #ifndef _MIDIKeyboard_HXX_
2 #define _MIDIKeyboard_HXX_
3 
4 #include "OutControl.hxx"
6 #include "InControl.hxx"
7 #include "MIDIInControl.hxx"
8 #include "MIDIClocker.hxx"
9 #include "Processing.hxx"
10 #include "ProcessingConfig.hxx"
11 
12 namespace CLAM
13 {
14 
16 {
17  DYNAMIC_TYPE_USING_INTERFACE (MIDIKeyboardConfig, 1, ProcessingConfig);
18  DYN_ATTRIBUTE (0, public, std::string, MidiDevice);
19 
20  void DefaultInit(void);
21 };
22 
23 /* simple wrapper to provide quick and dirty access to MIDI devices in NetworkEditor */
24 class MIDIKeyboard : public Processing
25 {
26  MIDIKeyboardConfig mConfig;
27 
28  TControlData mCurrentTime;
29  TControlData mCurrentTimeIncrement;
30 
31  MIDIIOConfig mNoteInConfig;
32  MIDIInControl mNoteIn;
33 
34  FloatInControl mNoteInControl;
35  FloatInControl mVelocityInControl;
36  FloatInControl mPitchBendInControl;
37  FloatInControl mModulationInControl;
38 
39  MIDIIOConfig mPitchBendInConfig;
40  MIDIInControl mPitchBendIn;
41 
42  MIDIIOConfig mModulationConfig;
43  MIDIInControl mModulationIn;
44 
45  MIDIClockerConfig mClockerConfig;
46  MIDIClocker mClocker;
47 
48  OutControlPublisher mNoteOut;
49  OutControlPublisher mVelocityOut;
50  OutControlPublisher mPitchBendOut;
51  OutControlPublisher mModulationOut;
52 
53  public:
54 
55  const char* GetClassName() const { return "MIDIKeyboard"; }
56 
58 
59  bool ConcreteConfigure( const ProcessingConfig& cfg );
60 
61  bool Do();
62 
64 
65  const ProcessingConfig& GetConfig() const { return mConfig; }
66 
67  private:
68 
69  bool ConfigureAndCheck( Processing& p, ProcessingConfig& cfg );
70 };
71 
72 } // namespace CLAM
73 
74 
75 #endif
76