00001 00008 #ifndef ICUBEXDEVICE_H 00009 #define ICUBEXDEVICE_H 00010 00011 #include <G3D/G3DAll.h> 00012 #include <iostream> 00013 using namespace std; 00014 00015 #include "Midi.H" 00016 #include "InputDevice.H" 00017 00018 00019 namespace VRG3D { 00020 00021 class ICubeXDevice : public InputDevice 00022 { 00023 public: 00024 00025 enum ICubeXMode { 00026 HOST_MODE = 0, 00027 STAND_ALONE_MODE = 1 00028 }; 00029 00071 ICubeXDevice(const std::string &activeChannels, unsigned int samplingInterval, 00072 int midiInDeviceNum, int midiOutDeviceNum, 00073 ICubeXMode mode=STAND_ALONE_MODE, bool debug=false); 00074 00075 static void printMidiDevices(); 00076 00077 virtual ~ICubeXDevice(); 00078 00079 void pollForInput(Array<EventRef> &events); 00080 00081 protected: 00082 00083 void init(); 00084 EventRef reportChannel(int channel, double data); 00085 00086 std::string _activeChannelsStr; 00087 Array<int> _activeChannels; 00088 unsigned int _samplingInterval; 00089 bool _debug; 00090 int _inDevNum; 00091 int _outDevNum; 00092 MidiInDevice *_in; 00093 MidiOutDevice *_out; 00094 double _channelData[32]; 00095 ICubeXMode _mode; 00096 }; 00097 00098 } // end namespace 00099 00100 #endif