summaryrefslogtreecommitdiffstats
path: root/libmenu/vf_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmenu/vf_menu.c')
-rw-r--r--libmenu/vf_menu.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/libmenu/vf_menu.c b/libmenu/vf_menu.c
index c1e9eb220b..336261d233 100644
--- a/libmenu/vf_menu.c
+++ b/libmenu/vf_menu.c
@@ -18,7 +18,6 @@
#include "config.h"
#include "mp_msg.h"
-#include "help_mp.h"
#include <stdio.h>
#include <stdlib.h>
@@ -54,19 +53,21 @@ struct vf_priv_s {
int passthrough;
};
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts);
+static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts);
-void vf_menu_pause_update(struct vf_instance *vf) {
- const vo_functions_t *video_out = mpctx_get_video_out(vf->priv->current->ctx);
+void vf_menu_pause_update(struct vf_instance* vf) {
+ const struct vo *video_out = mpctx_get_video_out(vf->priv->current->ctx);
if(pause_mpi) {
put_image(vf,pause_mpi, MP_NOPTS_VALUE);
// Don't draw the osd atm
//vf->control(vf,VFCTRL_DRAW_OSD,NULL);
- video_out->flip_page();
+ vo_flip_page(video_out, 0, -1);
}
}
-static int cmd_filter(mp_cmd_t* cmd, int paused, struct vf_priv_s * priv) {
+static int cmd_filter(mp_cmd_t* cmd, void *ctx)
+{
+ struct vf_priv_s *priv = ctx;
switch(cmd->id) {
case MP_CMD_MENU : { // Convert txt cmd from the users into libmenu stuff
@@ -99,7 +100,7 @@ static int cmd_filter(mp_cmd_t* cmd, int paused, struct vf_priv_s * priv) {
else if(strcmp(arg,"hide") == 0 || strcmp(arg,"toggle") == 0)
priv->current->show = 0;
else
- mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_UnknownMenuCommand,arg);
+ mp_tmsg(MSGT_GLOBAL,MSGL_WARN,"[MENU] Unknown command: '%s'.\n",arg);
return 1;
}
case MP_CMD_SET_MENU : {
@@ -107,7 +108,7 @@ static int cmd_filter(mp_cmd_t* cmd, int paused, struct vf_priv_s * priv) {
menu_t* l = priv->current;
priv->current = menu_open(menu);
if(!priv->current) {
- mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_FailedToOpenMenu,menu);
+ mp_tmsg(MSGT_GLOBAL,MSGL_WARN,"[MENU] Failed to open menu: '%s'.\n",menu);
priv->current = l;
priv->current->show = 0;
} else {
@@ -120,7 +121,7 @@ static int cmd_filter(mp_cmd_t* cmd, int paused, struct vf_priv_s * priv) {
return 0;
}
-static void get_image(struct vf_instance *vf, mp_image_t *mpi){
+static void get_image(struct vf_instance* vf, mp_image_t *mpi){
mp_image_t *dmpi;
if(mpi->type == MP_IMGTYPE_TEMP && (!(mpi->flags&MP_IMGFLAG_PRESERVE)) ) {
@@ -137,7 +138,7 @@ static int key_cb(int code) {
return menu_read_key(st_priv->current,code);
}
-static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
+static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
mp_image_t *dmpi = NULL;
if (vf->priv->passthrough) {
@@ -213,7 +214,7 @@ static void uninit(vf_instance_t *vf) {
}
}
-static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height,
+static int config(struct vf_instance* vf, int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt) {
#ifdef CONFIG_FREETYPE
// here is the right place to get screen dimensions
@@ -227,8 +228,8 @@ static int config(struct vf_instance *vf, int width, int height, int d_width, in
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
-static int query_format(struct vf_instance *vf, unsigned int fmt){
- return vf_next_query_format(vf,fmt);
+static int query_format(struct vf_instance* vf, unsigned int fmt){
+ return vf_next_query_format(vf, fmt);
}
static int open_vf(vf_instance_t *vf, char* args){
@@ -241,7 +242,7 @@ static int open_vf(vf_instance_t *vf, char* args){
return 0;
}
st_priv->root->show = menu_startup;
- mp_input_add_cmd_filter((mp_input_cmd_filter)cmd_filter,st_priv);
+ mp_input_add_cmd_filter(cmd_filter,st_priv);
}
vf->config = config;