ReverbEffect class
Пакет: com.hypixel.hytale.server.core.asset.type.reverbeffect.config
Файл: com/hypixel/hytale/server/core/asset/type/reverbeffect/config/ReverbEffect.java
implements: JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, ReverbEffect>>,
NetworkSerializable<com.hypixel.hytale.protocol.ReverbEffect>
Поля (4)
| Модификаторы | Тип | Имя |
|---|---|---|
|
|
ASSET_STORE |
final |
int |
EMPTY_ID |
|
com.hypixel.hytale.protocol.ReverbEffect |
var1 |
|
com.hypixel.hytale.protocol.ReverbEffect |
var2 |
Методы (19)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
float |
getAirAbsorptionHighFrequencyGainfloat getAirAbsorptionHighFrequencyGain() |
static |
IndexedLookupTableAssetMap<String, ReverbEffect> |
getAssetMapIndexedLookupTableAssetMap<String, ReverbEffect> getAssetMap() |
static |
AssetStore<String, ReverbEffect, IndexedLookupTableAssetMap<String, ReverbEffect>> |
getAssetStoreAssetStore<String, ReverbEffect, IndexedLookupTableAssetMap<String, ReverbEffect>> getAssetStore() |
public |
float |
getDecayTimefloat getDecayTime() |
public |
float |
getDiffusionfloat getDiffusion() |
public |
float |
getDryGainfloat getDryGain() |
public |
float |
getGainfloat getGain() |
public |
float |
getHighFrequencyDecayRatiofloat getHighFrequencyDecayRatio() |
public |
float |
getHighFrequencyGainfloat getHighFrequencyGain() |
public |
String |
getIdString getId() |
public |
float |
getLateReverbDelayfloat getLateReverbDelay() |
public |
float |
getLateReverbGainfloat getLateReverbGain() |
public |
float |
getModalDensityfloat getModalDensity() |
public |
float |
getReflectionDelayfloat getReflectionDelay() |
public |
float |
getReflectionGainfloat getReflectionGain() |
public |
float |
getRoomRolloffFactorfloat getRoomRolloffFactor() |
|
|
if if(ASSET_STORE == null) |
|
|
if if(var1 != null) |
public |
boolean |
isLimitDecayHighFrequencyboolean isLimitDecayHighFrequency() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.reverbeffect.config;
class="kw">import com.hypixel.hytale.assetstore.AssetExtraInfo;
class="kw">import com.hypixel.hytale.assetstore.AssetKeyValidator;
class="kw">import com.hypixel.hytale.assetstore.AssetRegistry;
class="kw">import com.hypixel.hytale.assetstore.AssetStore;
class="kw">import com.hypixel.hytale.assetstore.codec.AssetBuilderCodec;
class="kw">import com.hypixel.hytale.assetstore.map.IndexedLookupTableAssetMap;
class="kw">import com.hypixel.hytale.assetstore.map.JsonAssetWithMap;
class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.schema.metadata.ui.UIEditor;
class="kw">import com.hypixel.hytale.codec.schema.metadata.ui.UIEditorPreview;
class="kw">import com.hypixel.hytale.codec.validation.ValidatorCache;
class="kw">import com.hypixel.hytale.codec.validation.Validators;
class="kw">import com.hypixel.hytale.common.util.AudioUtil;
class="kw">import com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import java.lang.ref.SoftReference;
class="kw">import javax.annotation.Nonnull;
class="kw">public class ReverbEffect
class="kw">implements JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, ReverbEffect>>,
NetworkSerializable<com.hypixel.hytale.protocol.ReverbEffect> {
class="kw">public class="kw">static class="kw">final int EMPTY_ID = 0;
class="kw">public class="kw">static class="kw">final String EMPTY = "EMPTY";
class="kw">public class="kw">static class="kw">final ReverbEffect EMPTY_REVERB_EFFECT = new ReverbEffect("EMPTY");
class="kw">public class="kw">static class="kw">final AssetBuilderCodec<String, ReverbEffect> CODEC = AssetBuilderCodec.<String, ReverbEffect>builder(
ReverbEffect.class,
ReverbEffect::new,
Codec.STRING,
(var0, var1) -> var0.id = var1,
var0 -> var0.id,
(var0, var1) -> var0.data = var1,
var0 -> var0.data
)
.documentation("An asset used to define a reverb audio effect.")
.metadata(new UIEditorPreview(UIEditorPreview.PreviewType.REVERB_EFFECT))
.<Float>appendInherited(
new KeyedCodec<>("DryGain", Codec.FLOAT),
(var0, var1) -> var0.dryGain = AudioUtil.decibelsToLinearGain(var1),
var0 -> AudioUtil.linearGainToDecibels(var0.dryGain),
(var0, var1) -> var0.dryGain = var1.dryGain
)
.metadata(new UIEditor(new UIEditor.FormattedNumber(null, " dB", null)))
.addValidator(Validators.range(-100.0F, 10.0F))
.documentation("Dry signal gain adjustment in decibels.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("ModalDensity", Codec.FLOAT),
(var0, var1) -> var0.modalDensity = var1,
var0 -> var0.modalDensity,
(var0, var1) -> var0.modalDensity = var1.modalDensity
)
.addValidator(Validators.range(0.0F, 1.0F))
.documentation("Modal density of the reverb.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("Diffusion", Codec.FLOAT),
(var0, var1) -> var0.diffusion = var1,
var0 -> var0.diffusion,
(var0, var1) -> var0.diffusion = var1.diffusion
)
.addValidator(Validators.range(0.0F, 1.0F))
.documentation("Diffusion of the reverb reflections.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("Gain", Codec.FLOAT),
(var0, var1) -> var0.gain = AudioUtil.decibelsToLinearGain(var1),
var0 -> AudioUtil.linearGainToDecibels(var0.gain),
(var0, var1) -> var0.gain = var1.gain
)
.metadata(new UIEditor(new UIEditor.FormattedNumber(null, " dB", null)))
.addValidator(Validators.range(-100.0F, 0.0F))
.documentation("Overall reverb gain in decibels.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("HighFrequencyGain", Codec.FLOAT),
(var0, var1) -> var0.highFrequencyGain = AudioUtil.decibelsToLinearGain(var1),
var0 -> AudioUtil.linearGainToDecibels(var0.highFrequencyGain),
(var0, var1) -> var0.highFrequencyGain = var1.highFrequencyGain
)
.metadata(new UIEditor(new UIEditor.FormattedNumber(null, " dB", null)))
.addValidator(Validators.range(-100.0F, 0.0F))
.documentation("High frequency gain in decibels.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("DecayTime", Codec.FLOAT),
(var0, var1) -> var0.decayTime = var1,
var0 -> var0.decayTime,
(var0, var1) -> var0.decayTime = var1.decayTime
)
.addValidator(Validators.range(0.1F, 20.0F))
.documentation("Decay time in seconds.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("HighFrequencyDecayRatio", Codec.FLOAT),
(var0, var1) -> var0.highFrequencyDecayRatio = var1,
var0 -> var0.highFrequencyDecayRatio,
(var0, var1) -> var0.highFrequencyDecayRatio = var1.highFrequencyDecayRatio
)
.addValidator(Validators.range(0.1F, 2.0F))
.documentation("High frequency decay ratio.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("ReflectionGain", Codec.FLOAT),
(var0, var1) -> var0.reflectionGain = AudioUtil.decibelsToLinearGain(var1),
var0 -> AudioUtil.linearGainToDecibels(var0.reflectionGain),
(var0, var1) -> var0.reflectionGain = var1.reflectionGain
)
.metadata(new UIEditor(new UIEditor.FormattedNumber(null, " dB", null)))
.addValidator(Validators.range(-100.0F, 10.0F))
.documentation("Early reflections gain in decibels.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("ReflectionDelay", Codec.FLOAT),
(var0, var1) -> var0.reflectionDelay = var1,
var0 -> var0.reflectionDelay,
(var0, var1) -> var0.reflectionDelay = var1.reflectionDelay
)
.addValidator(Validators.range(0.0F, 0.3F))
.documentation("Early reflections delay in seconds.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("LateReverbGain", Codec.FLOAT),
(var0, var1) -> var0.lateReverbGain = AudioUtil.decibelsToLinearGain(var1),
var0 -> AudioUtil.linearGainToDecibels(var0.lateReverbGain),
(var0, var1) -> var0.lateReverbGain = var1.lateReverbGain
)
.metadata(new UIEditor(new UIEditor.FormattedNumber(null, " dB", null)))
.addValidator(Validators.range(-100.0F, 20.0F))
.documentation("Late reverb gain in decibels.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("LateReverbDelay", Codec.FLOAT),
(var0, var1) -> var0.lateReverbDelay = var1,
var0 -> var0.lateReverbDelay,
(var0, var1) -> var0.lateReverbDelay = var1.lateReverbDelay
)
.addValidator(Validators.range(0.0F, 0.1F))
.documentation("Late reverb delay in seconds.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("RoomRolloffFactor", Codec.FLOAT),
(var0, var1) -> var0.roomRolloffFactor = var1,
var0 -> var0.roomRolloffFactor,
(var0, var1) -> var0.roomRolloffFactor = var1.roomRolloffFactor
)
.addValidator(Validators.range(0.0F, 10.0F))
.documentation("Room rolloff factor.")
.add()
.<Float>appendInherited(
new KeyedCodec<>("AirAbsorbptionHighFrequencyGain", Codec.FLOAT),
(var0, var1) -> var0.airAbsorptionHighFrequencyGain = AudioUtil.decibelsToLinearGain(var1),
var0 -> AudioUtil.linearGainToDecibels(var0.airAbsorptionHighFrequencyGain),
(var0, var1) -> var0.airAbsorptionHighFrequencyGain = var1.airAbsorptionHighFrequencyGain
)
.metadata(new UIEditor(new UIEditor.FormattedNumber(null, " dB", null)))
.addValidator(Validators.range(-1.0F, 0.0F))
.documentation("Air absorption high frequency gain in decibels.")
.add()
.<Boolean>appendInherited(
new KeyedCodec<>("LimitDecayHighFrequency", Codec.BOOLEAN),
(var0, var1) -> var0.limitDecayHighFrequency = var1,
var0 -> var0.limitDecayHighFrequency,
(var0, var1) -> var0.limitDecayHighFrequency = var1.limitDecayHighFrequency
)
.documentation("Whether to limit high frequency decay time.")
.add()
.build();
class="kw">public class="kw">static class="kw">final ValidatorCache<String> VALIDATOR_CACHE = new ValidatorCache<>(new AssetKeyValidator<>(ReverbEffect::getAssetStore));
class="kw">private class="kw">static AssetStore<String, ReverbEffect, IndexedLookupTableAssetMap<String, ReverbEffect>> ASSET_STORE;
class="kw">protected AssetExtraInfo.Data data;
class="kw">protected String id;
class="kw">protected float dryGain = AudioUtil.decibelsToLinearGain(0.0F);
class="kw">protected float modalDensity = 1.0F;
class="kw">protected float diffusion = 1.0F;
class="kw">protected float gain = AudioUtil.decibelsToLinearGain(-10.0F);
class="kw">protected float highFrequencyGain = AudioUtil.decibelsToLinearGain(-1.0F);
class="kw">protected float decayTime = 1.49F;
class="kw">protected float highFrequencyDecayRatio = 0.83F;
class="kw">protected float reflectionGain = AudioUtil.decibelsToLinearGain(-26.0F);
class="kw">protected float reflectionDelay = 0.007F;
class="kw">protected float lateReverbGain = AudioUtil.decibelsToLinearGain(2.0F);
class="kw">protected float lateReverbDelay = 0.011F;
class="kw">protected float roomRolloffFactor = 0.0F;
class="kw">protected float airAbsorptionHighFrequencyGain = AudioUtil.decibelsToLinearGain(-0.05F);
class="kw">protected boolean limitDecayHighFrequency = true;
class="kw">private SoftReference<com.hypixel.hytale.protocol.ReverbEffect> cachedPacket;
class="kw">public class="kw">static AssetStore<String, ReverbEffect, IndexedLookupTableAssetMap<String, ReverbEffect>> getAssetStore() {
if (ASSET_STORE == null) {
ASSET_STORE = AssetRegistry.getAssetStore(ReverbEffect.class);
}
class="kw">return ASSET_STORE;
}
class="kw">public class="kw">static IndexedLookupTableAssetMap<String, ReverbEffect> getAssetMap() {
class="kw">return (IndexedLookupTableAssetMap<String, ReverbEffect>)getAssetStore().getAssetMap();
}
class="kw">public ReverbEffect(String var1) {
this.id = var1;
}
class="kw">protected ReverbEffect() {
}
class="kw">public String getId() {
class="kw">return this.id;
}
class="kw">public float getDryGain() {
class="kw">return this.dryGain;
}
class="kw">public float getModalDensity() {
class="kw">return this.modalDensity;
}
class="kw">public float getDiffusion() {
class="kw">return this.diffusion;
}
class="kw">public float getGain() {
class="kw">return this.gain;
}
class="kw">public float getHighFrequencyGain() {
class="kw">return this.highFrequencyGain;
}
class="kw">public float getDecayTime() {
class="kw">return this.decayTime;
}
class="kw">public float getHighFrequencyDecayRatio() {
class="kw">return this.highFrequencyDecayRatio;
}
class="kw">public float getReflectionGain() {
class="kw">return this.reflectionGain;
}
class="kw">public float getReflectionDelay() {
class="kw">return this.reflectionDelay;
}
class="kw">public float getLateReverbGain() {
class="kw">return this.lateReverbGain;
}
class="kw">public float getLateReverbDelay() {
class="kw">return this.lateReverbDelay;
}
class="kw">public float getRoomRolloffFactor() {
class="kw">return this.roomRolloffFactor;
}
class="kw">public float getAirAbsorptionHighFrequencyGain() {
class="kw">return this.airAbsorptionHighFrequencyGain;
}
class="kw">public boolean isLimitDecayHighFrequency() {
class="kw">return this.limitDecayHighFrequency;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "ReverbEffect{id='"
+ this.id
+ "', dryGain="
+ this.dryGain
+ ", modalDensity="
+ this.modalDensity
+ ", diffusion="
+ this.diffusion
+ ", gain="
+ this.gain
+ ", highFrequencyGain="
+ this.highFrequencyGain
+ ", decayTime="
+ this.decayTime
+ ", highFrequencyDecayRatio="
+ this.highFrequencyDecayRatio
+ ", reflectionGain="
+ this.reflectionGain
+ ", reflectionDelay="
+ this.reflectionDelay
+ ", lateReverbGain="
+ this.lateReverbGain
+ ", lateReverbDelay="
+ this.lateReverbDelay
+ ", roomRolloffFactor="
+ this.roomRolloffFactor
+ ", airAbsorptionHighFrequencyGain="
+ this.airAbsorptionHighFrequencyGain
+ ", limitDecayHighFrequency="
+ this.limitDecayHighFrequency
+ "}";
}
@Nonnull
class="kw">public com.hypixel.hytale.protocol.ReverbEffect toPacket() {
com.hypixel.hytale.protocol.ReverbEffect var1 = this.cachedPacket == null ? null : this.cachedPacket.get();
if (var1 != null) {
class="kw">return var1;
}
com.hypixel.hytale.protocol.ReverbEffect var2 = new com.hypixel.hytale.protocol.ReverbEffect();
var2.id = this.id;
var2.dryGain = this.dryGain;
var2.modalDensity = this.modalDensity;
var2.diffusion = this.diffusion;
var2.gain = this.gain;
var2.highFrequencyGain = this.highFrequencyGain;
var2.decayTime = this.decayTime;
var2.highFrequencyDecayRatio = this.highFrequencyDecayRatio;
var2.reflectionGain = this.reflectionGain;
var2.reflectionDelay = this.reflectionDelay;
var2.lateReverbGain = this.lateReverbGain;
var2.lateReverbDelay = this.lateReverbDelay;
var2.roomRolloffFactor = this.roomRolloffFactor;
var2.airAbsorptionHighFrequencyGain = this.airAbsorptionHighFrequencyGain;
var2.limitDecayHighFrequency = this.limitDecayHighFrequency;
this.cachedPacket = new SoftReference<>(var2);
class="kw">return var2;
}
}