Commit Graph

8 Commits

Author SHA1 Message Date
wm4 e00aad18cb command: redo the property type
Instead of absuing m_option to store the property list, introduce a
separate type for properties. m_option is still used to handle data
types. The property declaration itself now never contains the option
type, and instead it's always queried with M_PROPERTY_GET_TYPE. (This
was already done with some properties, now all properties use it.)

This also fixes that the function signatures did not match the function
type with which these functions were called. They were called as:

   int (*)(const m_option_t*, int, void*, void*)

but the actual function signatures were:

   int (*)(m_option_t*, int, void*, MPContext *)

Two arguments were mismatched.

This adds one line per property implementation. With additional the
reordering of the parameters, this makes most of the changes in this
commit.
2014-06-13 02:11:39 +02:00
wm4 da89af1076 player: show "neutral" position markers for OSD bars
This commit implements them for volume and some video properties.
2014-06-08 23:52:58 +02:00
wm4 5cd20c7320 command: add helper function to split property paths
We've just checked whether a sub-path started with "name/", but that
changes behavior whether the property name has a trailing '/' or not.
Using a helper function to split of path components avoids this problem.
2014-03-30 13:41:03 +02:00
wm4 91f752f43f m_property: add mechanism to access properties as mpv_node
Allows retrieving properties by their native values (or something close
to it), rather than having to go through string conversion. The caller
could actually just copy the value itself and then use the m_option
functions to convert it to mpv_node, but maybe it's more flexible this
way.
2014-02-24 22:50:23 +01:00
wm4 801de5ac6d m_property: add a mechanism to organize a list of sub-properties
This automatically adds a "count" sub-property, and for each entry in
the range [0, count), a numbered sub-property to access the item.
2014-02-16 03:51:02 +01:00
wm4 309ae76e0b m_property: add a sub-property mechanism
This adds a mechanism for easier export of sub-properties. The following
commits will make use of it to export fine grained information about
certain things. The sub-property mechanism reduces the amount of code
needed to export a data value to 1 line.
2014-02-16 03:51:02 +01:00
wm4 a2d144fc8f m_property: mp_msg conversions
Includes some semi-crappy hacks to avoid changing too much code for this
conversion (allowing NULL log argument for m_property_do()).
2013-12-21 21:04:21 +01:00
wm4 eb15151705 Move options/config related files from mpvcore/ to options/
Since m_option.h and options.h are extremely often included, a lot of
files have to be changed.

Moving path.c/h to options/ is a bit questionable, but since this is
mainly about access to config files (which are also handled in
options/), it's probably ok.
2013-12-17 02:07:57 +01:00