Commit 398bf6a8 authored by Rocky Bernstein's avatar Rocky Bernstein

Don't limit VCD Entries or LIDs to number of MPEG tracks.

Untabify.
parent d579d01b
...@@ -665,7 +665,7 @@ wxPanel *OpenDialog::DiscPanel( wxWindow* parent ) ...@@ -665,7 +665,7 @@ wxPanel *OpenDialog::DiscPanel( wxWindow* parent )
#ifdef HAVE_LIBCDIO #ifdef HAVE_LIBCDIO
disc_probe = new wxCheckBox( panel, DiscProbe_Event, disc_probe = new wxCheckBox( panel, DiscProbe_Event,
wxU(_("Probe Disc")) ); wxU(_("Probe Disc")) );
#endif #endif
sizer_row->Add( disc_type, i_disc_type_selection, wxEXPAND | wxALL, 5 ); sizer_row->Add( disc_type, i_disc_type_selection, wxEXPAND | wxALL, 5 );
...@@ -846,8 +846,8 @@ void OpenDialog::UpdateMRL( int i_access_method ) ...@@ -846,8 +846,8 @@ void OpenDialog::UpdateMRL( int i_access_method )
{ {
case 0: /* DVD with menus */ case 0: /* DVD with menus */
case 1: /* DVD without menus */ case 1: /* DVD without menus */
disc_device->SetToolTip( wxU(_("Name of DVD device " disc_device->SetToolTip( wxU(_("Name of DVD device "
"to read from.")) ); "to read from.")) );
if( i_disc_type_selection == 0 ) if( i_disc_type_selection == 0 )
{ {
mrltemp = wxT("dvd://") + disc_device->GetValue(); mrltemp = wxT("dvd://") + disc_device->GetValue();
...@@ -877,17 +877,17 @@ void OpenDialog::UpdateMRL( int i_access_method ) ...@@ -877,17 +877,17 @@ void OpenDialog::UpdateMRL( int i_access_method )
case 2: /* VCD of some sort */ case 2: /* VCD of some sort */
#ifdef HAVE_VCDX #ifdef HAVE_VCDX
disc_device->SetToolTip( wxU(_("Name of CD-ROM device " disc_device->SetToolTip( wxU(_("Name of CD-ROM device "
"to read Video CD from. If this field is left empty, we will scan " "to read Video CD from. If this field is left empty, we will scan "
"for a CD-ROM with a VCD in it.")) ); "for a CD-ROM with a VCD in it.")) );
mrltemp = wxT("vcdx://") + disc_device->GetValue(); mrltemp = wxT("vcdx://") + disc_device->GetValue();
if( i_disc_title > 0 ) if( i_disc_title > 0 )
mrltemp += wxString::Format( wxT("@%c%d"), mrltemp += wxString::Format( wxT("@%c%d"),
config_GetInt( p_intf, "vcdx-PBC" ) config_GetInt( p_intf, "vcdx-PBC" )
? 'P' : 'E', i_disc_title ); ? 'P' : 'E', i_disc_title );
#else #else
disc_device->SetToolTip( wxU(_("Name of CD-ROM device " disc_device->SetToolTip( wxU(_("Name of CD-ROM device "
"to read Video CD from.")) ); "to read Video CD from.")) );
mrltemp = wxT("vcd://") + disc_device->GetValue(); mrltemp = wxT("vcd://") + disc_device->GetValue();
if( i_disc_title > 0 ) if( i_disc_title > 0 )
mrltemp += wxString::Format( wxT("@%d"), i_disc_title ); mrltemp += wxString::Format( wxT("@%d"), i_disc_title );
...@@ -905,13 +905,13 @@ void OpenDialog::UpdateMRL( int i_access_method ) ...@@ -905,13 +905,13 @@ void OpenDialog::UpdateMRL( int i_access_method )
case 3: /* CD-DA */ case 3: /* CD-DA */
#ifdef HAVE_CDDAX #ifdef HAVE_CDDAX
disc_device->SetToolTip( wxU(_("Name of CD-ROM device " disc_device->SetToolTip( wxU(_("Name of CD-ROM device "
"to read audio CD from. If this field is left empty, we will scan " "to read audio CD from. If this field is left empty, we will scan "
"for a CD-ROM with an audio CD in it." )) ); "for a CD-ROM with an audio CD in it." )) );
mrltemp = wxT("cddax://") mrltemp = wxT("cddax://")
#else #else
disc_device->SetToolTip( wxU(_("Name of CD-ROM device " disc_device->SetToolTip( wxU(_("Name of CD-ROM device "
"to read audio CD from." )) ); "to read audio CD from." )) );
mrltemp = wxT("cdda://") mrltemp = wxT("cdda://")
#endif #endif
+ disc_device->GetValue(); + disc_device->GetValue();
...@@ -1254,19 +1254,19 @@ static char * ProbeDVD() ...@@ -1254,19 +1254,19 @@ static char * ProbeDVD()
char **c; char **c;
for( c = ppsz_cd_drives; *c != NULL; c++ ) for( c = ppsz_cd_drives; *c != NULL; c++ )
{ {
CdIo_t *p_cdio = cdio_open (*c, DRIVER_UNKNOWN); CdIo_t *p_cdio = cdio_open (*c, DRIVER_UNKNOWN);
if (p_cdio) if (p_cdio)
{ {
discmode_t discmode = cdio_get_discmode(p_cdio); discmode_t discmode = cdio_get_discmode(p_cdio);
cdio_destroy(p_cdio); cdio_destroy(p_cdio);
if( cdio_is_discmode_dvd(discmode) ) if( cdio_is_discmode_dvd(discmode) )
{ {
char *psz_drive = strdup(*c); char *psz_drive = strdup(*c);
cdio_free_device_list(ppsz_cd_drives); cdio_free_device_list(ppsz_cd_drives);
return strdup(psz_drive); return strdup(psz_drive);
} }
} }
} }
cdio_free_device_list(ppsz_cd_drives); cdio_free_device_list(ppsz_cd_drives);
} }
...@@ -1275,7 +1275,7 @@ static char * ProbeDVD() ...@@ -1275,7 +1275,7 @@ static char * ProbeDVD()
static char * ProbeDevice(char **search_devices, cdio_fs_anal_t mask, static char * ProbeDevice(char **search_devices, cdio_fs_anal_t mask,
bool b_any) bool b_any)
{ {
char **ppsz_devices; char **ppsz_devices;
...@@ -1285,8 +1285,8 @@ static char * ProbeDevice(char **search_devices, cdio_fs_anal_t mask, ...@@ -1285,8 +1285,8 @@ static char * ProbeDevice(char **search_devices, cdio_fs_anal_t mask,
if (ppsz_devices && *ppsz_devices) if (ppsz_devices && *ppsz_devices)
{ {
char *psz_device = strdup(*ppsz_devices); char *psz_device = strdup(*ppsz_devices);
cdio_free_device_list(ppsz_devices); cdio_free_device_list(ppsz_devices);
return psz_device; return psz_device;
} }
/* If there was no device specified on the first try then give up /* If there was no device specified on the first try then give up
...@@ -1299,8 +1299,8 @@ static char * ProbeDevice(char **search_devices, cdio_fs_anal_t mask, ...@@ -1299,8 +1299,8 @@ static char * ProbeDevice(char **search_devices, cdio_fs_anal_t mask,
if (ppsz_devices && *ppsz_devices) if (ppsz_devices && *ppsz_devices)
{ {
char *psz_device = strdup(*ppsz_devices); char *psz_device = strdup(*ppsz_devices);
cdio_free_device_list(ppsz_devices); cdio_free_device_list(ppsz_devices);
return psz_device; return psz_device;
} }
return NULL; return NULL;
...@@ -1331,8 +1331,8 @@ static char * ProbeVCD(const wxChar *device) ...@@ -1331,8 +1331,8 @@ static char * ProbeVCD(const wxChar *device)
ppsz_device[0] = (device && *device) ? psz_device : NULL; ppsz_device[0] = (device && *device) ? psz_device : NULL;
ppsz_device[1] = NULL; ppsz_device[1] = NULL;
return ProbeDevice(ppsz_device, return ProbeDevice(ppsz_device,
(CDIO_FS_ANAL_SVCD|CDIO_FS_ANAL_CVD|CDIO_FS_ANAL_VIDEOCD (CDIO_FS_ANAL_SVCD|CDIO_FS_ANAL_CVD|CDIO_FS_ANAL_VIDEOCD
|CDIO_FS_UNKNOWN), true); |CDIO_FS_UNKNOWN), true);
} }
...@@ -1357,14 +1357,14 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) ) ...@@ -1357,14 +1357,14 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) )
case 0: /* DVD with menus */ case 0: /* DVD with menus */
case 1: /* DVD without menus */ case 1: /* DVD without menus */
/* If not a DVD then try for a VCD. If VCD fails it will /* If not a DVD then try for a VCD. If VCD fails it will
try for a CD-DA. */ try for a CD-DA. */
if (!psz_device) psz_device = ProbeDVD(); if (!psz_device) psz_device = ProbeDVD();
if (!psz_device) if (!psz_device)
{ {
b_probed_DVD = true; b_probed_DVD = true;
disc_type->SetSelection(2); disc_type->SetSelection(2);
OnDiscTypeChange( dummy_event ); OnDiscTypeChange( dummy_event );
goto retry; goto retry;
} }
disc_device->SetValue( wxL2U(psz_device) ); disc_device->SetValue( wxL2U(psz_device) );
free(psz_device); free(psz_device);
...@@ -1375,33 +1375,33 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) ) ...@@ -1375,33 +1375,33 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) )
if( psz_device ) if( psz_device )
{ {
CdIo_t *p_cdio = cdio_open (psz_device, DRIVER_UNKNOWN); CdIo_t *p_cdio = cdio_open (psz_device, DRIVER_UNKNOWN);
disc_device->SetValue( wxL2U(psz_device) ); disc_device->SetValue( wxL2U(psz_device) );
#ifdef HAVE_VCDX #ifdef HAVE_VCDX
/* FIXME: get information from libvcdinfo. */ /* FIXME: get information from libvcdinfo. */
if (config_GetInt( p_intf, "vcdx-PBC" )) if (config_GetInt( p_intf, "vcdx-PBC" ))
{ {
/* Set largest LID. */; /* Set largest LID. */;
; ;
} }
else else
{ {
/* Set largest Entry */ /* Set largest Entry */
; ;
} }
#else #else
/* Set track range accurately if possible. */ /* Set track range accurately if possible. */
if (p_cdio) if (p_cdio)
{ {
track_t i_last_track = cdio_get_last_track_num(p_cdio); track_t i_last_track = cdio_get_last_track_num(p_cdio);
disc_title->SetRange( 0, i_last_track-1 ); disc_title->SetRange( 0, i_last_track-1 );
} }
#endif #endif
free(psz_device); free(psz_device);
cdio_destroy(p_cdio); cdio_destroy(p_cdio);
break; break;
} }
b_probed_VCD = true; b_probed_VCD = true;
...@@ -1409,9 +1409,9 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) ) ...@@ -1409,9 +1409,9 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) )
/* Not a VCD. Try for a DVD unless we've been there before. */ /* Not a VCD. Try for a DVD unless we've been there before. */
if( !b_probed_DVD && (psz_device = ProbeDVD()) ) if( !b_probed_DVD && (psz_device = ProbeDVD()) )
{ {
disc_type->SetSelection(0); disc_type->SetSelection(0);
OnDiscTypeChange( dummy_event ); OnDiscTypeChange( dummy_event );
goto retry; goto retry;
} }
b_probed_DVD = true; b_probed_DVD = true;
...@@ -1419,9 +1419,9 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) ) ...@@ -1419,9 +1419,9 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) )
psz_device = ProbeCDDA(disc_device->GetValue()); psz_device = ProbeCDDA(disc_device->GetValue());
if( psz_device ) if( psz_device )
{ {
disc_type->SetSelection(3); disc_type->SetSelection(3);
OnDiscTypeChange( dummy_event ); OnDiscTypeChange( dummy_event );
goto retry; goto retry;
} }
break; break;
...@@ -1430,33 +1430,33 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) ) ...@@ -1430,33 +1430,33 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) )
if( psz_device ) if( psz_device )
{ {
CdIo_t *p_cdio = cdio_open (psz_device, DRIVER_UNKNOWN); CdIo_t *p_cdio = cdio_open (psz_device, DRIVER_UNKNOWN);
disc_device->SetValue( wxL2U(psz_device) ); disc_device->SetValue( wxL2U(psz_device) );
if (p_cdio) if (p_cdio)
{ {
track_t i_last_track = cdio_get_last_track_num(p_cdio); track_t i_last_track = cdio_get_last_track_num(p_cdio);
disc_title->SetRange( 0, i_last_track ); disc_title->SetRange( 0, i_last_track );
} }
free(psz_device); free(psz_device);
cdio_destroy(p_cdio); cdio_destroy(p_cdio);
break; break;
} }
/* Not a CD-DA. Try for a DVD unless we've been there before. */ /* Not a CD-DA. Try for a DVD unless we've been there before. */
if( !b_probed_DVD && (psz_device = ProbeDVD()) ) if( !b_probed_DVD && (psz_device = ProbeDVD()) )
{ {
disc_type->SetSelection(0); disc_type->SetSelection(0);
OnDiscTypeChange( dummy_event ); OnDiscTypeChange( dummy_event );
goto retry; goto retry;
} }
/* Couldn't find a CD-DA or DVD. See if we can find a VCD, unless /* Couldn't find a CD-DA or DVD. See if we can find a VCD, unless
we've tried that before. */ we've tried that before. */
if (!b_probed_VCD) psz_device = ProbeVCD(disc_device->GetValue()); if (!b_probed_VCD) psz_device = ProbeVCD(disc_device->GetValue());
if( psz_device ) if( psz_device )
{ {
disc_type->SetSelection(2); disc_type->SetSelection(2);
OnDiscTypeChange( dummy_event ); OnDiscTypeChange( dummy_event );
goto retry; goto retry;
} }
break; break;
...@@ -1495,13 +1495,13 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) ) ...@@ -1495,13 +1495,13 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
disc_sub->SetRange( -1, 31 ); // up to 32 subtitles -1: no subtitle disc_sub->SetRange( -1, 31 ); // up to 32 subtitles -1: no subtitle
disc_audio->SetRange( 0, 7 ); // up to 8 audio channels disc_audio->SetRange( 0, 7 ); // up to 8 audio channels
disc_chapter->SetRange( 0, 255 ); disc_chapter->SetRange( 0, 255 );
disc_title->SetToolTip( wxU(_("Title number.")) ); disc_title->SetToolTip( wxU(_("Title number.")) );
disc_sub->SetToolTip( wxU(_( disc_sub->SetToolTip( wxU(_(
"DVD's can have up to 32 subtitles numbered 0..31. " "DVD's can have up to 32 subtitles numbered 0..31. "
"Note this is not the same thing as a subtitle name e.g. 'en'. " "Note this is not the same thing as a subtitle name e.g. 'en'. "
"If a value -1 is used, no subtitle will be shown." )) ); "If a value -1 is used, no subtitle will be shown." )) );
disc_audio->SetToolTip( wxU(_("Audio track number. " disc_audio->SetToolTip( wxU(_("Audio track number. "
"DVD's can have up to 8 audio tracks numbered 0..7." "DVD's can have up to 8 audio tracks numbered 0..7."
)) ); )) );
break; break;
...@@ -1517,31 +1517,31 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) ) ...@@ -1517,31 +1517,31 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
} }
#ifdef HAVE_VCDX #ifdef HAVE_VCDX
if (config_GetInt( p_intf, "vcdx-PBC" )) if (config_GetInt( p_intf, "vcdx-PBC" ))
{ {
disc_title_label->SetLabel ( wxT("Playback LID") ); disc_title_label->SetLabel ( wxT("Playback LID") );
disc_title->SetToolTip( wxU(_( disc_title->SetToolTip( wxU(_(
"Playback control (PBC) usually starts with number 1." )) ); "Playback control (PBC) usually starts with number 1." )) );
} }
else else
{ {
disc_title_label->SetLabel ( wxT("Entry") ); disc_title_label->SetLabel ( wxT("Entry") );
disc_title->SetToolTip( wxU(_( disc_title->SetToolTip( wxU(_(
"The first entry (the beginning of the first MPEG track) is 0." )) ); "The first entry (the beginning of the first MPEG track) is 0." )) );
} }
#else #else
disc_title_label->SetLabel ( wxU(_("Track")) ); disc_title_label->SetLabel ( wxU(_("Track")) );
disc_title->SetToolTip( wxU(_("Track number.")) ); disc_title->SetToolTip( wxU(_("Track number.")) );
#endif #endif
disc_title->SetRange( 0, 99 ); // only 100 tracks allowed on VCDs disc_title->SetRange( 0, 99 ); // only 100 tracks allowed on VCDs
disc_sub->SetRange( -1, 3 ); // up to 4 subtitles -1 = no subtitle disc_sub->SetRange( -1, 3 ); // up to 4 subtitles -1 = no subtitle
disc_audio->SetRange( 0, 1 ); // up to 2 audio tracks disc_audio->SetRange( 0, 1 ); // up to 2 audio tracks
disc_sub->SetToolTip( wxU(_( disc_sub->SetToolTip( wxU(_(
"SVCD's can have up to 4 subtitles numbered 0..3. " "SVCD's can have up to 4 subtitles numbered 0..3. "
"If a value -1 is used, no subtitle will be shown." )) ); "If a value -1 is used, no subtitle will be shown." )) );
disc_audio->SetToolTip( wxU(_("Audio track number. " disc_audio->SetToolTip( wxU(_("Audio track number. "
"VCD's can have up to 2 audio tracks numbered 0 or 1. " "VCD's can have up to 2 audio tracks numbered 0 or 1. "
)) ); )) );
break; break;
...@@ -1551,12 +1551,12 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) ) ...@@ -1551,12 +1551,12 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
disc_audio->Disable(); disc_audio_label->Disable(); disc_audio->Disable(); disc_audio_label->Disable();
disc_title_label->SetLabel ( wxU(_("Track")) ); disc_title_label->SetLabel ( wxU(_("Track")) );
#ifdef HAVE_CDDAX #ifdef HAVE_CDDAX
disc_title->SetToolTip( wxU(_( disc_title->SetToolTip( wxU(_(
"Audio CDs can have up to 100 tracks, the first track is usually 1. " "Audio CDs can have up to 100 tracks, the first track is usually 1. "
"If 0 is given, then all tracks are played.")) ); "If 0 is given, then all tracks are played.")) );
#else #else
disc_title->SetToolTip( wxU(_( disc_title->SetToolTip( wxU(_(
"Audio CDs can have up to 100 tracks, the first track is usually 1." "Audio CDs can have up to 100 tracks, the first track is usually 1."
)) ); )) );
#endif #endif
psz_device = config_GetPsz( p_intf, "cd-audio" ); psz_device = config_GetPsz( p_intf, "cd-audio" );
......
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