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  = GstTypeFindFactory.html
27  * outPack = gstreamer
28  * outFile = TypeFindFactory
29  * strct   = GstTypeFindFactory
30  * realStrct=
31  * ctorStrct=
32  * clss    = TypeFindFactory
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gst_type_find_factory_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- glib.ListG
48  * 	- gstreamer.Caps
49  * 	- gstreamer.TypeFind
50  * structWrap:
51  * 	- GList* -> ListG
52  * 	- GstCaps* -> Caps
53  * 	- GstTypeFind* -> TypeFind
54  * module aliases:
55  * local aliases:
56  * overrides:
57  */
58 
59 module gstreamer.TypeFindFactory;
60 
61 public  import gstreamerc.gstreamertypes;
62 
63 private import gstreamerc.gstreamer;
64 private import glib.ConstructionException;
65 private import gobject.ObjectG;
66 
67 private import glib.Str;
68 private import glib.ListG;
69 private import gstreamer.Caps;
70 private import gstreamer.TypeFind;
71 
72 
73 private import gstreamer.PluginFeature;
74 
75 /**
76  * These functions allow querying informations about registered typefind
77  * functions. How to create and register these functions is described in
78  * the section
79  * "Writing typefind functions".
80  *
81  * $(DDOC_COMMENT example)
82  *
83  * The above example shows how to write a very simple typefinder that
84  * identifies the given data. You can get quite a bit more complicated than
85  * that though.
86  *
87  * Last reviewed on 2005-11-09 (0.9.4)
88  */
89 public class TypeFindFactory : PluginFeature
90 {
91 	
92 	/** the main Gtk struct */
93 	protected GstTypeFindFactory* gstTypeFindFactory;
94 	
95 	
96 	/** Get the main Gtk struct */
97 	public GstTypeFindFactory* getTypeFindFactoryStruct()
98 	{
99 		return gstTypeFindFactory;
100 	}
101 	
102 	
103 	/** the main Gtk struct as a void* */
104 	protected override void* getStruct()
105 	{
106 		return cast(void*)gstTypeFindFactory;
107 	}
108 	
109 	/**
110 	 * Sets our main struct and passes it to the parent class
111 	 */
112 	public this (GstTypeFindFactory* gstTypeFindFactory)
113 	{
114 		super(cast(GstPluginFeature*)gstTypeFindFactory);
115 		this.gstTypeFindFactory = gstTypeFindFactory;
116 	}
117 	
118 	protected override void setStruct(GObject* obj)
119 	{
120 		super.setStruct(obj);
121 		gstTypeFindFactory = cast(GstTypeFindFactory*)obj;
122 	}
123 	
124 	/**
125 	 */
126 	
127 	/**
128 	 * Gets the list of all registered typefind factories. You must free the
129 	 * list using gst_plugin_feature_list_free().
130 	 * The returned factories are sorted by highest rank first, and then by
131 	 * factory name.
132 	 * Free-function: gst_plugin_feature_list_free
133 	 * Returns: the list of all registered GstTypeFindFactory. [transfer full][element-type Gst.TypeFindFactory]
134 	 */
135 	public static ListG getList()
136 	{
137 		// GList * gst_type_find_factory_get_list (void);
138 		auto p = gst_type_find_factory_get_list();
139 		
140 		if(p is null)
141 		{
142 			return null;
143 		}
144 		
145 		return ObjectG.getDObject!(ListG)(cast(GList*) p);
146 	}
147 	
148 	/**
149 	 * Gets the extensions associated with a GstTypeFindFactory. The returned
150 	 * array should not be changed. If you need to change stuff in it, you should
151 	 * copy it using g_strdupv(). This function may return NULL to indicate
152 	 * a 0-length list.
153 	 * Returns: a NULL-terminated array of extensions associated with this factory. [transfer none][array zero-terminated=1][element-type utf8]
154 	 */
155 	public string[] getExtensions()
156 	{
157 		// const gchar * const * gst_type_find_factory_get_extensions  (GstTypeFindFactory *factory);
158 		return Str.toStringArray(gst_type_find_factory_get_extensions(gstTypeFindFactory));
159 	}
160 	
161 	/**
162 	 * Gets the GstCaps associated with a typefind factory.
163 	 * Returns: the GstCaps associated with this factory. [transfer none]
164 	 */
165 	public Caps getCaps()
166 	{
167 		// GstCaps * gst_type_find_factory_get_caps (GstTypeFindFactory *factory);
168 		auto p = gst_type_find_factory_get_caps(gstTypeFindFactory);
169 		
170 		if(p is null)
171 		{
172 			return null;
173 		}
174 		
175 		return ObjectG.getDObject!(Caps)(cast(GstCaps*) p);
176 	}
177 	
178 	/**
179 	 * Check whether the factory has a typefind function. Typefind factories
180 	 * without typefind functions are a last-effort fallback mechanism to
181 	 * e.g. assume a certain media type based on the file extension.
182 	 * Returns: TRUE if the factory has a typefind functions set, otherwise FALSE
183 	 */
184 	public int hasFunction()
185 	{
186 		// gboolean gst_type_find_factory_has_function (GstTypeFindFactory *factory);
187 		return gst_type_find_factory_has_function(gstTypeFindFactory);
188 	}
189 	
190 	/**
191 	 * Calls the GstTypeFindFunction associated with this factory.
192 	 * Params:
193 	 * find = a properly setup GstTypeFind entry. The get_data
194 	 * and suggest_type members must be set. [transfer none]
195 	 */
196 	public void callFunction(TypeFind find)
197 	{
198 		// void gst_type_find_factory_call_function (GstTypeFindFactory *factory,  GstTypeFind *find);
199 		gst_type_find_factory_call_function(gstTypeFindFactory, (find is null) ? null : find.getTypeFindStruct());
200 	}
201 }