- GetCDDBInfo(p_access, p_cdda);
-
- if ( p_cdda->cddb.disc ) {
-
- p_cdda->p_meta = vlc_meta_New();
-
- add_cddb_meta(title, VLC_META_CDDB_TITLE);
- add_cddb_meta(artist, VLC_META_CDDB_ARTIST);
- add_cddb_meta(genre, VLC_META_CDDB_GENRE);
- add_cddb_meta(ext_data, VLC_META_CDDB_EXT_DATA);
-
- add_cddb_meta_fmt(year, "%d", VLC_META_CDDB_YEAR);
- add_cddb_meta_fmt(discid, "%x", VLC_META_CDDB_DISCID);
- }
- }
-
-#endif /*HAVE_LIBCDDB*/
-#define TITLE_MAX 30
-
-/* Adds a string-valued entry to the stream and media information if
- the string is not null or the null string.
- */
-#define add_cddb_info_str(CATEGORY, TITLE, FIELD) \
- if (FIELD && strlen(FIELD)) { \
- input_Control( p_cdda->p_input, INPUT_ADD_INFO, CATEGORY, \
- _(TITLE), "%s", FIELD ); \
- }
-
-/* Adds a numeric-valued entry to the stream and media information */
-#define add_cddb_info_val(CATEGORY, TITLE, FMT, FIELD) \
- if (FIELD) { \
- input_Control( p_cdda->p_input, INPUT_ADD_INFO, CATEGORY, \
- _(TITLE), FMT, FIELD ); \
- }
-
-#define add_cddb_disc_info_str(TITLE, FIELD) \
- add_cddb_info_str("Disc", TITLE, p_cdda->cddb.disc->FIELD)
-
-#define add_cddb_disc_info_val(TITLE, FMT, FIELD) \
- add_cddb_info_val("Disc", TITLE, FMT, p_cdda->cddb.disc->FIELD)
-
-/*#if UPDATE_TRACK_INFORMATION_FINISHED*/
-#if 1
- {
- track_t i_track = p_cdda->i_tracks;
- char psz_buffer[MSTRTIME_MAX_SIZE];
- mtime_t i_duration =
- (p_cdda->p_lsns[i_track] - p_cdda->p_lsns[0])
- / CDIO_CD_FRAMES_PER_SEC;
-
- dbg_print( INPUT_DBG_META, "Duration %ld", (long int) i_duration );
- input_Control( p_cdda->p_input, INPUT_ADD_INFO,
- _("Disc"), _("Duration"), "%s",
- secstotimestr( psz_buffer, i_duration ) );
-
-#ifdef HAVE_LIBCDDB
- if (p_cdda->i_cddb_enabled && p_cdda->cddb.disc) {
- add_cddb_disc_info_str("Artist (CDDB)", artist);
- add_cddb_disc_info_str("Genre (CDDB)", genre);
- add_cddb_disc_info_str("Extended Data (CDDB)", ext_data);
- add_cddb_disc_info_val("Year (CDDB)", "%d", year);
- add_cddb_disc_info_val("Disc ID (CDDB)", "%x", discid);
- add_cddb_disc_info_str("Title (CDDB)", title);
- add_cddb_info_str("Disc", "Category (CDDB)",
- CDDB_CATEGORY[p_cdda->cddb.disc->category]);
- }
-#endif /*HAVE_LIBCDDB*/
-
- for( i_track = 0 ; i_track < p_cdda->i_tracks ; i_track++ ) {
-
- char track_str[TITLE_MAX];
- mtime_t i_duration =
- (p_cdda->p_lsns[i_track+1] - p_cdda->p_lsns[i_track])
- / CDIO_CD_FRAMES_PER_SEC;
- snprintf(track_str, TITLE_MAX, "%s %02d", _("Track"), i_track+1);
- input_Control( p_cdda->p_input, INPUT_ADD_INFO, track_str,
- _("Duration"), "%s",
- secstotimestr( psz_buffer, i_duration ) );
-
-#ifdef HAVE_LIBCDDB
- if (p_cdda->i_cddb_enabled) {
- cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, i_track);
- if (t != NULL) {
- add_cddb_info_str(track_str, "Artist (CDDB)", t->artist);
- add_cddb_info_str(track_str, "Title (CDDB)", t->title);
- add_cddb_info_str(track_str, "Extended Data (CDDB)", t->ext_data);