1 /** 2 Base class for audio equalizers. Gives you control over frequencies. 3 Use it to create a custom equalizer if $(D AudioEffectEQ6), $(D AudioEffectEQ10) or $(D AudioEffectEQ21) don't fit your needs. 4 5 Copyright: 6 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 7 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 8 Copyright (c) 2017-2018 Godot-D contributors 9 10 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 11 12 13 */ 14 module godot.audioeffecteq; 15 import std.meta : AliasSeq, staticIndexOf; 16 import std.traits : Unqual; 17 import godot.d.traits; 18 import godot.core; 19 import godot.c; 20 import godot.d.bind; 21 import godot.d.reference; 22 import godot.globalenums; 23 import godot.object; 24 import godot.classdb; 25 import godot.audioeffect; 26 import godot.resource; 27 /** 28 Base class for audio equalizers. Gives you control over frequencies. 29 Use it to create a custom equalizer if $(D AudioEffectEQ6), $(D AudioEffectEQ10) or $(D AudioEffectEQ21) don't fit your needs. 30 31 AudioEffectEQ gives you control over frequencies. Use it to compensate for existing deficiencies in audio. AudioEffectEQs are useful on the Master bus to completely master a mix and give it more character. They are also useful when a game is run on a mobile device, to adjust the mix to that kind of speakers (it can be added but disabled when headphones are plugged). 32 */ 33 @GodotBaseClass struct AudioEffectEQ 34 { 35 package(godot) enum string _GODOT_internal_name = "AudioEffectEQ"; 36 public: 37 @nogc nothrow: 38 union { /** */ godot_object _godot_object; /** */ AudioEffect _GODOT_base; } 39 alias _GODOT_base this; 40 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 41 package(godot) __gshared bool _classBindingInitialized = false; 42 package(godot) static struct GDNativeClassBinding 43 { 44 __gshared: 45 @GodotName("get_band_count") GodotMethod!(long) getBandCount; 46 @GodotName("get_band_gain_db") GodotMethod!(double, long) getBandGainDb; 47 @GodotName("set_band_gain_db") GodotMethod!(void, long, double) setBandGainDb; 48 } 49 /// 50 pragma(inline, true) bool opEquals(in AudioEffectEQ other) const 51 { return _godot_object.ptr is other._godot_object.ptr; } 52 /// 53 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 54 { _godot_object.ptr = n; return null; } 55 /// 56 pragma(inline, true) bool opEquals(typeof(null) n) const 57 { return _godot_object.ptr is n; } 58 /// 59 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 60 mixin baseCasts; 61 /// Construct a new instance of AudioEffectEQ. 62 /// Note: use `memnew!AudioEffectEQ` instead. 63 static AudioEffectEQ _new() 64 { 65 static godot_class_constructor constructor; 66 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("AudioEffectEQ"); 67 if(constructor is null) return typeof(this).init; 68 return cast(AudioEffectEQ)(constructor()); 69 } 70 @disable new(size_t s); 71 /** 72 Returns the number of bands of the equalizer. 73 */ 74 long getBandCount() const 75 { 76 checkClassBinding!(typeof(this))(); 77 return ptrcall!(long)(GDNativeClassBinding.getBandCount, _godot_object); 78 } 79 /** 80 Returns the band's gain at the specified index, in dB. 81 */ 82 double getBandGainDb(in long band_idx) const 83 { 84 checkClassBinding!(typeof(this))(); 85 return ptrcall!(double)(GDNativeClassBinding.getBandGainDb, _godot_object, band_idx); 86 } 87 /** 88 Sets band's gain at the specified index, in dB. 89 */ 90 void setBandGainDb(in long band_idx, in double volume_db) 91 { 92 checkClassBinding!(typeof(this))(); 93 ptrcall!(void)(GDNativeClassBinding.setBandGainDb, _godot_object, band_idx, volume_db); 94 } 95 }