]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/src/vlcproc.cpp
cosmetic: remove nullity test on free() and delete
[vlc] / modules / gui / skins2 / src / vlcproc.cpp
index a2dcd273008cb672184e353c1a0ec6579ea1cd29..6dc6eff2b49bf384bf959d7a58e89a3726f4336b 100644 (file)
 
 #include "vlcproc.hpp"
 #include "os_factory.hpp"
+#include "os_loop.hpp"
 #include "os_timer.hpp"
 #include "var_manager.hpp"
+#include "vout_manager.hpp"
 #include "theme.hpp"
 #include "window_manager.hpp"
 #include "../commands/async_queue.hpp"
@@ -63,11 +65,8 @@ VlcProc *VlcProc::instance( intf_thread_t *pIntf )
 
 void VlcProc::destroy( intf_thread_t *pIntf )
 {
-    if( pIntf->p_sys->p_vlcProc )
-    {
-        delete pIntf->p_sys->p_vlcProc;
-        pIntf->p_sys->p_vlcProc = NULL;
-    }
+    delete pIntf->p_sys->p_vlcProc;
+    pIntf->p_sys->p_vlcProc = NULL;
 }
 
 
@@ -195,6 +194,7 @@ VlcProc::~VlcProc()
     var_DelCallback( getIntf()->p_sys->p_playlist, "item-change",
                      onItemChange, this );
     var_DelCallback( getIntf(), "skin-to-load", onSkinToLoad, this );
+    var_DelCallback( getIntf(), "interaction", onInteraction, this );
 }
 
 void VlcProc::manage()
@@ -202,15 +202,20 @@ void VlcProc::manage()
     // Did the user request to quit vlc ?
     if( !vlc_object_alive( getIntf() ) )
     {
-        CmdQuit *pCmd = new CmdQuit( getIntf() );
-        AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
-        pQueue->push( CmdGenericPtr( pCmd ) );
+        // Get the instance of OSFactory
+        OSFactory *pOsFactory = OSFactory::instance( getIntf() );
+
+        // Exit the main OS loop
+        pOsFactory->getOSLoop()->exit();
+
+        return;
     }
 
     refreshPlaylist();
     refreshAudio();
     refreshInput();
 }
+
 void VlcProc::CmdManage::execute()
 {
     // Just forward to VlcProc
@@ -250,7 +255,7 @@ void VlcProc::refreshAudio()
 
     // Refresh sound volume
     audio_volume_t volume;
-    aout_VolumeGet( getIntf(), &volume );
+    aout_VolumeGet( getIntf()->p_sys->p_playlist, &volume );
     Volume *pVolume = (Volume*)m_cVarVolume.get();
     pVolume->set( (double)volume * 2.0 / AOUT_VOLUME_MAX );
 
@@ -344,7 +349,7 @@ void VlcProc::refreshInput()
         pVarHasVout->set( pVout != NULL );
         if( pVout )
         {
-            pVarFullscreen->set( pVout->b_fullscreen );
+            pVarFullscreen->set( var_GetBool( pVout, "fullscreen" ) );
             vlc_object_release( pVout );
         }