+
+ var_DelCallback( p_intf->p_libvlc, "volume-change", VolumeChanged, p_intf );
+}
+
+static void Help( intf_thread_t *p_intf, bool 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"));
+ msg_rc(_("| next . . . . . . . . . . . . . . next playlist item"));
+ msg_rc(_("| prev . . . . . . . . . . . . previous playlist item"));
+ msg_rc(_("| goto . . . . . . . . . . . . . . goto item at index"));
+ msg_rc(_("| repeat [on|off] . . . . toggle playlist item repeat"));
+ msg_rc(_("| loop [on|off] . . . . . . . . . toggle playlist loop"));
+ msg_rc(_("| random [on|off] . . . . . . . toggle random jumping"));
+ msg_rc(_("| clear . . . . . . . . . . . . . . clear the playlist"));
+ msg_rc(_("| status . . . . . . . . . . . current playlist status"));
+ msg_rc(_("| title [X] . . . . . . set/get title in current item"));
+ msg_rc(_("| title_n . . . . . . . . next title in current item"));
+ msg_rc(_("| title_p . . . . . . previous title in current item"));
+ msg_rc(_("| chapter [X] . . . . set/get chapter in current item"));
+ msg_rc(_("| chapter_n . . . . . . next chapter in current item"));
+ msg_rc(_("| chapter_p . . . . previous chapter in current item"));
+ msg_rc( "| ");
+ msg_rc(_("| seek X . . . seek in seconds, for instance `seek 12'"));
+ msg_rc(_("| pause . . . . . . . . . . . . . . . . toggle pause"));
+ msg_rc(_("| fastforward . . . . . . . . . set to maximum rate"));
+ msg_rc(_("| rewind . . . . . . . . . . . . set to minimum rate"));
+ msg_rc(_("| faster . . . . . . . . . . faster playing of stream"));
+ msg_rc(_("| slower . . . . . . . . . . slower playing of stream"));
+ msg_rc(_("| normal . . . . . . . . . . normal playing of stream"));
+ msg_rc(_("| f [on|off] . . . . . . . . . . . . toggle fullscreen"));
+ msg_rc(_("| info . . . . . information about the current stream"));
+ msg_rc(_("| stats . . . . . . . . show statistical information"));
+ 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(_("| voldown [X] . . . . . . lower audio volume X steps"));
+ msg_rc(_("| adev [X] . . . . . . . . . . . set/get audio device"));
+ msg_rc(_("| achan [X]. . . . . . . . . . set/get audio channels"));
+ msg_rc(_("| atrack [X] . . . . . . . . . . . set/get audio track"));
+ msg_rc(_("| vtrack [X] . . . . . . . . . . . set/get video track"));
+ msg_rc(_("| vratio [X] . . . . . . . set/get video aspect ratio"));
+ msg_rc(_("| vcrop [X] . . . . . . . . . . . set/get video crop"));
+ msg_rc(_("| vzoom [X] . . . . . . . . . . . set/get video zoom"));
+ msg_rc(_("| snapshot . . . . . . . . . . . . take video snapshot"));
+ msg_rc(_("| strack [X] . . . . . . . . . set/get subtitles track"));
+ msg_rc(_("| key [hotkey name] . . . . . . simulate hotkey press"));
+ msg_rc(_("| menu . . [on|off|up|down|left|right|select] use menu"));
+ msg_rc( "| ");
+
+ if (b_longhelp)
+ {
+ msg_rc(_("| @name marq-marquee STRING . . overlay STRING in video"));
+ msg_rc(_("| @name marq-x X . . . . . . . . . . . .offset from left"));
+ msg_rc(_("| @name marq-y Y . . . . . . . . . . . . offset from top"));
+ msg_rc(_("| @name marq-position #. . . .relative position control"));
+ msg_rc(_("| @name marq-color # . . . . . . . . . . font color, RGB"));
+ msg_rc(_("| @name marq-opacity # . . . . . . . . . . . . . opacity"));
+ msg_rc(_("| @name marq-timeout T. . . . . . . . . . timeout, in ms"));
+ msg_rc(_("| @name marq-size # . . . . . . . . font size, in pixels"));
+ msg_rc( "| ");
+ msg_rc(_("| @name logo-file STRING . . .the overlay file path/name"));
+ msg_rc(_("| @name logo-x X . . . . . . . . . . . .offset from left"));
+ msg_rc(_("| @name logo-y Y . . . . . . . . . . . . offset from top"));
+ msg_rc(_("| @name logo-position #. . . . . . . . relative position"));
+ msg_rc(_("| @name logo-transparency #. . . . . . . . .transparency"));
+ msg_rc( "| ");
+ msg_rc(_("| @name mosaic-alpha # . . . . . . . . . . . . . . alpha"));
+ msg_rc(_("| @name mosaic-height #. . . . . . . . . . . . . .height"));
+ msg_rc(_("| @name mosaic-width # . . . . . . . . . . . . . . width"));
+ msg_rc(_("| @name mosaic-xoffset # . . . .top left corner position"));
+ msg_rc(_("| @name mosaic-yoffset # . . . .top left corner position"));
+ msg_rc(_("| @name mosaic-offsets x,y(,x,y)*. . . . list of offsets"));
+ msg_rc(_("| @name mosaic-align 0..2,4..6,8..10. . .mosaic alignment"));
+ msg_rc(_("| @name mosaic-vborder # . . . . . . . . vertical border"));
+ msg_rc(_("| @name mosaic-hborder # . . . . . . . horizontal border"));
+ msg_rc(_("| @name mosaic-position {0=auto,1=fixed} . . . .position"));
+ msg_rc(_("| @name mosaic-rows #. . . . . . . . . . .number of rows"));
+ msg_rc(_("| @name mosaic-cols #. . . . . . . . . . .number of cols"));
+ msg_rc(_("| @name mosaic-order id(,id)* . . . . order of pictures "));
+ msg_rc(_("| @name mosaic-keep-aspect-ratio {0,1} . . .aspect ratio"));
+ msg_rc( "| ");
+ }
+ msg_rc(_("| help . . . . . . . . . . . . . . . this help message"));
+ msg_rc(_("| longhelp . . . . . . . . . . . a longer help message"));
+ msg_rc(_("| logout . . . . . . . exit (if in socket connection)"));
+ msg_rc(_("| quit . . . . . . . . . . . . . . . . . . . quit vlc"));
+ msg_rc( "| ");
+ msg_rc(_("+----[ end of help ]"));
+}
+
+/********************************************************************
+ * Status callback routines
+ ********************************************************************/
+static int TimeOffsetChanged( vlc_object_t *p_this, char const *psz_cmd,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ VLC_UNUSED(p_this); VLC_UNUSED(psz_cmd);
+ VLC_UNUSED(oldval); VLC_UNUSED(newval);
+ intf_thread_t *p_intf = (intf_thread_t*)p_data;
+ input_thread_t *p_input = NULL;
+
+ vlc_mutex_lock( &p_intf->p_sys->status_lock );
+ p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
+ if( p_input )
+ {
+ msg_rc( STATUS_CHANGE "( time-offset: %d )",
+ var_GetInteger( p_input, "time-offset" ) );
+ vlc_object_release( p_input );
+ }
+ vlc_mutex_unlock( &p_intf->p_sys->status_lock );
+ return VLC_SUCCESS;
+}
+
+static int VolumeChanged( vlc_object_t *p_this, char const *psz_cmd,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(newval);
+ intf_thread_t *p_intf = (intf_thread_t*)p_data;
+
+ vlc_mutex_lock( &p_intf->p_sys->status_lock );
+ msg_rc( STATUS_CHANGE "( audio volume: %d )",
+ config_GetInt( p_this, "volume") );
+ vlc_mutex_unlock( &p_intf->p_sys->status_lock );
+ return VLC_SUCCESS;
+}
+
+static int StateChanged( vlc_object_t *p_this, char const *psz_cmd,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ VLC_UNUSED(p_this); VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval);
+ intf_thread_t *p_intf = (intf_thread_t*)p_data;
+ playlist_t *p_playlist = NULL;
+ input_thread_t *p_input = NULL;
+
+ vlc_mutex_lock( &p_intf->p_sys->status_lock );
+ p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
+ if( p_input )
+ {
+ p_playlist = pl_Yield( p_input );
+ char cmd[6];
+ switch( p_playlist->status.i_status )
+ {
+ case PLAYLIST_STOPPED:
+ strcpy( cmd, "stop" );
+ break;
+ case PLAYLIST_RUNNING:
+ strcpy( cmd, "play" );
+ break;
+ case PLAYLIST_PAUSED:
+ strcpy( cmd, "pause" );
+ break;
+ default:
+ cmd[0] = '\0';
+ } /* var_GetInteger( p_input, "state" ) */
+ msg_rc( STATUS_CHANGE "( %s state: %d ): %s",
+ cmd, newval.i_int,
+ ppsz_input_state[ newval.i_int ] );
+ vlc_object_release( p_playlist );
+ vlc_object_release( p_input );
+ }
+ vlc_mutex_unlock( &p_intf->p_sys->status_lock );
+ return VLC_SUCCESS;
+}
+
+static int RateChanged( vlc_object_t *p_this, char const *psz_cmd,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ VLC_UNUSED(p_this); VLC_UNUSED(psz_cmd);
+ VLC_UNUSED(oldval); VLC_UNUSED(newval);
+ intf_thread_t *p_intf = (intf_thread_t*)p_data;
+ input_thread_t *p_input = NULL;
+
+ vlc_mutex_lock( &p_intf->p_sys->status_lock );
+ p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
+ if( p_input )
+ {
+ msg_rc( STATUS_CHANGE "( new rate: %d )",
+ var_GetInteger( p_input, "rate" ) );
+ vlc_object_release( p_input );
+ }
+ vlc_mutex_unlock( &p_intf->p_sys->status_lock );
+ return VLC_SUCCESS;