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