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
|
|
|
|
Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).
This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.
One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-25 22:41:14 +00:00
|
|
|
void command_init(struct MPContext *mpctx);
|
2013-09-30 20:27:37 +00:00
|
|
|
void command_uninit(struct MPContext *mpctx);
|
Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).
This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.
One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-25 22:41:14 +00:00
|
|
|
|
2008-11-30 01:19:46 +00:00
|
|
|
void run_command(struct MPContext *mpctx, struct mp_cmd *cmd);
|
2013-09-20 21:33:38 +00:00
|
|
|
char *mp_property_expand_string(struct MPContext *mpctx, const 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
|
|
|
|
Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).
This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.
One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-25 22:41:14 +00:00
|
|
|
const struct m_option *mp_get_property_list(void);
|
|
|
|
|
|
|
|
enum mp_event {
|
|
|
|
MP_EVENT_NONE,
|
|
|
|
MP_EVENT_TICK,
|
|
|
|
MP_EVENT_PROPERTY, // char*, property that is changed
|
|
|
|
MP_EVENT_TRACKS_CHANGED,
|
|
|
|
MP_EVENT_START_FILE,
|
|
|
|
MP_EVENT_END_FILE,
|
|
|
|
};
|
|
|
|
|
|
|
|
void mp_notify(struct MPContext *mpctx, enum mp_event event, void *arg);
|
|
|
|
void mp_notify_property(struct MPContext *mpctx, const char *property);
|
|
|
|
|
|
|
|
void mp_flush_events(struct MPContext *mpctx);
|
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#endif /* MPLAYER_COMMAND_H */
|