summaryrefslogtreecommitdiffstats
path: root/m_property.h
Commit message (Collapse)AuthorAgeFilesLines
* commands: handle property clamping in m_optionwm42012-10-121-8/+0
| | | | | | | | | | | | | | | Instead of clamping property values to the valid range in each property implementation, handle it in the property layer. The functionality to handle clamping for each type is in m_option.c. It's not really clear whether this is really needed. Normally, the raw values for M_PROPERTY_SET come only from m_option_type.parse (setting properties as string) or from m_option_parse.add (using the "switch" input command). However, since this was already done before, and since we _really_ want to be sure only to write valid values, add this code anyway. The newly added warnings/error messages should never actually be printed during normal operation and are for debugging (if they happen, we definitely want to see them).
* commands: generally handle property formatting with m_optionwm42012-10-121-11/+0
| | | | | | | | | | | | | Use the m_option code by default to format property values, instead of having separate code in m_property. To facilitate that, add a pretty_print callback to option types. These format values in a more human readable and user friendly way, as opposed to the print callback, which produces parseable values. This also changes the strings used with flags. Instead of "enabled" and "disabled", flags are formatted as "yes" and "no". (We could use the pretty_print callback to deal with this, but we don't for consistency.)
* commands: handle property stepping in a generic waywm42012-10-121-12/+4
| | | | | | | | | | | | | | | | | | | | | Instead of forcing each property implementation implement its own logic for M_PROPERTY_STEP_UP/M_PROPERTY_STEP_DOWN, handle it in the generic property code. Rename the M_PROPERTY_STEP_UP command to M_PROPERTY_SWITCH (the other property command, M_PROPERTY_STEP_DOWN, isn't needed anymore: stepping downwards is done by passing a negative argument). Always use double as argument type; it makes the code easier, and covers all property types. Move the code which does the actual type-specific value stepping to m_option.c (the idea is that m_option handles types). Some properties still have custom handlers implemented with M_PROPERTY_SWITCH. They can't be mapped to the generic mechanism, because their value range is dynamic or entirely unknown. For some properties, the default step stride is changed to 1. This is no issue, because the default bindings in input.conf all use an explicit stride in the affected cases.
* commands: rename "osdlevel" option and property, make it a choicewm42012-10-121-4/+0
| | | | | | | | | Rename both the option and property to "osd-level", which fits a bit better with the general naming scheme. Make it a choice instead of an integer range. I failed to come up with good names for the various levels, so leave them as-is. Remove the useless property handler for the "loop" property too.
* Add license header to all top-level files missing them.diego2010-01-301-0/+18
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
* whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add a m_property_flag_ro function for the default behaviour of areimar2008-10-011-0/+3
| | | | | | read-only flag. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27679 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add necessary #includes to pass 'make checkheaders'.diego2008-03-041-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26163 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add MPLAYER_ prefix to multiple inclusion guards.diego2008-02-221-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26061 b3059339-0415-0410-9bf9-f77b7e298cf2
* All the m_property stuff works fine with constant m_option_treimar2008-01-131-15/+15
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25744 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add multiple inclusion guards to all header files that lack them.diego2008-01-011-0/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25581 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move the time printing code out of the length property.albeu2007-05-311-0/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23434 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make all the info available via the metadata API available via properties.albeu2007-05-291-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23412 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rework the property API to allow sub properties such asalbeu2007-05-291-18/+33
| | | | | | | metadata/title, etc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23411 b3059339-0415-0410-9bf9-f77b7e298cf2
* Split command/property handling from mplayer.c to a new file command.c.uau2007-02-211-6/+6
| | | | | | | | | Move some global and static variables under a struct that can be given as a parameter. Add a context argument to the property functions so that they do not have to depend on global/static variables. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22298 b3059339-0415-0410-9bf9-f77b7e298cf2
* marks several read-only string parameters which aren't modified inside the ↵reynaldo2006-07-151-1/+1
| | | | | | called function as const. Patch by Stefan Huehner, stefan AT huehner-org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19109 b3059339-0415-0410-9bf9-f77b7e298cf2
* marks several string parameters as const, as they are not modified inside ↵reynaldo2006-07-131-1/+1
| | | | | | the function, Patch by Stefan Huehner, stefan AT huehner-org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19058 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix most of the mistakes pointed out by Diego.albeu2006-04-251-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18284 b3059339-0415-0410-9bf9-f77b7e298cf2
* Doxygen attack!albeu2006-04-241-29/+119
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18259 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add the declarations for mp_property_find/do.albeu2006-04-221-0/+8
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18190 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add an option to list the properties: -list-propertiesalbeu2006-03-221-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17915 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add the new property API and implement a couple properties.albeu2006-03-221-0/+78
Move the volume and mute command to the command to property bridge. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17912 b3059339-0415-0410-9bf9-f77b7e298cf2