#include "vlc_error.h"
#include "network.h"
+#include "vlc_url.h"
#if defined(AF_UNIX) && !defined(AF_LOCAL)
# define AF_LOCAL AF_UNIX
vlc_module_begin();
set_shortname( _("RC"));
set_category( CAT_INTERFACE );
- set_subcategory( SUBCAT_INTERFACE_GENERAL );
+ set_subcategory( SUBCAT_INTERFACE_MAIN );
set_description( _("Remote control interface") );
add_bool( "rc-show-pos", 0, NULL, POS_TEXT, POS_LONGTEXT, VLC_TRUE );
#ifdef HAVE_ISATTY
static int Activate( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t*)p_this;
- playlist_t *p_playlist;
char *psz_host, *psz_unix_path;
int *pi_socket = NULL;
vlc_UrlParse( &url, psz_host, 0 );
- msg_Dbg( p_intf, "base %s port %d", url.psz_host, url.i_port );
+ msg_Dbg( p_intf, "base: %s, port: %d", url.psz_host, url.i_port );
pi_socket = net_ListenTCP(p_this, url.psz_host, url.i_port);
if( pi_socket == NULL )
CONSOLE_INTRO_MSG;
#endif
- /* Force "no-view" mode */
- p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- if( p_playlist )
- {
- vlc_mutex_lock( &p_playlist->object_lock );
- p_playlist->status.i_view = -1;
- vlc_mutex_unlock( &p_playlist->object_lock );
- vlc_object_release( p_playlist );
- }
-
- msg_rc( _("Remote control interface initialized, `h' for help") );
+ msg_rc( _("Remote control interface initialized. Type `help' for help.") );
return VLC_SUCCESS;
}
var_AddCallback( p_intf, "mosaic-rows", Other, NULL );
var_Create( p_intf, "mosaic-cols", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
var_AddCallback( p_intf, "mosaic-cols", Other, NULL );
+ var_Create( p_intf, "mosaic-order", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
+ var_AddCallback( p_intf, "mosaic-order", Other, NULL );
var_Create( p_intf, "mosaic-keep-aspect-ratio",
VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
var_AddCallback( p_intf, "mosaic-keep-aspect-ratio", Other, NULL );
p_intf->p_sys->hConsoleIn = GetStdHandle(STD_INPUT_HANDLE);
if( p_intf->p_sys->hConsoleIn == INVALID_HANDLE_VALUE )
{
- msg_Err( p_intf, "Couldn't open STD_INPUT_HANDLE" );
+ msg_Err( p_intf, "couldn't find user input handle" );
p_intf->b_die = VLC_TRUE;
}
#endif
{
if( !p_input->b_dead || !p_input->b_die )
{
- msg_rc( STATUS_CHANGE "( New input: %s )", p_input->input.p_item->psz_uri );
+ msg_rc( STATUS_CHANGE "( new input: %s )", p_input->input.p_item->psz_uri );
msg_rc( STATUS_CHANGE "( audio volume: %d )", config_GetInt( p_intf, "volume" ));
}
var_AddCallback( p_input, "state", StateChanged, p_intf );
break;
default:
- msg_rc(_("unknown command `%s', type `help' for help"), psz_cmd);
+ msg_rc(_("Unknown command `%s'. Type `help' for help."), psz_cmd);
break;
}
msg_rc(_("| normal . . . . . . . . normal playing of stream"));
msg_rc(_("| f [on|off] . . . . . . . . . . toggle fullscreen"));
msg_rc(_("| info . . . information about the current stream"));
+ msg_rc(_("| get_time . . seconds elapsed since stream's beginning"));
+ msg_rc(_("| is_playing . . 1 if a stream plays, 0 otherwise"));
+ msg_rc(_("| get_title . . . the title of the current stream"));
+ msg_rc(_("| get_length . . the length of the current stream"));
msg_rc( "| ");
msg_rc(_("| volume [X] . . . . . . . . set/get audio volume"));
msg_rc(_("| volup [X] . . . . . raise audio volume X steps"));
msg_rc(_("| time-opacity # . . . . . . . . . . . . . opacity"));
msg_rc(_("| time-size # . . . . . . . . font size, in pixels"));
msg_rc( "| ");
- msg_rc(_("| logo-file STRING . . . the overlay file path/name"));
+ msg_rc(_("| logo-file STRING . . .the overlay file path/name"));
msg_rc(_("| logo-x X . . . . . . . . . . . .offset from left"));
msg_rc(_("| logo-y Y . . . . . . . . . . . . offset from top"));
msg_rc(_("| logo-position #. . . . . . . . relative position"));
msg_rc(_("| mosaic-position {0=auto,1=fixed} . . . .position"));
msg_rc(_("| mosaic-rows #. . . . . . . . . . .number of rows"));
msg_rc(_("| mosaic-cols #. . . . . . . . . . .number of cols"));
+ msg_rc(_("| mosaic-order id(,id)* . . . . order of pictures "));
msg_rc(_("| mosaic-keep-aspect-ratio {0,1} . . .aspect ratio"));
msg_rc( "| ");
msg_rc(_("| check-updates [newer] [equal] [older]\n"
if( ( ( val.i_int == PAUSE_S ) || ( val.i_int == PLAYLIST_PAUSED ) ) &&
( strcmp( psz_cmd, "pause" ) != 0 ) )
{
- msg_rc( _("press menu select or pause to continue") );
+ msg_rc( _("Press menu select or pause to continue.") );
vlc_object_release( p_input );
return VLC_EGENERIC;
}
var_Get( p_input, "chapter", &val );
var_Change( p_input, "chapter", VLC_VAR_GETCHOICES,
&val_list, NULL );
- msg_rc( "Currently playing chapter %d/%d",
+ msg_rc( "Currently playing chapter %d/%d.",
val.i_int, val_list.p_list->i_count );
var_Change( p_this, "chapter", VLC_VAR_FREELIST,
&val_list, NULL );
var_Get( p_input, "title", &val );
var_Change( p_input, "title", VLC_VAR_GETCHOICES,
&val_list, NULL );
- msg_rc( "Currently playing title %d/%d",
+ msg_rc( "Currently playing title %d/%d.",
val.i_int, val_list.p_list->i_count );
var_Change( p_this, "title", VLC_VAR_FREELIST,
&val_list, NULL );
FIND_ANYWHERE );
if( !p_playlist )
{
+ msg_Err( p_this, "no playlist" );
return VLC_ENOOBJ;
}
{
vlc_value_t val;
var_Get( p_playlist->p_input, "state", &val );
- if( ( val.i_int == PAUSE_S ) || ( val.i_int == PLAYLIST_PAUSED ) ) {
- msg_rc( _("press menu select or pause to continue") );
+ if( ( val.i_int == PAUSE_S ) || ( val.i_int == PLAYLIST_PAUSED ) )
+ {
+ msg_rc( _("Type 'menu select' or 'pause' to continue.") );
vlc_object_release( p_playlist );
return VLC_EGENERIC;
}
}
else if( !strcmp( psz_cmd, "play" ) )
{
- if( p_playlist->p_input )
- {
- vlc_value_t val;
-
- var_Get( p_playlist->p_input, "rate", &val );
- if( val.i_int != INPUT_RATE_DEFAULT )
- {
- val.i_int = INPUT_RATE_DEFAULT;
- var_Set( p_playlist->p_input, "rate", val );
- }
- else
- {
- playlist_Play( p_playlist );
- }
- }
+ msg_Warn( p_playlist, "play" );
+ playlist_Play( p_playlist );
}
else if (!strcmp( psz_cmd, "goto" ) )
{
- if( strlen( newval.psz_string ) > 0)
- {
- val.i_int = atoi( newval.psz_string );
- playlist_Goto( p_playlist, val.i_int);
- }
+ msg_Err( p_playlist, "goto is deprecated" );
}
else if( !strcmp( psz_cmd, "stop" ) )
{
if( p_item )
{
- msg_rc( "trying to add %s to playlist", newval.psz_string );
- playlist_AddItem( p_playlist, p_item,
- PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END );
+ msg_rc( "Trying to add %s to playlist.", newval.psz_string );
+// playlist_AddItem( p_playlist, p_item,
+// PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END );
}
}
else if( !strcmp( psz_cmd, "playlist" ) )
{
int i;
-
- for ( i = 0; i < p_playlist->i_size; i++ )
- {
- msg_rc( "|%s%s %s|%s|", i == p_playlist->i_index ? "*" : " ",
- p_playlist->pp_items[i]->input.psz_name,
- p_playlist->pp_items[i]->input.psz_uri,
- p_playlist->pp_items[i]->i_parents > 0 ?
- p_playlist->pp_items[i]->pp_parents[0]->p_parent->input.psz_name : "" );
- }
- if ( i == 0 )
- {
- msg_rc( "| no entries" );
- }
+ playlist_view_t *p_view;
+ playlist_NodeDump( p_playlist, p_playlist->p_root_category, 0 );
+ playlist_NodeDump( p_playlist, p_playlist->p_root_onelevel, 0 );
}
else if( !strcmp( psz_cmd, "status" ) )
{
if( p_playlist->p_input )
{
/* Replay the current state of the system. */
- msg_rc( STATUS_CHANGE "( New input: %s )", p_playlist->p_input->input.p_item->psz_uri );
+ msg_rc( STATUS_CHANGE "( new input: %s )", p_playlist->p_input->input.p_item->psz_uri );
msg_rc( STATUS_CHANGE "( audio volume: %d )", config_GetInt( p_intf, "volume" ));
vlc_mutex_lock( &p_playlist->object_lock );
var_Get( p_input, "state", &val );
if( ( val.i_int == PAUSE_S ) || ( val.i_int == PLAYLIST_PAUSED ) )
{
- msg_rc( _("press pause to continue") );
+ msg_rc( _("Type 'pause' to continue.") );
vlc_object_release( p_playlist );
vlc_object_release( p_input );
return VLC_EGENERIC;
var_Set( p_input->p_libvlc, "mosaic-cols", val );
}
}
+ else if( !strcmp( psz_cmd, "mosaic-order" ) )
+ {
+ if( strlen( newval.psz_string ) > 0)
+ {
+ val.psz_string = newval.psz_string;
+ var_Set( p_input->p_libvlc, "mosaic-order", val );
+ }
+ }
else if( !strcmp( psz_cmd, "mosaic-keep-aspect-ratio" ) )
{
if( strlen( newval.psz_string ) > 0)
*/
else
{
- msg_rc( "unknown command!" );
+ msg_rc( "Unknown command!" );
}
vlc_object_release( p_playlist );
var_Get( p_input, "state", &val );
if( ( val.i_int == PAUSE_S ) || ( val.i_int == PLAYLIST_PAUSED ) )
{
- msg_rc( _("press menu select or pause to continue") );
+ msg_rc( _("Type 'menu select' or 'pause' to continue.") );
vlc_object_release( p_input );
return VLC_EGENERIC;
}
audio_volume_t i_volume = atoi( newval.psz_string );
if ( (i_volume > (audio_volume_t)AOUT_VOLUME_MAX) )
{
- msg_rc( "Volume must be in the range %d-%d", AOUT_VOLUME_MIN,
+ msg_rc( "Volume must be in the range %d-%d.", AOUT_VOLUME_MIN,
AOUT_VOLUME_MAX );
i_error = VLC_EBADVAR;
}
var_Get( p_input, "state", &val );
if( ( val.i_int == PAUSE_S ) || ( val.i_int == PLAYLIST_PAUSED ) )
{
- msg_rc( _("press menu select or pause to continue") );
+ msg_rc( _("Type 'menu select' or 'pause' to continue.") );
vlc_object_release( p_input );
return VLC_EGENERIC;
}
var_Get( p_input, "state", &val );
if( ( val.i_int == PAUSE_S ) || ( val.i_int == PLAYLIST_PAUSED ) ) {
- msg_rc( _("press menu select or pause to continue") );
+ msg_rc( _("Type 'menu select' or 'pause' to continue.") );
vlc_object_release( p_input );
return VLC_EGENERIC;
}
if ( !*newval.psz_string )
{
- msg_rc( _("please provide one of the following paramaters") );
+ msg_rc( _("Please provide one of the following parameters:") );
msg_rc( "[on|off|up|down|left|right|select]" );
return i_error;
}
if( ( ( val.i_int == PAUSE_S ) || ( val.i_int == PLAYLIST_PAUSED ) ) &&
( strcmp( newval.psz_string, "select" ) != 0 ) )
{
- msg_rc( _("press menu select or pause to continue") );
+ msg_rc( _("Type 'menu select' or 'pause' to continue.") );
vlc_object_release( p_playlist );
return VLC_EGENERIC;
}
osd_MenuActivate( p_this );
else
{
- msg_rc( _("please provide one of the following paramaters") );
+ msg_rc( _("Please provide one of the following parameters:") );
msg_rc( "[on|off|up|down|left|right|select]" );
if( val.psz_string ) free( val.psz_string );
return i_error;