From b8c2e88ea3e2c7b416dc9f22e69677a9148370d0 Mon Sep 17 00:00:00 2001 From: Sigmund Augdal Helberg Date: Sun, 12 Jan 2003 01:26:36 +0000 Subject: [PATCH] new rule for remote controls with combined play/pause button (like mine has) --- doc/lirc/example.lircrc | 18 +++++++++++++++++- modules/control/lirc/lirc.c | 25 ++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/doc/lirc/example.lircrc b/doc/lirc/example.lircrc index ccd868f25d..24678674a5 100644 --- a/doc/lirc/example.lircrc +++ b/doc/lirc/example.lircrc @@ -1,10 +1,26 @@ +# This is an example .lircrc file that shows the different config strings that +# vlc understand. button names are from an animax remote, and these may change +# with different remotes + begin prog = vlc button = PLAY_UP config = PLAY +end + +begin + prog = vlc + button = PAUSE_UP config = PAUSE end +#use this target if you have a combined play/pause button +begin + prog = vlc + button = PLAY_UP + config = PLAYPAUSE +end + begin prog = vlc button = STOP_UP @@ -26,7 +42,7 @@ end begin prog = vlc button = SKIP_BACKWARD - config = LAST + config = PREV end begin diff --git a/modules/control/lirc/lirc.c b/modules/control/lirc/lirc.c index 230e5d0db1..53c0907c4e 100644 --- a/modules/control/lirc/lirc.c +++ b/modules/control/lirc/lirc.c @@ -2,7 +2,7 @@ * lirc.c : lirc plugin for vlc ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: lirc.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: lirc.c,v 1.2 2003/01/12 01:26:36 sigmunau Exp $ * * Authors: Sigmund Augdal * @@ -197,6 +197,29 @@ static void Run( intf_thread_t *p_intf ) } } } + if( !strcmp( c, "PLAYPAUSE" ) ) + { + if( p_intf->p_sys->p_input && + p_intf->p_sys->p_input->stream.control.i_status != PAUSE_S ) + { + input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE ); + } + else + { + p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, + FIND_ANYWHERE ); + if( p_playlist ) + { + vlc_mutex_lock( &p_playlist->object_lock ); + if( p_playlist->i_size ) + { + vlc_mutex_unlock( &p_playlist->object_lock ); + playlist_Play( p_playlist ); + vlc_object_release( p_playlist ); + } + } + } + } else if( p_intf->p_sys->p_input ) { p_input = p_intf->p_sys->p_input; -- 2.39.2