static void print_cddb_info(CdIo_t *p_cdio, track_t i_tracks, track_t i_first_track) { int i, i_cddb_matches = 0; cddb_conn_t *p_conn = NULL; cddb_disc_t *p_cddb_disc = NULL; if ( init_cddb(p_cdio, &p_conn, &p_cddb_disc, cddb_errmsg, i_first_track, i_tracks, &i_cddb_matches) ) { if (-1 == i_cddb_matches) printf("%s: %s\n", program_name, cddb_error_str(cddb_errno(p_conn))); else { printf("%s: Found %d matches in CDDB\n", program_name, i_cddb_matches); for (i=1; i<=i_cddb_matches; i++) { cddb_disc_print(p_cddb_disc); cddb_query_next(p_conn, p_cddb_disc); if (i != i_cddb_matches) cddb_read(p_conn, p_cddb_disc); } } cddb_disc_destroy(p_cddb_disc); cddb_destroy(p_conn); libcddb_shutdown(); } }
static void get_cddb_disc_info(CdIo_t *p_cdio) { #ifdef HAVE_CDDB b_db = init_cddb(p_cdio, &p_conn, &p_cddb_disc, xperror, i_first_track, i_tracks, &i_cddb_matches); if (b_db) { int i_year; i_year = atoi(year); cddb_disc_set_artist(p_cddb_disc, artist); cddb_disc_set_title(p_cddb_disc, title); cddb_disc_set_genre(p_cddb_disc, genre); cddb_disc_set_year(p_cddb_disc, i_year); } #endif /* HAVE_CDDB */ return; }