xine-lib  1.2.10
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 
13 typedef enum {
19 } ParamType;
20 
21 struct IntVal {
22  int value;
23  int min;
24  int max;
25  int step;
26 };
27 struct FloatVal {
28  float value;
29  float min;
30  float max;
31  float step;
32 };
33 struct StrVal {
34  char *value;
35 };
36 struct ListVal {
37  char *value;
38  int nbChoices;
39  char **choices;
40 };
41 struct BoolVal {
42  int value;
43 };
44 
45 
46 typedef 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;
57  } param;
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 */
66 } PluginParam;
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 
86 PluginParam goom_secure_b_param(const char *name, int value);
88 
91 
92 void goom_set_str_param_value(PluginParam *p, const char *str);
93 void goom_set_list_param_value(PluginParam *p, const char *str);
94 
95 typedef struct _PARAMETERS {
96  const char *name;
97  const char *desc;
98  int nbParams;
101 
102 PluginParameters 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
FloatVal::value
float value
Definition: goom_config_param.h:28
BoolVal
Definition: goom_config_param.h:41
FloatVal::step
float step
Definition: goom_config_param.h:31
ParamType
ParamType
Definition: goom_config_param.h:13
_PARAM::ival
struct IntVal ival
Definition: goom_config_param.h:52
goom_secure_s_param
PluginParam goom_secure_s_param(const char *name)
Definition: config_param.c:51
FloatVal::max
float max
Definition: goom_config_param.h:30
IntVal::step
int step
Definition: goom_config_param.h:25
PluginParameters
struct _PARAMETERS PluginParameters
FloatVal::min
float min
Definition: goom_config_param.h:29
PARAM_STRVAL
@ PARAM_STRVAL
Definition: goom_config_param.h:17
FloatVal
Definition: goom_config_param.h:27
ListVal::choices
char ** choices
Definition: goom_config_param.h:39
_PARAM::changed
void(* changed)(struct _PARAM *_this)
Definition: goom_config_param.h:63
_PARAM::name
const char * name
Definition: goom_config_param.h:47
PARAM_BOOLVAL
@ PARAM_BOOLVAL
Definition: goom_config_param.h:16
BoolVal::value
int value
Definition: goom_config_param.h:42
ListVal::nbChoices
int nbChoices
Definition: goom_config_param.h:38
goom_set_list_param_value
void goom_set_list_param_value(PluginParam *p, const char *str)
Definition: config_param.c:104
StrVal
Definition: goom_config_param.h:33
goom_plugin_parameters
PluginParameters goom_plugin_parameters(const char *name, int nb)
Definition: config_param.c:84
PARAM_INTVAL
@ PARAM_INTVAL
Definition: goom_config_param.h:14
PARAM_FLOATVAL
@ PARAM_FLOATVAL
Definition: goom_config_param.h:15
_PARAMETERS
Definition: goom_config_param.h:95
goom_secure_param
PluginParam goom_secure_param(void)
Definition: config_param.c:24
_PARAM::type
ParamType type
Definition: goom_config_param.h:50
IntVal::min
int min
Definition: goom_config_param.h:23
goom_secure_i_param
PluginParam goom_secure_i_param(const char *name)
Definition: config_param.c:67
StrVal::value
char * value
Definition: goom_config_param.h:34
IntVal
Definition: goom_config_param.h:21
_PARAMETERS::desc
const char * desc
Definition: goom_config_param.h:97
IntVal::value
int value
Definition: goom_config_param.h:22
_PARAM::desc
const char * desc
Definition: goom_config_param.h:48
_PARAMETERS::nbParams
int nbParams
Definition: goom_config_param.h:98
PARAM_LISTVAL
@ PARAM_LISTVAL
Definition: goom_config_param.h:18
_PARAM::change_listener
void(* change_listener)(struct _PARAM *_this)
Definition: goom_config_param.h:60
_PARAM::rw
char rw
Definition: goom_config_param.h:49
_PARAMETERS::params
PluginParam ** params
Definition: goom_config_param.h:99
name
const char name[16]
Definition: memcpy.c:569
_PARAM::sval
struct StrVal sval
Definition: goom_config_param.h:54
goom_set_str_param_value
void goom_set_str_param_value(PluginParam *p, const char *str)
Definition: config_param.c:95
goom_secure_f_param
PluginParam goom_secure_f_param(const char *name)
Definition: config_param.c:34
ListVal
Definition: goom_config_param.h:36
_PARAM::user_data
void * user_data
Definition: goom_config_param.h:65
IntVal::max
int max
Definition: goom_config_param.h:24
_PARAM::bval
struct BoolVal bval
Definition: goom_config_param.h:56
goom_secure_b_param
PluginParam goom_secure_b_param(const char *name, int value)
Definition: config_param.c:59
_PARAM::param
union _PARAM::@35 param
_PARAM::fval
struct FloatVal fval
Definition: goom_config_param.h:53
_PARAM
Definition: goom_config_param.h:46
ListVal::value
char * value
Definition: goom_config_param.h:37
_PARAMETERS::name
const char * name
Definition: goom_config_param.h:96
goom_secure_i_feedback
PluginParam goom_secure_i_feedback(const char *name)
Definition: config_param.c:78
goom_secure_f_feedback
PluginParam goom_secure_f_feedback(const char *name)
Definition: config_param.c:45
_PARAM::slist
struct ListVal slist
Definition: goom_config_param.h:55
PluginParam
struct _PARAM PluginParam