Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

cdda.c

00001 /*****************************************************************************
00002  * cdda.c : CD digital audio input module for vlc using libcdio
00003  *****************************************************************************
00004  * Copyright (C) 2000, 2003, 2004, 2005 the VideoLAN team
00005  * $Id: cdda.c 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Rocky Bernstein <[email protected]>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00022  *****************************************************************************/
00023 
00024 /*****************************************************************************
00025  * Preamble
00026  *****************************************************************************/
00027 
00028 #include "callback.h"
00029 #include "access.h"
00030 #include <cdio/version.h>
00031 
00032 /*****************************************************************************
00033  * Module descriptor
00034  *****************************************************************************/
00035 
00036 /*****************************************************************************
00037  * Option help text
00038  *****************************************************************************/
00039 
00040 #if LIBCDIO_VERSION_NUM >= 72
00041 static char *psz_paranoia_list[] = { "none", "overlap", "full" };
00042 static char *psz_paranoia_list_text[] = { N_("none"), N_("overlap"),
00043                                           N_("full") };
00044 #endif
00045 
00046 #define DEBUG_LONGTEXT N_( \
00047     "This integer when viewed in binary is a debugging mask\n" \
00048     "meta info          1\n" \
00049     "events             2\n" \
00050     "MRL                4\n" \
00051     "external call      8\n" \
00052     "all calls (0x10)  16\n" \
00053     "LSN       (0x20)  32\n" \
00054     "seek      (0x40)  64\n" \
00055     "libcdio   (0x80) 128\n" \
00056     "libcddb  (0x100) 256\n" )
00057 
00058 #define CACHING_LONGTEXT N_( \
00059     "Allows you to modify the default caching value for CDDA streams. This " \
00060     "value should be set in millisecond units." )
00061 
00062 #define BLOCKS_PER_READ_LONGTEXT N_( \
00063     "Allows you to specify how many CD blocks to get on a single CD read. " \
00064     "Generally on newer/faster CDs, this increases throughput at the " \
00065     "expense of a little more memory usage and initial delay. SCSI-MMC " \
00066     "limitations generally don't allow for more than 25 blocks per access.")
00067 
00068 #define CDDB_TITLE_FMT_LONGTEXT N_( \
00069 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
00070 "Format specifiers that start with a percent sign. Specifiers are: \n" \
00071 "   %a : The artist (for the album)\n" \
00072 "   %A : The album information\n" \
00073 "   %C : Category\n" \
00074 "   %e : The extended data (for a track)\n" \
00075 "   %I : CDDB disk ID\n" \
00076 "   %G : Genre\n" \
00077 "   %M : The current MRL\n" \
00078 "   %m : The CD-DA Media Catalog Number (MCN)\n" \
00079 "   %n : The number of tracks on the CD\n" \
00080 "   %p : The artist/performer/composer in the track\n" \
00081 "   %T : The track number\n" \
00082 "   %s : Number of seconds in this track\n" \
00083 "   %S : Number of seconds in the CD\n" \
00084 "   %t : The track title or MRL if no title\n" \
00085 "   %Y : The year 19xx or 20xx\n" \
00086 "   %% : a % \n")
00087 
00088 #define TITLE_FMT_LONGTEXT N_( \
00089 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
00090 "Format specifiers that start with a percent sign. Specifiers are: \n" \
00091 "   %M : The current MRL\n" \
00092 "   %m : The CD-DA Media Catalog Number (MCN)\n" \
00093 "   %n : The number of tracks on the CD\n" \
00094 "   %T : The track number\n" \
00095 "   %s : Number of seconds in this track\n" \
00096 "   %S : Number of seconds in the CD\n" \
00097 "   %t : The track title or MRL if no title\n" \
00098 "   %% : a % \n")
00099 
00100 #define PARANOIA_TEXT N_("Enable CD paranoia?")
00101 #define PARANOIA_LONGTEXT N_( \
00102         "Select whether to use CD Paranoia for jitter/error correction.\n" \
00103         "none: no paranoia - fastest.\n" \
00104         "overlap: do only overlap detection - not generally recommended.\n" \
00105         "full: complete jitter and error correction detection - slowest.\n" )
00106 
00107 /*****************************************************************************
00108  * Module descriptor
00109  *****************************************************************************/
00110 
00111 vlc_module_begin();
00112     add_usage_hint( N_("cddax://[device-or-file][@[T]track]") );
00113     set_description( _("Compact Disc Digital Audio (CD-DA) input") );
00114     set_capability( "access2", 10 /* compare with priority of cdda */ );
00115     set_shortname( N_("Audio Compact Disc"));
00116     set_callbacks( CDDAOpen, CDDAClose );
00117     add_shortcut( "cddax" );
00118     add_shortcut( "cd" );
00119     set_category( CAT_INPUT );
00120     set_subcategory( SUBCAT_INPUT_ACCESS );
00121 
00122     /* Configuration options */
00123     add_integer ( MODULE_STRING "-debug", 0, CDDADebugCB,
00124                   N_("If nonzero, this gives additional debug information."),
00125                   DEBUG_LONGTEXT, VLC_TRUE );
00126 
00127     add_integer( MODULE_STRING "-caching",
00128                  DEFAULT_PTS_DELAY / MILLISECONDS_PER_SEC, NULL,
00129                  N_("Caching value in microseconds"),
00130                  CACHING_LONGTEXT, VLC_TRUE );
00131 
00132     add_integer( MODULE_STRING "-blocks-per-read",
00133                  DEFAULT_BLOCKS_PER_READ, CDDABlocksPerReadCB,
00134                  N_("Number of blocks per CD read"),
00135                  BLOCKS_PER_READ_LONGTEXT, VLC_TRUE );
00136 
00137     add_string( MODULE_STRING "-title-format",
00138                 "Track %T. %t", NULL,
00139                 N_("Format to use in playlist \"title\" field when no CDDB"),
00140                 TITLE_FMT_LONGTEXT, VLC_TRUE );
00141 
00142 #if LIBCDIO_VERSION_NUM >= 73
00143     add_bool( MODULE_STRING "-analog-output", VLC_FALSE, NULL,
00144               N_("Use CD audio controls and output?"),
00145               N_("If set, audio controls and audio jack output are used"),
00146               VLC_FALSE );
00147 #endif
00148 
00149     add_bool( MODULE_STRING "-cdtext-enabled", VLC_TRUE, CDTextEnabledCB,
00150               N_("Do CD-Text lookups?"),
00151               N_("If set, get CD-Text information"),
00152               VLC_FALSE );
00153 
00154     add_bool( MODULE_STRING "-navigation-mode", VLC_TRUE, 
00155 #if FIXED
00156               CDDANavModeCB,
00157 #else
00158               NULL,
00159 #endif
00160               N_("Use Navigation-style playback?"),
00161               N_("If set, tracks are navigated via Navagation rather than "
00162                  "a playlist entries"),
00163               VLC_FALSE );
00164 
00165 #if LIBCDIO_VERSION_NUM >= 72
00166       add_string( MODULE_STRING "-paranoia", NULL, NULL,
00167                 PARANOIA_TEXT,
00168                 PARANOIA_LONGTEXT,
00169                 VLC_FALSE );
00170       change_string_list( psz_paranoia_list, psz_paranoia_list_text, 0 );
00171 #endif /* LIBCDIO_VERSION_NUM >= 72 */
00172 
00173 #ifdef HAVE_LIBCDDB
00174     set_section( N_("CDDB" ), 0 );
00175     add_string( MODULE_STRING "-cddb-title-format",
00176                 "Track %T. %t - %p %A", NULL,
00177                 N_("Format to use in playlist \"title\" field when using CDDB"),
00178                 CDDB_TITLE_FMT_LONGTEXT, VLC_TRUE );
00179 
00180     add_bool( MODULE_STRING "-cddb-enabled", VLC_TRUE, CDDBEnabledCB,
00181               N_("Do CDDB lookups?"),
00182               N_("If set, lookup CD-DA track information using the CDDB "
00183                  "protocol"),
00184               VLC_FALSE );
00185 
00186     add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
00187                 N_("CDDB server"),
00188                 N_( "Contact this CDDB server look up CD-DA information"),
00189                 VLC_TRUE );
00190 
00191     add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
00192                  N_("CDDB server port"),
00193                  N_("CDDB server uses this port number to communicate on"),
00194                  VLC_TRUE );
00195 
00196     add_string( MODULE_STRING "-cddb-email", "me@home", NULL,
00197                 N_("email address reported to CDDB server"),
00198                 N_("email address reported to CDDB server"),
00199                 VLC_TRUE );
00200 
00201     add_bool( MODULE_STRING "-cddb-enable-cache", VLC_TRUE, NULL,
00202               N_("Cache CDDB lookups?"),
00203               N_("If set cache CDDB information about this CD"),
00204               VLC_FALSE );
00205 
00206     add_bool( MODULE_STRING "-cddb-httpd", VLC_FALSE, NULL,
00207               N_("Contact CDDB via the HTTP protocol?"),
00208               N_("If set, the CDDB server gets information via the CDDB HTTP "
00209                  "protocol"),
00210               VLC_TRUE );
00211 
00212     add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
00213                  N_("CDDB server timeout"),
00214                  N_("Time (in seconds) to wait for a response from the "
00215                     "CDDB server"),
00216                  VLC_FALSE );
00217 
00218     add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
00219                 N_("Directory to cache CDDB requests"),
00220                 N_("Directory to cache CDDB requests"),
00221                 VLC_TRUE );
00222 
00223     add_bool( MODULE_STRING "-cdtext-prefer", VLC_TRUE, CDTextPreferCB,
00224               N_("Prefer CD-Text info to CDDB info?"),
00225               N_("If set, CD-Text information will be preferred "
00226                  "to CDDB information when both are available"),
00227               VLC_FALSE );
00228 #endif /*HAVE_LIBCDDB*/
00229 
00230 vlc_module_end();

Generated on Tue Dec 20 10:14:23 2005 for vlc-0.8.4a by  doxygen 1.4.2