[MPlayer-dev-eng] [PATCH] Add auto-close option to cmdlist menu
Reynaldo H. Verdejo Pinochet
reynaldo at opendot.cl
Fri May 12 10:08:59 CEST 2006
On Thu, May 11, 2006 at 05:07:21PM +0800, andrew.calkin at gmail.com wrote:
> The attached patch does $subj. It is used in the GeeXboX project.
>
> //Andrew
Not that i think its useless but, can you give a little more detail
on why is this needed?
> diff -r 3213b1684465 libmenu/menu_cmdlist.c
> --- a/libmenu/menu_cmdlist.c Sun Apr 30 16:54:38 2006 +0200
> +++ b/libmenu/menu_cmdlist.c Sun Apr 30 16:54:39 2006 +0200
> @@ -39,15 +39,20 @@ struct list_entry_s {
>
> struct menu_priv_s {
> menu_list_priv_t p;
> -};
> + int auto_close;
> +};
> +
> +#define ST_OFF(m) M_ST_OFF(struct menu_priv_s, m)
>
> static struct menu_priv_s cfg_dflt = {
> - MENU_LIST_PRIV_DFLT
> + MENU_LIST_PRIV_DFLT,
> + 0,
> };
>
> static m_option_t cfg_fields[] = {
> MENU_LIST_PRIV_FIELDS,
> { "title",M_ST_OFF(struct menu_priv_s,p.title), CONF_TYPE_STRING, 0, 0, 0, NULL },
> + { "auto-close", ST_OFF(auto_close), CONF_TYPE_FLAG, 0, 0, 1, NULL },
> { NULL, NULL, NULL, 0,0,0,NULL }
> };
>
> @@ -65,7 +70,11 @@ static void read_cmd(menu_t* menu,int cm
> if(mpriv->p.current->ok) {
> mp_cmd_t* c = mp_input_parse_cmd(mpriv->p.current->ok);
> if(c)
> + {
> + if (mpriv->auto_close)
> + mp_input_queue_cmd (mp_input_parse_cmd ("menu hide"));
Please respect indentation here, no space before (), not that important, but
what the hell, there are rules.
> mp_input_queue_cmd(c);
> + }
> }
> } break;
> case MENU_CMD_LEFT:
Best regards
Reynaldo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060512/ef446064/attachment.pgp>
More information about the MPlayer-dev-eng
mailing list