1 /**
2 Adds a delay audio effect to an audio bus. Plays input signal back after a period of time.
3 Two tap delay and feedback options.
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.audioeffectdelay;
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 delay audio effect to an audio bus. Plays input signal back after a period of time.
29 Two tap delay and feedback options.
30 
31 Plays input signal back after a period of time. The delayed signal may be played back multiple times to create the sound of a repeating, decaying echo. Delay effects range from a subtle echo effect to a pronounced blending of previous sounds with new sounds.
32 */
33 @GodotBaseClass struct AudioEffectDelay
34 {
35 	package(godot) enum string _GODOT_internal_name = "AudioEffectDelay";
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_dry") GodotMethod!(double) getDry;
46 		@GodotName("get_feedback_delay_ms") GodotMethod!(double) getFeedbackDelayMs;
47 		@GodotName("get_feedback_level_db") GodotMethod!(double) getFeedbackLevelDb;
48 		@GodotName("get_feedback_lowpass") GodotMethod!(double) getFeedbackLowpass;
49 		@GodotName("get_tap1_delay_ms") GodotMethod!(double) getTap1DelayMs;
50 		@GodotName("get_tap1_level_db") GodotMethod!(double) getTap1LevelDb;
51 		@GodotName("get_tap1_pan") GodotMethod!(double) getTap1Pan;
52 		@GodotName("get_tap2_delay_ms") GodotMethod!(double) getTap2DelayMs;
53 		@GodotName("get_tap2_level_db") GodotMethod!(double) getTap2LevelDb;
54 		@GodotName("get_tap2_pan") GodotMethod!(double) getTap2Pan;
55 		@GodotName("is_feedback_active") GodotMethod!(bool) isFeedbackActive;
56 		@GodotName("is_tap1_active") GodotMethod!(bool) isTap1Active;
57 		@GodotName("is_tap2_active") GodotMethod!(bool) isTap2Active;
58 		@GodotName("set_dry") GodotMethod!(void, double) setDry;
59 		@GodotName("set_feedback_active") GodotMethod!(void, bool) setFeedbackActive;
60 		@GodotName("set_feedback_delay_ms") GodotMethod!(void, double) setFeedbackDelayMs;
61 		@GodotName("set_feedback_level_db") GodotMethod!(void, double) setFeedbackLevelDb;
62 		@GodotName("set_feedback_lowpass") GodotMethod!(void, double) setFeedbackLowpass;
63 		@GodotName("set_tap1_active") GodotMethod!(void, bool) setTap1Active;
64 		@GodotName("set_tap1_delay_ms") GodotMethod!(void, double) setTap1DelayMs;
65 		@GodotName("set_tap1_level_db") GodotMethod!(void, double) setTap1LevelDb;
66 		@GodotName("set_tap1_pan") GodotMethod!(void, double) setTap1Pan;
67 		@GodotName("set_tap2_active") GodotMethod!(void, bool) setTap2Active;
68 		@GodotName("set_tap2_delay_ms") GodotMethod!(void, double) setTap2DelayMs;
69 		@GodotName("set_tap2_level_db") GodotMethod!(void, double) setTap2LevelDb;
70 		@GodotName("set_tap2_pan") GodotMethod!(void, double) setTap2Pan;
71 	}
72 	/// 
73 	pragma(inline, true) bool opEquals(in AudioEffectDelay other) const
74 	{ return _godot_object.ptr is other._godot_object.ptr; }
75 	/// 
76 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
77 	{ _godot_object.ptr = n; return null; }
78 	/// 
79 	pragma(inline, true) bool opEquals(typeof(null) n) const
80 	{ return _godot_object.ptr is n; }
81 	/// 
82 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
83 	mixin baseCasts;
84 	/// Construct a new instance of AudioEffectDelay.
85 	/// Note: use `memnew!AudioEffectDelay` instead.
86 	static AudioEffectDelay _new()
87 	{
88 		static godot_class_constructor constructor;
89 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("AudioEffectDelay");
90 		if(constructor is null) return typeof(this).init;
91 		return cast(AudioEffectDelay)(constructor());
92 	}
93 	@disable new(size_t s);
94 	/**
95 	
96 	*/
97 	double getDry()
98 	{
99 		checkClassBinding!(typeof(this))();
100 		return ptrcall!(double)(GDNativeClassBinding.getDry, _godot_object);
101 	}
102 	/**
103 	
104 	*/
105 	double getFeedbackDelayMs() const
106 	{
107 		checkClassBinding!(typeof(this))();
108 		return ptrcall!(double)(GDNativeClassBinding.getFeedbackDelayMs, _godot_object);
109 	}
110 	/**
111 	
112 	*/
113 	double getFeedbackLevelDb() const
114 	{
115 		checkClassBinding!(typeof(this))();
116 		return ptrcall!(double)(GDNativeClassBinding.getFeedbackLevelDb, _godot_object);
117 	}
118 	/**
119 	
120 	*/
121 	double getFeedbackLowpass() const
122 	{
123 		checkClassBinding!(typeof(this))();
124 		return ptrcall!(double)(GDNativeClassBinding.getFeedbackLowpass, _godot_object);
125 	}
126 	/**
127 	
128 	*/
129 	double getTap1DelayMs() const
130 	{
131 		checkClassBinding!(typeof(this))();
132 		return ptrcall!(double)(GDNativeClassBinding.getTap1DelayMs, _godot_object);
133 	}
134 	/**
135 	
136 	*/
137 	double getTap1LevelDb() const
138 	{
139 		checkClassBinding!(typeof(this))();
140 		return ptrcall!(double)(GDNativeClassBinding.getTap1LevelDb, _godot_object);
141 	}
142 	/**
143 	
144 	*/
145 	double getTap1Pan() const
146 	{
147 		checkClassBinding!(typeof(this))();
148 		return ptrcall!(double)(GDNativeClassBinding.getTap1Pan, _godot_object);
149 	}
150 	/**
151 	
152 	*/
153 	double getTap2DelayMs() const
154 	{
155 		checkClassBinding!(typeof(this))();
156 		return ptrcall!(double)(GDNativeClassBinding.getTap2DelayMs, _godot_object);
157 	}
158 	/**
159 	
160 	*/
161 	double getTap2LevelDb() const
162 	{
163 		checkClassBinding!(typeof(this))();
164 		return ptrcall!(double)(GDNativeClassBinding.getTap2LevelDb, _godot_object);
165 	}
166 	/**
167 	
168 	*/
169 	double getTap2Pan() const
170 	{
171 		checkClassBinding!(typeof(this))();
172 		return ptrcall!(double)(GDNativeClassBinding.getTap2Pan, _godot_object);
173 	}
174 	/**
175 	
176 	*/
177 	bool isFeedbackActive() const
178 	{
179 		checkClassBinding!(typeof(this))();
180 		return ptrcall!(bool)(GDNativeClassBinding.isFeedbackActive, _godot_object);
181 	}
182 	/**
183 	
184 	*/
185 	bool isTap1Active() const
186 	{
187 		checkClassBinding!(typeof(this))();
188 		return ptrcall!(bool)(GDNativeClassBinding.isTap1Active, _godot_object);
189 	}
190 	/**
191 	
192 	*/
193 	bool isTap2Active() const
194 	{
195 		checkClassBinding!(typeof(this))();
196 		return ptrcall!(bool)(GDNativeClassBinding.isTap2Active, _godot_object);
197 	}
198 	/**
199 	
200 	*/
201 	void setDry(in double amount)
202 	{
203 		checkClassBinding!(typeof(this))();
204 		ptrcall!(void)(GDNativeClassBinding.setDry, _godot_object, amount);
205 	}
206 	/**
207 	
208 	*/
209 	void setFeedbackActive(in bool amount)
210 	{
211 		checkClassBinding!(typeof(this))();
212 		ptrcall!(void)(GDNativeClassBinding.setFeedbackActive, _godot_object, amount);
213 	}
214 	/**
215 	
216 	*/
217 	void setFeedbackDelayMs(in double amount)
218 	{
219 		checkClassBinding!(typeof(this))();
220 		ptrcall!(void)(GDNativeClassBinding.setFeedbackDelayMs, _godot_object, amount);
221 	}
222 	/**
223 	
224 	*/
225 	void setFeedbackLevelDb(in double amount)
226 	{
227 		checkClassBinding!(typeof(this))();
228 		ptrcall!(void)(GDNativeClassBinding.setFeedbackLevelDb, _godot_object, amount);
229 	}
230 	/**
231 	
232 	*/
233 	void setFeedbackLowpass(in double amount)
234 	{
235 		checkClassBinding!(typeof(this))();
236 		ptrcall!(void)(GDNativeClassBinding.setFeedbackLowpass, _godot_object, amount);
237 	}
238 	/**
239 	
240 	*/
241 	void setTap1Active(in bool amount)
242 	{
243 		checkClassBinding!(typeof(this))();
244 		ptrcall!(void)(GDNativeClassBinding.setTap1Active, _godot_object, amount);
245 	}
246 	/**
247 	
248 	*/
249 	void setTap1DelayMs(in double amount)
250 	{
251 		checkClassBinding!(typeof(this))();
252 		ptrcall!(void)(GDNativeClassBinding.setTap1DelayMs, _godot_object, amount);
253 	}
254 	/**
255 	
256 	*/
257 	void setTap1LevelDb(in double amount)
258 	{
259 		checkClassBinding!(typeof(this))();
260 		ptrcall!(void)(GDNativeClassBinding.setTap1LevelDb, _godot_object, amount);
261 	}
262 	/**
263 	
264 	*/
265 	void setTap1Pan(in double amount)
266 	{
267 		checkClassBinding!(typeof(this))();
268 		ptrcall!(void)(GDNativeClassBinding.setTap1Pan, _godot_object, amount);
269 	}
270 	/**
271 	
272 	*/
273 	void setTap2Active(in bool amount)
274 	{
275 		checkClassBinding!(typeof(this))();
276 		ptrcall!(void)(GDNativeClassBinding.setTap2Active, _godot_object, amount);
277 	}
278 	/**
279 	
280 	*/
281 	void setTap2DelayMs(in double amount)
282 	{
283 		checkClassBinding!(typeof(this))();
284 		ptrcall!(void)(GDNativeClassBinding.setTap2DelayMs, _godot_object, amount);
285 	}
286 	/**
287 	
288 	*/
289 	void setTap2LevelDb(in double amount)
290 	{
291 		checkClassBinding!(typeof(this))();
292 		ptrcall!(void)(GDNativeClassBinding.setTap2LevelDb, _godot_object, amount);
293 	}
294 	/**
295 	
296 	*/
297 	void setTap2Pan(in double amount)
298 	{
299 		checkClassBinding!(typeof(this))();
300 		ptrcall!(void)(GDNativeClassBinding.setTap2Pan, _godot_object, amount);
301 	}
302 	/**
303 	Output percent of original sound. At 0, only delayed sounds are output. Value can range from 0 to 1.
304 	*/
305 	@property double dry()
306 	{
307 		return getDry();
308 	}
309 	/// ditto
310 	@property void dry(double v)
311 	{
312 		setDry(v);
313 	}
314 	/**
315 	If `true`, feedback is enabled.
316 	*/
317 	@property bool feedbackActive()
318 	{
319 		return isFeedbackActive();
320 	}
321 	/// ditto
322 	@property void feedbackActive(bool v)
323 	{
324 		setFeedbackActive(v);
325 	}
326 	/**
327 	Feedback delay time in milliseconds.
328 	*/
329 	@property double feedbackDelayMs()
330 	{
331 		return getFeedbackDelayMs();
332 	}
333 	/// ditto
334 	@property void feedbackDelayMs(double v)
335 	{
336 		setFeedbackDelayMs(v);
337 	}
338 	/**
339 	Sound level for `tap1`.
340 	*/
341 	@property double feedbackLevelDb()
342 	{
343 		return getFeedbackLevelDb();
344 	}
345 	/// ditto
346 	@property void feedbackLevelDb(double v)
347 	{
348 		setFeedbackLevelDb(v);
349 	}
350 	/**
351 	Low-pass filter for feedback, in Hz. Frequencies below this value are filtered out of the source signal.
352 	*/
353 	@property double feedbackLowpass()
354 	{
355 		return getFeedbackLowpass();
356 	}
357 	/// ditto
358 	@property void feedbackLowpass(double v)
359 	{
360 		setFeedbackLowpass(v);
361 	}
362 	/**
363 	If `true`, `tap1` will be enabled.
364 	*/
365 	@property bool tap1Active()
366 	{
367 		return isTap1Active();
368 	}
369 	/// ditto
370 	@property void tap1Active(bool v)
371 	{
372 		setTap1Active(v);
373 	}
374 	/**
375 	`tap1` delay time in milliseconds.
376 	*/
377 	@property double tap1DelayMs()
378 	{
379 		return getTap1DelayMs();
380 	}
381 	/// ditto
382 	@property void tap1DelayMs(double v)
383 	{
384 		setTap1DelayMs(v);
385 	}
386 	/**
387 	Sound level for `tap1`.
388 	*/
389 	@property double tap1LevelDb()
390 	{
391 		return getTap1LevelDb();
392 	}
393 	/// ditto
394 	@property void tap1LevelDb(double v)
395 	{
396 		setTap1LevelDb(v);
397 	}
398 	/**
399 	Pan position for `tap1`. Value can range from -1 (fully left) to 1 (fully right).
400 	*/
401 	@property double tap1Pan()
402 	{
403 		return getTap1Pan();
404 	}
405 	/// ditto
406 	@property void tap1Pan(double v)
407 	{
408 		setTap1Pan(v);
409 	}
410 	/**
411 	If `true`, `tap2` will be enabled.
412 	*/
413 	@property bool tap2Active()
414 	{
415 		return isTap2Active();
416 	}
417 	/// ditto
418 	@property void tap2Active(bool v)
419 	{
420 		setTap2Active(v);
421 	}
422 	/**
423 	$(B Tap2) delay time in milliseconds.
424 	*/
425 	@property double tap2DelayMs()
426 	{
427 		return getTap2DelayMs();
428 	}
429 	/// ditto
430 	@property void tap2DelayMs(double v)
431 	{
432 		setTap2DelayMs(v);
433 	}
434 	/**
435 	Sound level for `tap2`.
436 	*/
437 	@property double tap2LevelDb()
438 	{
439 		return getTap2LevelDb();
440 	}
441 	/// ditto
442 	@property void tap2LevelDb(double v)
443 	{
444 		setTap2LevelDb(v);
445 	}
446 	/**
447 	Pan position for `tap2`. Value can range from -1 (fully left) to 1 (fully right).
448 	*/
449 	@property double tap2Pan()
450 	{
451 		return getTap2Pan();
452 	}
453 	/// ditto
454 	@property void tap2Pan(double v)
455 	{
456 		setTap2Pan(v);
457 	}
458 }