1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GstPluginFeature.html
27  * outPack = gstreamer
28  * outFile = PluginFeature
29  * strct   = GstPluginFeature
30  * realStrct=
31  * ctorStrct=
32  * clss    = PluginFeature
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gst_plugin_feature_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- glib.ListG
48  * 	- gstreamer.Plugin
49  * structWrap:
50  * 	- GList* -> ListG
51  * 	- GstPlugin* -> Plugin
52  * 	- GstPluginFeature* -> PluginFeature
53  * module aliases:
54  * local aliases:
55  * 	- setName -> setFeatureName
56  * overrides:
57  * 	- getName
58  */
59 
60 module gstreamer.PluginFeature;
61 
62 public  import gstreamerc.gstreamertypes;
63 
64 private import gstreamerc.gstreamer;
65 private import glib.ConstructionException;
66 private import gobject.ObjectG;
67 
68 
69 private import glib.Str;
70 private import glib.ListG;
71 private import gstreamer.Plugin;
72 
73 
74 
75 private import gstreamer.ObjectGst;
76 
77 /**
78  * This is a base class for anything that can be added to a GstPlugin.
79  */
80 public class PluginFeature : ObjectGst
81 {
82 	
83 	/** the main Gtk struct */
84 	protected GstPluginFeature* gstPluginFeature;
85 	
86 	
87 	public GstPluginFeature* getPluginFeatureStruct()
88 	{
89 		return gstPluginFeature;
90 	}
91 	
92 	
93 	/** the main Gtk struct as a void* */
94 	protected override void* getStruct()
95 	{
96 		return cast(void*)gstPluginFeature;
97 	}
98 	
99 	/**
100 	 * Sets our main struct and passes it to the parent class
101 	 */
102 	public this (GstPluginFeature* gstPluginFeature)
103 	{
104 		super(cast(GstObject*)gstPluginFeature);
105 		this.gstPluginFeature = gstPluginFeature;
106 	}
107 	
108 	protected override void setStruct(GObject* obj)
109 	{
110 		super.setStruct(obj);
111 		gstPluginFeature = cast(GstPluginFeature*)obj;
112 	}
113 	
114 	/**
115 	 */
116 	
117 	/**
118 	 * Specifies a rank for a plugin feature, so that autoplugging uses
119 	 * the most appropriate feature.
120 	 * Params:
121 	 * rank = rank value - higher number means more priority rank
122 	 */
123 	public void setRank(uint rank)
124 	{
125 		// void gst_plugin_feature_set_rank (GstPluginFeature *feature,  guint rank);
126 		gst_plugin_feature_set_rank(gstPluginFeature, rank);
127 	}
128 	
129 	/**
130 	 * Gets the rank of a plugin feature.
131 	 * Returns: The rank of the feature
132 	 */
133 	public uint getRank()
134 	{
135 		// guint gst_plugin_feature_get_rank (GstPluginFeature *feature);
136 		return gst_plugin_feature_get_rank(gstPluginFeature);
137 	}
138 	
139 	/**
140 	 * Get the plugin that provides this feature.
141 	 * Returns: the plugin that provides this feature, or NULL. Unref with gst_object_unref() when no longer needed. [transfer full]
142 	 */
143 	public Plugin getPlugin()
144 	{
145 		// GstPlugin * gst_plugin_feature_get_plugin (GstPluginFeature *feature);
146 		auto p = gst_plugin_feature_get_plugin(gstPluginFeature);
147 		
148 		if(p is null)
149 		{
150 			return null;
151 		}
152 		
153 		return ObjectG.getDObject!(Plugin)(cast(GstPlugin*) p);
154 	}
155 	
156 	/**
157 	 * Get the name of the plugin that provides this feature.
158 	 * Since 1.2.0
159 	 * Returns: the name of the plugin that provides this feature, or NULL if the feature is not associated with a plugin.
160 	 */
161 	public string getPluginName()
162 	{
163 		// const gchar * gst_plugin_feature_get_plugin_name (GstPluginFeature *feature);
164 		return Str.toString(gst_plugin_feature_get_plugin_name(gstPluginFeature));
165 	}
166 	
167 	/**
168 	 * Loads the plugin containing feature if it's not already loaded. feature is
169 	 * unaffected; use the return value instead.
170 	 * Returns: a reference to the loaded feature, or NULL on error. [transfer full]
171 	 */
172 	public PluginFeature load()
173 	{
174 		// GstPluginFeature * gst_plugin_feature_load (GstPluginFeature *feature);
175 		auto p = gst_plugin_feature_load(gstPluginFeature);
176 		
177 		if(p is null)
178 		{
179 			return null;
180 		}
181 		
182 		return ObjectG.getDObject!(PluginFeature)(cast(GstPluginFeature*) p);
183 	}
184 	
185 	/**
186 	 * Copies the list of features. Caller should call gst_plugin_feature_list_free
187 	 * when done with the list.
188 	 * Params:
189 	 * list = list
190 	 * of GstPluginFeature. [transfer none][element-type Gst.PluginFeature]
191 	 * Returns: a copy of list, with each feature's reference count incremented. [transfer full][element-type Gst.PluginFeature]
192 	 */
193 	public static ListG listCopy(ListG list)
194 	{
195 		// GList * gst_plugin_feature_list_copy (GList *list);
196 		auto p = gst_plugin_feature_list_copy((list is null) ? null : list.getListGStruct());
197 		
198 		if(p is null)
199 		{
200 			return null;
201 		}
202 		
203 		return ObjectG.getDObject!(ListG)(cast(GList*) p);
204 	}
205 	
206 	/**
207 	 * Unrefs each member of list, then frees the list.
208 	 * Params:
209 	 * list = list
210 	 * of GstPluginFeature. [transfer full][element-type Gst.PluginFeature]
211 	 */
212 	public static void listFree(ListG list)
213 	{
214 		// void gst_plugin_feature_list_free (GList *list);
215 		gst_plugin_feature_list_free((list is null) ? null : list.getListGStruct());
216 	}
217 	
218 	/**
219 	 * Checks whether the given plugin feature is at least
220 	 *  the required version
221 	 * Params:
222 	 * minMajor = minimum required major version
223 	 * minMinor = minimum required minor version
224 	 * minMicro = minimum required micro version
225 	 * Returns: TRUE if the plugin feature has at least the required version, otherwise FALSE.
226 	 */
227 	public int checkVersion(uint minMajor, uint minMinor, uint minMicro)
228 	{
229 		// gboolean gst_plugin_feature_check_version (GstPluginFeature *feature,  guint min_major,  guint min_minor,  guint min_micro);
230 		return gst_plugin_feature_check_version(gstPluginFeature, minMajor, minMinor, minMicro);
231 	}
232 	
233 	/**
234 	 * Compares the two given GstPluginFeature instances. This function can be
235 	 * used as a GCompareFunc when sorting by rank and then by name.
236 	 * Params:
237 	 * p1 = a GstPluginFeature
238 	 * p2 = a GstPluginFeature
239 	 * Returns: negative value if the rank of p1 > the rank of p2 or the ranks are equal but the name of p1 comes before the name of p2; zero if the rank and names are equal; positive value if the rank of p1 < the rank of p2 or the ranks are equal but the name of p2 comes before the name of p1
240 	 */
241 	public static int rankCompareFunc(void* p1, void* p2)
242 	{
243 		// gint gst_plugin_feature_rank_compare_func  (gconstpointer p1,  gconstpointer p2);
244 		return gst_plugin_feature_rank_compare_func(p1, p2);
245 	}
246 }