annotate m_property.h @ 18189:faa148210f2b

Add the declarations for mp_property_find/do.
author albeu
date Sat, 22 Apr 2006 14:26:30 +0000
parents f9cb6fc1608a
children 96568be4bfdc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17911
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
1
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
2 // Get the current value
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
3 #define M_PROPERTY_GET 0
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
4 // Get a string representing the current value
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
5 #define M_PROPERTY_PRINT 1
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
6 // Set a new value
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
7 #define M_PROPERTY_SET 2
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
8 // Set a new value from a string
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
9 #define M_PROPERTY_PARSE 3
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
10 // Increment the property
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
11 #define M_PROPERTY_STEP_UP 4
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
12 // Decrement the property
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
13 #define M_PROPERTY_STEP_DOWN 5
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
14
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
15 // Return values for the control function
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
16 #define M_PROPERTY_OK 1
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
17 #define M_PROPERTY_ERROR 0
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
18 // Returned when the property can't be used, for ex something about
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
19 // the subs while playing audio only
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
20 #define M_PROPERTY_UNAVAILABLE -1
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
21 // Returned if the requested action is not implemented
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
22 #define M_PROPERTY_NOT_IMPLEMENTED -2
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
23 // Returned when asking for a property that doesn't exist
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
24 #define M_PROPERTY_UNKNOWN -3
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
25 // Returned when the action can't be done (like setting the volume when edl mute)
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
26 #define M_PROPERTY_DISABLED -4
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
27
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
28 typedef int(*m_property_ctrl_f)(m_option_t* prop,int action,void* arg);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
29
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
30 int m_property_do(m_option_t* prop, int action, void* arg);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
31
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
32 char* m_property_print(m_option_t* prop);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
33
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
34 int m_property_parse(m_option_t* prop, char* txt);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
35
17914
f9cb6fc1608a Add an option to list the properties: -list-properties
albeu
parents: 17911
diff changeset
36 void m_properties_print_help_list(m_option_t* list);
f9cb6fc1608a Add an option to list the properties: -list-properties
albeu
parents: 17911
diff changeset
37
17911
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
38 char* m_properties_expand_string(m_option_t* prop_list,char* str);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
39
18189
faa148210f2b Add the declarations for mp_property_find/do.
albeu
parents: 17914
diff changeset
40 // Helpers to use MPlayer's properties
faa148210f2b Add the declarations for mp_property_find/do.
albeu
parents: 17914
diff changeset
41
faa148210f2b Add the declarations for mp_property_find/do.
albeu
parents: 17914
diff changeset
42 m_option_t* mp_property_find(char* name);
faa148210f2b Add the declarations for mp_property_find/do.
albeu
parents: 17914
diff changeset
43
faa148210f2b Add the declarations for mp_property_find/do.
albeu
parents: 17914
diff changeset
44 int mp_property_do(char* name,int action, void* val);
faa148210f2b Add the declarations for mp_property_find/do.
albeu
parents: 17914
diff changeset
45
faa148210f2b Add the declarations for mp_property_find/do.
albeu
parents: 17914
diff changeset
46 // Helpers for property implementations
faa148210f2b Add the declarations for mp_property_find/do.
albeu
parents: 17914
diff changeset
47
17911
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
48 #define M_PROPERTY_CLAMP(prop,val) do { \
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
49 if(((prop)->flags & M_OPT_MIN) && (val) < (prop)->min) \
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
50 (val) = (prop)->min; \
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
51 else if(((prop)->flags & M_OPT_MAX) && (val) > (prop)->max) \
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
52 (val) = (prop)->max; \
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
53 } while(0)
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
54
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
55 // Implement get
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
56 int m_property_int_ro(m_option_t* prop,int action,
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
57 void* arg,int var);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
58
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
59 // Implement set, get and step up/down
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
60 int m_property_int_range(m_option_t* prop,int action,
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
61 void* arg,int* var);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
62
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
63 // Same but cycle
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
64 int m_property_choice(m_option_t* prop,int action,
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
65 void* arg,int* var);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
66
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
67 // Switch betwen min and max
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
68 int m_property_flag(m_option_t* prop,int action,
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
69 void* arg,int* var);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
70
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
71 // Implement get, print
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
72 int m_property_float_ro(m_option_t* prop,int action,
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
73 void* arg,float var);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
74
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
75 // Implement set, get and step up/down
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
76 int m_property_float_range(m_option_t* prop,int action,
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
77 void* arg,float* var);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
78
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
79 // float with a print function which print the time in ms
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
80 int m_property_delay(m_option_t* prop,int action,
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
81 void* arg,float* var);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
82
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
83 // Implement get, print
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
84 int m_property_double_ro(m_option_t* prop,int action,
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
85 void* arg,double var);
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
86
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
87 // get/print the string
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents:
diff changeset
88 int m_property_string_ro(m_option_t* prop,int action,void* arg, char* str);