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
28G_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 */
40typedef struct _GstPreset GstPreset; /* dummy object */
41typedef 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 */
57struct _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
80GST_API
81GType gst_preset_get_type (void);
82
83GST_API
84gchar** gst_preset_get_preset_names (GstPreset *preset) G_GNUC_MALLOC;
85
86GST_API
87gchar** gst_preset_get_property_names (GstPreset *preset) G_GNUC_MALLOC;
88
89GST_API
90gboolean gst_preset_load_preset (GstPreset *preset, const gchar *name);
91
92GST_API
93gboolean gst_preset_save_preset (GstPreset *preset, const gchar *name);
94
95GST_API
96gboolean gst_preset_rename_preset (GstPreset *preset, const gchar *old_name,
97 const gchar *new_name);
98GST_API
99gboolean gst_preset_delete_preset (GstPreset *preset, const gchar *name);
100
101GST_API
102gboolean gst_preset_set_meta (GstPreset *preset, const gchar *name,
103 const gchar *tag, const gchar *value);
104GST_API
105gboolean gst_preset_get_meta (GstPreset *preset, const gchar *name,
106 const gchar *tag, gchar **value);
107GST_API
108gboolean gst_preset_set_app_dir (const gchar *app_dir);
109
110GST_API
111const gchar *gst_preset_get_app_dir (void);
112
113GST_API
114gboolean gst_preset_is_editable (GstPreset *preset);
115
116G_END_DECLS
117
118#endif /* __GST_PRESET_H__ */
119

source code of include/gstreamer-1.0/gst/gstpreset.h