HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OBJ_Sound.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: OBJ_Sound.h (Custom Library, C++)
7  *
8  * COMMENTS: An object to describe a motion capture handle
9  *
10  */
11 
12 #ifndef __OBJ_Sound__
13 #define __OBJ_Sound__
14 
15 #include "OBJ_API.h"
16 #include "OBJ_Geometry.h"
17 
19 {
29  I_N_SOUND_INDICES // should always be last in the list
30 };
31 
32 
33 #define FLOAT_OBJ_PARM(name, idx, vi, t) \
34  return evalFloat(name, &handleIndirect[idx], vi, t);
35 #define INT_OBJ_PARM(name, idx, vi, t) \
36  return evalInt(name, &handleIndirect[idx], vi, t);
37 #define STR_OBJ_PARM(name, idx, vi, t) \
38  evalString(str, name, &handleIndirect[idx], vi, t);
39 
41 {
42 public:
43  OBJ_Sound(OP_Network *net,
44  const char *name,
45  OP_Operator *op);
46  virtual ~OBJ_Sound();
47 
48  static OP_Node *myConstructor(OP_Network *net,
49  const char *name,
50  OP_Operator *entry);
51 
52  virtual OBJ_OBJECT_TYPE getObjectType() const;
53 
54  void getSoundSource(UT_String &choppath, fpreal t);
55  int isDirectional() { return EMISSION_TYPE(); }
56  int getRolloffType() { return DROPOFF(); }
57  void getSoundParms(int &active,
58  fpreal &volume, fpreal &volume2,
59  fpreal &angle1, fpreal &angle2,
60  fpreal &rolloff, fpreal t);
61 
62  virtual void resolveObsoleteParms(PRM_ParmList *obsolete);
63  static PRM_Template *getObsolete();
64  static PRM_Template *getTemplateList();
65 protected:
66  virtual bool updateParmsFlags();
67 
68  virtual OP_ERROR cookMyObj(OP_Context &context);
69  // Used to get pointer to indirection indices for each object type
70  virtual int *getIndirect() const
71  { return handleIndirect; }
72 
73 private:
74 
75  int ACTIVE(fpreal t)
76  { INT_OBJ_PARM("soundactive", I_SOUND_ACTIVE, 0, t); }
77 
79  { FLOAT_OBJ_PARM("volume", I_SOUND_VOLUME, 0, t); }
80 
81  int EMISSION_TYPE()
82  { INT_OBJ_PARM("direct", I_SOUND_TYPE, 0, 0); }
83 
84  fpreal EMISSION_CONE(fpreal t)
85  { FLOAT_OBJ_PARM("emitcone", I_SOUND_CONE, 0, t); }
86 
87  fpreal OUTER_CONE(fpreal t)
88  { FLOAT_OBJ_PARM("outcone", I_SOUND_OUTER_CONE, 0, t); }
89 
90  int DROPOFF()
91  { INT_OBJ_PARM("dropoff", I_SOUND_DROPOFF, 0, 0); }
92 
93  fpreal DROPOFF_RATE(fpreal t)
94  { FLOAT_OBJ_PARM("droprate", I_SOUND_DROPOFF_RATE, 0, t); }
95 
96  fpreal OUTER_VOLUME(fpreal t)
97  { FLOAT_OBJ_PARM("outvolume", I_SOUND_OUTER_VOLUME, 0, t); }
98 
99 public:
100  virtual int isObjectRenderable(fpreal t) const;
101 
102 private:
103  static int *handleIndirect;
104 };
105 
106 #undef FLOAT_OBJ_PARM
107 #undef STR_OBJ_PARM
108 #undef INT_OBJ_PARM
109 
110 #endif
int getRolloffType()
Definition: OBJ_Sound.h:56
int isDirectional()
Definition: OBJ_Sound.h:55
virtual void resolveObsoleteParms(PRM_ParmList *obsolete_parms)
UT_ErrorSeverity
Definition: UT_Error.h:25
static PRM_Template * getTemplateList(OBJ_ParmsStyle style)
static PRM_Template * getObsolete()
virtual OP_ERROR cookMyObj(OP_Context &context)
GLuint const GLchar * name
Definition: glcorearb.h:785
static OP_Node * myConstructor(OP_Network *net, const char *name, OP_Operator *entry)
double fpreal
Definition: SYS_Types.h:269
virtual int isObjectRenderable(fpreal t) const
OBJ_SoundIndex
Definition: OBJ_Sound.h:18
#define INT_OBJ_PARM(name, idx, vi, t)
Definition: OBJ_Sound.h:35
virtual int * getIndirect() const
Definition: OBJ_Sound.h:70
virtual OBJ_OBJECT_TYPE getObjectType() const
#define OBJ_API
Definition: OBJ_API.h:10
virtual bool updateParmsFlags() override
#define FLOAT_OBJ_PARM(name, idx, vi, t)
Definition: OBJ_Sound.h:33
OBJ_OBJECT_TYPE
Definition: OBJ_Node.h:70