[MPlayer-cvslog] r25348 - in trunk/libmenu: menu.c menu_cmdlist.c menu_filesel.c
ulion
subversion at mplayerhq.hu
Tue Dec 11 09:11:21 CET 2007
Author: ulion
Date: Tue Dec 11 09:11:21 2007
New Revision: 25348
Log:
Support to run multiple mplayer commands set in menu.conf
Modified:
trunk/libmenu/menu.c
trunk/libmenu/menu_cmdlist.c
trunk/libmenu/menu_filesel.c
Modified: trunk/libmenu/menu.c
==============================================================================
--- trunk/libmenu/menu.c (original)
+++ trunk/libmenu/menu.c Tue Dec 11 09:11:21 2007
@@ -275,7 +275,7 @@ int menu_dflt_read_key(menu_t* menu,int
for (i = 0; i < bindings->binding_num; ++i) {
if (bindings->bindings[i].key == cmd) {
if (bindings->bindings[i].cmd)
- mp_input_queue_cmd(mp_input_parse_cmd(bindings->bindings[i].cmd));
+ mp_input_parse_and_queue_cmds(bindings->bindings[i].cmd);
return 1;
}
}
Modified: trunk/libmenu/menu_cmdlist.c
==============================================================================
--- trunk/libmenu/menu_cmdlist.c (original)
+++ trunk/libmenu/menu_cmdlist.c Tue Dec 11 09:11:21 2007
@@ -58,32 +58,26 @@ static void read_cmd(menu_t* menu,int cm
switch(cmd) {
case MENU_CMD_RIGHT:
if(mpriv->p.current->right) {
- mp_cmd_t* c = mp_input_parse_cmd(mpriv->p.current->right);
- if(c) mp_input_queue_cmd(c);
+ mp_input_parse_and_queue_cmds(mpriv->p.current->right);
break;
} // fallback on ok if right is not defined
case MENU_CMD_OK: {
if(mpriv->p.current->ok) {
- mp_cmd_t* c = mp_input_parse_cmd(mpriv->p.current->ok);
- if(c)
+ if (mp_input_parse_and_queue_cmds(mpriv->p.current->ok))
{
if (mpriv->auto_close)
mp_input_queue_cmd (mp_input_parse_cmd ("menu hide"));
- mp_input_queue_cmd(c);
}
}
} break;
case MENU_CMD_LEFT:
if(mpriv->p.current->left) {
- mp_cmd_t* c = mp_input_parse_cmd(mpriv->p.current->left);
- if(c) mp_input_queue_cmd(c);
+ mp_input_parse_and_queue_cmds(mpriv->p.current->left);
break;
} // fallback on cancel if left is not defined
case MENU_CMD_CANCEL:
if(mpriv->p.current->cancel) {
- mp_cmd_t* c = mp_input_parse_cmd(mpriv->p.current->cancel);
- if(c)
- mp_input_queue_cmd(c);
+ mp_input_parse_and_queue_cmds(mpriv->p.current->cancel);
break;
}
default:
Modified: trunk/libmenu/menu_filesel.c
==============================================================================
--- trunk/libmenu/menu_filesel.c (original)
+++ trunk/libmenu/menu_filesel.c Tue Dec 11 09:11:21 2007
@@ -355,21 +355,18 @@ static void read_cmd(menu_t* menu,int cm
}
free(p);
} else { // File and directory dealt with action string.
- mp_cmd_t* c;
int fname_len = strlen(mpriv->dir) + strlen(mpriv->p.current->p.txt) + 1;
char filename[fname_len];
char *str;
char *action = mpriv->p.current->d ? mpriv->dir_action:mpriv->file_action;
sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt);
str = replace_path(action, filename);
- c = mp_input_parse_cmd(str);
+ if (mp_input_parse_and_queue_cmds(str)) {
+ if(mpriv->auto_close)
+ menu->cl = 1;
+ }
if (str != action)
free(str);
- if(c) {
- mp_input_queue_cmd(c);
- if(mpriv->auto_close)
- menu->cl = 1;
- }
}
} break;
case MENU_CMD_ACTION: {
@@ -378,7 +375,7 @@ static void read_cmd(menu_t* menu,int cm
char *str;
sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt);
str = replace_path(action, filename);
- mp_input_queue_cmd(mp_input_parse_cmd(str));
+ mp_input_parse_and_queue_cmds(str);
if(str != action)
free(str);
} break;
More information about the MPlayer-cvslog
mailing list