1 /*
2  * NodeSound.h
3  *
4  * Copyright (C) 1999 Stephen F. White
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program (see the file "COPYING" for details); if
18  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
19  * Cambridge, MA 02139, USA.
20  */
21 
22 #pragma once
23 
24 #include "Node.h"
25 #include "ProtoMacros.h"
26 #include "Proto.h"
27 #include "swt.h"
28 #include "SFMFTypes.h"
29 
30 class ProtoSound : public Proto {
31 public:
32                     ProtoSound(Scene *scene);
33     virtual Node   *create(Scene *scene);
34 
getType()35     virtual int     getType() const { return VRML_SOUND; }
36 
37     FieldIndex direction;
38     FieldIndex intensity;
39     FieldIndex location;
40     FieldIndex maxBack;
41     FieldIndex maxFront;
42     FieldIndex minBack;
43     FieldIndex minFront;
44     FieldIndex priority;
45     FieldIndex source;
46     FieldIndex spatialize;
47     FieldIndex doppler;
48 };
49 
50 class NodeSound : public Node {
51 public:
52                     NodeSound(Scene *scene, Proto *proto);
53 
getProfile(void)54     virtual int     getProfile(void) const { return PROFILE_IMMERSIVE; }
getX3dVersion(void)55     virtual int     getX3dVersion(void) const { return 0; }
copy()56     virtual Node   *copy() const { return new NodeSound(*this); }
57 
hasNumbers4kids(void)58     virtual bool    hasNumbers4kids(void) { return true; }
59 
60     virtual int     getAnimationCommentID(void);
61 
hasCoverFields(void)62     virtual bool    hasCoverFields(void) { return true; }
63 
64     fieldMacros(SFVec3f, direction,  ProtoSound)
65     fieldMacros(SFFloat, intensity,  ProtoSound)
66     fieldMacros(SFVec3f, location,   ProtoSound)
67     fieldMacros(SFFloat, maxBack,    ProtoSound)
68     fieldMacros(SFFloat, maxFront,   ProtoSound)
69     fieldMacros(SFFloat, minBack,    ProtoSound)
70     fieldMacros(SFFloat, minFront,   ProtoSound)
71     fieldMacros(SFFloat, priority,   ProtoSound)
72     fieldMacros(SFNode,  source,     ProtoSound)
73     fieldMacros(SFBool,  spatialize, ProtoSound)
74     fieldMacros(SFBool,  doppler,    ProtoSound)
75 };
76 
77