mxskeys.h

Go to the documentation of this file.
00001 /*  
00002  *      MAXKeys.h - MAX controller keyframe access classes
00003  *
00004  *          Copyright (c) John Wainwright 1996
00005  *
00006  */
00007 
00008 #pragma once
00009 
00010 #include "..\kernel\value.h"
00011 #include "..\kernel\exceptions.h"
00012 
00013 // forward declaration
00014 class MAXControl;
00015 class IKey;
00016 class AnyKey;
00017 class IKeyControl;
00018 class ParamDimension;
00019 
00020 visible_class (MAXKeyArray)
00021 
00022 class MAXKeyArray : public Value
00023 {
00024 public:
00025     MAXControl*      controller;        /* the controller                           */
00026 
00027     ENABLE_STACK_ALLOCATE(MAXKeyArray);
00028     ScripterExport  MAXKeyArray(Control* icont, ParamDimension* idim);
00029 
00030                 classof_methods (MAXKeyArray, Value);
00031     BOOL        _is_collection() { return 1; }
00032     void        collect() { delete this; }
00033     void        gc_trace();
00034     ScripterExport void sprin1(CharStream* s);
00035 
00036     /* operations */
00037     
00038 #include "..\macros\define_implementations.h"
00039 #   include "..\protocols\arrays.inl"
00040     def_generic ( sortKeys,         "sortKeys");
00041     def_generic ( addNewKey,        "addNewKey");
00042     def_generic ( deleteKeys,       "deleteKeys");
00043     def_generic ( deleteKey,        "deleteKey");
00044 //  def_generic ( append_key,       "appendKey"); // RK: 6/19/02, Commenting these, breaks the SDK
00045 //  def_generic ( assign_key,       "assignKey"); // RK: 6/19/02, Commenting these, breaks the SDK
00046 
00047     def_generic (show_props,        "showProperties");
00048     def_generic (get_props,         "getPropNames");
00049 
00050     ScripterExport Value* map(node_map& m);
00051 
00052     /* built-in property accessors */
00053 
00054     def_property ( count );
00055 };
00056 
00057 #define ToTCBUI(a) (((a)+1.0f)*25.0f)  // HEY!! pinched from TCBINTRP.CPP, why not in a header or documented?
00058 #define FromTCBUI(a) (((a)/25.0f)-1.0f)
00059 #define ToEaseUI(a) ((a)*50.0f)
00060 #define FromEaseUI(a) ((a)/50.0f)
00061 
00062 visible_class (MAXKey)
00063 
00064 class MAXKey : public Value
00065 {
00066 public:
00067     MAXControl* controller;         /* MAX-side controller                      */
00068     int         key_index;
00069 
00070     ENABLE_STACK_ALLOCATE(MAXKey);
00071     ScripterExport MAXKey (Control* icont, int ikey, ParamDimension* dim);
00072     ScripterExport MAXKey (Control* icont, int ikey);
00073     ScripterExport MAXKey (MAXControl* icont, int ikey);
00074 
00075     static void setup();
00076 
00077                 classof_methods (MAXKey, Value);
00078     void        collect() { delete this; }
00079     void        gc_trace();
00080     ScripterExport void sprin1(CharStream* s);
00081 
00082     def_generic ( delete,       "delete");
00083     def_generic ( copy,         "copy");
00084     def_generic ( show_props,   "showProperties");
00085     def_generic ( get_props,    "getPropNames");
00086 
00087     ScripterExport IKey* setup_key_access(AnyKey& ak, IKeyControl** kip);
00088 
00089     def_property    (time);
00090     def_property    (selected);
00091     def_property    (value);
00092     def_property    (inTangent);
00093     def_property    (outTangent);
00094     def_property    (inTangentLength);
00095     def_property    (outTangentLength);
00096     def_property    (inTangentType);
00097     def_property    (outTangentType);
00098     def_property    (x_locked);
00099     def_property    (y_locked);
00100     def_property    (z_locked);
00101     def_property    (w_locked);
00102     def_property    (constantVelocity);
00103     def_property    (freeHandle);
00104     def_property    (tension);
00105     def_property    (continuity);
00106     def_property    (bias);
00107     def_property    (easeTo);
00108     def_property    (easeFrom);
00109 
00110 // add implementations of the recursive time controller fns here to complain
00111 // since they wuill default to operating on the key's controller which can be very confusing
00112 // the user should use them on the controller or track, not the key
00113 #ifdef def_time_fn
00114 #   undef def_time_fn
00115 #endif
00116 #define def_time_fn(_fn)    \
00117     Value* _fn##_vf(Value** arg_list, int count) { throw NoMethodError (_M(#_fn), this); return (Value*)0; }     
00118 #include "..\protocols\timefunctions.inl"
00119 
00120 };
00121