1 /* GStreamer 2 * Copyright (C) 2006 Stefan Kost <ensonic@users.sf.net> 3 * 4 * gstpreset.h: helper interface header for element presets 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 22 #ifndef __GST_PRESET_H__ 23 #define __GST_PRESET_H__ 24 25 #include <glib-object.h> 26 #include <gst/gstconfig.h> 27 28 G_BEGIN_DECLS 29 30 #define GST_TYPE_PRESET (gst_preset_get_type()) 31 #define GST_PRESET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PRESET, GstPreset)) 32 #define GST_IS_PRESET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PRESET)) 33 #define GST_PRESET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_PRESET, GstPresetInterface)) 34 35 /** 36 * GstPreset: 37 * 38 * Opaque #GstPreset data structure. 39 */ 40 typedef struct _GstPreset GstPreset; /* dummy object */ 41 typedef struct _GstPresetInterface GstPresetInterface; 42 43 /** 44 * GstPresetInterface: 45 * @parent: parent interface type. 46 * @get_preset_names: virtual method to get list of presets 47 * @get_property_names: virtual methods to get properties that are persistent 48 * @load_preset: virtual methods to load a preset into properties 49 * @save_preset: virtual methods to save properties into a preset 50 * @rename_preset: virtual methods to rename a preset 51 * @delete_preset: virtual methods to remove a preset 52 * @set_meta: virtual methods to set textual meta data to a preset 53 * @get_meta: virtual methods to get textual meta data from a preset 54 * 55 * #GstPreset interface. 56 */ 57 struct _GstPresetInterface 58 { 59 GTypeInterface parent; 60 61 /* methods */ 62 gchar** (*get_preset_names) (GstPreset *preset); 63 64 gchar** (*get_property_names) (GstPreset *preset); 65 66 gboolean (*load_preset) (GstPreset *preset, const gchar *name); 67 gboolean (*save_preset) (GstPreset *preset, const gchar *name); 68 gboolean (*rename_preset) (GstPreset *preset, const gchar *old_name, 69 const gchar *new_name); 70 gboolean (*delete_preset) (GstPreset *preset, const gchar *name); 71 72 gboolean (*set_meta) (GstPreset *preset, const gchar *name, 73 const gchar *tag, const gchar *value); 74 gboolean (*get_meta) (GstPreset *preset, const gchar *name, 75 const gchar *tag, gchar **value); 76 /*< private >*/ 77 gpointer _gst_reserved[GST_PADDING]; 78 }; 79 80 GST_API 81 GType gst_preset_get_type (void); 82 83 GST_API 84 gchar** gst_preset_get_preset_names (GstPreset *preset) G_GNUC_MALLOC; 85 86 GST_API 87 gchar** gst_preset_get_property_names (GstPreset *preset) G_GNUC_MALLOC; 88 89 GST_API 90 gboolean gst_preset_load_preset (GstPreset *preset, const gchar *name); 91 92 GST_API 93 gboolean gst_preset_save_preset (GstPreset *preset, const gchar *name); 94 95 GST_API 96 gboolean gst_preset_rename_preset (GstPreset *preset, const gchar *old_name, 97 const gchar *new_name); 98 GST_API 99 gboolean gst_preset_delete_preset (GstPreset *preset, const gchar *name); 100 101 GST_API 102 gboolean gst_preset_set_meta (GstPreset *preset, const gchar *name, 103 const gchar *tag, const gchar *value); 104 GST_API 105 gboolean gst_preset_get_meta (GstPreset *preset, const gchar *name, 106 const gchar *tag, gchar **value); 107 GST_API 108 gboolean gst_preset_set_app_dir (const gchar *app_dir); 109 110 GST_API 111 const gchar *gst_preset_get_app_dir (void); 112 113 GST_API 114 gboolean gst_preset_is_editable (GstPreset *preset); 115 116 G_END_DECLS 117 118 #endif /* __GST_PRESET_H__ */ 119