Mercurial > mplayer.hg
annotate m_property.h @ 17942:f2868534283d
Simplify rules with common make constructs.
author | diego |
---|---|
date | Sat, 25 Mar 2006 10:18:18 +0000 |
parents | f9cb6fc1608a |
children | faa148210f2b |
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 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
40 #define M_PROPERTY_CLAMP(prop,val) do { \ |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
41 if(((prop)->flags & M_OPT_MIN) && (val) < (prop)->min) \ |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
42 (val) = (prop)->min; \ |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
43 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
|
44 (val) = (prop)->max; \ |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
45 } while(0) |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
46 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
47 // Implement get |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
48 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
|
49 void* arg,int var); |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
50 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
51 // Implement set, get and step up/down |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
52 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
|
53 void* arg,int* var); |
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 // Same but cycle |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
56 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
|
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 // Switch betwen min and max |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
60 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
|
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 // Implement get, print |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
64 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
|
65 void* arg,float 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 // Implement set, get and step up/down |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
68 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
|
69 void* arg,float* 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 // 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
|
72 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
|
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 get, print |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
76 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
|
77 void* arg,double 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 // get/print the string |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
80 int m_property_string_ro(m_option_t* prop,int action,void* arg, char* str); |