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  = GstPreset.html
27  * outPack = gstreamer
28  * outFile = PresetT
29  * strct   = GstPreset
30  * realStrct=
31  * ctorStrct=
32  * clss    = PresetT
33  * interf  = PresetIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * 	- TStruct
38  * extend  = 
39  * implements:
40  * prefixes:
41  * 	- gst_preset_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * 	- glib.Str
48  * structWrap:
49  * module aliases:
50  * local aliases:
51  * overrides:
52  */
53 
54 module gstreamer.PresetT;
55 
56 public  import gstreamerc.gstreamertypes;
57 
58 public import gstreamerc.gstreamer;
59 public import glib.ConstructionException;
60 public import gobject.ObjectG;
61 
62 
63 public import glib.Str;
64 
65 
66 
67 
68 /**
69  * This interface offers methods to query and manipulate parameter preset sets.
70  * A preset is a bunch of property settings, together with meta data and a name.
71  * The name of a preset serves as key for subsequent method calls to manipulate
72  * single presets.
73  * All instances of one type will share the list of presets. The list is created
74  * on demand, if presets are not used, the list is not created.
75  *
76  * The interface comes with a default implementation that serves most plugins.
77  * Wrapper plugins will override most methods to implement support for the
78  * native preset format of those wrapped plugins.
79  * One method that is useful to be overridden is gst_preset_get_property_names().
80  * With that one can control which properties are saved and in which order.
81  *
82  * The default implementation supports presets located in a system directory,
83  * application specific directory and in the users home directory. When getting
84  * a list of presets individual presets are read and overlaid in 1) system,
85  * 2) application and 3) user order. Whenever an earlier entry is newer, the
86  * later entries will be updated.
87  */
88 public template PresetT(TStruct)
89 {
90 	
91 	/** the main Gtk struct */
92 	protected GstPreset* gstPreset;
93 	
94 	
95 	public GstPreset* getPresetTStruct()
96 	{
97 		return cast(GstPreset*)getStruct();
98 	}
99 	
100 	
101 	/**
102 	 */
103 	
104 	/**
105 	 * Get a copy of preset names as a NULL terminated string array.
106 	 * Returns: list with names, ue g_strfreev() after usage. [transfer full][array zero-terminated=1][element-type gchar*]
107 	 */
108 	public string[] getPresetNames()
109 	{
110 		// gchar ** gst_preset_get_preset_names (GstPreset *preset);
111 		return Str.toStringArray(gst_preset_get_preset_names(getPresetTStruct()));
112 	}
113 	
114 	/**
115 	 * Get a the names of the GObject properties that can be used for presets.
116 	 * Returns: an array of property names which should be freed with g_strfreev() after use. [transfer full][array zero-terminated=1][element-type gchar*]
117 	 */
118 	public string[] getPropertyNames()
119 	{
120 		// gchar ** gst_preset_get_property_names (GstPreset *preset);
121 		return Str.toStringArray(gst_preset_get_property_names(getPresetTStruct()));
122 	}
123 	
124 	/**
125 	 * Load the given preset.
126 	 * Params:
127 	 * name = preset name to load
128 	 * Returns: TRUE for success, FALSE if e.g. there is no preset with that name
129 	 */
130 	public int loadPreset(string name)
131 	{
132 		// gboolean gst_preset_load_preset (GstPreset *preset,  const gchar *name);
133 		return gst_preset_load_preset(getPresetTStruct(), Str.toStringz(name));
134 	}
135 	
136 	/**
137 	 * Save the current object settings as a preset under the given name. If there
138 	 * is already a preset by this name it will be overwritten.
139 	 * Params:
140 	 * name = preset name to save
141 	 * Returns: TRUE for success, FALSE
142 	 */
143 	public int savePreset(string name)
144 	{
145 		// gboolean gst_preset_save_preset (GstPreset *preset,  const gchar *name);
146 		return gst_preset_save_preset(getPresetTStruct(), Str.toStringz(name));
147 	}
148 	
149 	/**
150 	 * Renames a preset. If there is already a preset by the new_name it will be
151 	 * overwritten.
152 	 * Params:
153 	 * oldName = current preset name
154 	 * newName = new preset name
155 	 * Returns: TRUE for success, FALSE if e.g. there is no preset with old_name
156 	 */
157 	public int renamePreset(string oldName, string newName)
158 	{
159 		// gboolean gst_preset_rename_preset (GstPreset *preset,  const gchar *old_name,  const gchar *new_name);
160 		return gst_preset_rename_preset(getPresetTStruct(), Str.toStringz(oldName), Str.toStringz(newName));
161 	}
162 	
163 	/**
164 	 * Delete the given preset.
165 	 * Params:
166 	 * name = preset name to remove
167 	 * Returns: TRUE for success, FALSE if e.g. there is no preset with that name
168 	 */
169 	public int deletePreset(string name)
170 	{
171 		// gboolean gst_preset_delete_preset (GstPreset *preset,  const gchar *name);
172 		return gst_preset_delete_preset(getPresetTStruct(), Str.toStringz(name));
173 	}
174 	
175 	/**
176 	 * Sets a new value for an existing meta data item or adds a new item. Meta
177 	 * data tag names can be something like e.g. "comment". Supplying NULL for the
178 	 * value will unset an existing value.
179 	 * Params:
180 	 * name = preset name
181 	 * tag = meta data item name
182 	 * value = new value
183 	 * Returns: TRUE for success, FALSE if e.g. there is no preset with that name
184 	 */
185 	public int setMeta(string name, string tag, string value)
186 	{
187 		// gboolean gst_preset_set_meta (GstPreset *preset,  const gchar *name,  const gchar *tag,  const gchar *value);
188 		return gst_preset_set_meta(getPresetTStruct(), Str.toStringz(name), Str.toStringz(tag), Str.toStringz(value));
189 	}
190 	
191 	/**
192 	 * Gets the value for an existing meta data tag. Meta data tag names can be
193 	 * something like e.g. "comment". Returned values need to be released when done.
194 	 * Params:
195 	 * name = preset name
196 	 * tag = meta data item name
197 	 * value = value. [out callee-allocates]
198 	 * Returns: TRUE for success, FALSE if e.g. there is no preset with that name or no value for the given tag
199 	 */
200 	public int getMeta(string name, string tag, out string value)
201 	{
202 		// gboolean gst_preset_get_meta (GstPreset *preset,  const gchar *name,  const gchar *tag,  gchar **value);
203 		char* outvalue = null;
204 		
205 		auto p = gst_preset_get_meta(getPresetTStruct(), Str.toStringz(name), Str.toStringz(tag), &outvalue);
206 		
207 		value = Str.toString(outvalue);
208 		return p;
209 	}
210 	
211 	/**
212 	 * Sets an extra directory as an absolute path that should be considered when
213 	 * looking for presets. Any presets in the application dir will shadow the
214 	 * system presets.
215 	 * Params:
216 	 * appDir = the application specific preset dir
217 	 * Returns: TRUE for success, FALSE if the dir already has been set
218 	 */
219 	public static int setAppDir(string appDir)
220 	{
221 		// gboolean gst_preset_set_app_dir (const gchar *app_dir);
222 		return gst_preset_set_app_dir(Str.toStringz(appDir));
223 	}
224 	
225 	/**
226 	 * Gets the directory for application specific presets if set by the
227 	 * application.
228 	 * Returns: the directory or NULL, don't free or modify the string
229 	 */
230 	public static string getAppDir()
231 	{
232 		// const gchar * gst_preset_get_app_dir (void);
233 		return Str.toString(gst_preset_get_app_dir());
234 	}
235 }