1 /** 2 Adds a Pitch shift audio effect to an Audio bus. 3 Raises or lowers the pitch of original sound. 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.audioeffectpitchshift; 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 Adds a Pitch shift audio effect to an Audio bus. 29 Raises or lowers the pitch of original sound. 30 31 Allows modulation of pitch independently of tempo. All frequencies can be increased/decreased with minimal effect on transients. 32 */ 33 @GodotBaseClass struct AudioEffectPitchShift 34 { 35 enum string _GODOT_internal_name = "AudioEffectPitchShift"; 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_pitch_scale") GodotMethod!(void, double) setPitchScale; 46 @GodotName("get_pitch_scale") GodotMethod!(double) getPitchScale; 47 } 48 bool opEquals(in AudioEffectPitchShift other) const { return _godot_object.ptr is other._godot_object.ptr; } 49 AudioEffectPitchShift opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 50 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 51 mixin baseCasts; 52 static AudioEffectPitchShift _new() 53 { 54 static godot_class_constructor constructor; 55 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("AudioEffectPitchShift"); 56 if(constructor is null) return typeof(this).init; 57 return cast(AudioEffectPitchShift)(constructor()); 58 } 59 @disable new(size_t s); 60 /** 61 62 */ 63 void setPitchScale(in double rate) 64 { 65 checkClassBinding!(typeof(this))(); 66 ptrcall!(void)(_classBinding.setPitchScale, _godot_object, rate); 67 } 68 /** 69 70 */ 71 double getPitchScale() const 72 { 73 checkClassBinding!(typeof(this))(); 74 return ptrcall!(double)(_classBinding.getPitchScale, _godot_object); 75 } 76 /** 77 Pitch value. Can range from 0 (-1 octave) to 16 (+16 octaves). 78 */ 79 @property double pitchScale() 80 { 81 return getPitchScale(); 82 } 83 /// ditto 84 @property void pitchScale(double v) 85 { 86 setPitchScale(v); 87 } 88 }