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  * 	- gst_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * 	- glib.ListG
49  * 	- gstreamer.TypeFind
50  * 	- gstreamer.Caps
51  * structWrap:
52  * 	- GList* -> ListG
53  * 	- GstCaps* -> Caps
54  * 	- GstTypeFind* -> TypeFind
55  * 	- GstTypeFindFactory* -> TypeFindFactory
56  * module aliases:
57  * local aliases:
58  * overrides:
59  */
60 
61 module gstreamer.TypeFindFactory;
62 
63 public  import gstreamerc.gstreamertypes;
64 
65 private import gstreamerc.gstreamer;
66 private import glib.ConstructionException;
67 private import gobject.ObjectG;
68 
69 
70 private import glib.Str;
71 private import glib.ListG;
72 private import gstreamer.TypeFind;
73 private import gstreamer.Caps;
74 
75 
76 
77 private import gstreamer.PluginFeature;
78 
79 /**
80  * Description
81  * These functions allow querying informations about registered typefind
82  * functions. How to create and register these functions is described in
83  * the section
84  * "Writing typefind functions".
85  * $(DDOC_COMMENT example)
86  * The above example shows how to write a very simple typefinder that
87  * identifies the given data. You can get quite a bit more complicated than
88  * that though.
89  * Last reviewed on 2005-11-09 (0.9.4)
90  */
91 public class TypeFindFactory : PluginFeature
92 {
93 	
94 	/** the main Gtk struct */
95 	protected GstTypeFindFactory* gstTypeFindFactory;
96 	
97 	
98 	public GstTypeFindFactory* getTypeFindFactoryStruct()
99 	{
100 		return gstTypeFindFactory;
101 	}
102 	
103 	
104 	/** the main Gtk struct as a void* */
105 	protected override void* getStruct()
106 	{
107 		return cast(void*)gstTypeFindFactory;
108 	}
109 	
110 	/**
111 	 * Sets our main struct and passes it to the parent class
112 	 */
113 	public this (GstTypeFindFactory* gstTypeFindFactory)
114 	{
115 		super(cast(GstPluginFeature*)gstTypeFindFactory);
116 		this.gstTypeFindFactory = gstTypeFindFactory;
117 	}
118 	
119 	protected override void setStruct(GObject* obj)
120 	{
121 		super.setStruct(obj);
122 		gstTypeFindFactory = cast(GstTypeFindFactory*)obj;
123 	}
124 	
125 	/**
126 	 */
127 	
128 	/**
129 	 * Gets the list of all registered typefind factories. You must free the
130 	 * list using gst_plugin_feature_list_free.
131 	 * Returns: the list of all registered GstTypeFindFactory.
132 	 */
133 	public static ListG getList()
134 	{
135 		// GList* gst_type_find_factory_get_list (void);
136 		auto p = gst_type_find_factory_get_list();
137 		
138 		if(p is null)
139 		{
140 			return null;
141 		}
142 		
143 		return ObjectG.getDObject!(ListG)(cast(GList*) p);
144 	}
145 	
146 	/**
147 	 * Gets the extensions associated with a GstTypeFindFactory. The returned
148 	 * array should not be changed. If you need to change stuff in it, you should
149 	 * copy it using g_stdupv(). This function may return NULL to indicate
150 	 * a 0-length list.
151 	 * Returns: a NULL-terminated array of extensions associated with this factory
152 	 */
153 	public string[] getExtensions()
154 	{
155 		// gchar** gst_type_find_factory_get_extensions  (GstTypeFindFactory *factory);
156 		return Str.toStringArray(gst_type_find_factory_get_extensions(gstTypeFindFactory));
157 	}
158 	
159 	/**
160 	 * Gets the GstCaps associated with a typefind factory.
161 	 * Returns: The GstCaps associated with this factory
162 	 */
163 	public Caps getCaps()
164 	{
165 		// GstCaps* gst_type_find_factory_get_caps (GstTypeFindFactory *factory);
166 		auto p = gst_type_find_factory_get_caps(gstTypeFindFactory);
167 		
168 		if(p is null)
169 		{
170 			return null;
171 		}
172 		
173 		return ObjectG.getDObject!(Caps)(cast(GstCaps*) p);
174 	}
175 	
176 	/**
177 	 * Calls the GstTypeFindFunction associated with this factory.
178 	 * Params:
179 	 * find = A properly setup GstTypeFind entry. The get_data and suggest_type
180 	 *  members must be set.
181 	 */
182 	public void callFunction(TypeFind find)
183 	{
184 		// void gst_type_find_factory_call_function (GstTypeFindFactory *factory,  GstTypeFind *find);
185 		gst_type_find_factory_call_function(gstTypeFindFactory, (find is null) ? null : find.getTypeFindStruct());
186 	}
187 }