]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/src/vlcproc.cpp
skins2: use the vout window interface (untested)
[vlc] / modules / gui / skins2 / src / vlcproc.cpp
index dcd36ed537c19b9739e4270fc9794505ed7dfbdb..bf2ef4f681e69601a81dc9012274d82087ffc720 100644 (file)
@@ -5,7 +5,7 @@
  * $Id$
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
- *          Olivier Teulie <ipkiss@via.ecp.fr>
+ *          Olivier Teulière <ipkiss@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include <vlc/aout.h>
-#include <vlc/vout.h>
-#include <aout_internal.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_aout.h>
+#include <vlc_vout.h>
+#include <vlc_playlist.h>
+#include <vlc_window.h>
 
 #include "vlcproc.hpp"
 #include "os_factory.hpp"
@@ -143,7 +149,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
     var_AddCallback( pIntf->p_sys->p_playlist, "item-deleted",
                      onItemDelete, this );
     // Called when the "interface shower" wants us to show the skin
-    var_AddCallback( pIntf->p_sys->p_playlist, "intf-show",
+    var_AddCallback( pIntf->p_libvlc, "intf-show",
                      onIntfShow, this );
     // Called when the current played item changes
     var_AddCallback( pIntf->p_sys->p_playlist, "playlist-current",
@@ -157,12 +163,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
     // Called when we have an interaction dialog to display
     var_Create( pIntf, "interaction", VLC_VAR_ADDRESS );
     var_AddCallback( pIntf, "interaction", onInteraction, this );
-    pIntf->b_interaction = VLC_TRUE;
-
-    // Callbacks for vout requests
-    getIntf()->pf_request_window = &getWindow;
-    getIntf()->pf_release_window = &releaseWindow;
-    getIntf()->pf_control_window = &controlWindow;
+    pIntf->b_interaction = true;
 
     getIntf()->p_sys->p_input = NULL;
 }
@@ -177,18 +178,13 @@ VlcProc::~VlcProc()
         vlc_object_release( getIntf()->p_sys->p_input );
     }
 
-    // Callbacks for vout requests
-    getIntf()->pf_request_window = NULL;
-    getIntf()->pf_release_window = NULL;
-    getIntf()->pf_control_window = NULL;
-
     var_DelCallback( getIntf()->p_sys->p_playlist, "intf-change",
                      onIntfChange, this );
     var_DelCallback( getIntf()->p_sys->p_playlist, "item-append",
                      onItemAppend, this );
     var_DelCallback( getIntf()->p_sys->p_playlist, "item-deleted",
                      onItemDelete, this );
-    var_DelCallback( getIntf()->p_sys->p_playlist, "intf-show",
+    var_DelCallback( getIntf()->p_libvlc, "intf-show",
                      onIntfShow, this );
     var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-current",
                      onPlaylistChange, this );
@@ -204,7 +200,7 @@ void VlcProc::registerVoutWindow( void *pVoutWindow )
     // Reparent the vout window
     if( m_pVout )
     {
-        if( vout_Control( m_pVout, VOUT_REPARENT ) != VLC_SUCCESS )
+        if( vout_Control( m_pVout, VOUT_REPARENT, 0 ) != VLC_SUCCESS )
             vout_Control( m_pVout, VOUT_CLOSE );
     }
 }
@@ -220,7 +216,7 @@ void VlcProc::dropVout()
 {
     if( m_pVout )
     {
-        if( vout_Control( m_pVout, VOUT_REPARENT ) != VLC_SUCCESS )
+        if( vout_Control( m_pVout, VOUT_REPARENT, 0 ) != VLC_SUCCESS )
             vout_Control( m_pVout, VOUT_CLOSE );
         m_pVout = NULL;
     }
@@ -230,7 +226,7 @@ void VlcProc::dropVout()
 void VlcProc::manage()
 {
     // Did the user request to quit vlc ?
-    if( getIntf()->b_die || getIntf()->p_vlc->b_die )
+    if( intf_ShouldDie( getIntf() ) )
     {
         CmdQuit *pCmd = new CmdQuit( getIntf() );
         AsyncQueue *pQueue = AsyncQueue::instance( getIntf() );
@@ -249,7 +245,7 @@ void VlcProc::CmdManage::execute()
 
 void VlcProc::refreshAudio()
 {
-    char *pFilters = NULL;
+    char *pFilters;
 
     // Check if the audio output has changed
     aout_instance_t *pAout = (aout_instance_t *)vlc_object_find( getIntf(),
@@ -269,7 +265,7 @@ void VlcProc::refreshAudio()
             }
         }
         // Get the audio filters
-        pFilters = var_GetString( pAout, "audio-filter" );
+        pFilters = var_GetNonEmptyString( pAout, "audio-filter" );
         vlc_object_release( pAout );
     }
     else
@@ -291,6 +287,7 @@ void VlcProc::refreshAudio()
     // Refresh the equalizer variable
     VarBoolImpl *pVarEqualizer = (VarBoolImpl*)m_cVarEqualizer.get();
     pVarEqualizer->set( pFilters && strstr( pFilters, "equalizer" ) );
+    free( pFilters );
 }
 
 void VlcProc::refreshPlaylist()
@@ -566,7 +563,7 @@ void VlcProc::updateStreamName( playlist_t *p_playlist )
     if( p_playlist && p_playlist->p_input )
     {
         // Get playlist item information
-        input_item_t *pItem = p_playlist->p_input->input.p_item;
+        input_item_t *pItem = input_GetItem(p_playlist->p_input);
 
         VarText &rStreamName = getStreamNameVar();
         VarText &rStreamURI = getStreamURIVar();
@@ -627,9 +624,10 @@ void VlcProc::releaseWindow( intf_thread_t *pIntf, void *pWindow )
 }
 
 
-int VlcProc::controlWindow( intf_thread_t *pIntf, void *pWindow,
+int VlcProc::controlWindow( struct vout_window_t *pWnd,
                             int query, va_list args )
 {
+    intf_thread_t *pIntf = (intf_thread_t *)pWnd->p_private;
     VlcProc *pThis = pIntf->p_sys->p_vlcProc;
 
     switch( query )
@@ -645,7 +643,7 @@ int VlcProc::controlWindow( intf_thread_t *pIntf, void *pWindow,
 
                 // Post a resize vout command
                 CmdResizeVout *pCmd =
-                    new CmdResizeVout( pThis->getIntf(), pWindow,
+                    new CmdResizeVout( pThis->getIntf(), pWnd->handle,
                                        i_width, i_height );
                 AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
                 pQueue->push( CmdGenericPtr( pCmd ) );
@@ -653,7 +651,7 @@ int VlcProc::controlWindow( intf_thread_t *pIntf, void *pWindow,
         }
 
         default:
-            msg_Dbg( pIntf, "control query not supported" );
+            msg_Dbg( pWnd, "control query not supported" );
             break;
     }