* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: timer.cpp,v 1.21 2003/06/04 16:03:34 gbazin Exp $
+ * $Id: timer.cpp,v 1.27 2003/07/17 18:58:23 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
#include <stdio.h>
#include <vlc/vlc.h>
+#include <vlc/aout.h>
#ifdef WIN32 /* mingw32 hack */
#undef Yield
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 );
+static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
+ vlc_value_t old_val, vlc_value_t new_val, void *param );
/*****************************************************************************
* Constructor.
FIND_ANYWHERE );
if( p_playlist != NULL )
{
- var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB,
- p_main_interface );
+ var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
vlc_object_release( p_playlist );
}
/*****************************************************************************
* Private methods.
*****************************************************************************/
-/*****************************************************************************
- * wxModeManage: actualise the aspect of the interface whenever the input
- * changes.
- *****************************************************************************
- * The lock has to be taken before you call the function.
- *****************************************************************************/
-static int wxModeManage( intf_thread_t * p_intf )
-{
- return 0;
-}
-
-/*****************************************************************************
- * wxSetupMenus: function that generates title/chapter/audio/subpic
- * menus with help from preceding functions
- *****************************************************************************
- * Function called with the lock on stream
- *****************************************************************************/
-static int wxSetupMenus( intf_thread_t * p_intf )
-{
- return 0;
-}
/*****************************************************************************
* Manage: manage main thread messages
vlc_mutex_lock( &p_intf->change_lock );
/* If the "display popup" flag has changed */
- if( p_main_interface->b_popup_change )
+ if( p_intf->p_sys->b_popup_change )
{
+#if 0
wxPoint mousepos = wxGetMousePosition();
wxMouseEvent event = wxMouseEvent( wxEVT_RIGHT_UP );
event.m_y = p_main_interface->ScreenToClient(mousepos).y;
p_main_interface->AddPendingEvent(event);
+#endif
+ if( p_intf->p_sys->pf_show_dialog )
+ p_intf->p_sys->pf_show_dialog( p_intf, INTF_DIALOG_POPUPMENU, 0 );
- p_main_interface->b_popup_change = VLC_FALSE;
+ p_intf->p_sys->b_popup_change = VLC_FALSE;
}
- /* Update the log window */
- p_intf->p_sys->p_messages_window->UpdateLog();
-
- /* Update the playlist */
- p_intf->p_sys->p_playlist_window->UpdatePlaylist();
-
- /* Update the fileinfo windows */
- p_intf->p_sys->p_fileinfo_window->UpdateFileInfo();
-
/* Update the input */
if( p_intf->p_sys->p_input == NULL )
{
p_main_interface->TogglePlayButton( PLAYING_S );
i_old_playing_status = PLAYING_S;
- }
-
- /* control buttons for free pace streams */
- b_pace_control = p_intf->p_sys->p_input->stream.b_pace_control;
+ /* Take care of the volume */
+ audio_volume_t i_volume;
+ aout_VolumeGet( p_intf, &i_volume );
+ p_main_interface->volctrl->SetValue( i_volume * 200 /
+ AOUT_VOLUME_MAX );
+ p_main_interface->volctrl->SetToolTip(
+ wxString::Format((wxString)wxU(_("Volume")) + wxT(" %d"),
+ i_volume * 200 / AOUT_VOLUME_MAX ) );
+
+ /* control buttons for free pace streams */
+ b_pace_control = p_intf->p_sys->p_input->stream.b_pace_control;
+ }
}
else if( p_intf->p_sys->p_input->b_dead )
{
}
}
- if( p_intf->p_sys->i_part !=
- p_input->stream.p_selected_area->i_part )
- {
- p_intf->p_sys->b_chapter_update = 1;
- wxSetupMenus( p_intf );
- }
-
/* Manage Playing status */
if( i_old_playing_status != p_input->stream.control.i_status )
{
}
else if( p_intf->p_sys->b_playing && !p_intf->b_die )
{
- wxModeManage( p_intf );
p_intf->p_sys->b_playing = 0;
p_main_interface->TogglePlayButton( PAUSE_S );
i_old_playing_status = PAUSE_S;
* We don't show the menu 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 )
+static 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;
+ intf_thread_t *p_intf = (intf_thread_t *)param;
- p_main_interface->b_popup_change = VLC_TRUE;
+ p_intf->p_sys->b_popup_change = VLC_TRUE;
return VLC_SUCCESS;
}