2010-01-30 23:24:23 +00:00
|
|
|
/*
|
|
|
|
* This file is part of MPlayer.
|
|
|
|
*
|
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#ifndef MPLAYER_COMMAND_H
|
|
|
|
#define MPLAYER_COMMAND_H
|
2008-01-01 21:35:58 +00:00
|
|
|
|
2008-03-31 04:10:54 +00:00
|
|
|
struct MPContext;
|
|
|
|
struct mp_cmd;
|
2008-03-04 23:35:24 +00:00
|
|
|
|
2008-11-30 01:19:46 +00:00
|
|
|
void run_command(struct MPContext *mpctx, struct mp_cmd *cmd);
|
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-09-23 21:00:54 +00:00
|
|
|
char *mp_property_expand_string(struct MPContext *mpctx, char *str);
|
2007-02-21 00:49:24 +00:00
|
|
|
void property_print_help(void);
|
2012-09-21 10:19:59 +00:00
|
|
|
int mp_property_do(const char* name, int action, void* val,
|
|
|
|
struct MPContext *mpctx);
|
2008-01-01 21:35:58 +00:00
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#endif /* MPLAYER_COMMAND_H */
|