VR-Forces 5.0.1 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) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvAudio/vrvAudio.h>
13 
14 #include <vrvCore/DtUniqueID.h>
15 
17 
18 #include <makAudio/abstractAudio.h>
19 #include <makAudio/sound.h>
20 
21 #include <matrix/vlVector.h>
22 
23 namespace makVrv
24 {
25  class DtDe;
26 
37  {
38  public:
39  enum class DtSoundState
40  {
41  STOPPED,
42  PAUSED,
43  PLAYED
44  };
45 
46  public:
47 
49  DtSoundModel(DtDe& de, DtUniqueID id);
50 
52  DtSoundModel() = delete;
53 
55  DtSoundModel(const DtSoundModel&) = delete;
56 
58  DtSoundModel& operator=(const DtSoundModel&) = delete;
59 
61  virtual ~DtSoundModel();
62 
63  public:
64 
69  virtual void setModelDefinition(const std::string& modelDef);
70 
77  virtual void realize(const std::string& filename, float decibels, bool is3d,
78  bool isLooping, makAudio::DtAbstractAudio::Priority priority);
79 
83  virtual void play();
84 
88  virtual void pause();
89 
93  virtual void stop();
94 
98  virtual void setRelativePosition(bool relative);
99 
102  virtual void setPosition(const DtVector& pos);
103 
107  virtual void setVelocity(const DtVector& vel);
108 
110  virtual void setDecibel(float decibel);
111 
113  virtual float decibel();
114 
119  virtual void setGain(float vol);
120 
122  virtual float gain();
123 
125  virtual float maxFalloffDistance();
126 
128  virtual void setIs3d(bool is3d);
129 
131  virtual bool shouldPlaySound();
132 
136  virtual void setIsInteractionSound(bool isInteractionSound);
137 
141  virtual bool isInteractionSound();
142 
145  virtual void setAttachedEntityEngineRunning(bool running);
146 
149  virtual bool attachedEntityEngineRunning();
150 
152  virtual makAudio::DtSound* sound();
153 
155  virtual const makAudio::DtSound* sound() const;
156 
157  protected:
164  virtual void createSoundFromDescriptor();
165 
169  virtual void handleDelayedSoundCreation();
170 
171  protected:
175 
176  makAudio::DtSound* mySound;
177 
178  makAudio::DtSoundDescriptor mySoundDescriptor;
183  float myGain;
184 
187  };
188 }
DtSoundState mySoundState
Definition: DtSoundModel.h:182
DtSoundModel can be used to configure, start, and stop a sound. The sound can be marked as an interac...
Definition: DtSoundModel.h:36
DtVector myVelocity
Definition: DtSoundModel.h:180
Contains the DLL export macro for vrvAudio classes.
DtVector myPosition
Definition: DtSoundModel.h:179
DtSignalConnectionManager myConnections
Definition: DtSoundModel.h:174
float myGain
Definition: DtSoundModel.h:183
DtDe & myDe
Definition: DtSoundModel.h:172
bool myAttachedEntityEngineRunning
Definition: DtSoundModel.h:186
DtUniqueID myId
Definition: DtSoundModel.h:173
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
bool myIsInteractionSound
Definition: DtSoundModel.h:185
DtSoundState
Definition: DtSoundModel.h:39
Base class to provide boost signal/slot management.
makAudio::DtSoundDescriptor mySoundDescriptor
Definition: DtSoundModel.h:178
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:70
makAudio::DtSound * mySound
Definition: DtSoundModel.h:176
bool myIsRelativePosition
Definition: DtSoundModel.h:181

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)