08e96113ea1437298ee1f878b645a6a03c0f2e29
[platform/upstream/gstreamer.git] / gst / gstpreset.h
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., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 #ifndef __GST_PRESET_H__
23 #define __GST_PRESET_H__
24
25 #include <glib-object.h>
26 #include <gst/gst.h>
27 #include <gst/controller/gstcontroller.h>
28
29 G_BEGIN_DECLS
30
31 #define GST_TYPE_PRESET               (gst_preset_get_type())
32 #define GST_PRESET(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PRESET, GstPreset))
33 #define GST_IS_PRESET(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PRESET))
34 #define GST_PRESET_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_PRESET, GstPresetInterface))
35
36
37 typedef struct _GstPreset GstPreset; /* dummy object */
38 typedef struct _GstPresetInterface GstPresetInterface;
39
40 struct _GstPresetInterface
41 {
42   GTypeInterface parent;
43
44   GList* (*get_preset_names) (GstPreset *self);
45
46   gboolean (*load_preset) (GstPreset *self, const gchar *name);
47   gboolean (*save_preset) (GstPreset *self, const gchar *name);
48   gboolean (*rename_preset) (GstPreset *self, const gchar *old_name, const gchar *new_name);
49   gboolean (*delete_preset) (GstPreset *self, const gchar *name);
50   
51   gboolean (*set_meta) (GstPreset *self,const gchar *name, const gchar *tag, gchar *value);
52   gboolean (*get_meta) (GstPreset *self,const gchar *name, const gchar *tag, gchar **value);
53
54   void (*create_preset) (GstPreset *self);
55   
56   /* @todo:
57    *
58    * need a presets-changed signal, to notify of changes in preset list
59    *
60    * need a way to sync class instances, we want to keep only one list for all
61    * instances of a type and if the list changes, we trigger the signal for all
62    * instance
63    */
64
65   /*< private >*/
66   gpointer _gst_reserved[GST_PADDING];
67 };
68
69 GType gst_preset_get_type(void);
70
71 GList* gst_preset_get_preset_names (GstPreset *self);
72
73 gboolean gst_preset_load_preset (GstPreset *self, const gchar *name);
74 gboolean gst_preset_save_preset (GstPreset *self, const gchar *name);
75 gboolean gst_preset_rename_preset (GstPreset *self, const gchar *old_name, const gchar *new_name);
76 gboolean gst_preset_delete_preset (GstPreset *self, const gchar *name);
77
78 gboolean gst_preset_set_meta (GstPreset *self,const gchar *name, const gchar *tag, gchar *value);
79 gboolean gst_preset_get_meta (GstPreset *self,const gchar *name, const gchar *tag, gchar **value);
80
81 void gst_preset_create_preset (GstPreset *self);
82
83 G_END_DECLS
84
85 #endif /* __GST_PRESET_H__ */