* open.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: open.cpp,v 1.45 2003/11/27 06:37:10 adn Exp $
+ * $Id: open.cpp,v 1.46 2003/12/09 00:46:03 yoann Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/* Events generated by the disc panel */
EVT_RADIOBOX(DiscType_Event, OpenDialog::OnDiscTypeChange)
+ EVT_TEXT(DiscDevice_Event, OpenDialog::OnDiscDeviceChange)
EVT_TEXT(DiscDevice_Event, OpenDialog::OnDiscPanelChange)
EVT_TEXT(DiscTitle_Event, OpenDialog::OnDiscPanelChange)
EVT_SPINCTRL(DiscTitle_Event, OpenDialog::OnDiscPanelChange)
#endif
sout_dialog = NULL;
subsfile_dialog = NULL;
+ b_disc_device_changed = false;
/* Create a panel to put everything in */
wxPanel *panel = new wxPanel( this, -1 );
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
sout_button = new wxButton( panel, SoutSettings_Event,
wxU(_("Settings...")) );
- sout_button->Disable();
+ sout_button->Disable();
char *psz_sout = config_GetPsz( p_intf, "sout" );
if( psz_sout && *psz_sout )
disc_type->GetSelection() == 1 ? wxT("dvdsimple") :
disc_type->GetSelection() == 2 ? wxT("vcd") : wxT("cdda") )
+ demux + wxT(":")
- + disc_device->GetLineText(0)
+// + disc_device->GetLineText(0)
+ + disc_device->GetValue()
+ wxString::Format( wxT("@%d:%d"),
disc_title->GetValue(),
disc_chapter->GetValue() );
UpdateMRL( DISC_ACCESS );
}
+void OpenDialog::OnDiscDeviceChange( wxCommandEvent& event )
+{
+ char *psz_device;
+
+ switch( disc_type->GetSelection() )
+ {
+ case 3:
+ psz_device = config_GetPsz( p_intf, "cd-audio" );
+ break;
+
+ case 2:
+ psz_device = config_GetPsz( p_intf, "vcd" );
+ break;
+
+ default:
+ psz_device = config_GetPsz( p_intf, "dvd" );
+ break;
+ }
+
+ if( strcmp( psz_device, disc_device->GetValue().c_str() ) )
+ {
+ b_disc_device_changed = true;
+ }
+
+ UpdateMRL( DISC_ACCESS );
+}
+
void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
{
char *psz_device;
switch( disc_type->GetSelection() )
{
+ case 3:
+ psz_device = config_GetPsz( p_intf, "cd-audio" );
+ if( !b_disc_device_changed )
+ {
+ disc_device->SetValue( psz_device ? wxU(psz_device) : wxT("") );
+ }
+ break;
+
case 2:
psz_device = config_GetPsz( p_intf, "vcd" );
- disc_device->SetValue( psz_device ? wxU(psz_device) : wxT("") );
+ if( !b_disc_device_changed )
+ {
+ disc_device->SetValue( psz_device ? wxU(psz_device) : wxT("") );
+ }
break;
default:
psz_device = config_GetPsz( p_intf, "dvd" );
- disc_device->SetValue( psz_device ? wxU(psz_device) : wxT("") );
+ if( !b_disc_device_changed )
+ {
+ disc_device->SetValue( psz_device ? wxU(psz_device) : wxT("") );
+ }
break;
}