1 /**
2 OGG Vorbis audio stream driver.
3 
4 Copyright:
5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur.  
6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)  
7 Copyright (c) 2017-2018 Godot-D contributors  
8 
9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License)
10 
11 
12 */
13 module godot.audiostreamoggvorbis;
14 import std.meta : AliasSeq, staticIndexOf;
15 import std.traits : Unqual;
16 import godot.d.meta;
17 import godot.core;
18 import godot.c;
19 import godot.d.bind;
20 import godot.d.reference;
21 import godot.object;
22 import godot.classdb;
23 import godot.audiostream;
24 import godot.resource;
25 import godot.reference;
26 /**
27 OGG Vorbis audio stream driver.
28 
29 
30 */
31 @GodotBaseClass struct AudioStreamOGGVorbis
32 {
33 	enum string _GODOT_internal_name = "AudioStreamOGGVorbis";
34 public:
35 @nogc nothrow:
36 	union { godot_object _godot_object; AudioStream _GODOT_base; }
37 	alias _GODOT_base this;
38 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
39 	package(godot) __gshared bool _classBindingInitialized = false;
40 	package(godot) static struct _classBinding
41 	{
42 		__gshared:
43 		@GodotName("set_data") GodotMethod!(void, PoolByteArray) setData;
44 		@GodotName("get_data") GodotMethod!(PoolByteArray) getData;
45 		@GodotName("set_loop") GodotMethod!(void, bool) setLoop;
46 		@GodotName("has_loop") GodotMethod!(bool) hasLoop;
47 		@GodotName("set_loop_offset") GodotMethod!(void, double) setLoopOffset;
48 		@GodotName("get_loop_offset") GodotMethod!(double) getLoopOffset;
49 	}
50 	bool opEquals(in AudioStreamOGGVorbis other) const { return _godot_object.ptr is other._godot_object.ptr; }
51 	AudioStreamOGGVorbis opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
52 	bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
53 	mixin baseCasts;
54 	static AudioStreamOGGVorbis _new()
55 	{
56 		static godot_class_constructor constructor;
57 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("AudioStreamOGGVorbis");
58 		if(constructor is null) return typeof(this).init;
59 		return cast(AudioStreamOGGVorbis)(constructor());
60 	}
61 	@disable new(size_t s);
62 	/**
63 	
64 	*/
65 	void setData(in PoolByteArray data)
66 	{
67 		checkClassBinding!(typeof(this))();
68 		ptrcall!(void)(_classBinding.setData, _godot_object, data);
69 	}
70 	/**
71 	
72 	*/
73 	PoolByteArray getData() const
74 	{
75 		checkClassBinding!(typeof(this))();
76 		return ptrcall!(PoolByteArray)(_classBinding.getData, _godot_object);
77 	}
78 	/**
79 	
80 	*/
81 	void setLoop(in bool enable)
82 	{
83 		checkClassBinding!(typeof(this))();
84 		ptrcall!(void)(_classBinding.setLoop, _godot_object, enable);
85 	}
86 	/**
87 	
88 	*/
89 	bool hasLoop() const
90 	{
91 		checkClassBinding!(typeof(this))();
92 		return ptrcall!(bool)(_classBinding.hasLoop, _godot_object);
93 	}
94 	/**
95 	
96 	*/
97 	void setLoopOffset(in double seconds)
98 	{
99 		checkClassBinding!(typeof(this))();
100 		ptrcall!(void)(_classBinding.setLoopOffset, _godot_object, seconds);
101 	}
102 	/**
103 	
104 	*/
105 	double getLoopOffset() const
106 	{
107 		checkClassBinding!(typeof(this))();
108 		return ptrcall!(double)(_classBinding.getLoopOffset, _godot_object);
109 	}
110 	/**
111 	Contains the audio data in bytes.
112 	*/
113 	@property PoolByteArray data()
114 	{
115 		return getData();
116 	}
117 	/// ditto
118 	@property void data(PoolByteArray v)
119 	{
120 		setData(v);
121 	}
122 	/**
123 	
124 	*/
125 	@property bool loop()
126 	{
127 		return hasLoop();
128 	}
129 	/// ditto
130 	@property void loop(bool v)
131 	{
132 		setLoop(v);
133 	}
134 	/**
135 	
136 	*/
137 	@property double loopOffset()
138 	{
139 		return getLoopOffset();
140 	}
141 	/// ditto
142 	@property void loopOffset(double v)
143 	{
144 		setLoopOffset(v);
145 	}
146 }