Commit d68b6075 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Renamed overloaded standard C-library function printf with msg_rc()/msg_rtci().

parent 3bb6d189
...@@ -102,11 +102,11 @@ struct intf_sys_t ...@@ -102,11 +102,11 @@ struct intf_sys_t
}; };
#ifdef HAVE_VARIADIC_MACROS #ifdef HAVE_VARIADIC_MACROS
# define printf( psz_format, args... ) \ # define msg_rc( psz_format, args... ) \
Printf( p_intf, psz_format, ## args ) __msg_rc( p_intf, psz_format, ## args )
#endif #endif
void Printf( intf_thread_t *p_intf, const char *psz_fmt, ... ) void __msg_rc( intf_thread_t *p_intf, const char *psz_fmt, ... )
{ {
va_list args; va_list args;
va_start( args, psz_fmt ); va_start( args, psz_fmt );
...@@ -274,7 +274,7 @@ static int Activate( vlc_object_t *p_this ) ...@@ -274,7 +274,7 @@ static int Activate( vlc_object_t *p_this )
CONSOLE_INTRO_MSG; CONSOLE_INTRO_MSG;
#endif #endif
printf( _("Remote control interface initialized, `h' for help\n") ); msg_rc( _("Remote control interface initialized, `h' for help\n") );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -433,7 +433,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -433,7 +433,7 @@ static void Run( intf_thread_t *p_intf )
if( i_oldpos != i_newpos ) if( i_oldpos != i_newpos )
{ {
i_oldpos = i_newpos; i_oldpos = i_newpos;
printf( "pos: %d%%\n", i_newpos ); msg_rc( "pos: %d%%\n", i_newpos );
} }
} }
...@@ -472,7 +472,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -472,7 +472,7 @@ static void Run( intf_thread_t *p_intf )
val.psz_string = psz_arg; val.psz_string = psz_arg;
i_ret = var_Set( p_intf, psz_cmd, val ); i_ret = var_Set( p_intf, psz_cmd, val );
printf( _("%s: returned %i (%s)\n"), msg_rc( _("%s: returned %i (%s)\n"),
psz_cmd, i_ret, vlc_error( i_ret ) ); psz_cmd, i_ret, vlc_error( i_ret ) );
} }
/* Or maybe it's a global command */ /* Or maybe it's a global command */
...@@ -487,7 +487,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -487,7 +487,7 @@ static void Run( intf_thread_t *p_intf )
i_ret = var_Set( p_intf->p_libvlc, psz_cmd, val ); i_ret = var_Set( p_intf->p_libvlc, psz_cmd, val );
if( i_ret != 0 ) if( i_ret != 0 )
{ {
printf( _("%s: returned %i (%s)\n"), msg_rc( _("%s: returned %i (%s)\n"),
psz_cmd, i_ret, vlc_error( i_ret ) ); psz_cmd, i_ret, vlc_error( i_ret ) );
} }
} }
...@@ -511,70 +511,70 @@ static void Run( intf_thread_t *p_intf ) ...@@ -511,70 +511,70 @@ static void Run( intf_thread_t *p_intf )
info_category_t *p_category = info_category_t *p_category =
p_input->input.p_item->pp_categories[i]; p_input->input.p_item->pp_categories[i];
printf( "+----[ %s ]\n", p_category->psz_name ); msg_rc( "+----[ %s ]\n", p_category->psz_name );
printf( "| \n" ); msg_rc( "| \n" );
for ( j = 0; j < p_category->i_infos; j++ ) for ( j = 0; j < p_category->i_infos; j++ )
{ {
info_t *p_info = p_category->pp_infos[j]; info_t *p_info = p_category->pp_infos[j];
printf( "| %s: %s\n", p_info->psz_name, msg_rc( "| %s: %s\n", p_info->psz_name,
p_info->psz_value ); p_info->psz_value );
} }
printf( "| \n" ); msg_rc( "| \n" );
} }
printf( _("+----[ end of stream info ]\n") ); msg_rc( _("+----[ end of stream info ]\n") );
vlc_mutex_unlock( &p_input->input.p_item->lock ); vlc_mutex_unlock( &p_input->input.p_item->lock );
} }
else else
{ {
printf( _("no input\n") ); msg_rc( _("no input\n") );
} }
} }
else if( !strcmp( psz_cmd, "is_playing" ) ) else if( !strcmp( psz_cmd, "is_playing" ) )
{ {
if( ! p_input ) if( ! p_input )
{ {
printf( "0\n" ); msg_rc( "0\n" );
} }
else else
{ {
printf( "1\n" ); msg_rc( "1\n" );
} }
} }
else if( !strcmp( psz_cmd, "get_time" ) ) else if( !strcmp( psz_cmd, "get_time" ) )
{ {
if( ! p_input ) if( ! p_input )
{ {
printf("0\n"); msg_rc("0\n");
} }
else else
{ {
vlc_value_t time; vlc_value_t time;
var_Get( p_input, "time", &time ); var_Get( p_input, "time", &time );
printf( "%i\n", time.i_time / 1000000); msg_rc( "%i\n", time.i_time / 1000000);
} }
} }
else if( !strcmp( psz_cmd, "get_length" ) ) else if( !strcmp( psz_cmd, "get_length" ) )
{ {
if( ! p_input ) if( ! p_input )
{ {
printf("0\n"); msg_rc("0\n");
} }
else else
{ {
vlc_value_t time; vlc_value_t time;
var_Get( p_input, "length", &time ); var_Get( p_input, "length", &time );
printf( "%i\n", time.i_time / 1000000); msg_rc( "%i\n", time.i_time / 1000000);
} }
} }
else if( !strcmp( psz_cmd, "get_title" ) ) else if( !strcmp( psz_cmd, "get_title" ) )
{ {
if( ! p_input ) if( ! p_input )
{ {
printf("\n"); msg_rc("\n");
} }
else else
{ {
printf( "%s\n", p_input->input.p_item->psz_name ); msg_rc( "%s\n", p_input->input.p_item->psz_name );
} }
} }
else switch( psz_cmd[0] ) else switch( psz_cmd[0] )
...@@ -603,45 +603,45 @@ static void Run( intf_thread_t *p_intf ) ...@@ -603,45 +603,45 @@ static void Run( intf_thread_t *p_intf )
case '?': case '?':
case 'h': case 'h':
case 'H': case 'H':
printf(_("+----[ Remote control commands ]\n")); msg_rc(_("+----[ Remote control commands ]\n"));
printf("| \n"); msg_rc("| \n");
printf(_("| add XYZ . . . . . . . . . . add XYZ to playlist\n")); msg_rc(_("| add XYZ . . . . . . . . . . add XYZ to playlist\n"));
printf(_("| playlist . . . show items currently in playlist\n")); msg_rc(_("| playlist . . . show items currently in playlist\n"));
printf(_("| play . . . . . . . . . . . . . . . . play stream\n")); msg_rc(_("| play . . . . . . . . . . . . . . . . play stream\n"));
printf(_("| stop . . . . . . . . . . . . . . . . stop stream\n")); msg_rc(_("| stop . . . . . . . . . . . . . . . . stop stream\n"));
printf(_("| next . . . . . . . . . . . . next playlist item\n")); msg_rc(_("| next . . . . . . . . . . . . next playlist item\n"));
printf(_("| prev . . . . . . . . . . previous playlist item\n")); msg_rc(_("| prev . . . . . . . . . . previous playlist item\n"));
printf(_("| title [X] . . . . set/get title in current item\n")); msg_rc(_("| title [X] . . . . set/get title in current item\n"));
printf(_("| title_n . . . . . . next title in current item\n")); msg_rc(_("| title_n . . . . . . next title in current item\n"));
printf(_("| title_p . . . . previous title in current item\n")); msg_rc(_("| title_p . . . . previous title in current item\n"));
printf(_("| chapter [X] . . set/get chapter in current item\n")); msg_rc(_("| chapter [X] . . set/get chapter in current item\n"));
printf(_("| chapter_n . . . . next chapter in current item\n")); msg_rc(_("| chapter_n . . . . next chapter in current item\n"));
printf(_("| chapter_p . . previous chapter in current item\n")); msg_rc(_("| chapter_p . . previous chapter in current item\n"));
printf("| \n"); msg_rc("| \n");
printf(_("| seek X . seek in seconds, for instance `seek 12'\n")); msg_rc(_("| seek X . seek in seconds, for instance `seek 12'\n"));
printf(_("| pause . . . . . . . . . . . . . . toggle pause\n")); msg_rc(_("| pause . . . . . . . . . . . . . . toggle pause\n"));
printf(_("| f . . . . . . . . . . . . . . toggle fullscreen\n")); msg_rc(_("| f . . . . . . . . . . . . . . toggle fullscreen\n"));
printf(_("| info . . . information about the current stream\n")); msg_rc(_("| info . . . information about the current stream\n"));
printf("| \n"); msg_rc("| \n");
printf(_("| volume [X] . . . . . . . . set/get audio volume\n")); msg_rc(_("| volume [X] . . . . . . . . set/get audio volume\n"));
printf(_("| volup [X] . . . . . raise audio volume X steps\n")); msg_rc(_("| volup [X] . . . . . raise audio volume X steps\n"));
printf(_("| voldown [X] . . . . lower audio volume X steps\n")); msg_rc(_("| voldown [X] . . . . lower audio volume X steps\n"));
printf(_("| adev [X] . . . . . . . . . set/get audio device\n")); msg_rc(_("| adev [X] . . . . . . . . . set/get audio device\n"));
printf(_("| achan [X]. . . . . . . . set/get audio channels\n")); msg_rc(_("| achan [X]. . . . . . . . set/get audio channels\n"));
printf("| \n"); msg_rc("| \n");
if (p_intf->p_sys->b_extend) if (p_intf->p_sys->b_extend)
{ {
printf(_("| marq-marquee STRING . . overlay STRING in video\n")); msg_rc(_("| marq-marquee STRING . . overlay STRING in video\n"));
printf(_("| marq-x X . . . . . .offset of marquee, from left\n")); msg_rc(_("| marq-x X . . . . . .offset of marquee, from left\n"));
printf(_("| marq-y Y . . . . . . offset of marquee, from top\n")); msg_rc(_("| marq-y Y . . . . . . offset of marquee, from top\n"));
printf(_("| marq-timeout T. . . . .timeout of marquee, in ms\n")); msg_rc(_("| marq-timeout T. . . . .timeout of marquee, in ms\n"));
printf("| \n"); msg_rc("| \n");
} }
printf(_("| help . . . . . . . . . . . . . this help message\n")); msg_rc(_("| help . . . . . . . . . . . . . this help message\n"));
printf(_("| logout . . . . . .exit (if in socket connection)\n")); msg_rc(_("| logout . . . . . .exit (if in socket connection)\n"));
printf(_("| quit . . . . . . . . . . . . . . . . . quit vlc\n")); msg_rc(_("| quit . . . . . . . . . . . . . . . . . quit vlc\n"));
printf("| \n"); msg_rc("| \n");
printf(_("+----[ end of help ]\n")); msg_rc(_("+----[ end of help ]\n"));
break; break;
case '\0': case '\0':
...@@ -649,7 +649,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -649,7 +649,7 @@ static void Run( intf_thread_t *p_intf )
break; break;
default: default:
printf(_("unknown command `%s', type `help' for help\n"), psz_cmd); msg_rc(_("unknown command `%s', type `help' for help\n"), psz_cmd);
break; break;
} }
...@@ -726,7 +726,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd, ...@@ -726,7 +726,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
var_Get( p_input, "chapter", &val ); var_Get( p_input, "chapter", &val );
var_Change( p_input, "chapter", VLC_VAR_GETCHOICES, var_Change( p_input, "chapter", VLC_VAR_GETCHOICES,
&val_list, NULL ); &val_list, NULL );
printf( _("Currently playing chapter %d/%d\n"), msg_rc( _("Currently playing chapter %d/%d\n"),
val.i_int, val_list.p_list->i_count ); val.i_int, val_list.p_list->i_count );
var_Change( p_this, "chapter", VLC_VAR_FREELIST, var_Change( p_this, "chapter", VLC_VAR_FREELIST,
&val_list, NULL ); &val_list, NULL );
...@@ -766,7 +766,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd, ...@@ -766,7 +766,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
var_Get( p_input, "title", &val ); var_Get( p_input, "title", &val );
var_Change( p_input, "title", VLC_VAR_GETCHOICES, var_Change( p_input, "title", VLC_VAR_GETCHOICES,
&val_list, NULL ); &val_list, NULL );
printf( _("Currently playing title %d/%d\n"), msg_rc( _("Currently playing title %d/%d\n"),
val.i_int, val_list.p_list->i_count ); val.i_int, val_list.p_list->i_count );
var_Change( p_this, "title", VLC_VAR_FREELIST, var_Change( p_this, "title", VLC_VAR_FREELIST,
&val_list, NULL ); &val_list, NULL );
...@@ -823,7 +823,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, ...@@ -823,7 +823,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
} }
else if( !strcmp( psz_cmd, "add" ) ) else if( !strcmp( psz_cmd, "add" ) )
{ {
printf( _("trying to add %s to playlist\n"), newval.psz_string ); msg_rc( _("trying to add %s to playlist\n"), newval.psz_string );
playlist_Add( p_playlist, newval.psz_string, newval.psz_string, playlist_Add( p_playlist, newval.psz_string, newval.psz_string,
PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END ); PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END );
} }
...@@ -832,13 +832,13 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, ...@@ -832,13 +832,13 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
int i; int i;
for ( i = 0; i < p_playlist->i_size; i++ ) for ( i = 0; i < p_playlist->i_size; i++ )
{ {
printf( "|%s%s %s|\n", i == p_playlist->i_index?"*":" ", msg_rc( "|%s%s %s|\n", i == p_playlist->i_index?"*":" ",
p_playlist->pp_items[i]->input.psz_name, p_playlist->pp_items[i]->input.psz_name,
p_playlist->pp_items[i]->input.psz_uri ); p_playlist->pp_items[i]->input.psz_uri );
} }
if ( i == 0 ) if ( i == 0 )
{ {
printf( _("| no entries\n") ); msg_rc( _("| no entries\n") );
} }
} }
...@@ -847,7 +847,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, ...@@ -847,7 +847,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
*/ */
else else
{ {
printf( _("unknown command!\n") ); msg_rc( _("unknown command!\n") );
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
...@@ -920,7 +920,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd, ...@@ -920,7 +920,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
*/ */
else else
{ {
printf( _("unknown command!\n") ); msg_rc( _("unknown command!\n") );
} }
vlc_object_release( p_pl ); vlc_object_release( p_pl );
...@@ -967,7 +967,7 @@ static int Volume( vlc_object_t *p_this, char const *psz_cmd, ...@@ -967,7 +967,7 @@ static int Volume( vlc_object_t *p_this, char const *psz_cmd,
audio_volume_t i_volume = atoi( newval.psz_string ); audio_volume_t i_volume = atoi( newval.psz_string );
if ( i_volume > AOUT_VOLUME_MAX ) if ( i_volume > AOUT_VOLUME_MAX )
{ {
printf( _("Volume must be in the range %d-%d\n"), AOUT_VOLUME_MIN, msg_rc( _("Volume must be in the range %d-%d\n"), AOUT_VOLUME_MIN,
AOUT_VOLUME_MAX ); AOUT_VOLUME_MAX );
i_error = VLC_EBADVAR; i_error = VLC_EBADVAR;
} }
...@@ -983,7 +983,7 @@ static int Volume( vlc_object_t *p_this, char const *psz_cmd, ...@@ -983,7 +983,7 @@ static int Volume( vlc_object_t *p_this, char const *psz_cmd,
} }
else else
{ {
printf( _("Volume is %d\n"), i_volume ); msg_rc( _("Volume is %d\n"), i_volume );
i_error = VLC_SUCCESS; i_error = VLC_SUCCESS;
} }
} }
...@@ -1015,7 +1015,7 @@ static int VolumeMove( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1015,7 +1015,7 @@ static int VolumeMove( vlc_object_t *p_this, char const *psz_cmd,
i_error = VLC_EGENERIC; i_error = VLC_EGENERIC;
} }
if ( !i_error ) printf( _("Volume is %d\n"), i_volume ); if ( !i_error ) msg_rc( _("Volume is %d\n"), i_volume );
return i_error; return i_error;
} }
...@@ -1065,19 +1065,19 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1065,19 +1065,19 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
return VLC_EGENERIC; return VLC_EGENERIC;
} }
printf( "+----[ %s ]\n", val_name.psz_string ); msg_rc( "+----[ %s ]\n", val_name.psz_string );
for ( i = 0; i < val.p_list->i_count; i++ ) for ( i = 0; i < val.p_list->i_count; i++ )
{ {
if ( i_value == val.p_list->p_values[i].i_int ) if ( i_value == val.p_list->p_values[i].i_int )
printf( "| %i - %s *\n", val.p_list->p_values[i].i_int, msg_rc( "| %i - %s *\n", val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string ); text.p_list->p_values[i].psz_string );
else else
printf( "| %i - %s\n", val.p_list->p_values[i].i_int, msg_rc( "| %i - %s\n", val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string ); text.p_list->p_values[i].psz_string );
} }
var_Change( (vlc_object_t *)p_aout, psz_variable, VLC_VAR_FREELIST, var_Change( (vlc_object_t *)p_aout, psz_variable, VLC_VAR_FREELIST,
&val, &text ); &val, &text );
printf( _("+----[ end of %s ]\n"), val_name.psz_string ); msg_rc( _("+----[ end of %s ]\n"), val_name.psz_string );
if( val_name.psz_string ) free( val_name.psz_string ); if( val_name.psz_string ) free( val_name.psz_string );
i_error = VLC_SUCCESS; i_error = VLC_SUCCESS;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* $Id: rc.c 8847 2004-09-29 11:36:37Z markfm $ * $Id: rc.c 8847 2004-09-29 11:36:37Z markfm $
* *
* Author: Peter Surda <shurdeek@panorama.sth.ac.at> * Author: Peter Surda <shurdeek@panorama.sth.ac.at>
* Jean-Paul Saman
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -108,11 +109,11 @@ struct intf_sys_t ...@@ -108,11 +109,11 @@ struct intf_sys_t
}; };
#ifdef HAVE_VARIADIC_MACROS #ifdef HAVE_VARIADIC_MACROS
# define printf( psz_format, args... ) \ # define msg_rtci( psz_format, args... ) \
Printf( p_intf, psz_format, ## args ) __msg_rtci( p_intf, psz_format, ## args )
#endif #endif
void Printf( intf_thread_t *p_intf, const char *psz_fmt, ... ) static void __msg_rtci( intf_thread_t *p_intf, const char *psz_fmt, ... )
{ {
va_list args; va_list args;
va_start( args, psz_fmt ); va_start( args, psz_fmt );
...@@ -275,7 +276,7 @@ static int Activate( vlc_object_t *p_this ) ...@@ -275,7 +276,7 @@ static int Activate( vlc_object_t *p_this )
CONSOLE_INTRO_MSG; CONSOLE_INTRO_MSG;
#endif #endif
printf( _("Real time control interface initialized, `h' for help\n") ); msg_rtci( _("Real time control interface initialized, `h' for help\n") );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -434,7 +435,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -434,7 +435,7 @@ static void Run( intf_thread_t *p_intf )
if( i_oldpos != i_newpos ) if( i_oldpos != i_newpos )
{ {
i_oldpos = i_newpos; i_oldpos = i_newpos;
printf( "pos: %d%%\n", i_newpos ); msg_rtci( "pos: %d%%\n", i_newpos );
} }
} }
...@@ -473,7 +474,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -473,7 +474,7 @@ static void Run( intf_thread_t *p_intf )
val.psz_string = psz_arg; val.psz_string = psz_arg;
i_ret = var_Set( p_intf, psz_cmd, val ); i_ret = var_Set( p_intf, psz_cmd, val );
printf( _("%s: returned %i (%s)\n"), msg_rtci( _("%s: returned %i (%s)\n"),
psz_cmd, i_ret, vlc_error( i_ret ) ); psz_cmd, i_ret, vlc_error( i_ret ) );
} }
/* Or maybe it's a global command */ /* Or maybe it's a global command */
...@@ -488,7 +489,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -488,7 +489,7 @@ static void Run( intf_thread_t *p_intf )
i_ret = var_Set( p_intf->p_libvlc, psz_cmd, val ); i_ret = var_Set( p_intf->p_libvlc, psz_cmd, val );
if( i_ret != 0 ) if( i_ret != 0 )
{ {
printf( _("%s: returned %i (%s)\n"), msg_rtci( _("%s: returned %i (%s)\n"),
psz_cmd, i_ret, vlc_error( i_ret ) ); psz_cmd, i_ret, vlc_error( i_ret ) );
} }
} }
...@@ -512,70 +513,70 @@ static void Run( intf_thread_t *p_intf ) ...@@ -512,70 +513,70 @@ static void Run( intf_thread_t *p_intf )
info_category_t *p_category = info_category_t *p_category =
p_input->input.p_item->pp_categories[i]; p_input->input.p_item->pp_categories[i];
printf( "+----[ %s ]\n", p_category->psz_name ); msg_rtci( "+----[ %s ]\n", p_category->psz_name );
printf( "| \n" ); msg_rtci( "| \n" );
for ( j = 0; j < p_category->i_infos; j++ ) for ( j = 0; j < p_category->i_infos; j++ )
{ {
info_t *p_info = p_category->pp_infos[j]; info_t *p_info = p_category->pp_infos[j];
printf( "| %s: %s\n", p_info->psz_name, msg_rtci( "| %s: %s\n", p_info->psz_name,
p_info->psz_value ); p_info->psz_value );
} }
printf( "| \n" ); msg_rtci( "| \n" );
} }
printf( _("+----[ end of stream info ]\n") ); msg_rtci( _("+----[ end of stream info ]\n") );
vlc_mutex_unlock( &p_input->input.p_item->lock ); vlc_mutex_unlock( &p_input->input.p_item->lock );
} }
else else
{ {
printf( _("no input\n") ); msg_rtci( _("no input\n") );
} }
} }
else if( !strcmp( psz_cmd, "is_playing" ) ) else if( !strcmp( psz_cmd, "is_playing" ) )
{ {
if( ! p_input ) if( ! p_input )
{ {
printf( "0\n" ); msg_rtci( "0\n" );
} }
else else
{ {
printf( "1\n" ); msg_rtci( "1\n" );
} }
} }
else if( !strcmp( psz_cmd, "get_time" ) ) else if( !strcmp( psz_cmd, "get_time" ) )
{ {
if( ! p_input ) if( ! p_input )
{ {
printf("0\n"); msg_rtci("0\n");
} }
else else
{ {
vlc_value_t time; vlc_value_t time;
var_Get( p_input, "time", &time ); var_Get( p_input, "time", &time );
printf( "%i\n", time.i_time / 1000000); msg_rtci( "%i\n", time.i_time / 1000000);
} }
} }
else if( !strcmp( psz_cmd, "get_length" ) ) else if( !strcmp( psz_cmd, "get_length" ) )
{ {
if( ! p_input ) if( ! p_input )
{ {
printf("0\n"); msg_rtci("0\n");
} }
else else
{ {
vlc_value_t time; vlc_value_t time;
var_Get( p_input, "length", &time ); var_Get( p_input, "length", &time );
printf( "%i\n", time.i_time / 1000000); msg_rtci( "%i\n", time.i_time / 1000000);
} }
} }
else if( !strcmp( psz_cmd, "get_title" ) ) else if( !strcmp( psz_cmd, "get_title" ) )
{ {
if( ! p_input ) if( ! p_input )
{ {
printf("\n"); msg_rtci("\n");
} }
else else
{ {
printf( "%s\n", p_input->input.p_item->psz_name ); msg_rtci( "%s\n", p_input->input.p_item->psz_name );
} }
} }
else switch( psz_cmd[0] ) else switch( psz_cmd[0] )
...@@ -604,45 +605,45 @@ static void Run( intf_thread_t *p_intf ) ...@@ -604,45 +605,45 @@ static void Run( intf_thread_t *p_intf )
case '?': case '?':
case 'h': case 'h':
case 'H': case 'H':
printf(_("+----[ Remote control commands ]\n")); msg_rtci(_("+----[ Remote control commands ]\n"));
printf("| \n"); msg_rtci("| \n");
printf(_("| add XYZ . . . . . . . . . . add XYZ to playlist\n")); msg_rtci(_("| add XYZ . . . . . . . . . . add XYZ to playlist\n"));
printf(_("| playlist . . . show items currently in playlist\n")); msg_rtci(_("| playlist . . . show items currently in playlist\n"));
printf(_("| play . . . . . . . . . . . . . . . . play stream\n")); msg_rtci(_("| play . . . . . . . . . . . . . . . . play stream\n"));
printf(_("| stop . . . . . . . . . . . . . . . . stop stream\n")); msg_rtci(_("| stop . . . . . . . . . . . . . . . . stop stream\n"));
printf(_("| next . . . . . . . . . . . . next playlist item\n")); msg_rtci(_("| next . . . . . . . . . . . . next playlist item\n"));
printf(_("| prev . . . . . . . . . . previous playlist item\n")); msg_rtci(_("| prev . . . . . . . . . . previous playlist item\n"));
printf(_("| title [X] . . . . set/get title in current item\n")); msg_rtci(_("| title [X] . . . . set/get title in current item\n"));
printf(_("| title_n . . . . . . next title in current item\n")); msg_rtci(_("| title_n . . . . . . next title in current item\n"));
printf(_("| title_p . . . . previous title in current item\n")); msg_rtci(_("| title_p . . . . previous title in current item\n"));
printf(_("| chapter [X] . . set/get chapter in current item\n")); msg_rtci(_("| chapter [X] . . set/get chapter in current item\n"));
printf(_("| chapter_n . . . . next chapter in current item\n")); msg_rtci(_("| chapter_n . . . . next chapter in current item\n"));
printf(_("| chapter_p . . previous chapter in current item\n")); msg_rtci(_("| chapter_p . . previous chapter in current item\n"));
printf("| \n"); msg_rtci("| \n");
printf(_("| seek X . seek in seconds, for instance `seek 12'\n")); msg_rtci(_("| seek X . seek in seconds, for instance `seek 12'\n"));
printf(_("| pause . . . . . . . . . . . . . . toggle pause\n")); msg_rtci(_("| pause . . . . . . . . . . . . . . toggle pause\n"));
printf(_("| f . . . . . . . . . . . . . . toggle fullscreen\n")); msg_rtci(_("| f . . . . . . . . . . . . . . toggle fullscreen\n"));
printf(_("| info . . . information about the current stream\n")); msg_rtci(_("| info . . . information about the current stream\n"));
printf("| \n"); msg_rtci("| \n");
printf(_("| volume [X] . . . . . . . . set/get audio volume\n")); msg_rtci(_("| volume [X] . . . . . . . . set/get audio volume\n"));
printf(_("| volup [X] . . . . . raise audio volume X steps\n")); msg_rtci(_("| volup [X] . . . . . raise audio volume X steps\n"));
printf(_("| voldown [X] . . . . lower audio volume X steps\n")); msg_rtci(_("| voldown [X] . . . . lower audio volume X steps\n"));
printf(_("| adev [X] . . . . . . . . . set/get audio device\n")); msg_rtci(_("| adev [X] . . . . . . . . . set/get audio device\n"));
printf(_("| achan [X]. . . . . . . . set/get audio channels\n")); msg_rtci(_("| achan [X]. . . . . . . . set/get audio channels\n"));
printf("| \n"); msg_rtci("| \n");
if (p_intf->p_sys->b_extend) if (p_intf->p_sys->b_extend)
{ {
printf(_("| marq-marquee STRING . . overlay STRING in video\n")); msg_rtci(_("| marq-marquee STRING . . overlay STRING in video\n"));
printf(_("| marq-x X . . . . . .offset of marquee, from left\n")); msg_rtci(_("| marq-x X . . . . . .offset of marquee, from left\n"));
printf(_("| marq-y Y . . . . . . offset of marquee, from top\n")); msg_rtci(_("| marq-y Y . . . . . . offset of marquee, from top\n"));
printf(_("| marq-timeout T. . . . .timeout of marquee, in ms\n")); msg_rtci(_("| marq-timeout T. . . . .timeout of marquee, in ms\n"));
printf("| \n"); msg_rtci("| \n");
} }
printf(_("| help . . . . . . . . . . . . . this help message\n")); msg_rtci(_("| help . . . . . . . . . . . . . this help message\n"));
printf(_("| logout . . . . . .exit (if in socket connection)\n")); msg_rtci(_("| logout . . . . . .exit (if in socket connection)\n"));
printf(_("| quit . . . . . . . . . . . . . . . . . quit vlc\n")); msg_rtci(_("| quit . . . . . . . . . . . . . . . . . quit vlc\n"));
printf("| \n"); msg_rtci("| \n");
printf(_("+----[ end of help ]\n")); msg_rtci(_("+----[ end of help ]\n"));
break; break;
case '\0': case '\0':
...@@ -650,7 +651,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -650,7 +651,7 @@ static void Run( intf_thread_t *p_intf )
break; break;
default: default:
printf(_("unknown command `%s', type `help' for help\n"), psz_cmd); msg_rtci(_("unknown command `%s', type `help' for help\n"), psz_cmd);
break; break;
} }
...@@ -727,7 +728,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd, ...@@ -727,7 +728,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
var_Get( p_input, "chapter", &val ); var_Get( p_input, "chapter", &val );
var_Change( p_input, "chapter", VLC_VAR_GETCHOICES, var_Change( p_input, "chapter", VLC_VAR_GETCHOICES,
&val_list, NULL ); &val_list, NULL );
printf( _("Currently playing chapter %d/%d\n"), msg_rtci( _("Currently playing chapter %d/%d\n"),
val.i_int, val_list.p_list->i_count ); val.i_int, val_list.p_list->i_count );
var_Change( p_this, "chapter", VLC_VAR_FREELIST, var_Change( p_this, "chapter", VLC_VAR_FREELIST,
&val_list, NULL ); &val_list, NULL );
...@@ -767,7 +768,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd, ...@@ -767,7 +768,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
var_Get( p_input, "title", &val ); var_Get( p_input, "title", &val );
var_Change( p_input, "title", VLC_VAR_GETCHOICES, var_Change( p_input, "title", VLC_VAR_GETCHOICES,
&val_list, NULL ); &val_list, NULL );
printf( _("Currently playing title %d/%d\n"), msg_rtci( _("Currently playing title %d/%d\n"),
val.i_int, val_list.p_list->i_count ); val.i_int, val_list.p_list->i_count );
var_Change( p_this, "title", VLC_VAR_FREELIST, var_Change( p_this, "title", VLC_VAR_FREELIST,
&val_list, NULL ); &val_list, NULL );
...@@ -824,7 +825,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, ...@@ -824,7 +825,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
} }
else if( !strcmp( psz_cmd, "add" ) ) else if( !strcmp( psz_cmd, "add" ) )
{ {
printf( _("trying to add %s to playlist\n"), newval.psz_string ); msg_rtci( _("trying to add %s to playlist\n"), newval.psz_string );
playlist_Add( p_playlist, newval.psz_string, newval.psz_string, playlist_Add( p_playlist, newval.psz_string, newval.psz_string,
PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END ); PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END );
} }
...@@ -833,13 +834,13 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, ...@@ -833,13 +834,13 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
int i; int i;
for ( i = 0; i < p_playlist->i_size; i++ ) for ( i = 0; i < p_playlist->i_size; i++ )
{ {
printf( "|%s%s %s|\n", i == p_playlist->i_index?"*":" ", msg_rtci( "|%s%s %s|\n", i == p_playlist->i_index?"*":" ",
p_playlist->pp_items[i]->input.psz_name, p_playlist->pp_items[i]->input.psz_name,
p_playlist->pp_items[i]->input.psz_uri ); p_playlist->pp_items[i]->input.psz_uri );
} }
if ( i == 0 ) if ( i == 0 )
{ {
printf( _("| no entries\n") ); msg_rtci( _("| no entries\n") );
} }
} }
...@@ -848,7 +849,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd, ...@@ -848,7 +849,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
*/ */
else else
{ {
printf( _("unknown command!\n") ); msg_rtci( _("unknown command!\n") );
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
...@@ -913,7 +914,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd, ...@@ -913,7 +914,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
*/ */
else else
{ {
printf( _("unknown command!\n") ); msg_rtci( _("unknown command!\n") );
} }
vlc_object_release( p_pl ); vlc_object_release( p_pl );
...@@ -959,7 +960,7 @@ static int Volume( vlc_object_t *p_this, char const *psz_cmd, ...@@ -959,7 +960,7 @@ static int Volume( vlc_object_t *p_this, char const *psz_cmd,
audio_volume_t i_volume = atoi( newval.psz_string ); audio_volume_t i_volume = atoi( newval.psz_string );
if ( i_volume > AOUT_VOLUME_MAX ) if ( i_volume > AOUT_VOLUME_MAX )
{ {
printf( _("Volume must be in the range %d-%d\n"), AOUT_VOLUME_MIN, msg_rtci( _("Volume must be in the range %d-%d\n"), AOUT_VOLUME_MIN,
AOUT_VOLUME_MAX ); AOUT_VOLUME_MAX );
i_error = VLC_EBADVAR; i_error = VLC_EBADVAR;
} }
...@@ -975,7 +976,7 @@ static int Volume( vlc_object_t *p_this, char const *psz_cmd, ...@@ -975,7 +976,7 @@ static int Volume( vlc_object_t *p_this, char const *psz_cmd,
} }
else else
{ {
printf( _("Volume is %d\n"), i_volume ); msg_rtci( _("Volume is %d\n"), i_volume );
i_error = VLC_SUCCESS; i_error = VLC_SUCCESS;
} }
} }
...@@ -1007,7 +1008,7 @@ static int VolumeMove( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1007,7 +1008,7 @@ static int VolumeMove( vlc_object_t *p_this, char const *psz_cmd,
i_error = VLC_EGENERIC; i_error = VLC_EGENERIC;
} }
if ( !i_error ) printf( _("Volume is %d\n"), i_volume ); if ( !i_error ) msg_rtci( _("Volume is %d\n"), i_volume );
return i_error; return i_error;
} }
...@@ -1057,19 +1058,19 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1057,19 +1058,19 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
return VLC_EGENERIC; return VLC_EGENERIC;
} }
printf( "+----[ %s ]\n", val_name.psz_string ); msg_rtci( "+----[ %s ]\n", val_name.psz_string );
for ( i = 0; i < val.p_list->i_count; i++ ) for ( i = 0; i < val.p_list->i_count; i++ )
{ {
if ( i_value == val.p_list->p_values[i].i_int ) if ( i_value == val.p_list->p_values[i].i_int )
printf( "| %i - %s *\n", val.p_list->p_values[i].i_int, msg_rtci( "| %i - %s *\n", val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string ); text.p_list->p_values[i].psz_string );
else else
printf( "| %i - %s\n", val.p_list->p_values[i].i_int, msg_rtci( "| %i - %s\n", val.p_list->p_values[i].i_int,
text.p_list->p_values[i].psz_string ); text.p_list->p_values[i].psz_string );
} }
var_Change( (vlc_object_t *)p_aout, psz_variable, VLC_VAR_FREELIST, var_Change( (vlc_object_t *)p_aout, psz_variable, VLC_VAR_FREELIST,
&val, &text ); &val, &text );
printf( _("+----[ end of %s ]\n"), val_name.psz_string ); msg_rtci( _("+----[ end of %s ]\n"), val_name.psz_string );
if( val_name.psz_string ) free( val_name.psz_string ); if( val_name.psz_string ) free( val_name.psz_string );
i_error = VLC_SUCCESS; i_error = VLC_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment