[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    Bug#2586: KSCD track navigation not "normal"
From:       David Joham <djoham () netscape ! net>
Date:       2000-01-30 8:19:56
[Download RAW message or body]


Package: kdemultimedia
Version: 1.2.2

Most CD Players will start the current track over when the "previous" button
on the console is pressed during the song. If the button is pressed in the
first few seconds of the song, then the track is decremented.

KSCD, however will *always* go the previous track. This makes trying to repeat
the current song more difficult that it has to be. You have to press the
previous button and then the next button or select the track again from the
drop down box. I finally got annoyed enough tonight to fix this.

The fix is in kscd.cpp in the prevClicked() function

The old code is as follows:
void KSCD::prevClicked(){
 
    setLEDs("00:00");
    qApp->processEvents();
    qApp->flushX();
 
    if(playlist.count()>0){
        playlistpointer--;
        if(playlistpointer < 0 )
            playlistpointer = playlist.count() -1;
        cur_track = atoi(playlist.at(playlistpointer));
    }
    else{
        cur_track--;
        if (cur_track < 1)
            cur_track = cur_ntracks;
    }
    if(randomplay){
        play_cd (cur_track, 0, cur_track + 1);
    }
    else{
        play_cd (cur_track, 0, cur_ntracks + 1);
    }
 
} 


I propose that in the future the code read like this:

void KSCD::prevClicked(){
 
    setLEDs("00:00");
    qApp->processEvents();
    qApp->flushX();
 
    if(playlist.count()>0){
        playlistpointer--;
        if(playlistpointer < 0 )
            playlistpointer = playlist.count() -1;
        cur_track = atoi(playlist.at(playlistpointer));
    }
    else{
 
        // 30 Jan 2000 changed by djoham@netscape.net
        // Repeat the current track unless we've
        // played less then two seconds of it
        // In that case, move the previous track
 
        if (cur_pos_rel > 2){
           cur_track = cur_track;
        }
        else{
           cur_track--;
        }
 
        if (cur_track < 1)
            cur_track = cur_ntracks;
    }
    if(randomplay){      
        play_cd (cur_track, 0, cur_track + 1);
    }
    else{
        play_cd (cur_track, 0, cur_ntracks + 1);
    }
 
}
 

Best regards,

David Joham
djoham@netscape.net

____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic