xine-lib 1.2.11
goom_config_param.h
Go to the documentation of this file.
1#ifndef _CONFIG_PARAM_H
2#define _CONFIG_PARAM_H
3
4#include <stdlib.h>
5
13typedef enum {
19} ParamType;
20
21struct IntVal {
22 int value;
23 int min;
24 int max;
25 int step;
26};
27struct FloatVal {
28 float value;
29 float min;
30 float max;
31 float step;
32};
33struct StrVal {
34 char *value;
35};
36struct ListVal {
37 char *value;
39 char **choices;
40};
41struct BoolVal {
42 int value;
43};
44
45
46typedef struct _PARAM {
47 const char *name;
48 const char *desc;
49 char rw;
51 union {
52 struct IntVal ival;
53 struct FloatVal fval;
54 struct StrVal sval;
55 struct ListVal slist;
56 struct BoolVal bval;
58
59 /* used by the core to inform the GUI of a change */
60 void (*change_listener)(struct _PARAM *_this);
61
62 /* used by the GUI to inform the core of a change */
63 void (*changed)(struct _PARAM *_this);
64
65 void *user_data; /* can be used by the GUI */
67
68#define IVAL(p) ((p).param.ival.value)
69#define SVAL(p) ((p).param.sval.value)
70#define FVAL(p) ((p).param.fval.value)
71#define BVAL(p) ((p).param.bval.value)
72#define LVAL(p) ((p).param.slist.value)
73
74#define FMIN(p) ((p).param.fval.min)
75#define FMAX(p) ((p).param.fval.max)
76#define FSTEP(p) ((p).param.fval.step)
77
78#define IMIN(p) ((p).param.ival.min)
79#define IMAX(p) ((p).param.ival.max)
80#define ISTEP(p) ((p).param.ival.step)
81
83
86PluginParam goom_secure_b_param(const char *name, int value);
88
91
92void goom_set_str_param_value(PluginParam *p, const char *str);
93void goom_set_list_param_value(PluginParam *p, const char *str);
94
95typedef struct _PARAMETERS {
96 const char *name;
97 const char *desc;
101
102PluginParameters goom_plugin_parameters(const char *name, int nb);
103
104#define secure_param goom_secure_param
105#define secure_f_param goom_secure_f_param
106#define secure_i_param goom_secure_i_param
107#define secure_b_param goom_secure_b_param
108#define secure_s_param goom_secure_s_param
109#define secure_f_feedback goom_secure_f_feedback
110#define secure_i_feedback goom_secure_i_feedback
111#define set_list_param_value goom_set_list_param_value
112#define set_str_param_value goom_set_str_param_value
113#define plugin_parameters goom_plugin_parameters
114
115#endif
void goom_set_list_param_value(PluginParam *p, const char *str)
Definition: config_param.c:104
PluginParam goom_secure_param(void)
Definition: config_param.c:24
PluginParam goom_secure_s_param(const char *name)
Definition: config_param.c:51
PluginParam goom_secure_i_feedback(const char *name)
Definition: config_param.c:78
ParamType
Definition: goom_config_param.h:13
@ PARAM_STRVAL
Definition: goom_config_param.h:17
@ PARAM_FLOATVAL
Definition: goom_config_param.h:15
@ PARAM_BOOLVAL
Definition: goom_config_param.h:16
@ PARAM_LISTVAL
Definition: goom_config_param.h:18
@ PARAM_INTVAL
Definition: goom_config_param.h:14
PluginParameters goom_plugin_parameters(const char *name, int nb)
Definition: config_param.c:84
struct _PARAMETERS PluginParameters
PluginParam goom_secure_i_param(const char *name)
Definition: config_param.c:67
PluginParam goom_secure_f_feedback(const char *name)
Definition: config_param.c:45
PluginParam goom_secure_f_param(const char *name)
Definition: config_param.c:34
void goom_set_str_param_value(PluginParam *p, const char *str)
Definition: config_param.c:95
struct _PARAM PluginParam
PluginParam goom_secure_b_param(const char *name, int value)
Definition: config_param.c:59
const char name[16]
Definition: memcpy.c:570
Definition: goom_config_param.h:41
int value
Definition: goom_config_param.h:42
Definition: goom_config_param.h:27
float value
Definition: goom_config_param.h:28
float min
Definition: goom_config_param.h:29
float max
Definition: goom_config_param.h:30
float step
Definition: goom_config_param.h:31
Definition: goom_config_param.h:21
int step
Definition: goom_config_param.h:25
int max
Definition: goom_config_param.h:24
int min
Definition: goom_config_param.h:23
int value
Definition: goom_config_param.h:22
Definition: goom_config_param.h:36
int nbChoices
Definition: goom_config_param.h:38
char ** choices
Definition: goom_config_param.h:39
char * value
Definition: goom_config_param.h:37
Definition: goom_config_param.h:33
char * value
Definition: goom_config_param.h:34
Definition: goom_config_param.h:95
const char * desc
Definition: goom_config_param.h:97
int nbParams
Definition: goom_config_param.h:98
const char * name
Definition: goom_config_param.h:96
PluginParam ** params
Definition: goom_config_param.h:99
Definition: goom_config_param.h:46
const char * desc
Definition: goom_config_param.h:48
union _PARAM::@37 param
struct FloatVal fval
Definition: goom_config_param.h:53
void(* change_listener)(struct _PARAM *_this)
Definition: goom_config_param.h:60
char rw
Definition: goom_config_param.h:49
void * user_data
Definition: goom_config_param.h:65
const char * name
Definition: goom_config_param.h:47
struct ListVal slist
Definition: goom_config_param.h:55
struct IntVal ival
Definition: goom_config_param.h:52
ParamType type
Definition: goom_config_param.h:50
struct BoolVal bval
Definition: goom_config_param.h:56
struct StrVal sval
Definition: goom_config_param.h:54
void(* changed)(struct _PARAM *_this)
Definition: goom_config_param.h:63