Better slider management in the main interface. Misc other small fixes.
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: interface.cpp,v 1.13 2003/01/23 23:57:50 gbazin Exp $
+ * $Id: interface.cpp,v 1.14 2003/01/26 10:36:10 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
EVT_MENU(PlayStream_Event, Interface::OnPlayStream)
EVT_MENU(PrevStream_Event, Interface::OnPrevStream)
EVT_MENU(NextStream_Event, Interface::OnNextStream)
+
/* Slider events */
EVT_COMMAND_SCROLL(SliderScroll_Event, Interface::OnSliderUpdate)
END_EVENT_TABLE()
void Interface::OnSliderUpdate( wxScrollEvent& event )
{
- p_intf->p_sys->i_slider_pos = event.GetPosition();
+ vlc_mutex_lock( &p_intf->change_lock );
+
+ if( event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE
+ || event.GetEventType() == wxEVT_SCROLL_ENDSCROLL )
+ {
+ if( p_intf->p_sys->i_slider_pos != event.GetPosition()
+ && p_intf->p_sys->p_input )
+ {
+ p_intf->p_sys->i_slider_pos = event.GetPosition();
+ input_Seek( p_intf->p_sys->p_input, p_intf->p_sys->i_slider_pos *
+ 100 / SLIDER_MAX_POS,
+ INPUT_SEEK_PERCENT | INPUT_SEEK_SET );
+ }
+
+ p_intf->p_sys->b_slider_free = VLC_TRUE;
+ }
+ else
+ {
+ p_intf->p_sys->b_slider_free = VLC_FALSE;
+
+ if( p_intf->p_sys->p_input )
+ {
+ /* Update stream date */
+#define p_area p_intf->p_sys->p_input->stream.p_selected_area
+ char psz_time[ OFFSETTOTIME_MAX_SIZE ];
+
+ slider_box->SetLabel(
+ input_OffsetToTime( p_intf->p_sys->p_input,
+ psz_time,
+ p_area->i_size * event.GetPosition()
+ / SLIDER_MAX_POS ) );
+#undef p_area
+ }
+ }
+
+ vlc_mutex_unlock( &p_intf->change_lock );
}
void Interface::OnPrevStream( wxCommandEvent& WXUNUSED(event) )
* open.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: open.cpp,v 1.1 2003/01/23 23:57:50 gbazin Exp $
+ * $Id: open.cpp,v 1.2 2003/01/26 10:36:10 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
"following predefined targets:") );
/* Create notebook */
- wxNotebook *notebook = new wxNotebook( panel, Notebook_Event,
- wxDefaultPosition,
- wxSize( 300, 250 ) );
+ wxNotebook *notebook = new wxNotebook( panel, Notebook_Event );
+ wxNotebookSizer *notebook_sizer = new wxNotebookSizer( notebook );
+
notebook->AddPage( FilePanel( notebook ), _("File"),
i_access_method == FILE_ACCESS );
notebook->AddPage( DiscPanel( notebook ), _("Disc"),
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 );
panel_sizer->Add( label, 0, wxEXPAND | wxALL, 5 );
- panel_sizer->Add( notebook, 1, wxEXPAND | wxALL, 5 );
+ panel_sizer->Add( notebook_sizer, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT );
panel_sizer->Layout();
panel->SetSizerAndFit( panel_sizer );
sizer_row->Add( disc_type, 0, wxEXPAND | wxALL, 5 );
wxStaticText *label = new wxStaticText( panel, -1, _("Device Name") );
- char *psz_device = config_GetPsz( p_intf, "dvd" );
- disc_device = new wxTextCtrl( panel, DiscDevice_Event,
- psz_device ? psz_device : "",
+ disc_device = new wxTextCtrl( panel, DiscDevice_Event, "",
wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER);
- if( psz_device ) free( psz_device );
sizer->Add( label, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
sizer->Add( disc_device, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
panel->SetSizerAndFit( sizer_row );
+ /* Update Disc panel */
+ wxCommandEvent dummy_event;
+ OnDiscTypeChange( dummy_event );
+
return panel;
}
subpanel_sizer->Add( net_ports[0], 1,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
net_subpanels[0]->SetSizerAndFit( subpanel_sizer );
+ net_radios[0]->SetValue( TRUE );
/* UDP/RTP Multicast row */
subpanel_sizer = new wxFlexGridSizer( 4, 1, 20 );
/* HTTP row */
subpanel_sizer = new wxFlexGridSizer( 2, 1, 20 );
label = new wxStaticText( net_subpanels[3], -1, _("URL") );
- net_addrs[3] = new wxTextCtrl( net_subpanels[3], NetAddr4_Event, "http://",
+ net_addrs[3] = new wxTextCtrl( net_subpanels[3], NetAddr4_Event, "",
wxDefaultPosition, wxSize( 200, -1 ),
wxTE_PROCESS_ENTER);
subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
panel->SetSizerAndFit( sizer_row );
/* Update Net panel */
+ net_addrs[3]->SetValue( "http://" );
wxCommandEvent dummy_event;
dummy_event.SetId( NetRadio1_Event );
OnNetTypeChange( dummy_event );
break;
}
break;
-
case SAT_ACCESS:
mrl = "satellite://";
break;
disc_device->SetValue( psz_device ? psz_device : "" );
break;
- case 2:
default:
psz_device = config_GetPsz( p_intf, "dvd" );
disc_device->SetValue( psz_device ? psz_device : "" );
}
if( psz_device ) free( psz_device );
+
+ UpdateMRL( DISC_ACCESS );
}
/*****************************************************************************
for(i=0; i<4; i++)
{
+ net_radios[i]->SetValue( event.GetId() == (NetRadio1_Event+i) );
net_subpanels[i]->Enable( event.GetId() == (NetRadio1_Event+i) );
}
* popup.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: popup.cpp,v 1.2 2003/01/23 23:57:50 gbazin Exp $
+ * $Id: popup.cpp,v 1.3 2003/01/26 10:36:10 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
enum
{
/* menu items */
- Close_Event = wxID_HIGHEST,
+ Close_Event = wxID_HIGHEST + 1000,
MenuDummy_Event,
+ MenuLast_Event,
};
BEGIN_EVENT_TABLE(PopupMenu, wxMenu)
/* Initializations */
p_intf = _p_intf;
p_main_interface = _p_main_interface;
- i_item_id = 0;
+ i_item_id = MenuLast_Event;
/* Audio menu */
Append( MenuDummy_Event, _("Audio menu") );
* timer.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: timer.cpp,v 1.8 2003/01/23 23:57:50 gbazin Exp $
+ * $Id: timer.cpp,v 1.9 2003/01/26 10:36:10 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
stream_position_t position;
- /* If the user hasn't touched the slider since the last time,
- * then the input can safely change it */
- if( p_intf->p_sys->i_slider_pos ==
- p_intf->p_sys->i_slider_oldpos )
+ /* Update the slider if the user isn't dragging it. */
+ if( p_intf->p_sys->b_slider_free )
{
/* Update the value */
vlc_mutex_unlock( &p_input->stream.stream_lock );
input_Tell( p_input, &position );
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_intf->p_sys->i_slider_oldpos =
+ p_intf->p_sys->i_slider_pos =
( SLIDER_MAX_POS * position.i_tell ) / position.i_size;
- if( p_intf->p_sys->i_slider_pos !=
- p_intf->p_sys->i_slider_oldpos )
- {
- p_intf->p_sys->i_slider_pos =
- p_intf->p_sys->i_slider_oldpos;
+ p_main_interface->slider->SetValue(
+ p_intf->p_sys->i_slider_pos );
- p_main_interface->slider->SetValue(
- p_intf->p_sys->i_slider_pos );
-
- DisplayStreamDate( p_main_interface->slider_box,
- p_intf,
- p_intf->p_sys->i_slider_pos );
- }
- }
-
- /* Otherwise, send message to the input if the user has
- * finished dragging the slider */
- else if( p_intf->p_sys->b_slider_free )
- {
- /* release the lock to be able to seek */
- vlc_mutex_unlock( &p_input->stream.stream_lock );
- input_Seek( p_input, p_intf->p_sys->i_slider_pos *
- 100 / SLIDER_MAX_POS,
- INPUT_SEEK_PERCENT | INPUT_SEEK_SET );
- vlc_mutex_lock( &p_input->stream.stream_lock );
-
- /* Update the old value */
- p_intf->p_sys->i_slider_oldpos =
- p_intf->p_sys->i_slider_pos;
+ DisplayStreamDate( p_main_interface->slider_box,
+ p_intf,
+ p_intf->p_sys->i_slider_pos );
}
}