00001 /********************************************************************** 00002 *< 00003 FILE: mcapdev.h 00004 00005 DESCRIPTION: Motion capture device plug-in interface 00006 00007 CREATED BY: Rolf Berteig 00008 00009 HISTORY: May 01, 1997 00010 00011 *> Copyright (c) 1997, All Rights Reserved. 00012 **********************************************************************/ 00013 00014 #pragma once 00015 #include "maxheap.h" 00016 #include "control.h" 00017 00018 class IMCParamDlg; 00019 class MCDeviceBinding; 00020 class IRollupWindow; 00021 00022 // Motion capture controller class IDs 00023 #define POS_MOTION_CLASS_ID 0xff8826de 00024 #define ROT_MOTION_CLASS_ID 0xff7826df 00025 #define SCALE_MOTION_CLASS_ID 0xff6826da 00026 #define FLOAT_MOTION_CLASS_ID 0xff5826db 00027 #define POINT3_MOTION_CLASS_ID 0xff4826dc 00028 00029 // If a controller has one of the above class IDs, then it 00030 // can be cast into this class. 00043 class IMCControl : public Control { 00044 public: 00048 virtual BOOL IsLiveOn()=0; 00052 virtual BOOL IsRecordOn()=0; 00054 virtual int NumDeviceBindings()=0; 00059 virtual MCDeviceBinding *GetDeviceBinding(int i)=0; 00066 virtual void SetDeviceBinding(int i,MCDeviceBinding *b)=0; 00089 virtual void GetValueLive(TimeValue t,void *val, GetSetMethod method)=0; 00090 }; 00091 00098 class IMCapManager: public MaxHeapOperators { 00099 public: 00101 virtual void MidiNote(int channel, int note)=0; 00109 virtual TimeValue GetTime()=0; 00110 }; 00111 00112 #pragma warning(push) 00113 #pragma warning(disable:4100) 00114 00115 // Base class for an input device 00135 class MCInputDevice: public MaxHeapOperators { 00136 public: 00138 virtual ~MCInputDevice() {} 00140 virtual MSTR DeviceName()=0; 00145 virtual MCDeviceBinding *CreateBinding()=0; 00152 virtual void UtilityStarted(IMCapManager *im) {} 00159 virtual void UtilityStopped(IMCapManager *im) {} 00182 virtual void Cycle(UINT tick) {} 00183 00184 }; 00185 00186 // An instance of this class is created when a motion caprture controller 00187 // binds one of its parameters to a device. The main purpose of this 00188 // class is to store any parameters that describe the binding. 00194 class MCDeviceBinding : public ReferenceTarget { 00195 public: 00197 virtual ~MCDeviceBinding() {} 00199 virtual MCInputDevice *GetDevice()=0; 00201 virtual MSTR BindingName()=0; 00211 virtual float Eval(TimeValue t)=0; 00213 virtual void DeleteThis()=0; 00224 virtual void AddRollup(IMCParamDlg *dlg)=0; 00232 virtual void UpdateRollup(IRollupWindow *iRoll)=0; 00240 virtual void BeginActivate(BOOL reset=TRUE) {} 00244 virtual void EndActivate() {} 00277 virtual void Accumulate(TimeValue t) {} 00278 00279 SClass_ID SuperClassID() {return MOT_CAP_DEVBINDING_CLASS_ID;} 00280 RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, 00281 PartID& partID, RefMessage message) {return REF_SUCCEED;} 00282 00283 }; 00284 #pragma warning(pop) 00285 00295 class IMCParamDlg : public ReferenceMaker { 00296 public: 00297 MCDeviceBinding *binding; 00298 IRollupWindow *iRoll; 00299 }; 00300 00301 00302 00303