Commit 34e462b4 authored by Gildas Bazin's avatar Gildas Bazin

* modules/audio_output/alsa.c: the aout-device obj var wasn't destroyed properly on probe() failure, preventing other audio plugins from working afterwards.
* modules/gui/skins/src/skin_main.cpp: got rid of the skins shortcut.
* modules/gui/wxwindows/*: the popupmenu is not created inside the timer anymore so the slider will still be active when the popup is triggered.
* modules/video_output/directx/events.c, modules/video_output/x11/xcommon.c, src/playlist/playlist.c: new intf-popupmenu obj var to handle popup context menu requests from the vouts.
parent 0188c099
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* alsa.c : alsa plugin for vlc * alsa.c : alsa plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: alsa.c,v 1.27 2003/05/19 23:36:44 gbazin Exp $ * $Id: alsa.c,v 1.28 2003/05/26 19:06:47 gbazin Exp $
* *
* Authors: Henri Fallon <henri@videolan.org> - Original Author * Authors: Henri Fallon <henri@videolan.org> - Original Author
* Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API * Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
...@@ -123,6 +123,7 @@ static void Probe( aout_instance_t * p_aout, ...@@ -123,6 +123,7 @@ static void Probe( aout_instance_t * p_aout,
msg_Warn( p_aout, "unable to retrieve initial hardware parameters" msg_Warn( p_aout, "unable to retrieve initial hardware parameters"
", disabling linear PCM audio" ); ", disabling linear PCM audio" );
snd_pcm_close( p_sys->p_snd_pcm ); snd_pcm_close( p_sys->p_snd_pcm );
var_Destroy( p_aout, "audio-device" );
return; return;
} }
...@@ -135,6 +136,7 @@ static void Probe( aout_instance_t * p_aout, ...@@ -135,6 +136,7 @@ static void Probe( aout_instance_t * p_aout,
msg_Warn( p_aout, "unable to set stream sample size and word order" msg_Warn( p_aout, "unable to set stream sample size and word order"
", disabling linear PCM audio" ); ", disabling linear PCM audio" );
snd_pcm_close( p_sys->p_snd_pcm ); snd_pcm_close( p_sys->p_snd_pcm );
var_Destroy( p_aout, "audio-device" );
return; return;
} }
...@@ -208,6 +210,14 @@ static void Probe( aout_instance_t * p_aout, ...@@ -208,6 +210,14 @@ static void Probe( aout_instance_t * p_aout,
} }
} }
var_Change( p_aout, "audio-device", VLC_VAR_CHOICESCOUNT, &val, NULL );
if( val.i_int <= 0 )
{
/* Probe() has failed. */
var_Destroy( p_aout, "audio-device" );
return;
}
/* Add final settings to the variable */ /* Add final settings to the variable */
var_AddCallback( p_aout, "audio-device", aout_ChannelsRestart, NULL ); var_AddCallback( p_aout, "audio-device", aout_ChannelsRestart, NULL );
val.b_bool = VLC_TRUE; val.b_bool = VLC_TRUE;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* skin-main.cpp: skins plugin for VLC * skin-main.cpp: skins plugin for VLC
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: skin_main.cpp,v 1.27 2003/05/26 02:09:27 gbazin Exp $ * $Id: skin_main.cpp,v 1.28 2003/05/26 19:06:47 gbazin 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>
...@@ -298,7 +298,6 @@ vlc_module_begin(); ...@@ -298,7 +298,6 @@ vlc_module_begin();
set_description( _("Skinnable Interface") ); set_description( _("Skinnable Interface") );
set_capability( "interface", 30 ); set_capability( "interface", 30 );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
add_shortcut( "skins" );
vlc_module_end(); vlc_module_end();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* interface.cpp : wxWindows plugin for vlc * interface.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: interface.cpp,v 1.34 2003/05/26 16:06:13 gbazin Exp $ * $Id: interface.cpp,v 1.35 2003/05/26 19:06:47 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -172,6 +172,8 @@ Interface::Interface( intf_thread_t *_p_intf ): ...@@ -172,6 +172,8 @@ Interface::Interface( intf_thread_t *_p_intf ):
p_prefs_dialog = NULL; p_prefs_dialog = NULL;
i_old_playing_status = PAUSE_S; i_old_playing_status = PAUSE_S;
p_open_dialog = NULL; p_open_dialog = NULL;
p_popup_menu = NULL;
b_popup_change = VLC_FALSE;
/* Give our interface a nice little icon */ /* Give our interface a nice little icon */
p_intf->p_sys->p_icon = new wxIcon( vlc_xpm ); p_intf->p_sys->p_icon = new wxIcon( vlc_xpm );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* menus.cpp : wxWindows plugin for vlc * menus.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: menus.cpp,v 1.13 2003/05/24 20:54:27 gbazin Exp $ * $Id: menus.cpp,v 1.14 2003/05/26 19:06:47 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -174,6 +174,7 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface, ...@@ -174,6 +174,7 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
_p_main_interface->p_popup_menu = &popupmenu; _p_main_interface->p_popup_menu = &popupmenu;
_p_main_interface->PopupMenu( &popupmenu, pos.x, pos.y ); _p_main_interface->PopupMenu( &popupmenu, pos.x, pos.y );
_p_main_interface->p_popup_menu = NULL;
} }
wxMenu *AudioMenu( intf_thread_t *_p_intf, Interface *_p_main_interface ) wxMenu *AudioMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* timer.cpp : wxWindows plugin for vlc * timer.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: timer.cpp,v 1.18 2003/05/18 19:46:35 gbazin Exp $ * $Id: timer.cpp,v 1.19 2003/05/26 19:06:47 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -49,6 +49,10 @@ ...@@ -49,6 +49,10 @@
void DisplayStreamDate( wxControl *, intf_thread_t *, int ); void DisplayStreamDate( wxControl *, intf_thread_t *, int );
/* Callback prototype */
int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param );
/***************************************************************************** /*****************************************************************************
* Constructor. * Constructor.
*****************************************************************************/ *****************************************************************************/
...@@ -59,6 +63,17 @@ Timer::Timer( intf_thread_t *_p_intf, Interface *_p_main_interface ) ...@@ -59,6 +63,17 @@ Timer::Timer( intf_thread_t *_p_intf, Interface *_p_main_interface )
i_old_playing_status = PAUSE_S; i_old_playing_status = PAUSE_S;
i_old_rate = DEFAULT_RATE; i_old_rate = DEFAULT_RATE;
/* Register callback for the intf-popupmenu variable */
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist != NULL )
{
var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB,
p_main_interface );
vlc_object_release( p_playlist );
}
Start( 100 /*milliseconds*/, wxTIMER_CONTINUOUS ); Start( 100 /*milliseconds*/, wxTIMER_CONTINUOUS );
} }
...@@ -104,12 +119,21 @@ void Timer::Notify() ...@@ -104,12 +119,21 @@ void Timer::Notify()
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
/* If the "display popup" flag has changed */ /* If the "display popup" flag has changed */
if( p_intf->b_menu_change ) if( p_main_interface->b_popup_change )
{ {
wxPoint mousepos = wxGetMousePosition(); wxPoint mousepos = wxGetMousePosition();
PopupMenu( p_intf, p_main_interface,
p_main_interface->ScreenToClient(mousepos) ); #if defined( __WXMSW__ ) || defined( __WXMAC__ )
p_intf->b_menu_change = 0; wxContextMenuEvent event =
wxContextMenuEvent( wxEVT_NULL, 0, mousepos );
#else
wxMouseEvent event = wxMouseEvent( wxEVT_RIGHT_UP );
event.m_x = p_main_interface->ScreenToClient(mousepos).x;
event.m_y = p_main_interface->ScreenToClient(mousepos).y;
#endif
p_main_interface->AddPendingEvent(event);
p_main_interface->b_popup_change = VLC_FALSE;
} }
/* Update the log window */ /* Update the log window */
...@@ -296,3 +320,18 @@ void DisplayStreamDate( wxControl *p_slider_frame, intf_thread_t * p_intf , ...@@ -296,3 +320,18 @@ void DisplayStreamDate( wxControl *p_slider_frame, intf_thread_t * p_intf ,
#undef p_area #undef p_area
} }
} }
/*****************************************************************************
* PlaylistChanged: callback triggered by the intf-change playlist variable
* We don't rebuild the playlist directly here because we don't want the
* caller to block for a too long time.
*****************************************************************************/
int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
Interface *p_main_interface = (Interface *)param;
p_main_interface->b_popup_change = VLC_TRUE;
return VLC_SUCCESS;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description * wxwindows.h: private wxWindows interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.31 2003/05/24 17:52:49 gbazin Exp $ * $Id: wxwindows.h,v 1.32 2003/05/26 19:06:47 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -140,6 +140,7 @@ public: ...@@ -140,6 +140,7 @@ public:
OpenDialog *p_open_dialog; OpenDialog *p_open_dialog;
wxMenu *p_popup_menu; wxMenu *p_popup_menu;
vlc_bool_t b_popup_change;
private: private:
void CreateOurMenuBar(); void CreateOurMenuBar();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* events.c: Windows DirectX video output events handler * events.c: Windows DirectX video output events handler
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: events.c,v 1.15 2003/05/17 14:36:19 gbazin Exp $ * $Id: events.c,v 1.16 2003/05/26 19:06:47 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -170,13 +170,14 @@ void DirectXEventThread( event_thread_t *p_event ) ...@@ -170,13 +170,14 @@ void DirectXEventThread( event_thread_t *p_event )
val.i_int &= ~4; val.i_int &= ~4;
var_Set( p_event->p_vout, "mouse-button-down", val ); var_Set( p_event->p_vout, "mouse-button-down", val );
{ {
intf_thread_t *p_intf; playlist_t *p_playlist =
p_intf = vlc_object_find( p_event, VLC_OBJECT_INTF, vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
if( p_intf ) if( p_playlist != NULL )
{ {
p_intf->b_menu_change = 1; vlc_value_t val;
vlc_object_release( p_intf ); var_Set( p_playlist, "intf-popupmenu", val );
vlc_object_release( p_playlist );
} }
} }
break; break;
...@@ -202,13 +203,14 @@ void DirectXEventThread( event_thread_t *p_event ) ...@@ -202,13 +203,14 @@ void DirectXEventThread( event_thread_t *p_event )
case VK_MENU: case VK_MENU:
{ {
intf_thread_t *p_intf; playlist_t *p_playlist =
p_intf = vlc_object_find( p_event->p_vout, VLC_OBJECT_INTF, vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
if( p_intf ) if( p_playlist != NULL )
{ {
p_intf->b_menu_change = 1; vlc_value_t val;
vlc_object_release( p_intf ); var_Set( p_playlist, "intf-popupmenu", val );
vlc_object_release( p_playlist );
} }
} }
break; break;
......
...@@ -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.18 2003/05/25 20:16:26 gbazin Exp $ * $Id: xcommon.c,v 1.19 2003/05/26 19:06:47 gbazin 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>
...@@ -539,6 +539,16 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -539,6 +539,16 @@ static int ManageVideo( vout_thread_t *p_vout )
p_intf->b_menu_change = 1; p_intf->b_menu_change = 1;
vlc_object_release( p_intf ); vlc_object_release( p_intf );
} }
playlist_t *p_playlist =
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist != NULL )
{
vlc_value_t val;
var_Set( p_playlist, "intf-popupmenu", val );
vlc_object_release( p_playlist );
}
} }
break; break;
case XK_Left: case XK_Left:
...@@ -676,6 +686,16 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -676,6 +686,16 @@ static int ManageVideo( vout_thread_t *p_vout )
p_intf->b_menu_change = 1; p_intf->b_menu_change = 1;
vlc_object_release( p_intf ); vlc_object_release( p_intf );
} }
playlist_t *p_playlist =
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist != NULL )
{
vlc_value_t val;
var_Set( p_playlist, "intf-popupmenu", val );
vlc_object_release( p_playlist );
}
} }
break; break;
......
...@@ -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.35 2003/05/12 17:33:20 gbazin Exp $ * $Id: playlist.c,v 1.36 2003/05/26 19:06:47 gbazin Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -64,6 +64,8 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent ) ...@@ -64,6 +64,8 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
val.b_bool = VLC_TRUE; val.b_bool = VLC_TRUE;
var_Set( p_playlist, "intf-change", val ); var_Set( p_playlist, "intf-change", val );
var_Create( p_playlist, "intf-popupmenu", VLC_VAR_VOID );
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;
......
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