libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] cdtext reading


From: R. Bernstein
Subject: [Libcdio-devel] cdtext reading
Date: Tue, 4 Oct 2005 05:52:08 -0400

Two pieces of information that might be useful would be what version
of libcdio you are using and with what driver, which can be deduced
from the OS that you are running.

Looking at NEWS I see that as late as version 0.75 there was a bug in
CD-Text retrieval and I think it matches the below behavior. So make
sure to use version 0.75 or greater. Version 0.76 is the current release.

Ross Burton writes:
 > Hi,
 > 
 > I'm adding CD-TEXT support to Sound Juicer and am seeing odd behaviour.
 > I'm probably not understanding the situation properly...
 > 
 > If I do this (album and text are my types):
 > 
 > cdio = cdio_open (NULL, DRIVER_UNKNOWN);
 > /* Get album data */
 > cdtext = cdio_get_cdtext(cdio, 0);
 > album->title = g_strdup (cdtext_get (CDTEXT_TITLE, cdtext));
 > album->artist = g_strdup (cdtext_get (CDTEXT_PERFORMER, cdtext));
 > /* Now iterate over the tracks */
 > cdtrack = cdio_get_first_track_num(cdio);
 > last_cdtrack = cdtrack + cdio_get_num_tracks(cdio);
 > for ( ; cdtrack < last_cdtrack; cdtrack++ ) {
 >   track->album = album;
 >   track->number = cdtrack;
 >   cdtext = cdio_get_cdtext(cdio, cdtrack);
 >   track->title = g_strdup (cdtext_get (CDTEXT_TITLE, cdtext));
 >   track->artist = g_strdup (cdtext_get (CDTEXT_PERFORMER, cdtext));
 >   album->tracks = g_list_append (album->tracks, track);
 > }
 > 
 > Then I end up missing the last track details: track 1 doesn't have
 > artist and title set, and the real data for track 1 is returned for
 > track 2.
 > 
 > However, if I do:
 > 
 > cdio = cdio_open (NULL, DRIVER_UNKNOWN);
 > /* Iterate over the tracks */
 > cdtrack = cdio_get_first_track_num(cdio);
 > last_cdtrack = cdtrack + cdio_get_num_tracks(cdio);
 > for ( ; cdtrack < last_cdtrack; cdtrack++ ) {
 >   track->album = album;
 >   track->number = cdtrack;
 >   cdtext = cdio_get_cdtext(cdio, cdtrack);
 >   track->title = g_strdup (cdtext_get (CDTEXT_TITLE, cdtext));
 >   track->artist = g_strdup (cdtext_get (CDTEXT_PERFORMER, cdtext));
 >   album->tracks = g_list_append (album->tracks, track);
 > }
 > /* Now fill in the album data */
 > cdtext = cdio_get_cdtext(cdio, 0);
 > album->title = g_strdup (cdtext_get (CDTEXT_TITLE, cdtext));
 > album->artist = g_strdup (cdtext_get (CDTEXT_PERFORMER, cdtext));
 > 
 > Then the data is correct.  Am I doing something wrong here?  The flow of
 > the first code sample is more logical and fits into the error handling
 > far easier, so I'd prefer to use it.
 > 
 > Despite this problem I'm very pleased with how easy it is to get CD-TEXT
 > data with libcdio, many thanks!
 > 
 > Cheers,
 > Ross
 > -- 
 > Ross Burton                                 mail: address@hidden
 >                                           jabber: address@hidden
 >                                      www: http://www.burtonini.com./
 >  PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF
 > 
 > 
 > 
 > 
 > 
 > _______________________________________________
 > Libcdio-devel mailing list
 > address@hidden
 > http://lists.gnu.org/mailman/listinfo/libcdio-devel
 > 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]