Mercurial > mplayer.hg
annotate m_property.h @ 17911:52f95509cd05
Add the new property API and implement a couple properties.
Move the volume and mute command to the command to property
bridge.
author | albeu |
---|---|
date | Wed, 22 Mar 2006 00:19:02 +0000 |
parents | |
children | f9cb6fc1608a |
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 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
36 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
|
37 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
38 #define M_PROPERTY_CLAMP(prop,val) do { \ |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
39 if(((prop)->flags & M_OPT_MIN) && (val) < (prop)->min) \ |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
40 (val) = (prop)->min; \ |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
41 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
|
42 (val) = (prop)->max; \ |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
43 } while(0) |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
44 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
45 // Implement get |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
46 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
|
47 void* arg,int var); |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
48 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
49 // Implement set, get and step up/down |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
50 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
|
51 void* arg,int* var); |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
52 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
53 // Same but cycle |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
54 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
|
55 void* arg,int* var); |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
56 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
57 // Switch betwen min and max |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
58 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
|
59 void* arg,int* var); |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
60 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
61 // Implement get, print |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
62 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
|
63 void* arg,float var); |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
64 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
65 // Implement set, get and step up/down |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
66 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
|
67 void* arg,float* var); |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
68 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
69 // 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
|
70 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
|
71 void* arg,float* var); |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
72 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
73 // Implement get, print |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
74 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
|
75 void* arg,double var); |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
76 |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
77 // get/print the string |
52f95509cd05
Add the new property API and implement a couple properties.
albeu
parents:
diff
changeset
|
78 int m_property_string_ro(m_option_t* prop,int action,void* arg, char* str); |