+void VlcProc::refreshPlaylist()
+{
+ // Refresh the random variable
+ VarBoolImpl *pVarRandom = (VarBoolImpl*)m_cVarRandom.get();
+ vlc_value_t val;
+ var_Get( getIntf()->p_sys->p_playlist, "random", &val );
+ pVarRandom->set( val.b_bool != 0 );
+
+ // Refresh the loop variable
+ VarBoolImpl *pVarLoop = (VarBoolImpl*)m_cVarLoop.get();
+ var_Get( getIntf()->p_sys->p_playlist, "loop", &val );
+ pVarLoop->set( val.b_bool != 0 );
+
+ // Refresh the repeat variable
+ VarBoolImpl *pVarRepeat = (VarBoolImpl*)m_cVarRepeat.get();
+ var_Get( getIntf()->p_sys->p_playlist, "repeat", &val );
+ pVarRepeat->set( val.b_bool != 0 );
+}
+
+void VlcProc::refreshInput()
+{
+ StreamTime *pTime = (StreamTime*)m_cVarTime.get();
+ VarBoolImpl *pVarSeekable = (VarBoolImpl*)m_cVarSeekable.get();
+ VarBoolImpl *pVarDvdActive = (VarBoolImpl*)m_cVarDvdActive.get();
+ VarBoolImpl *pVarHasVout = (VarBoolImpl*)m_cVarHasVout.get();
+ VarBoolImpl *pVarHasAudio = (VarBoolImpl*)m_cVarHasAudio.get();
+ VarText *pBitrate = (VarText*)m_cVarStreamBitRate.get();
+ VarText *pSampleRate = (VarText*)m_cVarStreamSampleRate.get();
+ VarBoolImpl *pVarFullscreen = (VarBoolImpl*)m_cVarFullscreen.get();
+ VarBoolImpl *pVarPlaying = (VarBoolImpl*)m_cVarPlaying.get();
+ VarBoolImpl *pVarStopped = (VarBoolImpl*)m_cVarStopped.get();
+ VarBoolImpl *pVarPaused = (VarBoolImpl*)m_cVarPaused.get();
+
+ // Update the input
+ if( getIntf()->p_sys->p_input == NULL )
+ {
+ getIntf()->p_sys->p_input =
+ playlist_CurrentInput( getIntf()->p_sys->p_playlist );
+ }
+ else if( getIntf()->p_sys->p_input->b_dead )
+ {
+ vlc_object_release( getIntf()->p_sys->p_input );
+ getIntf()->p_sys->p_input = NULL;
+ }
+
+ input_thread_t *pInput = getIntf()->p_sys->p_input;
+
+ if( pInput && vlc_object_alive (pInput) )
+ {
+ // Refresh time variables
+ vlc_value_t pos;
+ var_Get( pInput, "position", &pos );
+ pTime->set( pos.f_float, false );
+ pVarSeekable->set( pos.f_float != 0.0 );
+
+ // Refresh DVD detection
+ vlc_value_t chapters_count;
+ var_Change( pInput, "chapter", VLC_VAR_CHOICESCOUNT,
+ &chapters_count, NULL );
+ pVarDvdActive->set( chapters_count.i_int > 0 );
+
+ // Get the input bitrate
+ int bitrate = var_GetInteger( pInput, "bit-rate" ) / 1000;
+ pBitrate->set( UString::fromInt( getIntf(), bitrate ) );
+
+ // Get the audio sample rate
+ int sampleRate = var_GetInteger( pInput, "sample-rate" ) / 1000;
+ pSampleRate->set( UString::fromInt( getIntf(), sampleRate ) );
+
+ // Do we have audio
+ vlc_value_t audio_es;
+ var_Change( pInput, "audio-es", VLC_VAR_CHOICESCOUNT,
+ &audio_es, NULL );
+ pVarHasAudio->set( audio_es.i_int > 0 );
+
+ // Refresh fullscreen status
+ vout_thread_t *pVout = input_GetVout( pInput );
+ pVarHasVout->set( pVout != NULL );
+ if( pVout )
+ {
+ pVarFullscreen->set( pVout->b_fullscreen );
+ vlc_object_release( pVout );
+ }
+
+ // Refresh play/pause status
+ int state = var_GetInteger( pInput, "state" );
+ pVarStopped->set( false );
+ pVarPlaying->set( state != PAUSE_S );
+ pVarPaused->set( state == PAUSE_S );
+ }
+ else
+ {
+ pVarSeekable->set( false );
+ pVarDvdActive->set( false );
+ pTime->set( 0, false );
+ pVarFullscreen->set( false );
+ pVarHasAudio->set( false );
+ pVarHasVout->set( false );
+ pVarStopped->set( true );
+ pVarPlaying->set( false );
+ pVarPaused->set( false );
+ }
+}