From cb9d21f9ed44b9f5cf2a0cbeb9f7c6f937bb4086 Mon Sep 17 00:00:00 2001 From: Antoine Cellerier Date: Thu, 10 Aug 2006 19:21:25 +0000 Subject: [PATCH] Add "enqueue" command. Original patch by Greg Farell --- THANKS | 1 + modules/control/rc.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/THANKS b/THANKS index 95b0770686..758c3ae30d 100644 --- a/THANKS +++ b/THANKS @@ -61,6 +61,7 @@ Eurodata Computer Club - VLC icon design (v0.8.4) François Seingier - TTL setting in the wx stream output dialog Frank Chao - Chinese Traditional translation Fumio Nakayama - Japanese translation +Greg Farrell - rc interface "enqueue" command Gregory Hazel - wxWidgets fixes and improvements Goetz Waschk - Mandrake packages Haakon Meland Eriksen - Norwegian translation diff --git a/modules/control/rc.c b/modules/control/rc.c index 200ad49579..487ba17c23 100644 --- a/modules/control/rc.c +++ b/modules/control/rc.c @@ -358,6 +358,8 @@ static void RegisterCallbacks( intf_thread_t *p_intf ) var_Create( p_intf, "add", VLC_VAR_STRING | VLC_VAR_ISCOMMAND ); var_AddCallback( p_intf, "add", Playlist, NULL ); + var_Create( p_intf, "enqueue", VLC_VAR_STRING | VLC_VAR_ISCOMMAND ); + var_AddCallback( p_intf, "enqueue", Playlist, NULL ); var_Create( p_intf, "playlist", VLC_VAR_VOID | VLC_VAR_ISCOMMAND ); var_AddCallback( p_intf, "playlist", Playlist, NULL ); var_Create( p_intf, "sort", VLC_VAR_VOID | VLC_VAR_ISCOMMAND ); @@ -872,6 +874,7 @@ static void Help( intf_thread_t *p_intf, vlc_bool_t b_longhelp) msg_rc(_("+----[ Remote control commands ]")); msg_rc( "| "); msg_rc(_("| add XYZ . . . . . . . . . . add XYZ to playlist")); + msg_rc(_("| enqueue XYZ . . . . . . . queue XYZ to playlist")); msg_rc(_("| playlist . . . show items currently in playlist")); msg_rc(_("| play . . . . . . . . . . . . . . . . play stream")); msg_rc(_("| stop . . . . . . . . . . . . . . . . stop stream")); @@ -1280,6 +1283,18 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END ); } } + else if( !strcmp( psz_cmd, "enqueue" ) && + newval.psz_string && *newval.psz_string ) + { + playlist_item_t *p_item = parse_MRL( p_intf, newval.psz_string ); + + if( p_item ) + { + msg_rc( "trying to enqueue %s to playlist", newval.psz_string ); + playlist_PlaylistAddInput( p_playlist, p_item, + PLAYLIST_APPEND, PLAYLIST_END ); + } + } else if( !strcmp( psz_cmd, "playlist" ) ) { msg_Dbg( p_playlist, "Dumping category" ); -- 2.39.2