Commit 299501b7 authored by Mark Moriarty's avatar Mark Moriarty

rc.c -- Add hooks to control marquee string and offsets

parent 37c747ac
......@@ -310,6 +310,13 @@ static void Run( intf_thread_t *p_intf )
var_AddCallback( p_intf, "prev", Playlist, NULL );
var_Create( p_intf, "next", VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
var_AddCallback( p_intf, "next", Playlist, NULL );
var_Create( p_intf, "marquee", VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
var_AddCallback( p_intf, "marquee", Input, NULL );
var_Create( p_intf, "marq-x", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
var_AddCallback( p_intf, "marq-x", Input, NULL );
var_Create( p_intf, "marq-y", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
var_AddCallback( p_intf, "marq-y", Input, NULL );
var_Create( p_intf, "pause", VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
var_AddCallback( p_intf, "pause", Input, NULL );
......@@ -570,6 +577,10 @@ static void Run( intf_thread_t *p_intf )
printf(_("| chapter_n . . . . next chapter in current item\n"));
printf(_("| chapter_p . . previous chapter in current item\n"));
printf("| \n");
printf(_("| marquee STRING . . . . . overlay STRING in video\n"));
printf(_("| marq-x X . . . . . .offset of marquee, from left\n"));
printf(_("| marq-y Y . . . . . . offset of marquee, from top\n"));
printf("| \n");
printf(_("| seek X . seek in seconds, for instance `seek 12'\n"));
printf(_("| pause . . . . . . . . . . . . . . toggle pause\n"));
printf(_("| f . . . . . . . . . . . . . . toggle fullscreen\n"));
......@@ -648,6 +659,59 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
vlc_object_release( p_input );
return VLC_SUCCESS;
}
else if( !strcmp( psz_cmd, "marquee" ) )
{
if( strlen( newval.psz_string ) > 0 )
{
val.psz_string = newval.psz_string;
/* check for the playlist structure */
vlc_object_t *p_pl =
vlc_object_find( p_this, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( !p_pl )
{
return VLC_ENOOBJ;
}
var_Set( p_pl, "marquee", val );
vlc_object_release( p_pl );
}
vlc_object_release( p_input );
return VLC_SUCCESS;
}
else if( !strcmp( psz_cmd, "marq-x" ) )
{
if( strlen( newval.psz_string ) > 0)
{
vlc_object_t *p_pl =
vlc_object_find( p_this, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( !p_pl )
{
return VLC_ENOOBJ;
}
val.i_int = atoi( newval.psz_string );
var_Set( p_pl, "marq-x", val );
vlc_object_release( p_pl );
}
vlc_object_release( p_input );
return VLC_SUCCESS;
}
else if( !strcmp( psz_cmd, "marq-y" ) )
{
if( strlen( newval.psz_string ) > 0)
{
vlc_object_t *p_pl =
vlc_object_find( p_this, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( !p_pl )
{
return VLC_ENOOBJ;
}
val.i_int = atoi( newval.psz_string );
var_Set( p_pl, "marq-y", val );
vlc_object_release( p_pl );
}
vlc_object_release( p_input );
return VLC_SUCCESS;
}
else if( !strcmp( psz_cmd, "chapter" ) ||
!strcmp( psz_cmd, "chapter_n" ) ||
!strcmp( psz_cmd, "chapter_p" ) )
......
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