Commit 78ba4b7e authored by Rocky Bernstein's avatar Rocky Bernstein

Add CD-DA CDDB support via libcddb.

parent f54c0f61
dnl Autoconf settings for vlc
dnl $Id: configure.ac,v 1.124 2003/11/30 14:28:07 fenrir Exp $
dnl $Id: configure.ac,v 1.125 2003/11/30 18:14:20 rocky Exp $
AC_INIT(vlc,0.7.0-test1)
......@@ -295,7 +295,7 @@ fi
AC_CHECK_FUNCS(connect,,[
AC_CHECK_LIB(socket,connect,[
AX_ADD_LDFLAGS([vlc ipv4],-lsocket)
AX_ADD_LDFLAGS([vlc ipv4 cddax],-lsocket)
])
])
......@@ -307,7 +307,7 @@ AC_CHECK_FUNCS(send,,[
AC_CHECK_FUNCS(gethostbyname,,[
AC_CHECK_LIB(nsl,gethostbyname,[
AX_ADD_LDFLAGS([ipv4 httpd vlc],[-lnsl])
AX_ADD_LDFLAGS([cddax ipv4 httpd vlc],[-lnsl])
],[
AC_CHECK_LIB(bind,gethostbyname,[
AX_ADD_LDFLAGS([ipv4 access_mms httpd],[-lbind])
......@@ -1474,6 +1474,56 @@ then
AX_ADD_PLUGINS([pvr])
fi
dnl
dnl VCDX and CDDAX modules
dnl
AC_ARG_ENABLE(libcdio,
[ --enable-libcdio CDDA support via libcdio (default enabled)])
AC_ARG_ENABLE(libcddb,
[ --enable-libcddb CDDB support for CDDAX (default enabled)])
AC_ARG_ENABLE(vcdx,
[ --enable-vcdx VCD support with Navigation (default enabled)])
if test "${enable_cddax}" != "no"
then
PKG_CHECK_MODULES(LIBCDIO, libcdio >= 0.65,
[enable_cddax="no"
AX_ADD_LDFLAGS([cddax],[$LIBCDIO_LIBS])
AX_ADD_CFLAGS([cddax],[$LIBCDIO_CFLAGS])
AX_ADD_PLUGINS([cddax])],
[AC_MSG_WARN(libcdio library not found)])
if test x$enable_cddb != no; then
PKG_CHECK_MODULES(LIBCDDB, libcddb >= 0.9.4, [
HAVE_LIBCDDB=yes
AC_DEFINE(HAVE_LIBCDDB, [], [Define this if you have libcddb installed])
AX_ADD_LDFLAGS([cddax],[$LIBCDDB_LIBS])
AX_ADD_CFLAGS([cddax],[$LIBCDDB_CFLAGS])
],
[AC_MSG_WARN(new enough libcddb not found. CDDB access disabled)
HAVE_LIBCDDB=no])
fi
PKG_CHECK_MODULES(LIBCDIO, libcdio >= 0.65,
[enable_cddax="no"
AX_ADD_LDFLAGS([cddax],[$LIBCDIO_LIBS])
AX_ADD_CFLAGS([cddax],[$LIBCDIO_CFLAGS])
AX_ADD_PLUGINS([cddax])],
[AC_MSG_WARN(libcdio library not found)])
if test "${enable_vcdx}" != "no"
then
PKG_CHECK_MODULES(VCDINFO, libvcdinfo >= 0.7.20-cdio,
[enable_vcd="no"
AX_ADD_LDFLAGS([vcdx],[$VCDINFO_LIBS])
AX_ADD_CFLAGS([vcdx],[$VCDINFO_CFLAGS])
AX_ADD_PLUGINS([vcdx])],
[AC_MSG_WARN(vcdinfo library not found)])
fi
fi
dnl
dnl VCD module
dnl
......@@ -1520,29 +1570,6 @@ then
fi
fi
dnl
dnl VCDX and CDX modules
dnl
AC_ARG_ENABLE(vcdx,
[ --enable-vcdx VCD support with Navigation for Linux and Win32 (default enabled)])
if test "${enable_vcdx}" != "no"
then
PKG_CHECK_MODULES(LIBCDIO, libcdio >= 0.65,
[enable_cdda="no"
AX_ADD_LDFLAGS([cddax],[$LIBCDIO_LIBS])
AX_ADD_CFLAGS([cddax],[$LIBCDIO_CFLAGS])
AX_ADD_PLUGINS([cddax])],
[AC_MSG_WARN(libcdio library not found)])
PKG_CHECK_MODULES(VCDINFO, libvcdinfo >= 0.7.20-cdio,
[enable_vcd="no"
AX_ADD_LDFLAGS([vcdx],[$VCDINFO_LIBS])
AX_ADD_CFLAGS([vcdx],[$VCDINFO_CFLAGS])
AX_ADD_PLUGINS([vcdx])],
[AC_MSG_WARN(vcdinfo library not found)])
fi
dnl
dnl Satellite input module
dnl
......
This diff is collapsed.
......@@ -2,11 +2,11 @@
* cddax.c : CD digital audio input module for vlc using libcdio
*****************************************************************************
* Copyright (C) 2000,2003 VideoLAN
* $Id: cdda.c,v 1.2 2003/11/26 03:35:26 rocky Exp $
* $Id: cdda.c,v 1.3 2003/11/30 18:14:20 rocky Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Rocky Bernstein <rocky@panix.com>
* Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
* Rocky Bernstein <rocky@panix.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -53,23 +53,22 @@ int E_(DebugCallback) ( vlc_object_t *p_this, const char *psz_name,
* Option help text
*****************************************************************************/
#define DEBUG_TEXT N_("set debug mask for additional debugging.")
#define DEBUG_LONGTEXT N_( \
"This integer when viewed in binary is a debugging mask\n" \
"MRL 1\n" \
"events 2\n" \
"external call 4\n" \
"all calls 8\n" \
"LSN (10) 16\n" \
"libcdio (20) 32\n" \
"seeks (40) 64\n" )
#define DEV_TEXT N_("CD-ROM device name")
"meta info 1\n" \
"events 2\n" \
"MRL 4\n" \
"external call 8\n" \
"all calls (10) 16\n" \
"LSN (20) 32\n" \
"seek (40) 64\n" \
"libcdio (80) 128\n" \
"libcddb (100) 256\n" )
#define DEV_LONGTEXT N_( \
"Specify the name of the CD-ROM device that will be used by default. " \
"If you don't specify anything, we'll scan for a suitable CD-ROM device.")
#define CACHING_TEXT N_("Caching value in ms")
#define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for cdda streams. This " \
"value should be set in millisecond units." )
......@@ -79,7 +78,7 @@ int E_(DebugCallback) ( vlc_object_t *p_this, const char *psz_name,
*****************************************************************************/
vlc_module_begin();
add_usage_hint( N_("cddax://[device-or-file][@num]") );
add_usage_hint( N_("cddax://[device-or-file][@[T]num]") );
set_description( _("Compact Disc Digital Audio (CD-DA) input") );
set_capability( "access", 75 /* slightly higher than cdda */ );
set_callbacks( E_(Open), E_(Close) );
......@@ -89,15 +88,64 @@ vlc_module_begin();
/* Configuration options */
add_category_hint( N_("CDX"), NULL, VLC_TRUE );
add_integer ( MODULE_STRING "-debug", 0, E_(DebugCallback), DEBUG_TEXT,
add_integer ( MODULE_STRING "-debug", 0, E_(DebugCallback),
N_("set debug mask for additional debugging."),
DEBUG_LONGTEXT, VLC_TRUE );
add_integer( MODULE_STRING "-caching",
DEFAULT_PTS_DELAY / 1000, NULL,
CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE );
add_string( MODULE_STRING "-device", "", NULL, DEV_TEXT,
DEV_LONGTEXT, VLC_TRUE );
N_("Caching value in ms"),
CACHING_LONGTEXT, VLC_TRUE );
add_string( MODULE_STRING "-device", "", NULL,
N_("CD-ROM device name"),
DEV_LONGTEXT, VLC_FALSE );
#ifdef HAVE_LIBCDDB
add_bool( MODULE_STRING "-cddb-enabled", 1, NULL,
N_("Do CDDB lookups?"),
N_("If set, lookup CD-DA track information using the CDDB "
"protocol"),
VLC_FALSE );
add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
N_("CDDB server"),
N_( "Contact this CDDB server look up CD-DA information"),
VLC_TRUE );
add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
N_("CDDB server port"),
N_("CDDB server uses this port number to communicate on"),
VLC_TRUE );
add_string( MODULE_STRING "-cddb-email", "me@home", NULL,
N_("email address reported to CDDB server"),
N_("email address reported to CDDB server"),
VLC_TRUE );
add_bool( MODULE_STRING "-cddb-enable-cache", 1, NULL,
N_("Cache CDDB lookups?"),
N_("If set cache CDDB information about this CD"),
VLC_FALSE );
add_bool( MODULE_STRING "-cddb-httpd", 0, NULL,
N_("Contact CDDB via the HTTP protocol?"),
N_("If set, the CDDB server get information via the CDDB HTTP "
"protocol"),
VLC_TRUE );
add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
N_("CDDB server timeout"),
N_("Time (in seconds) to wait for a response from the "
"CDDB server"),
VLC_FALSE );
add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
N_("Directory to cache CDDB requests"),
N_("Directory to cache CDDB requests"),
VLC_TRUE );
#endif
add_submodule();
set_description( _("CD Audio demux") );
......
......@@ -3,7 +3,7 @@
* using libcdio, libvcd and libvcdinfo
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: cdda.h,v 1.1 2003/11/26 03:35:26 rocky Exp $
* $Id: cdda.h,v 1.2 2003/11/30 18:14:20 rocky Exp $
*
* Authors: Rocky Bernstein <rocky@panix.com>
*
......@@ -24,16 +24,22 @@
#include "../vcdx/cdrom.h"
#ifdef HAVE_LIBCDDB
#include <cddb/cddb.h>
#endif
/*****************************************************************************
* Debugging
*****************************************************************************/
#define INPUT_DBG_MRL 1
#define INPUT_DBG_META 1 /* Meta information */
#define INPUT_DBG_EVENT 2 /* Trace keyboard events */
#define INPUT_DBG_EXT 4 /* Calls from external routines */
#define INPUT_DBG_CALL 8 /* all calls */
#define INPUT_DBG_LSN 16 /* LSN changes */
#define INPUT_DBG_CDIO 32 /* Debugging from CDIO */
#define INPUT_DBG_MRL 4 /* MRL debugging */
#define INPUT_DBG_EXT 8 /* Calls from external routines */
#define INPUT_DBG_CALL 16 /* all calls */
#define INPUT_DBG_LSN 32 /* LSN changes */
#define INPUT_DBG_SEEK 64 /* Seeks to set location */
#define INPUT_DBG_CDIO 128 /* Debugging from CDIO */
#define INPUT_DBG_CDDB 256 /* CDDB debugging */
#define INPUT_DEBUG 1
#if INPUT_DEBUG
......@@ -58,6 +64,30 @@ typedef struct cdda_data_s
int i_debug; /* Debugging mask */
intf_thread_t *p_intf;
#ifdef HAVE_LIBCDDB
struct {
bool have_info; /* True if we have any info */
cddb_disc_t *disc; /* libcdio uses this to get disc info */
char *cdiscid;
char *disc_title;
char disc_year[5]; /* Year. Probably 19XX or 20XX */
char *disc_artist;
char *disc_genre;
cddb_cat_t disc_category; /* CDDB category */
int disc_seconds; /* Length in seconds listed in CDDB
catalog. May or may not match
length below.
*/
int disc_length; /* Length in frames of cd. Used in
CDDB lookups */
unsigned int disc_id; /* This along with the length and
num_tracks below is what CDDB uses
to look up CD info */
} cddb;
#endif
} cdda_data_t;
/*****************************************************************************
......
......@@ -7,7 +7,6 @@
msgid ""
msgstr ""
"Project-Id-Version: vlc 0.73.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-11-27 00:11+0100\n"
"PO-Revision-Date: 2002-04-18 23:38+0100\n"
"Last-Translator: Felix Khne <fk@aenneburghardt.de>\n"
......@@ -15,6 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"Report-Msgid-Bugs-To: \n"
#: include/vlc_help.h:32
#, fuzzy
......
......@@ -17,7 +17,6 @@
msgid ""
msgstr ""
"Project-Id-Version: vlc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-11-27 00:11+0100\n"
"PO-Revision-Date: 2002-04-22 09:56+0200\n"
"Last-Translator: Samuel Hocevar <sam@zoy.org>\n"
......@@ -25,6 +24,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"Report-Msgid-Bugs-To: \n"
#: include/vlc_help.h:32
msgid "VLC Preferences"
......
......@@ -6,7 +6,6 @@
msgid ""
msgstr ""
"Project-Id-Version: vlc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-11-27 00:11+0100\n"
"PO-Revision-Date: 2002-04-22 09:56+0200\n"
"Last-Translator: Antonio Javier Varela <tonxabar@hotmail.com>\n"
......@@ -14,6 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8-bit\n"
"Report-Msgid-Bugs-To: \n"
#: include/vlc_help.h:32
msgid "VLC Preferences"
......
This diff is collapsed.
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