Commit Graph

11 Commits

Author SHA1 Message Date
wm4 32c5a87a01 commands: change property expansion format string
This affects property format strings like they are used in the
"show_text" input command, for --playing-msg, and other places.

To quote the documentation comment on m_properties_expand_string():

    ${NAME} is expanded to the value of property NAME.
    If NAME starts with '=', use the raw value of the property.
    ${NAME:STR} expands to the property, or STR if the property is not
    available.
    ${?NAME:STR} expands to STR if the property is available.
    ${!NAME:STR} expands to STR if the property is not available.
    STR is recursively expanded using the same rules.
    "$$" can be used to escape "$", and "$}" to escape "}".
    "$>" disables parsing of "$" for the rest of the string.

Most importantly, "?(property:str)" becomes "${?property:str}".

Make the simple fallback case easier, e.g. "${property:fallback}"
instead of "${property}?(!property:fallback)".

Add the ability to escape the format meta characters. "$" is used for
escaping, because escaping with "\" is taken by the commands parser in
the layer below. "$>" can be used to disable interpretation of format
strings (of course escapes by the commands parser can't be canceled).

By default, properties which are unavailable or don't exist are turned
into a string signaling the status (e.g. "(unavailable)"), instead of
an empty string. If an empty string is desired, this has to be done
explicitly: "${property:}" (the fallback part is an empty string). Raw
properties still return an empty string on error.

m_properties_expand_string() now returns a talloc'ed pointer, instead of
a malloc'ed one.
2012-10-12 10:10:32 +02:00
wm4 ed8e738e0f commands: cosmetic changes mostly to m_property.h
The Doxygen-style documentation comments were nothing but bloat.

Also move mp_property_do() and mp_property_print() to command.h, where
they should belong, and fix their argument types. m_property.c/h is
supposed to be generic, while command.h provides declarations specific
to the mplayer core.
2012-10-12 10:10:31 +02:00
Uoti Urpala 12d3caebc7 Merge svn changes up to r30475 2010-03-09 19:18:43 +02:00
diego 99c1bbca2a Add license header to all top-level files missing them.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-30 23:24:23 +00:00
Uoti Urpala 6fec7ec734 Allow seeking while paused
Screen is now updated immediately (doesn't always work without
correct-pts yet though). Doing audio unpause after the seek reset can
display errors.

Main loop code now checks for possible reasons to stop command
processing instead of relying on each command to also set an explicit
'break' flag.
2008-12-09 04:31:07 +02:00
uau 2b2792565e command.h: Remove unnecessary includes
Remove #include of "mp_core.h" and "input/input.h". Their only use was
that functions declared in command.h took pointers to structs defined
in those headers. Declare the structs directly as incomplete types
instead.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26305 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-03-31 04:10:54 +00:00
diego b5ed673f32 Add necessary #includes to pass 'make checkheaders'.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26163 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-03-04 23:35:24 +00:00
diego 8efb2fa21c Add MPLAYER_ prefix to multiple inclusion guards.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26061 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-02-22 09:09:46 +00:00
diego 2b6af2000b Add multiple inclusion guards to all header files that lack them.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25581 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-01 21:35:58 +00:00
albeu a931f0083e Make command.h usable without the MPContext typedef.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23415 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-30 07:05:34 +00:00
uau d5d4c6c7e2 Split command/property handling from mplayer.c to a new file command.c.
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
2007-02-21 00:49:24 +00:00