HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  ~OBJ_Sound() override;
47 
48  static OP_Node *myConstructor(OP_Network *net,
49  const char *name,
50  OP_Operator *entry);
51 
52  OBJ_OBJECT_TYPE getObjectType() const override;
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 
63  PRM_ParmList *obsolete) override;
64  static PRM_Template *getObsolete();
65  static PRM_Template *getTemplateList();
66 protected:
67  bool updateParmsFlags() override;
68 
69  OP_ERROR cookMyObj(OP_Context &context) override;
70  // Used to get pointer to indirection indices for each object type
71  int *getIndirect() const override
72  { return handleIndirect; }
73 
74 private:
75 
76  int ACTIVE(fpreal t)
77  { INT_OBJ_PARM("soundactive", I_SOUND_ACTIVE, 0, t); }
78 
80  { FLOAT_OBJ_PARM("volume", I_SOUND_VOLUME, 0, t); }
81 
82  int EMISSION_TYPE()
83  { INT_OBJ_PARM("direct", I_SOUND_TYPE, 0, 0); }
84 
85  fpreal EMISSION_CONE(fpreal t)
86  { FLOAT_OBJ_PARM("emitcone", I_SOUND_CONE, 0, t); }
87 
88  fpreal OUTER_CONE(fpreal t)
89  { FLOAT_OBJ_PARM("outcone", I_SOUND_OUTER_CONE, 0, t); }
90 
91  int DROPOFF()
92  { INT_OBJ_PARM("dropoff", I_SOUND_DROPOFF, 0, 0); }
93 
94  fpreal DROPOFF_RATE(fpreal t)
95  { FLOAT_OBJ_PARM("droprate", I_SOUND_DROPOFF_RATE, 0, t); }
96 
97  fpreal OUTER_VOLUME(fpreal t)
98  { FLOAT_OBJ_PARM("outvolume", I_SOUND_OUTER_VOLUME, 0, t); }
99 
100 public:
101  int isObjectRenderable(fpreal t) const override;
102 
103 private:
104  static int *handleIndirect;
105 };
106 
107 #undef FLOAT_OBJ_PARM
108 #undef STR_OBJ_PARM
109 #undef INT_OBJ_PARM
110 
111 #endif
int getRolloffType()
Definition: OBJ_Sound.h:56
int isDirectional()
Definition: OBJ_Sound.h:55
OBJ_OBJECT_TYPE getObjectType() const override
UT_ErrorSeverity
Definition: UT_Error.h:25
void resolveObsoleteParms(PRM_ParmList *obsolete_parms) override
static PRM_Template * getTemplateList(OBJ_ParmsStyle style)
static PRM_Template * getObsolete()
int * getIndirect() const override
Definition: OBJ_Sound.h:71
virtual OP_ERROR cookMyObj(OP_Context &context)
GLuint const GLchar * name
Definition: glcorearb.h:786
static OP_Node * myConstructor(OP_Network *net, const char *name, OP_Operator *entry)
GLdouble t
Definition: glad.h:2397
virtual int isObjectRenderable(fpreal t) const
fpreal64 fpreal
Definition: SYS_Types.h:277
bool updateParmsFlags() override
OBJ_SoundIndex
Definition: OBJ_Sound.h:18
#define INT_OBJ_PARM(name, idx, vi, t)
Definition: OBJ_Sound.h:35
#define OBJ_API
Definition: OBJ_API.h:10
#define FLOAT_OBJ_PARM(name, idx, vi, t)
Definition: OBJ_Sound.h:33
OBJ_OBJECT_TYPE
Definition: OBJ_Node.h:73