|
Packit |
dd8086 |
/*
|
|
Packit |
dd8086 |
$Id: cddb.h,v 1.6 2008/06/25 08:01:54 rocky Exp $
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
Copyright (C) 2005, 2007, 2008, 2009 Rocky Bernstein <rocky@gnu.org>
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
This program is free software: you can redistribute it and/or modify
|
|
Packit |
dd8086 |
it under the terms of the GNU General Public License as published by
|
|
Packit |
dd8086 |
the Free Software Foundation, either version 3 of the License, or
|
|
Packit |
dd8086 |
(at your option) any later version.
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
This program is distributed in the hope that it will be useful,
|
|
Packit |
dd8086 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
dd8086 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
dd8086 |
GNU General Public License for more details.
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
You should have received a copy of the GNU General Public License
|
|
Packit |
dd8086 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
typedef struct cddb_opts_s
|
|
Packit |
dd8086 |
{
|
|
Packit |
dd8086 |
char *email; /* email to report to CDDB server. */
|
|
Packit |
dd8086 |
char *server; /* CDDB server to contact */
|
|
Packit |
dd8086 |
int port; /* port number to contact CDDB server. */
|
|
Packit |
dd8086 |
int http; /* 1 if use http proxy */
|
|
Packit |
dd8086 |
int timeout;
|
|
Packit |
dd8086 |
bool disable_cache; /* If set the below is meaningless. */
|
|
Packit |
dd8086 |
char *cachedir;
|
|
Packit |
dd8086 |
} cddb_opts_t;
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
extern cddb_opts_t cddb_opts;
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/*!
|
|
Packit |
dd8086 |
Compute the CDDB disk ID for an Audio disk. This is a funny checksum
|
|
Packit |
dd8086 |
consisting of the concatenation of 3 things:
|
|
Packit |
dd8086 |
the sum of the decimal digits of sizes of all tracks,
|
|
Packit |
dd8086 |
the total length of the disk, and
|
|
Packit |
dd8086 |
the number of tracks.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
uint32_t cddb_discid(CdIo_t *p_cdio, track_t i_tracks);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
#ifdef HAVE_CDDB
|
|
Packit |
dd8086 |
#include <cddb/cddb.h>
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
typedef void (*error_fn_t) (const char *msg);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
bool init_cddb(CdIo_t *p_cdio, cddb_conn_t **pp_conn,
|
|
Packit |
dd8086 |
cddb_disc_t **pp_cddb_disc, error_fn_t errmsg,
|
|
Packit |
dd8086 |
track_t i_first_track, track_t i_tracks, int *i_cddb_matches);
|
|
Packit |
dd8086 |
#endif
|