#54 Track selection lost upon completion of cddb lookup

Bug
open
Mike Oliphant
None
4
2002-01-06
2001-10-13
Taku YASUI
No

Insert CD and select some tracks before CDDB loookup
completes. When
lookup completes, track selection is lost.

This is from Debian Bug tracking system:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=109649

Discussion

  • Taku YASUI
    Taku YASUI
    2001-10-13

    • summary: Track selection lost upon completion of --> Track selection lost upon completion of cddb lookup
     
  • Logged In: YES
    user_id=29358

    Here's a patch to fix it.

    --- grip.c~ Thu Oct 18 22:04:56 2001
    +++ grip.c Mon Oct 22 19:30:52 2001
    @@ -1936,6 +1936,7 @@
    int track;
    char buf[PATH_MAX];
    char *col_strings[3];
    + char checked_tracks[256];

    if(have_disc) {
    auto_eject_countdown=0; /* Reset to make sure we don't
    eject twice */
    @@ -1973,8 +1974,12 @@

    gtk_entry_set_text(GTK_ENTRY(playlist_entry),ddata.data_playlist);

    - if(!first_time)
    + if(!first_time) {
    + // Save the track selection (for ripping) status.
    + for(track=0;track<info.disc_totaltracks;track++)
    + checked_tracks[track] = TrackIsChecked(track);
    gtk_clist_clear(GTK_CLIST(trackclist));
    + }
    else {
    setCurrentTrackIndex(info.disc_track - 1);
    }
    @@ -2008,6 +2013,10 @@
    info.track[track].track_length.seconds);

    gtk_clist_append(GTK_CLIST(trackclist),col_strings);
    +
    + // Restore the track selection (for ripping) status.
    + if (!first_time)
    + SetChecked(track, checked_tracks[track]);
    }

    free(col_strings[0]);

     
  • Logged In: YES
    user_id=29358

    One small cleanup to my patch. This line in the first hunk
    of diff:

    + char checked_tracks[256];

    should be:

    + char checked_tracks[MAX_TRACKS];

     
  • Logged In: YES
    user_id=29358

    Here's a revised version of the patch that has the proper
    protection so it compiles as gcd as well as grip.

    --- grip.c~ Thu Oct 18 22:04:56 2001
    +++ grip.c Mon Oct 22 19:30:52 2001
    @@ -1936,6 +1936,9 @@
    int track;
    char buf[PATH_MAX];
    char *col_strings[3];
    +#ifndef GRIPCD
    + char checked_tracks[MAX_TRACKS];
    +#endif

    if(have_disc) {
    auto_eject_countdown=0; /* Reset to make sure we don't
    eject twice */
    @@ -1973,8 +1974,14 @@

    gtk_entry_set_text(GTK_ENTRY(playlist_entry),ddata.data_playlist);

    - if(!first_time)
    + if(!first_time) {
    +#ifndef GRIPCD
    + // Save the track selection (for ripping) status.
    + for(track=0;track<info.disc_totaltracks;track++)
    + checked_tracks[track] = TrackIsChecked(track);
    +#endif
    gtk_clist_clear(GTK_CLIST(trackclist));
    + }
    else {
    setCurrentTrackIndex(info.disc_track - 1);
    }
    @@ -2008,6 +2013,12 @@
    info.track[track].track_length.seconds);

    gtk_clist_append(GTK_CLIST(trackclist),col_strings);
    +
    +#ifndef GRIPCD
    + // Restore the track selection (for ripping) status.
    + if (!first_time)
    + SetChecked(track, checked_tracks[track]);
    +#endif
    }

    free(col_strings[0]);

     
  • Mike Oliphant
    Mike Oliphant
    2002-01-06

    • milestone: --> Bug
    • priority: 5 --> 4
    • assigned_to: nobody --> oliphant