+void VlcProc::on_repeat_changed( vlc_object_t* p_obj, vlc_value_t newVal )
+{
+ playlist_t* pPlaylist = (playlist_t*) p_obj;
+
+ SET_BOOL( m_cVarRepeat, var_GetBool( pPlaylist, "repeat" ) );
+}
+
+void VlcProc::on_volume_changed( vlc_object_t* p_obj, vlc_value_t newVal )
+{
+ (void)p_obj; (void)newVal;
+ playlist_t* pPlaylist = getIntf()->p_sys->p_playlist;
+
+ audio_volume_t volume;
+ aout_VolumeGet( pPlaylist, &volume );
+ SET_VOLUME( m_cVarVolume, (double)volume / AOUT_VOLUME_MAX, false );
+ SET_BOOL( m_cVarMute, volume == 0 );
+}
+
+void VlcProc::on_audio_filter_changed( vlc_object_t* p_obj, vlc_value_t newVal )
+{
+ aout_instance_t* pAout = (aout_instance_t*) p_obj;
+
+ char *pFilters = newVal.psz_string;
+
+ bool b_equalizer = pFilters && strstr( pFilters, "equalizer" );
+ SET_BOOL( m_cVarEqualizer, b_equalizer );
+ if( b_equalizer && !m_bEqualizer_started )
+ {
+ var_AddCallback( pAout, "equalizer-bands", onEqBandsChange, this );
+ var_AddCallback( pAout, "equalizer-preamp", onEqPreampChange, this );
+ m_bEqualizer_started = true;
+ }
+}
+
+void VlcProc::on_intf_show_changed( vlc_object_t* p_obj, vlc_value_t newVal )
+{
+ (void)p_obj;
+ bool b_fullscreen = getFullscreenVar().get();
+
+ if( !b_fullscreen )
+ {
+ if( newVal.b_bool )
+ {
+ // Create a raise all command
+ CmdRaiseAll *pCmd = new CmdRaiseAll( getIntf(),
+ getIntf()->p_sys->p_theme->getWindowManager() );
+
+ // Push the command in the asynchronous command queue
+ AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
+ pQueue->push( CmdGenericPtr( pCmd ) );
+ }
+ }
+ else
+ {
+ Theme* pTheme = getIntf()->p_sys->p_theme;
+ TopWindow *pWin = pTheme->getWindowById( "fullscreenController" );
+ if( pWin )
+ {
+ bool b_visible = pWin->getVisibleVar().get();
+ AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
+
+ if( !b_visible )
+ {
+ CmdShowWindow* pCmd = new CmdShowWindow( getIntf(),
+ getIntf()->p_sys->p_theme->getWindowManager(),
+ *pWin );
+ pQueue->push( CmdGenericPtr( pCmd ) );
+ }
+ else
+ {
+ CmdHideWindow* pCmd = new CmdHideWindow( getIntf(),
+ getIntf()->p_sys->p_theme->getWindowManager(),
+ *pWin );
+ pQueue->push( CmdGenericPtr( pCmd ) );
+ }
+ }
+ }
+}
+
+void VlcProc::reset_input()
+{
+ SET_BOOL( m_cVarSeekable, false );
+ SET_BOOL( m_cVarRecordable, false );
+ SET_BOOL( m_cVarRecording, false );
+ SET_BOOL( m_cVarDvdActive, false );
+ SET_BOOL( m_cVarFullscreen, false );
+ SET_BOOL( m_cVarHasAudio, false );
+ SET_BOOL( m_cVarHasVout, false );
+ SET_BOOL( m_cVarStopped, true );
+ SET_BOOL( m_cVarPlaying, false );
+ SET_BOOL( m_cVarPaused, false );
+
+ SET_STREAMTIME( m_cVarTime, 0, false );
+ SET_TEXT( m_cVarStreamBitRate, UString( getIntf(), "") );
+ SET_TEXT( m_cVarStreamSampleRate, UString( getIntf(), "") );
+}
+
+void VlcProc::init_variables()
+{
+ playlist_t* pPlaylist = getIntf()->p_sys->p_playlist;
+
+ SET_BOOL( m_cVarRandom, var_GetBool( pPlaylist, "random" ) );
+ SET_BOOL( m_cVarLoop, var_GetBool( pPlaylist, "loop" ) );
+ SET_BOOL( m_cVarRepeat, var_GetBool( pPlaylist, "repeat" ) );
+
+ audio_volume_t volume;
+ aout_VolumeGet( pPlaylist, &volume );
+ SET_VOLUME( m_cVarVolume, (double)volume / AOUT_VOLUME_MAX, false );
+ SET_BOOL( m_cVarMute, volume == 0 );
+
+ update_equalizer();
+}
+
+void VlcProc::update_equalizer()
+{
+
+ char *pFilters;
+ if( m_pAout )
+ pFilters = var_GetNonEmptyString( m_pAout, "audio-filter" );
+ else
+ pFilters = config_GetPsz( getIntf(), "audio-filter" );
+
+ bool b_equalizer = pFilters && strstr( pFilters, "equalizer" );
+ free( pFilters );
+
+ SET_BOOL( m_cVarEqualizer, b_equalizer );
+}
+
+void VlcProc::setFullscreenVar( bool b_fullscreen )
+{
+ SET_BOOL( m_cVarFullscreen, b_fullscreen );