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 InControl mNoteInControl; 00035 InControl mVelocityInControl; 00036 InControl mPitchBendInControl; 00037 InControl 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(); 00058 00059 MIDIKeyboard( ProcessingConfig& cfg ); 00060 00061 bool ConcreteConfigure( const ProcessingConfig& cfg ); 00062 00063 bool Do(); 00064 00065 ~MIDIKeyboard() {} 00066 00067 const ProcessingConfig& GetConfig() const { return mConfig; } 00068 00069 private: 00070 00071 bool ConfigureAndCheck( Processing& p, ProcessingConfig& cfg ); 00072 }; 00073 00074 } // namespace CLAM 00075 00076 00077 #endif 00078