Commit 4096fbfc authored by Cyril Deguet's avatar Cyril Deguet

* all: show/hide the interface with middle-click on the vout

       (when the last vout is closed, the interface reappears)
       Works only with the skins interface and X11/Xvideo vouts, but it's
       very easy to implement (just add a callback on "intf-show" in the
       interface, and trigger it in the vout)
parent bcac9ff0
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlcproc.cpp: VlcProc class * vlcproc.cpp: VlcProc class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: vlcproc.cpp,v 1.39 2003/06/23 20:35:36 asmax Exp $ * $Id: vlcproc.cpp,v 1.40 2003/06/24 22:26:01 asmax Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -54,6 +54,10 @@ VlcProc::VlcProc( intf_thread_t *_p_intf ) ...@@ -54,6 +54,10 @@ VlcProc::VlcProc( intf_thread_t *_p_intf )
{ {
// We want to be noticed of playlit changes // We want to be noticed of playlit changes
var_AddCallback( p_playlist, "intf-change", RefreshCallback, this ); var_AddCallback( p_playlist, "intf-change", RefreshCallback, this );
// Raise/lower interface with middle click on vout
var_AddCallback( p_playlist, "intf-show", IntfShowCallback, this );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
} }
...@@ -251,6 +255,21 @@ int VlcProc::RefreshCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -251,6 +255,21 @@ int VlcProc::RefreshCallback( vlc_object_t *p_this, const char *psz_variable,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
// Interface show/hide callback
int VlcProc::IntfShowCallback( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
if( new_val.b_bool == VLC_TRUE )
{
OSAPI_PostMessage( NULL, VLC_SHOW, 1, 0 );
}
else
{
OSAPI_PostMessage( NULL, VLC_HIDE, 1, 0 );
}
return VLC_SUCCESS;
}
void VlcProc::InterfaceRefresh() void VlcProc::InterfaceRefresh()
{ {
// Shortcut pointers // Shortcut pointers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlcproc.h: VlcProc class * vlcproc.h: VlcProc class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: vlcproc.h,v 1.8 2003/06/23 20:35:36 asmax Exp $ * $Id: vlcproc.h,v 1.9 2003/06/24 22:26:01 asmax Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -55,6 +55,10 @@ class VlcProc ...@@ -55,6 +55,10 @@ class VlcProc
static int RefreshCallback( vlc_object_t *p_this, static int RefreshCallback( vlc_object_t *p_this,
const char *psz_variable, vlc_value_t old_val, vlc_value_t new_val, const char *psz_variable, vlc_value_t old_val, vlc_value_t new_val,
void *param ); void *param );
static int IntfShowCallback( vlc_object_t *p_this,
const char *psz_variable, vlc_value_t old_val, vlc_value_t new_val,
void *param );
void InterfaceRefresh(); void InterfaceRefresh();
void EnabledEvent( string type, bool state ); void EnabledEvent( string type, bool state );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* xcommon.c: Functions common to the X11 and XVideo plugins * xcommon.c: Functions common to the X11 and XVideo plugins
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: xcommon.c,v 1.20 2003/05/28 00:52:05 titer Exp $ * $Id: xcommon.c,v 1.21 2003/06/24 22:26:01 asmax Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -542,7 +542,7 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -542,7 +542,7 @@ static int ManageVideo( vout_thread_t *p_vout )
vlc_object_release( p_intf ); vlc_object_release( p_intf );
} }
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
if( p_playlist != NULL ) if( p_playlist != NULL )
{ {
...@@ -669,9 +669,25 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -669,9 +669,25 @@ static int ManageVideo( vout_thread_t *p_vout )
break; break;
case Button2: case Button2:
var_Get( p_vout, "mouse-button-down", &val ); {
val.i_int &= ~2; playlist_t *p_playlist;
var_Set( p_vout, "mouse-button-down", val );
var_Get( p_vout, "mouse-button-down", &val );
val.i_int &= ~2;
var_Set( p_vout, "mouse-button-down", val );
p_playlist = vlc_object_find( p_vout,
VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist != NULL )
{
vlc_value_t val;
var_Get( p_playlist, "intf-show", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "intf-show", val );
vlc_object_release( p_playlist );
}
}
break; break;
case Button3: case Button3:
...@@ -690,7 +706,7 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -690,7 +706,7 @@ static int ManageVideo( vout_thread_t *p_vout )
vlc_object_release( p_intf ); vlc_object_release( p_intf );
} }
p_playlist = vlc_object_find( p_intf, p_playlist = vlc_object_find( p_vout,
VLC_OBJECT_PLAYLIST, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
if( p_playlist != NULL ) if( p_playlist != NULL )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions * playlist.c : Playlist management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.37 2003/06/23 20:35:36 asmax Exp $ * $Id: playlist.c,v 1.38 2003/06/24 22:26:01 asmax Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -66,6 +66,10 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent ) ...@@ -66,6 +66,10 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
var_Create( p_playlist, "intf-popupmenu", VLC_VAR_VOID ); var_Create( p_playlist, "intf-popupmenu", VLC_VAR_VOID );
var_Create( p_playlist, "intf-show", VLC_VAR_BOOL );
val.b_bool = VLC_TRUE;
var_Set( p_playlist, "intf-show", val );
p_playlist->p_input = NULL; p_playlist->p_input = NULL;
p_playlist->i_status = PLAYLIST_STOPPED; p_playlist->i_status = PLAYLIST_STOPPED;
p_playlist->i_index = -1; p_playlist->i_index = -1;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.225 2003/05/25 11:31:54 gbazin Exp $ * $Id: video_output.c,v 1.226 2003/06/24 22:26:01 asmax Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -446,15 +446,38 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, ...@@ -446,15 +446,38 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
* update using one of the THREAD_* constants. * update using one of the THREAD_* constants.
*****************************************************************************/ *****************************************************************************/
void vout_Destroy( vout_thread_t *p_vout ) void vout_Destroy( vout_thread_t *p_vout )
{ {
vlc_object_t *p_playlist;
/* Request thread destruction */ /* Request thread destruction */
p_vout->b_die = VLC_TRUE; p_vout->b_die = VLC_TRUE;
vlc_thread_join( p_vout ); vlc_thread_join( p_vout );
var_Destroy( p_vout, "intf-change" ); var_Destroy( p_vout, "intf-change" );
p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
/* Free structure */ /* Free structure */
vlc_object_destroy( p_vout ); vlc_object_destroy( p_vout );
/* If it was the last vout, tell the interface to show up */
if( p_playlist != NULL )
{
vout_thread_t *p_another_vout = vlc_object_find( p_playlist,
VLC_OBJECT_VOUT, FIND_ANYWHERE );
if( p_another_vout == NULL )
{
vlc_value_t val;
val.b_bool = VLC_TRUE;
var_Set( p_playlist, "intf-show", val );
}
else
{
vlc_object_release( p_another_vout );
}
vlc_object_release( p_playlist );
}
} }
/***************************************************************************** /*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment