00001 #ifndef _MIDIKeyboard_HXX_ 00002 #define _MIDIKeyboard_HXX_ 00003 00004 #include "OutControl.hxx" 00005 #include "OutControlPublisher.hxx" 00006 #include "InControl.hxx" 00007 #include "MIDIInControl.hxx" 00008 #include "MIDIClocker.hxx" 00009 #include "Processing.hxx" 00010 #include "ProcessingConfig.hxx" 00011 00012 namespace CLAM 00013 { 00014 00015 class MIDIKeyboardConfig : public ProcessingConfig 00016 { 00017 DYNAMIC_TYPE_USING_INTERFACE (MIDIKeyboardConfig, 1, ProcessingConfig); 00018 DYN_ATTRIBUTE (0, public, std::string, MidiDevice); 00019 00020 void DefaultInit(void); 00021 }; 00022 00023 /* simple wrapper to provide quick and dirty access to MIDI devices in NetworkEditor */ 00024 class MIDIKeyboard : public Processing 00025 { 00026 MIDIKeyboardConfig mConfig; 00027 00028 TControlData mCurrentTime; 00029 TControlData mCurrentTimeIncrement; 00030 00031 MIDIIOConfig mNoteInConfig; 00032 MIDIInControl mNoteIn; 00033 00034 FloatInControl mNoteInControl; 00035 FloatInControl mVelocityInControl; 00036 FloatInControl mPitchBendInControl; 00037 FloatInControl mModulationInControl; 00038 00039 MIDIIOConfig mPitchBendInConfig; 00040 MIDIInControl mPitchBendIn; 00041 00042 MIDIIOConfig mModulationConfig; 00043 MIDIInControl mModulationIn; 00044 00045 MIDIClockerConfig mClockerConfig; 00046 MIDIClocker mClocker; 00047 00048 OutControlPublisher mNoteOut; 00049 OutControlPublisher mVelocityOut; 00050 OutControlPublisher mPitchBendOut; 00051 OutControlPublisher mModulationOut; 00052 00053 public: 00054 00055 const char* GetClassName() const { return "MIDIKeyboard"; } 00056 00057 MIDIKeyboard( const MIDIKeyboardConfig & cfg = MIDIKeyboardConfig() ); 00058 00059 bool ConcreteConfigure( const ProcessingConfig& cfg ); 00060 00061 bool Do(); 00062 00063 ~MIDIKeyboard() {} 00064 00065 const ProcessingConfig& GetConfig() const { return mConfig; } 00066 00067 private: 00068 00069 bool ConfigureAndCheck( Processing& p, ProcessingConfig& cfg ); 00070 }; 00071 00072 } // namespace CLAM 00073 00074 00075 #endif 00076