VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtProceduralSoundBehaviorHelper.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>
14 
15 #include <string>
16 
17 namespace makVrv
18 {
19  class DtDe;
20  class DtDePathConfiguration;
21  class DtProceduralSoundLayer;
22 
29  enum class DtSourceKind
30  {
33  Invalid
34  };
35 
90  {
91  public:
98  {
101  int myFixedN = 1;
104  float myDensity = 1.0f;
106  float myGainMin = 0.6f;
108  float myGainMax = 1.0f;
110  float myPitchMin = 0.97f;
112  float myPitchMax = 1.03f;
114  bool myLoaded = false;
115  };
116 
130  static DtSourceKind classifySource(const std::string& src);
131 
145  static std::string extractKey(const std::string& src)
146  {
147  constexpr std::size_t kPrefixLen = 16; // strlen("ProceduralSound:") == strlen("ModelDefinition:")
148  if (src.size() > kPrefixLen &&
149  src.compare(0, kPrefixLen, "ProceduralSound:") == 0)
150  {
151  return src.substr(kPrefixLen);
152  }
153  if (src.size() > kPrefixLen &&
154  src.compare(0, kPrefixLen, "ModelDefinition:") == 0)
155  {
156  return src.substr(kPrefixLen);
157  }
158  return src;
159  }
160 
185  static ClipLoadResult loadClipsIntoLayer(
186  DtProceduralSoundLayer& layer,
187  const std::string& source,
188  DtDe& de);
189 
199  static void resolveSource(
200  std::string& source,
201  const DtDePathConfiguration& pathCfg);
202 
203  private:
205  };
206 
207 } // namespace makVrv
Contains makVrv::DtProceduralSoundLayer class.
empty, raw file path, or otherwise unrecognized
Static utility helpers shared by procedural sound behavior implementations.
Definition: DtProceduralSoundBehaviorHelper.h:89
The DtDePathConfiguration contains paths to various files, and can resolve the path macros ...
Definition: DtDePathConfiguration.h:23
Contains the DLL export macro for vrvAudio classes.
static std::string extractKey(const std::string &src)
Strip the optional &quot;ProceduralSound:&quot; or &quot;ModelDefinition:&quot; prefix and return the bare key / entry na...
Definition: DtProceduralSoundBehaviorHelper.h:145
Result of a loadClipsIntoLayer() call.
Definition: DtProceduralSoundBehaviorHelper.h:97
DtSourceKind
Classification of a procedural-soundscape source reference.
Definition: DtProceduralSoundBehaviorHelper.h:29
const char * source
Definition: lz4.h:442
#define DT_DLL_VRVAUDIO
Definition: vrvAudio.h:20
One pool of randomly-triggered WAV clips that can be mixed into a DtProceduralSound.
Definition: DtProceduralSoundLayer.h:37
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
&quot;ModelDefinition:&lt;entryName&gt;&quot;
&quot;ProceduralSound:&lt;key&gt;&quot; or legacy bare-word key

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)