4 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef __PVRUSB2_CTRL_H
17 #define __PVRUSB2_CTRL_H
29 /* Set the given control. */
30 int pvr2_ctrl_set_value(struct pvr2_ctrl
*,int val
);
32 /* Set/clear specific bits of the given control. */
33 int pvr2_ctrl_set_mask_value(struct pvr2_ctrl
*,int mask
,int val
);
35 /* Get the current value of the given control. */
36 int pvr2_ctrl_get_value(struct pvr2_ctrl
*,int *valptr
);
38 /* Retrieve control's type */
39 enum pvr2_ctl_type
pvr2_ctrl_get_type(struct pvr2_ctrl
*);
41 /* Retrieve control's maximum value (int type) */
42 int pvr2_ctrl_get_max(struct pvr2_ctrl
*);
44 /* Retrieve control's minimum value (int type) */
45 int pvr2_ctrl_get_min(struct pvr2_ctrl
*);
47 /* Retrieve control's default value (any type) */
48 int pvr2_ctrl_get_def(struct pvr2_ctrl
*, int *valptr
);
50 /* Retrieve control's enumeration count (enum only) */
51 int pvr2_ctrl_get_cnt(struct pvr2_ctrl
*);
53 /* Retrieve control's valid mask bits (bit mask only) */
54 int pvr2_ctrl_get_mask(struct pvr2_ctrl
*);
56 /* Retrieve the control's name */
57 const char *pvr2_ctrl_get_name(struct pvr2_ctrl
*);
59 /* Retrieve the control's desc */
60 const char *pvr2_ctrl_get_desc(struct pvr2_ctrl
*);
62 /* Retrieve a control enumeration or bit mask value */
63 int pvr2_ctrl_get_valname(struct pvr2_ctrl
*,int,char *,unsigned int,
66 /* Return true if control is writable */
67 int pvr2_ctrl_is_writable(struct pvr2_ctrl
*);
69 /* Return V4L flags value for control (or zero if there is no v4l control
70 actually under this control) */
71 unsigned int pvr2_ctrl_get_v4lflags(struct pvr2_ctrl
*);
73 /* Return V4L ID for this control or zero if none */
74 int pvr2_ctrl_get_v4lid(struct pvr2_ctrl
*);
76 /* Return true if control has custom symbolic representation */
77 int pvr2_ctrl_has_custom_symbols(struct pvr2_ctrl
*);
79 /* Convert a given mask/val to a custom symbolic value */
80 int pvr2_ctrl_custom_value_to_sym(struct pvr2_ctrl
*,
82 char *buf
,unsigned int maxlen
,
85 /* Convert a symbolic value to a mask/value pair */
86 int pvr2_ctrl_custom_sym_to_value(struct pvr2_ctrl
*,
87 const char *buf
,unsigned int len
,
88 int *maskptr
,int *valptr
);
90 /* Convert a given mask/val to a symbolic value */
91 int pvr2_ctrl_value_to_sym(struct pvr2_ctrl
*,
93 char *buf
,unsigned int maxlen
,
96 /* Convert a symbolic value to a mask/value pair */
97 int pvr2_ctrl_sym_to_value(struct pvr2_ctrl
*,
98 const char *buf
,unsigned int len
,
99 int *maskptr
,int *valptr
);
101 /* Convert a given mask/val to a symbolic value - must already be
102 inside of critical region. */
103 int pvr2_ctrl_value_to_sym_internal(struct pvr2_ctrl
*,
105 char *buf
,unsigned int maxlen
,
108 #endif /* __PVRUSB2_CTRL_H */