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 = GstIndexFactory.html 27 * outPack = gstreamer 28 * outFile = IndexFactory 29 * strct = GstIndexFactory 30 * realStrct= 31 * ctorStrct= 32 * clss = IndexFactory 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gst_index_factory_ 41 * - gst_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * omit signals: 46 * imports: 47 * - glib.Str 48 * - gstreamer.Index 49 * structWrap: 50 * - GstIndex* -> Index 51 * - GstIndexFactory* -> IndexFactory 52 * module aliases: 53 * local aliases: 54 * overrides: 55 */ 56 57 module gstreamer.IndexFactory; 58 59 public import gstreamerc.gstreamertypes; 60 61 private import gstreamerc.gstreamer; 62 private import glib.ConstructionException; 63 private import gobject.ObjectG; 64 65 66 private import glib.Str; 67 private import gstreamer.Index; 68 69 70 71 private import gstreamer.PluginFeature; 72 73 /** 74 * Description 75 * GstIndexFactory is used to dynamically create GstIndex implementations. 76 */ 77 public class IndexFactory : PluginFeature 78 { 79 80 /** the main Gtk struct */ 81 protected GstIndexFactory* gstIndexFactory; 82 83 84 public GstIndexFactory* getIndexFactoryStruct() 85 { 86 return gstIndexFactory; 87 } 88 89 90 /** the main Gtk struct as a void* */ 91 protected override void* getStruct() 92 { 93 return cast(void*)gstIndexFactory; 94 } 95 96 /** 97 * Sets our main struct and passes it to the parent class 98 */ 99 public this (GstIndexFactory* gstIndexFactory) 100 { 101 super(cast(GstPluginFeature*)gstIndexFactory); 102 this.gstIndexFactory = gstIndexFactory; 103 } 104 105 protected override void setStruct(GObject* obj) 106 { 107 super.setStruct(obj); 108 gstIndexFactory = cast(GstIndexFactory*)obj; 109 } 110 111 /** 112 */ 113 114 /** 115 * Create a new indexfactory with the given parameters 116 * Params: 117 * name = name of indexfactory to create 118 * longdesc = long description of indexfactory to create 119 * type = the GType of the GstIndex element of this factory 120 * Throws: ConstructionException GTK+ fails to create the object. 121 */ 122 public this (string name, string longdesc, GType type) 123 { 124 // GstIndexFactory* gst_index_factory_new (const gchar *name, const gchar *longdesc, GType type); 125 auto p = gst_index_factory_new(Str.toStringz(name), Str.toStringz(longdesc), type); 126 if(p is null) 127 { 128 throw new ConstructionException("null returned by gst_index_factory_new(Str.toStringz(name), Str.toStringz(longdesc), type)"); 129 } 130 this(cast(GstIndexFactory*) p); 131 } 132 133 /** 134 * Removes the index from the global list. 135 */ 136 public void destroy() 137 { 138 // void gst_index_factory_destroy (GstIndexFactory *factory); 139 gst_index_factory_destroy(gstIndexFactory); 140 } 141 142 /** 143 * Search for an indexfactory of the given name. 144 * Params: 145 * name = name of indexfactory to find 146 * Returns: GstIndexFactory if found, NULL otherwise 147 */ 148 public static IndexFactory find(string name) 149 { 150 // GstIndexFactory* gst_index_factory_find (const gchar *name); 151 auto p = gst_index_factory_find(Str.toStringz(name)); 152 153 if(p is null) 154 { 155 return null; 156 } 157 158 return ObjectG.getDObject!(IndexFactory)(cast(GstIndexFactory*) p); 159 } 160 161 /** 162 * Create a new GstIndex instance from the 163 * given indexfactory. 164 * Returns: A new GstIndex instance. 165 */ 166 public Index create() 167 { 168 // GstIndex* gst_index_factory_create (GstIndexFactory *factory); 169 auto p = gst_index_factory_create(gstIndexFactory); 170 171 if(p is null) 172 { 173 return null; 174 } 175 176 return ObjectG.getDObject!(Index)(cast(GstIndex*) p); 177 } 178 179 /** 180 * Create a new GstIndex instance from the 181 * indexfactory with the given name. 182 * Params: 183 * name = the name of the factory used to create the instance 184 * Returns: A new GstIndex instance. 185 */ 186 public static Index make(string name) 187 { 188 // GstIndex* gst_index_factory_make (const gchar *name); 189 auto p = gst_index_factory_make(Str.toStringz(name)); 190 191 if(p is null) 192 { 193 return null; 194 } 195 196 return ObjectG.getDObject!(Index)(cast(GstIndex*) p); 197 } 198 }