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 module gstreamer.PresetIF; 26 27 private import glib.Str; 28 private import gstreamerc.gstreamer; 29 public import gstreamerc.gstreamertypes; 30 31 32 /** 33 * This interface offers methods to query and manipulate parameter preset sets. 34 * A preset is a bunch of property settings, together with meta data and a name. 35 * The name of a preset serves as key for subsequent method calls to manipulate 36 * single presets. 37 * All instances of one type will share the list of presets. The list is created 38 * on demand, if presets are not used, the list is not created. 39 * 40 * The interface comes with a default implementation that serves most plugins. 41 * Wrapper plugins will override most methods to implement support for the 42 * native preset format of those wrapped plugins. 43 * One method that is useful to be overridden is gst_preset_get_property_names(). 44 * With that one can control which properties are saved and in which order. 45 * When implementing support for read-only presets, one should set the vmethods 46 * for gst_preset_save_preset() and gst_preset_delete_preset() to %NULL. 47 * Applications can use gst_preset_is_editable() to check for that. 48 * 49 * The default implementation supports presets located in a system directory, 50 * application specific directory and in the users home directory. When getting 51 * a list of presets individual presets are read and overlaid in 1) system, 52 * 2) application and 3) user order. Whenever an earlier entry is newer, the 53 * later entries will be updated. Since 1.8 you can also provide extra paths 54 * where to find presets through the GST_PRESET_PATH environment variable. 55 * Presets found in those paths will be concidered as "app presets". 56 */ 57 public interface PresetIF{ 58 /** Get the main Gtk struct */ 59 public GstPreset* getPresetStruct(bool transferOwnership = false); 60 61 /** the main Gtk struct as a void* */ 62 protected void* getStruct(); 63 64 65 /** 66 * Gets the directory for application specific presets if set by the 67 * application. 68 * 69 * Returns: the directory or %NULL, don't free or modify 70 * the string 71 */ 72 public static string getAppDir(); 73 74 /** 75 * Sets an extra directory as an absolute path that should be considered when 76 * looking for presets. Any presets in the application dir will shadow the 77 * system presets. 78 * 79 * Params: 80 * appDir = the application specific preset dir 81 * 82 * Returns: %TRUE for success, %FALSE if the dir already has been set 83 */ 84 public static bool setAppDir(string appDir); 85 86 /** 87 * Delete the given preset. 88 * 89 * Params: 90 * name = preset name to remove 91 * 92 * Returns: %TRUE for success, %FALSE if e.g. there is no preset with that @name 93 */ 94 public bool deletePreset(string name); 95 96 /** 97 * Gets the @value for an existing meta data @tag. Meta data @tag names can be 98 * something like e.g. "comment". Returned values need to be released when done. 99 * 100 * Params: 101 * name = preset name 102 * tag = meta data item name 103 * value = value 104 * 105 * Returns: %TRUE for success, %FALSE if e.g. there is no preset with that @name 106 * or no value for the given @tag 107 */ 108 public bool getMeta(string name, string tag, out string value); 109 110 /** 111 * Get a copy of preset names as a %NULL terminated string array. 112 * 113 * Returns: list with names, use g_strfreev() after usage. 114 */ 115 public string[] getPresetNames(); 116 117 /** 118 * Get a the names of the GObject properties that can be used for presets. 119 * 120 * Returns: an 121 * array of property names which should be freed with g_strfreev() after use. 122 */ 123 public string[] getPropertyNames(); 124 125 /** 126 * Check if one can add new presets, change existing ones and remove presets. 127 * 128 * Returns: %TRUE if presets are editable or %FALSE if they are static 129 * 130 * Since: 1.6 131 */ 132 public bool isEditable(); 133 134 /** 135 * Load the given preset. 136 * 137 * Params: 138 * name = preset name to load 139 * 140 * Returns: %TRUE for success, %FALSE if e.g. there is no preset with that @name 141 */ 142 public bool loadPreset(string name); 143 144 /** 145 * Renames a preset. If there is already a preset by the @new_name it will be 146 * overwritten. 147 * 148 * Params: 149 * oldName = current preset name 150 * newName = new preset name 151 * 152 * Returns: %TRUE for success, %FALSE if e.g. there is no preset with @old_name 153 */ 154 public bool renamePreset(string oldName, string newName); 155 156 /** 157 * Save the current object settings as a preset under the given name. If there 158 * is already a preset by this @name it will be overwritten. 159 * 160 * Params: 161 * name = preset name to save 162 * 163 * Returns: %TRUE for success, %FALSE 164 */ 165 public bool savePreset(string name); 166 167 /** 168 * Sets a new @value for an existing meta data item or adds a new item. Meta 169 * data @tag names can be something like e.g. "comment". Supplying %NULL for the 170 * @value will unset an existing value. 171 * 172 * Params: 173 * name = preset name 174 * tag = meta data item name 175 * value = new value 176 * 177 * Returns: %TRUE for success, %FALSE if e.g. there is no preset with that @name 178 */ 179 public bool setMeta(string name, string tag, string value); 180 }