Commit Graph

12 Commits

Author SHA1 Message Date
wm4 082b1cdeaa m_property: allow setting string properties via M_PROPERTY_SET_STRING
Setting string options to strings over the m_option fallback (i.e.
M_PROPERTY_SET_STRING is called if the option type is CONF_TYPE_STRING)
failed. This was because m_option_parse() returns 0. 0 still means
success, but the property code tried to be clever, and considered 0 not
a success in order to disallow setting flags to an emtpy string (which
in turn is allowed, because the command line allows flag options without
parameters).

Fix this by removing the overly clever code.

This could happen when e.g. using the "set" command on options/title (a
string option), and also was a problem for the client API.

Closes #610.
2014-03-03 12:48:41 +01:00
wm4 a0b1d5f888 m_property: fix confused error code
This broke the client API.
2014-02-26 21:03:35 +01:00
wm4 a6ebfbea69 m_property: retrieve chapter lists etc. as mpv_node
This automatically allows accessing properties like chapter-list and
track-list to be read as mpv_node. This affects all properties which use
m_property_read_sub() and m_property_read_list().
2014-02-24 22:50:23 +01: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 b097d76281 m_property: simplify some code 2014-02-24 20:51:05 +01:00
wm4 f225b5fc00 command: don't use option name in properties
Some code accessed m_option.name to get the property name. (Maybe only
show_property_osd() had a significant use of it.) Remove that, and
remove setting names and dummy names as well.

The old code usually assumed that the name was set, and
show_property_osd() used it to get the proper name of deprecated
aliases.

The "vf" property was listed as "vf*". Not sure why that was done, but
it works without anyway.
2014-02-23 16:49:47 +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 d8d42b44fc m_option, m_config: mp_msg conversions
Always pass around mp_log contexts in the option parser code. This of
course affects all users of this API as well.

In stream.c, pass a mp_null_log, because we can't do it properly yet.
This will be fixed later.
2013-12-21 21:05: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 0112143fda Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +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