VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTierSlotBehavior.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 
13 #include <vrvAudio/vrvAudio.h>
14 
15 namespace makVrv
16 {
20  {
21  float myFadeInLo = 0.0f;
22  float myFadeInHi = 1.0f;
25  float myFadeInPower = 1.0f;
26 
29  static const float kNoFadeOut;
30  };
31 
44  {
45  public:
48  explicit DtTierSlotBehavior(const DtTierGainCurve& curve);
49 
51  virtual ~DtTierSlotBehavior();
52 
53  DtTierSlotBehavior(const DtTierSlotBehavior&) = delete;
54  DtTierSlotBehavior& operator=(const DtTierSlotBehavior&) = delete;
55 
56  // ------------------------------------------------------------------
57  // DtProceduralSoundBehavior overrides (non-final)
58  // ------------------------------------------------------------------
59 
62  virtual bool isActive(const DtProceduralSoundBehaviorContext& ctx) const override;
63 
68  virtual float currentVolumeDb(const DtProceduralSoundBehaviorContext& ctx,
69  float channelBaseVolumeDb) const override;
70 
75  float currentGain() const;
76 
77  protected:
78  // ------------------------------------------------------------------
79  // Audio-thread pure virtuals -- subclass must implement
80  // ------------------------------------------------------------------
81 
84  virtual float currentSignal() const = 0;
85 
88  virtual bool isSignalActive() const = 0;
89 
90  // ------------------------------------------------------------------
91  // Shared crossfade math
92  // ------------------------------------------------------------------
93 
98  static float computeGain(float x, const DtTierGainCurve& curve);
99 
101  };
102 
103 } // namespace makVrv
DtTierGainCurve myGainCurve
Four-point gain envelope for this tier.
Definition: DtTierSlotBehavior.h:100
float myFadeInLo
signal value at which gain starts rising (0 below)
Definition: DtTierSlotBehavior.h:21
Read-only context passed to every DtProceduralSoundBehavior callback.
Definition: DtProceduralSoundBehaviorContext.h:20
float myFadeOutLo
signal value at which gain starts falling
Definition: DtTierSlotBehavior.h:23
Contains the DLL export macro for vrvAudio classes.
static const float kNoFadeOut
Sentinel value meaning &quot;no fade-out&quot;. Assign to both myFadeOutLo and myFadeOutHi to disable the fade-...
Definition: DtTierSlotBehavior.h:29
Four-point gain envelope for a single crossfade tier. Used by DtTierSlotBehavior and its subclasses...
Definition: DtTierSlotBehavior.h:19
float myFadeInPower
0.0 = equal-power sin ramp; &gt;0 = pow(t, myFadeInPower); 1.0 = linear
Definition: DtTierSlotBehavior.h:25
float myFadeOutHi
signal value at which gain reaches 0.0
Definition: DtTierSlotBehavior.h:24
Optional per-channel behavior hook for DtProceduralSoundPlayer.
Definition: DtProceduralSoundBehavior.h:40
#define DT_DLL_VRVAUDIO
Definition: vrvAudio.h:20
Abstract per-tier slot behavior that applies a four-point gain envelope to a single audio layer...
Definition: DtTierSlotBehavior.h:43
Contains makVrv::DtProceduralSoundBehavior base class.
float myFadeInHi
signal value at which gain reaches 1.0
Definition: DtTierSlotBehavior.h:22

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)