1 /**
2 Adds a pitch-shifting 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.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 Adds a pitch-shifting 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 	package(godot) 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 GDNativeClassBinding
43 	{
44 		__gshared:
45 		@GodotName("get_fft_size") GodotMethod!(AudioEffectPitchShift.FFT_Size) getFftSize;
46 		@GodotName("get_oversampling") GodotMethod!(long) getOversampling;
47 		@GodotName("get_pitch_scale") GodotMethod!(double) getPitchScale;
48 		@GodotName("set_fft_size") GodotMethod!(void, long) setFftSize;
49 		@GodotName("set_oversampling") GodotMethod!(void, long) setOversampling;
50 		@GodotName("set_pitch_scale") GodotMethod!(void, double) setPitchScale;
51 	}
52 	/// 
53 	pragma(inline, true) bool opEquals(in AudioEffectPitchShift other) const
54 	{ return _godot_object.ptr is other._godot_object.ptr; }
55 	/// 
56 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
57 	{ _godot_object.ptr = n; return null; }
58 	/// 
59 	pragma(inline, true) bool opEquals(typeof(null) n) const
60 	{ return _godot_object.ptr is n; }
61 	/// 
62 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
63 	mixin baseCasts;
64 	/// Construct a new instance of AudioEffectPitchShift.
65 	/// Note: use `memnew!AudioEffectPitchShift` instead.
66 	static AudioEffectPitchShift _new()
67 	{
68 		static godot_class_constructor constructor;
69 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("AudioEffectPitchShift");
70 		if(constructor is null) return typeof(this).init;
71 		return cast(AudioEffectPitchShift)(constructor());
72 	}
73 	@disable new(size_t s);
74 	/// 
75 	enum FFT_Size : int
76 	{
77 		/**
78 		
79 		*/
80 		fftSize256 = 0,
81 		/**
82 		
83 		*/
84 		fftSize512 = 1,
85 		/**
86 		
87 		*/
88 		fftSize1024 = 2,
89 		/**
90 		
91 		*/
92 		fftSize2048 = 3,
93 		/**
94 		
95 		*/
96 		fftSize4096 = 4,
97 		/**
98 		Represents the size of the $(D fftSize) enum.
99 		*/
100 		fftSizeMax = 5,
101 	}
102 	/// 
103 	enum Constants : int
104 	{
105 		fftSize256 = 0,
106 		fftSize512 = 1,
107 		fftSize1024 = 2,
108 		fftSize2048 = 3,
109 		fftSize4096 = 4,
110 		fftSizeMax = 5,
111 	}
112 	/**
113 	
114 	*/
115 	AudioEffectPitchShift.FFT_Size getFftSize() const
116 	{
117 		checkClassBinding!(typeof(this))();
118 		return ptrcall!(AudioEffectPitchShift.FFT_Size)(GDNativeClassBinding.getFftSize, _godot_object);
119 	}
120 	/**
121 	
122 	*/
123 	long getOversampling() const
124 	{
125 		checkClassBinding!(typeof(this))();
126 		return ptrcall!(long)(GDNativeClassBinding.getOversampling, _godot_object);
127 	}
128 	/**
129 	
130 	*/
131 	double getPitchScale() const
132 	{
133 		checkClassBinding!(typeof(this))();
134 		return ptrcall!(double)(GDNativeClassBinding.getPitchScale, _godot_object);
135 	}
136 	/**
137 	
138 	*/
139 	void setFftSize(in long size)
140 	{
141 		checkClassBinding!(typeof(this))();
142 		ptrcall!(void)(GDNativeClassBinding.setFftSize, _godot_object, size);
143 	}
144 	/**
145 	
146 	*/
147 	void setOversampling(in long amount)
148 	{
149 		checkClassBinding!(typeof(this))();
150 		ptrcall!(void)(GDNativeClassBinding.setOversampling, _godot_object, amount);
151 	}
152 	/**
153 	
154 	*/
155 	void setPitchScale(in double rate)
156 	{
157 		checkClassBinding!(typeof(this))();
158 		ptrcall!(void)(GDNativeClassBinding.setPitchScale, _godot_object, rate);
159 	}
160 	/**
161 	
162 	*/
163 	@property AudioEffectPitchShift.FFT_Size fftSize()
164 	{
165 		return getFftSize();
166 	}
167 	/// ditto
168 	@property void fftSize(long v)
169 	{
170 		setFftSize(v);
171 	}
172 	/**
173 	
174 	*/
175 	@property long oversampling()
176 	{
177 		return getOversampling();
178 	}
179 	/// ditto
180 	@property void oversampling(long v)
181 	{
182 		setOversampling(v);
183 	}
184 	/**
185 	Pitch value. Can range from 0 (-1 octave) to 16 (+16 octaves).
186 	*/
187 	@property double pitchScale()
188 	{
189 		return getPitchScale();
190 	}
191 	/// ditto
192 	@property void pitchScale(double v)
193 	{
194 		setPitchScale(v);
195 	}
196 }