#define ACTIONID_LOOP 82
#define ACTIONID_WALLPAPER 83
#define ACTIONID_LEAVE_FULLSCREEN 84
+#define ACTIONID_MENU_ON 85
+#define ACTIONID_MENU_OFF 86
+#define ACTIONID_MENU_RIGHT 87
+#define ACTIONID_MENU_LEFT 88
+#define ACTIONID_MENU_UP 89
+#define ACTIONID_MENU_DOWN 90
+#define ACTIONID_MENU_SELECT 91
playlist_Play( p_playlist );
}
}
+ else if( i_action == ACTIONID_MENU_ON )
+ {
+ osd_MenuShow( VLC_OBJECT(p_intf) );
+ }
+ else if( i_action == ACTIONID_MENU_OFF )
+ {
+ osd_MenuHide( VLC_OBJECT(p_intf) );
+ }
+ else if( i_action == ACTIONID_MENU_LEFT )
+ {
+ osd_MenuPrev( VLC_OBJECT(p_intf) );
+ }
+ else if( i_action == ACTIONID_MENU_RIGHT )
+ {
+ osd_MenuNext( VLC_OBJECT(p_intf) );
+ }
+ else if( i_action == ACTIONID_MENU_UP )
+ {
+ osd_MenuUp( VLC_OBJECT(p_intf) );
+ }
+ else if( i_action == ACTIONID_MENU_DOWN )
+ {
+ osd_MenuDown( VLC_OBJECT(p_intf) );
+ }
+ else if( i_action == ACTIONID_MENU_SELECT )
+ {
+ osd_MenuActivate( VLC_OBJECT(p_intf) );
+ }
}
if( p_vout )
vlc_object_release( p_vout );
#include <vlc/vlc.h>
#include <vlc_interface.h>
+#include <vlc_osd.h>
#include <lirc/lirc_client.h>
* Module descriptor
*****************************************************************************/
vlc_module_begin();
+ set_shortname( _("Infrared") );
set_category( CAT_INTERFACE );
set_subcategory( SUBCAT_INTERFACE_CONTROL );
set_description( _("Infrared remote control interface") );
}
while( !intf_ShouldDie( p_intf )
- && lirc_code2char( p_intf->p_sys->config, code, &c ) == 0
- && c != NULL )
+ && (lirc_code2char( p_intf->p_sys->config, code, &c ) == 0)
+ && (c != NULL) )
{
vlc_value_t keyval;
- if( strncmp( "key-", c, 4 ) )
+ if( !strncmp( "key-", c, 4 ) )
+ {
+ keyval.i_int = config_GetInt( p_intf, c );
+ var_Set( p_intf->p_libvlc, "key-pressed", keyval );
+ }
+ else if( !strncmp( "menu ", c, 5) )
+ {
+ if( !strncmp( c, "menu on", 7 ) ||
+ !strncmp( c, "menu show", 9 ))
+ osd_MenuShow( VLC_OBJECT(p_intf) );
+ else if( !strncmp( c, "menu off", 8 ) ||
+ !strncmp( c, "menu hide", 9 ) )
+ osd_MenuHide( VLC_OBJECT(p_intf) );
+ else if( !strncmp( c, "menu up", 7 ) )
+ osd_MenuUp( VLC_OBJECT(p_intf) );
+ else if( !strncmp( c, "menu down", 9 ) )
+ osd_MenuDown( VLC_OBJECT(p_intf) );
+ else if( !stnrcmp( c, "menu left", 9 ) )
+ osd_MenuPrev( VLC_OBJECT(p_intf) );
+ else if( !strncmp( c, "menu right", 10 ) )
+ osd_MenuNext( VLC_OBJECT(p_intf) );
+ else if( !strncmp( c, "menu select", 11 ) )
+ osd_MenuActivate( VLC_OBJECT(p_intf) );
+ else
+ {
+ msg_Err( p_intf, _("Please provide one of the following parameters:") );
+ msg_Err( p_intf, "[on|off|up|down|left|right|select]" );
+ break;
+ }
+ }
+ else
{
msg_Err( p_intf, "this doesn't appear to be a valid keycombo lirc sent us. Please look at the doc/lirc/example.lirc file in VLC" );
break;
}
- keyval.i_int = config_GetInt( p_intf, c );
- var_Set( p_intf->p_libvlc, "key-pressed", keyval );
}
free( code );
}
}
-
{ "key-random", ACTIONID_RANDOM, 0, 0, 0, 0 },
{ "key-loop", ACTIONID_LOOP, 0, 0, 0, 0 },
{ "key-wallpaper", ACTIONID_WALLPAPER, 0, 0, 0, 0 },
+ { "key-menu-on", ACTIONID_MENU_ON, 0, 0, 0, 0 },
+ { "key-menu-off", ACTIONID_MENU_OFF, 0, 0, 0, 0 },
+ { "key-menu-right", ACTIONID_MENU_RIGHT, 0, 0, 0, 0 },
+ { "key-menu-left", ACTIONID_MENU_LEFT, 0, 0, 0, 0 },
+ { "key-menu-up", ACTIONID_MENU_UP, 0, 0, 0, 0 },
+ { "key-menu-down", ACTIONID_MENU_DOWN, 0, 0, 0, 0 },
+ { "key-menu-select", ACTIONID_MENU_SELECT, 0, 0, 0, 0 },
{ NULL, 0, 0, 0, 0, 0 }
};