VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSoundModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvAudio/vrvAudio.h>
13 #include <vrvAudio/DtAudioLevel.h>
14 
15 #include <vrvCore/DtUniqueID.h>
16 
18 
19 #include <makAudio/abstractAudio.h>
20 #include <makAudio/sound.h>
21 
22 #include <matrix/vlVector.h>
23 
24 namespace makVrv
25 {
26  class DtDe;
27 
38  {
39  public:
40  enum class DtSoundState
41  {
42  STOPPED,
43  PAUSED,
44  PLAYED
45  };
46 
47  public:
48 
50  DtSoundModel(DtDe& de, DtUniqueID id);
51 
53  DtSoundModel() = delete;
54 
56  DtSoundModel(const DtSoundModel&) = delete;
57 
59  DtSoundModel& operator=(const DtSoundModel&) = delete;
60 
62  virtual ~DtSoundModel();
63 
64  public:
65 
70  virtual void setModelDefinition(const std::string& modelDef);
71 
81  virtual void realize(const std::string& filename, float decibels, bool is3d,
82  bool isLooping, makAudio::DtAbstractAudio::Priority priority);
83 
100  virtual void realizeWithAttenuation(const std::string& filename, float decibels,
101  bool is3d, bool isLooping, makAudio::DtAbstractAudio::Priority priority,
102  float minAudibleDistM, float maxAudibleDistM);
103 
107  virtual void play();
108 
112  virtual void pause();
113 
117  virtual void stop();
118 
122  virtual void setRelativePosition(bool relative);
123 
126  virtual void setPosition(const DtVector& pos);
127 
131  virtual void setVelocity(const DtVector& vel);
132 
134  virtual void setDecibel(float decibel);
135 
137  virtual float decibel();
138 
143  virtual void setGain(float vol);
144 
146  virtual float gain();
147 
149  virtual float maxFalloffDistance();
150 
152  virtual void setIs3d(bool is3d);
153 
155  virtual bool shouldPlaySound();
156 
160  virtual void setIsInteractionSound(bool isInteractionSound);
161 
165  virtual bool isInteractionSound();
166 
168  virtual makAudio::DtSound* sound();
169 
171  virtual const makAudio::DtSound* sound() const;
172 
173  protected:
180  virtual void createSoundFromDescriptor();
181 
185  virtual void handleDelayedSoundCreation();
186 
187  protected:
191 
192  makAudio::DtSound* mySound;
193 
194  makAudio::DtSoundDescriptor mySoundDescriptor;
195  DtVector myPosition;
196  DtVector myVelocity;
199  float myGain;
200 
202 
205  makAudio::DtAbstractAudio::Priority myPriority;
206  };
207 }
float myMinAudibleDistanceM
Definition: DtSoundModel.h:203
DtSoundState mySoundState
Definition: DtSoundModel.h:198
DtSoundModel can be used to configure, start, and stop a sound. The sound can be marked as an interac...
Definition: DtSoundModel.h:37
DtVector myVelocity
Definition: DtSoundModel.h:196
Contains the DLL export macro for vrvAudio classes.
DtVector myPosition
Definition: DtSoundModel.h:195
DtSignalConnectionManager myConnections
Definition: DtSoundModel.h:190
float myGain
Definition: DtSoundModel.h:199
DtDe & myDe
Definition: DtSoundModel.h:188
DtUniqueID myId
Definition: DtSoundModel.h:189
float myMaxAudibleDistanceM
Definition: DtSoundModel.h:204
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
bool myIsInteractionSound
Definition: DtSoundModel.h:201
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
DtSoundState
Definition: DtSoundModel.h:40
Base class to provide boost signal/slot management.
makAudio::DtSoundDescriptor mySoundDescriptor
Definition: DtSoundModel.h:194
Contains makVrv::DtUniqueID type.
#define DT_DLL_VRVAUDIO
Definition: vrvAudio.h:20
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Contains the DtAudioLevel utility class.
makAudio::DtSound * mySound
Definition: DtSoundModel.h:192
makAudio::DtAbstractAudio::Priority myPriority
Definition: DtSoundModel.h:205
bool myIsRelativePosition
Definition: DtSoundModel.h:197

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)