1 /*
2   $Id: cddb.h,v 1.6 2008/06/25 08:01:54 rocky Exp $
3 
4   Copyright (C) 2005, 2007, 2008, 2009 Rocky Bernstein <rocky@gnu.org>
5 
6   This program is free software: you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation, either version 3 of the License, or
9   (at your option) any later version.
10 
11   This program is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15 
16   You should have received a copy of the GNU General Public License
17   along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 typedef struct cddb_opts_s
21 {
22   char          *email;  /* email to report to CDDB server. */
23   char          *server; /* CDDB server to contact */
24   int            port;   /* port number to contact CDDB server. */
25   int            http;   /* 1 if use http proxy */
26   int            timeout;
27   bool           disable_cache; /* If set the below is meaningless. */
28   char          *cachedir;
29 } cddb_opts_t;
30 
31 extern cddb_opts_t cddb_opts;
32 
33 /*!
34    Compute the CDDB disk ID for an Audio disk.  This is a funny checksum
35    consisting of the concatenation of 3 things:
36       the sum of the decimal digits of sizes of all tracks,
37       the total length of the disk, and
38       the number of tracks.
39 */
40 uint32_t cddb_discid(CdIo_t *p_cdio, track_t i_tracks);
41 
42 #ifdef HAVE_CDDB
43 #include <cddb/cddb.h>
44 
45 typedef void (*error_fn_t) (const char *msg);
46 
47 bool init_cddb(CdIo_t *p_cdio, cddb_conn_t **pp_conn,
48 	       cddb_disc_t **pp_cddb_disc, error_fn_t errmsg,
49 	       track_t i_first_track, track_t i_tracks, int *i_cddb_matches);
50 #endif
51