From c743991c5df99a1f2df209ba0f9504d501be7dca Mon Sep 17 00:00:00 2001 From: Yoann Peronneau Date: Tue, 9 Dec 2003 00:46:03 +0000 Subject: [PATCH] This fixes bugs 1285 and 1343 * added a the default CD Audio device in General Settings -> Input * added OpenDialog::OnDiscPanelChange in wxwindows/open.cpp --- include/vlc_config.h | 2 ++ modules/gui/wxwindows/open.cpp | 54 ++++++++++++++++++++++++++++--- modules/gui/wxwindows/wxwindows.h | 8 +++-- src/libvlc.h | 7 +++- 4 files changed, 63 insertions(+), 8 deletions(-) diff --git a/include/vlc_config.h b/include/vlc_config.h index ba1c2e4c1c..a12a2fcc54 100644 --- a/include/vlc_config.h +++ b/include/vlc_config.h @@ -120,9 +120,11 @@ #if !defined( WIN32 ) && !defined( UNDER_CE ) # define DVD_DEVICE "/dev/dvd" # define VCD_DEVICE "/dev/cdrom" +# define CDAUDIO_DEVICE "/dev/cdrom" #else # define DVD_DEVICE "D:" # define VCD_DEVICE "D:" +# define CDAUDIO_DEVICE "D:" #endif /***************************************************************************** diff --git a/modules/gui/wxwindows/open.cpp b/modules/gui/wxwindows/open.cpp index 53966617e0..e7043fb7bd 100644 --- a/modules/gui/wxwindows/open.cpp +++ b/modules/gui/wxwindows/open.cpp @@ -2,7 +2,7 @@ * 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 * @@ -110,6 +110,7 @@ BEGIN_EVENT_TABLE(OpenDialog, wxFrame) /* 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) @@ -236,6 +237,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, #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 ); @@ -282,7 +284,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, 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 ) @@ -673,7 +675,8 @@ void OpenDialog::UpdateMRL( int i_access_method ) 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() ); @@ -933,20 +936,61 @@ void OpenDialog::OnDiscPanelChange( wxCommandEvent& event ) 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; } diff --git a/modules/gui/wxwindows/wxwindows.h b/modules/gui/wxwindows/wxwindows.h index 934665fad5..a4eac76e8f 100644 --- a/modules/gui/wxwindows/wxwindows.h +++ b/modules/gui/wxwindows/wxwindows.h @@ -2,7 +2,7 @@ * wxwindows.h: private wxWindows interface description ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: wxwindows.h,v 1.75 2003/11/29 13:39:43 gbazin Exp $ + * $Id: wxwindows.h,v 1.76 2003/12/09 00:46:03 yoann Exp $ * * Authors: Gildas Bazin * @@ -337,6 +337,7 @@ private: /* Event handlers for the disc page */ void OnDiscPanelChange( wxCommandEvent& event ); void OnDiscTypeChange( wxCommandEvent& event ); + void OnDiscDeviceChange( wxCommandEvent& event ); /* Event handlers for the net page */ void OnNetPanelChange( wxCommandEvent& event ); @@ -374,7 +375,10 @@ private: wxTextCtrl *disc_device; wxSpinCtrl *disc_title; wxSpinCtrl *disc_chapter; - + + /* Indicates if the disc device control was modified */ + bool b_disc_device_changed; + /* Controls for the net panel */ wxRadioBox *net_type; int i_net_type; diff --git a/src/libvlc.h b/src/libvlc.h index 02094b7f92..0e95d43ac8 100644 --- a/src/libvlc.h +++ b/src/libvlc.h @@ -2,7 +2,7 @@ * libvlc.h: main libvlc header ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: libvlc.h,v 1.114 2003/12/08 19:50:22 gbazin Exp $ + * $Id: libvlc.h,v 1.115 2003/12/09 00:46:03 yoann Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -339,6 +339,10 @@ static char *ppsz_language_text[] = #define VCD_DEV_LONGTEXT N_( \ "This is the default VCD device to use.") +#define CDAUDIO_DEV_TEXT N_("CD Audio device") +#define CDAUDIO_DEV_LONGTEXT N_( \ + "This is the default CD Audio device to use.") + #define IPV6_TEXT N_("Force IPv6") #define IPV6_LONGTEXT N_( \ "If you check this box, IPv6 will be used by default for all UDP and " \ @@ -708,6 +712,7 @@ vlc_module_begin(); add_file( "dvd", DVD_DEVICE, NULL, DVD_DEV_TEXT, DVD_DEV_LONGTEXT, VLC_FALSE ); add_file( "vcd", VCD_DEVICE, NULL, VCD_DEV_TEXT, VCD_DEV_LONGTEXT, VLC_FALSE ); + add_file( "cd-audio", CDAUDIO_DEVICE, NULL, CDAUDIO_DEV_TEXT, CDAUDIO_DEV_LONGTEXT, VLC_FALSE ); add_bool( "ipv6", 0, NULL, IPV6_TEXT, IPV6_LONGTEXT, VLC_FALSE ); change_short('6'); -- 2.39.2