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.meta; 18 import godot.core; 19 import godot.c; 20 import godot.d.bind; 21 import godot.d.reference; 22 import godot.object; 23 import godot.classdb; 24 import godot.audioeffect; 25 import godot.resource; 26 import godot.reference; 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. AudioEffectEQ are very useful on the Master Bus to completely master a mix and give it character. They are also very 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 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 _classBinding 43 { 44 __gshared: 45 @GodotName("set_band_gain_db") GodotMethod!(void, long, double) setBandGainDb; 46 @GodotName("get_band_gain_db") GodotMethod!(double, long) getBandGainDb; 47 @GodotName("get_band_count") GodotMethod!(long) getBandCount; 48 } 49 bool opEquals(in AudioEffectEQ other) const { return _godot_object.ptr is other._godot_object.ptr; } 50 AudioEffectEQ opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 51 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 52 mixin baseCasts; 53 static AudioEffectEQ _new() 54 { 55 static godot_class_constructor constructor; 56 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("AudioEffectEQ"); 57 if(constructor is null) return typeof(this).init; 58 return cast(AudioEffectEQ)(constructor()); 59 } 60 @disable new(size_t s); 61 /** 62 Sets band's gain at the specified index, in dB. 63 */ 64 void setBandGainDb(in long band_idx, in double volume_db) 65 { 66 checkClassBinding!(typeof(this))(); 67 ptrcall!(void)(_classBinding.setBandGainDb, _godot_object, band_idx, volume_db); 68 } 69 /** 70 Returns the band's gain at the specified index, in dB. 71 */ 72 double getBandGainDb(in long band_idx) const 73 { 74 checkClassBinding!(typeof(this))(); 75 return ptrcall!(double)(_classBinding.getBandGainDb, _godot_object, band_idx); 76 } 77 /** 78 Returns the number of bands of the equalizer. 79 */ 80 long getBandCount() const 81 { 82 checkClassBinding!(typeof(this))(); 83 return ptrcall!(long)(_classBinding.getBandCount, _godot_object); 84 } 85 }