Commit a00a9488 authored by Rocky Bernstein's avatar Rocky Bernstein

configure.ac: Allow libcdio 0.71 for libcdio things.

open.cpp: Add tooltip for Probe and fill out more vcdinfo things.
parent e9933970
...@@ -1496,7 +1496,7 @@ dnl ...@@ -1496,7 +1496,7 @@ dnl
dnl libsmbclient plugin dnl libsmbclient plugin
dnl dnl
AC_ARG_ENABLE(smb, AC_ARG_ENABLE(smb,
[ --enable-smb smb input module (default enabled)]) [ --enable-smb smb input module (default enabled)])
if test "${enable_smb}" != "no"; then if test "${enable_smb}" != "no"; then
AC_CHECK_HEADERS(libsmbclient.h, AC_CHECK_HEADERS(libsmbclient.h,
[ VLC_ADD_PLUGINS([access_smb]) [ VLC_ADD_PLUGINS([access_smb])
...@@ -1635,7 +1635,7 @@ have_libcdio=no ...@@ -1635,7 +1635,7 @@ have_libcdio=no
have_libvcdinfo=no have_libvcdinfo=no
if test "${enable_libcdio}" != "no" if test "${enable_libcdio}" != "no"
then then
PKG_CHECK_MODULES(LIBCDIO, libcdio >= 0.72, PKG_CHECK_MODULES(LIBCDIO, libcdio >= 0.71,
have_libcdio=yes have_libcdio=yes
AC_DEFINE(HAVE_LIBCDIO, [], AC_DEFINE(HAVE_LIBCDIO, [],
[Define if you have libcdio 0.72 or greater installed])) [Define if you have libcdio 0.72 or greater installed]))
...@@ -1663,6 +1663,8 @@ then ...@@ -1663,6 +1663,8 @@ then
VLC_ADD_LDFLAGS([cddax],[$LIBCDIO_LIBS $LIBCDIO_PARANOIA_LIBS]) VLC_ADD_LDFLAGS([cddax],[$LIBCDIO_LIBS $LIBCDIO_PARANOIA_LIBS])
VLC_ADD_CFLAGS([cddax],[$LIBCDIO_CFLAGS]) VLC_ADD_CFLAGS([cddax],[$LIBCDIO_CFLAGS])
VLC_ADD_PLUGINS([cddax]) VLC_ADD_PLUGINS([cddax])
PKG_CHECK_MODULES(LIBCDIO_PARANOIA, libcdio_paranoia >= 0.72, [
VLC_ADD_LDFLAGS([cddax],[$LIBCDIO_CDDA_LIBS $LIBCDIO_PARANOIA_LIBS])])
else else
AC_MSG_WARN([cddax plugin disabled because ok libcdio library not found or disabled]) AC_MSG_WARN([cddax plugin disabled because ok libcdio library not found or disabled])
HAVE_CDDAX=no HAVE_CDDAX=no
...@@ -1682,7 +1684,7 @@ then ...@@ -1682,7 +1684,7 @@ then
fi fi
AC_ARG_ENABLE(vcdx, AC_ARG_ENABLE(vcdx,
[ --enable-vcdx VCD with Navigation via libvcdinfo (default disabled)]) [ --enable-vcdx VCD with navigation via libvcdinfo (default disabled)])
if test "${enable_vcdx}" = "yes" if test "${enable_vcdx}" = "yes"
then then
...@@ -1695,7 +1697,7 @@ then ...@@ -1695,7 +1697,7 @@ then
HAVE_VCDX=no HAVE_VCDX=no
fi fi
PKG_CHECK_MODULES(LIBCDIO, libiso9660 >= 0.72, PKG_CHECK_MODULES(LIBCDIO, libiso9660 >= 0.71,
[VLC_ADD_LDFLAGS([vcdx],[$LIBISO9660_LIBS]) [VLC_ADD_LDFLAGS([vcdx],[$LIBISO9660_LIBS])
VLC_ADD_CFLAGS([vcdx],[$LIBISO9660_CFLAGS])], VLC_ADD_CFLAGS([vcdx],[$LIBISO9660_CFLAGS])],
[AC_MSG_WARN([vcdx plugin disabled because ok libiso9660 library not found]) [AC_MSG_WARN([vcdx plugin disabled because ok libiso9660 library not found])
...@@ -1715,13 +1717,13 @@ then ...@@ -1715,13 +1717,13 @@ then
fi fi
dnl dnl
dnl Built-in CDDA and VCD module dnl Built-in CD-DA and VCD module
dnl dnl
AC_ARG_ENABLE(cdda, AC_ARG_ENABLE(cdda,
[ --enable-cdda audio CD via builtin VCD (default enabled)]) [ --enable-cdda audio CD via built-in VCD (default enabled)])
AC_ARG_ENABLE(vcd, AC_ARG_ENABLE(vcd,
[ --enable-vcd VCD (not via libcdio) for GNU/Linux, FreeBSD, MacOS X and Win32 (default enabled)]) [ --enable-vcd built-in VCD (not via libcdio)])
if test "${enable_vcd}" != "no" if test "${enable_vcd}" != "no"
then then
......
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
#include <cdio/cdio.h> #include <cdio/cdio.h>
#include <cdio/cd_types.h> #include <cdio/cd_types.h>
#endif /* HAVE_LIBCDIO */ #endif /* HAVE_LIBCDIO */
#if defined(HAVE_VCDINFO) && LIBVCD_VERSION_NUM > 23
#include <libvcd/info.h>
#endif /* HAVE_VCDINFO */
#include <wx/combobox.h> #include <wx/combobox.h>
#include <wx/statline.h> #include <wx/statline.h>
...@@ -666,6 +669,12 @@ wxPanel *OpenDialog::DiscPanel( wxWindow* parent ) ...@@ -666,6 +669,12 @@ 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")) );
disc_probe->SetToolTip( wxU(_("Probe for a DVD, VCD or audio CD. "
"First try the device name entered for the selected disc type "
"(DVD, DVD Menu, VCD, CDDA). If that doesn't find media, try any device for "
"the disc type. If that doesn't work, then try looking for CD-ROMs or DVD "
"drives. The disc type, device name, and some parameter ranges are set "
"based on media we find.")) );
#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 );
...@@ -1274,13 +1283,12 @@ static char * ProbeDVD() ...@@ -1274,13 +1283,12 @@ static char * ProbeDVD()
} }
static char * ProbeDevice(char **search_devices, cdio_fs_anal_t mask, static char * ProbeDevice(char **ppsz_search_devices, cdio_fs_anal_t mask)
bool b_any)
{ {
char **ppsz_devices; char **ppsz_devices;
/* Start out trying the device that has been entered so far. */ /* Start out trying the device that has been entered so far. */
ppsz_devices = cdio_get_devices_with_cap(search_devices, mask, b_any); ppsz_devices = cdio_get_devices_with_cap(ppsz_search_devices, mask, true);
if (ppsz_devices && *ppsz_devices) if (ppsz_devices && *ppsz_devices)
{ {
...@@ -1292,9 +1300,9 @@ static char * ProbeDevice(char **search_devices, cdio_fs_anal_t mask, ...@@ -1292,9 +1300,9 @@ static char * ProbeDevice(char **search_devices, cdio_fs_anal_t mask,
/* 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
now. Otherwise accept any CD-ROM in the class (e.g. VCD or DVD). now. Otherwise accept any CD-ROM in the class (e.g. VCD or DVD).
*/ */
if (!search_devices[0]) return NULL; if (!ppsz_search_devices[0]) return NULL;
ppsz_devices = cdio_get_devices_with_cap(NULL, mask, b_any); ppsz_devices = cdio_get_devices_with_cap(NULL, mask, true);
if (ppsz_devices && *ppsz_devices) if (ppsz_devices && *ppsz_devices)
{ {
...@@ -1317,7 +1325,7 @@ static char * ProbeCDDA(const wxChar *device) ...@@ -1317,7 +1325,7 @@ static char * ProbeCDDA(const wxChar *device)
char *psz_device = (char *) tmp_buf; char *psz_device = (char *) tmp_buf;
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, CDIO_FS_AUDIO, false); return ProbeDevice(ppsz_device, CDIO_FS_AUDIO);
} }
/* Return a device that has a VCD in it. The caller needs to free /* Return a device that has a VCD in it. The caller needs to free
...@@ -1332,16 +1340,15 @@ static char * ProbeVCD(const wxChar *device) ...@@ -1332,16 +1340,15 @@ static char * ProbeVCD(const wxChar *device)
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));
} }
/* /*
Probe (find anywhere) a CD-DA, VCD, or a DVD. Probe (find anywhere) a CD-DA, VCD, or a DVD.
First we try the device name that may have been entered for the media class First try the device name that may have been entered for the "disc type"
selected. If that doesn't work we try any device for the media class. selected. If that doesn't work we try any device for the disc type.
If that doesn't work the try looking for CD-ROMs or DVD drives and set the If that doesn't work, try looking for CD-ROMs or DVD drives. the
media selection to whatever we find. disc type, device name and paramter ranges are set to whatever we find.
*/ */
void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) ) void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) )
{ {
...@@ -1374,23 +1381,32 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) ) ...@@ -1374,23 +1381,32 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) )
if(!psz_device) psz_device = ProbeVCD(disc_device->GetValue()); if(!psz_device) psz_device = ProbeVCD(disc_device->GetValue());
if( psz_device ) if( psz_device )
{ {
CdIo_t *p_cdio = cdio_open (psz_device, DRIVER_UNKNOWN);
disc_device->SetValue( wxL2U(psz_device) );
#ifdef HAVE_VCDX #ifdef HAVE_VCDX
/* FIXME: get information from libvcdinfo. */ #if LIBVCD_VERSION_NUM > 23
if (config_GetInt( p_intf, "vcdx-PBC" )) vcdinfo_obj_t *p_vcdinfo;
{
/* Set largest LID. */; /* Set LID or entry range accurately if possible. */
; if( vcdinfo_open(&p_vcdinfo, &psz_device, DRIVER_DEVICE,
} NULL) == VCDINFO_OPEN_VCD)
else {
{ if (config_GetInt( p_intf, "vcdx-PBC" ))
/* Set largest Entry */ {
; /* Set largest LID. */;
} disc_title->SetRange( 0, vcdinfo_get_num_LIDs(p_vcdinfo) );
}
else
{
/* Set largest Entry */
disc_title->SetRange( 0, vcdinfo_get_num_entries(p_vcdinfo) );
}
vcdinfo_close(p_vcdinfo);
}
#endif /* LIBVCD_VERSION_NUM > 23 */
disc_device->SetValue( wxL2U(psz_device) );
#else #else
CdIo_t *p_cdio = cdio_open (psz_device, DRIVER_UNKNOWN);
disc_device->SetValue( wxL2U(psz_device) );
/* Set track range accurately if possible. */ /* Set track range accurately if possible. */
if (p_cdio) if (p_cdio)
...@@ -1398,9 +1414,9 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) ) ...@@ -1398,9 +1414,9 @@ void OpenDialog::OnDiscProbe( wxCommandEvent& WXUNUSED(event) )
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
free(psz_device); free(psz_device);
cdio_destroy(p_cdio); cdio_destroy(p_cdio);
#endif
break; break;
} }
......
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