Ocean
AudioClip.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_SCENEDESCRIPTION_SDX_X3D_AUDIO_CLIP_H
9 #define META_OCEAN_SCENEDESCRIPTION_SDX_X3D_AUDIO_CLIP_H
10 
14 
16 
17 namespace Ocean
18 {
19 
20 namespace SceneDescription
21 {
22 
23 namespace SDX
24 {
25 
26 namespace X3D
27 {
28 
29 /**
30  * This class implements a x3d audio clip node.
31  * @ingroup scenedescriptionsdxx3d
32  */
33 class OCEAN_SCENEDESCRIPTION_SDX_X3D_EXPORT AudioClip :
34  virtual public X3DSoundSourceNode,
35  virtual public X3DUrlObject
36 {
37  public:
38 
39  /**
40  * Creates a new audio clip node.
41  * @param environment Node environment
42  */
43  AudioClip(const SDXEnvironment* environment);
44 
45  protected:
46 
47  /**
48  * Specifies the node type and the fields of this node.
49  * @return Unique node specification of this node
50  */
52 
53  /**
54  * Event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects.
55  * @see SDXNode::onInitialize().
56  */
57  void onInitialize(const Rendering::SceneRef& scene, const Timestamp timestamp) override;
58 
59  /**
60  * Event function to inform the node about a changed field.
61  * @see SDXNode::onFieldChanged().
62  */
63  void onFieldChanged(const std::string& fieldName) override;
64 
65  /**
66  * Event function for node update events.
67  * @see X3DTimeDependentNode::onUpdated().
68  */
69  void onUpdated(const Timestamp timestamp) override;
70 
71  /**
72  * Event function for node start events.
73  * @see X3DTimeDependentNode::onStarted().
74  */
75  void onStarted(const Timestamp eventTimestamp) override;
76 
77  /**
78  * Event function for node pause events.
79  * @see X3DTimeDependentNode::onPaused().
80  */
81  void onPaused(const Timestamp eventTimestamp) override;
82 
83  /**
84  * Event function for node resume events.
85  * @see X3DTimeDependentNode::onStarted().
86  */
87  void onResumed(const Timestamp eventTimestamp) override;
88 
89  /**
90  * Event function for node stop events.
91  * @see X3DTimeDependentNode::onStarted().
92  */
93  void onStopped(const Timestamp eventTimestamp) override;
94 
95  /**
96  * Returns the address of the most derived object.
97  * @see Node::objectAddress().
98  */
99  size_t objectAddress() const override;
100 
101  protected:
102 
103  /// Sound medium.
105 };
106 
107 }
108 
109 }
110 
111 }
112 
113 }
114 
115 #endif // META_OCEAN_SCENEDESCRIPTION_SDX_X3D_AUDIO_CLIP_H
This class implements a node specification object.
Definition: scenedescription/Node.h:77
This class implements a x3d audio clip node.
Definition: AudioClip.h:36
void onStarted(const Timestamp eventTimestamp) override
Event function for node start events.
NodeSpecification specifyNode()
Specifies the node type and the fields of this node.
AudioClip(const SDXEnvironment *environment)
Creates a new audio clip node.
void onFieldChanged(const std::string &fieldName) override
Event function to inform the node about a changed field.
void onResumed(const Timestamp eventTimestamp) override
Event function for node resume events.
Media::SoundMediumRef soundMedium_
Sound medium.
Definition: AudioClip.h:104
size_t objectAddress() const override
Returns the address of the most derived object.
void onPaused(const Timestamp eventTimestamp) override
Event function for node pause events.
void onStopped(const Timestamp eventTimestamp) override
Event function for node stop events.
void onInitialize(const Rendering::SceneRef &scene, const Timestamp timestamp) override
Event function to inform the node that it has been initialized and can apply all internal values to c...
void onUpdated(const Timestamp timestamp) override
Event function for node update events.
This class implements an abstract x3d sound source node.
Definition: X3DSoundSourceNode.h:31
This class implements an abstract x3d url object.
Definition: X3DUrlObject.h:35
This class implements a node environment container.
Definition: SDXNode.h:62
This class implements a timestamp.
Definition: Timestamp.h:36
SmartMediumRef< SoundMedium > SoundMediumRef
Definition of a smart medium reference holding a sound medium object.
Definition: SoundMedium.h:24
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15