| File src/display.cpp changed (mode: 100644) (index 476e8f3..1064bf7) |
| ... |
... |
void pms_win_playlist::draw() |
| 734 |
734 |
} |
} |
| 735 |
735 |
else if (pms->cursong() && song->file == pms->cursong()->file) |
else if (pms->cursong() && song->file == pms->cursong()->file) |
| 736 |
736 |
{ |
{ |
| 737 |
|
if (song->pos == MPD_SONG_NO_NUM || pms->cursong()->pos == song->pos) |
|
|
737 |
|
if (list->role != LIST_ROLE_MAIN || (list->role == LIST_ROLE_MAIN && pms->cursong()->pos == song->pos)) |
| 738 |
738 |
{ |
{ |
| 739 |
739 |
hilight = pms->options->colors->current; |
hilight = pms->options->colors->current; |
| 740 |
740 |
} |
} |
| File src/list.cpp changed (mode: 100644) (index 4c15ad7..8e48718) |
| ... |
... |
Songlist::Songlist() |
| 53 |
53 |
filename = ""; |
filename = ""; |
| 54 |
54 |
selection.size = 0; |
selection.size = 0; |
| 55 |
55 |
selection.length = 0; |
selection.length = 0; |
|
56 |
|
role = LIST_ROLE_PLAYLIST; |
| 56 |
57 |
ignorecase = pms->options->get_bool("ignorecase"); |
ignorecase = pms->options->get_bool("ignorecase"); |
| 57 |
58 |
} |
} |
| 58 |
59 |
|
|
| |
| ... |
... |
Song * Songlist::nextsong(song_t * id) |
| 93 |
94 |
} |
} |
| 94 |
95 |
|
|
| 95 |
96 |
/* Find the current song in this list */ |
/* Find the current song in this list */ |
| 96 |
|
if (s->pos != MPD_SONG_NO_NUM) |
|
|
97 |
|
if (s->pos != MPD_SONG_NO_NUM && role == LIST_ROLE_MAIN) |
| 97 |
98 |
i = match(Pms::tostring(pms->cursong()->pos), 0, end(), MATCH_POS); |
i = match(Pms::tostring(pms->cursong()->pos), 0, end(), MATCH_POS); |
| 98 |
99 |
|
|
| 99 |
100 |
if (i == MATCH_FAILED) |
if (i == MATCH_FAILED) |
| |
| ... |
... |
song_t Songlist::add(Song * song) |
| 494 |
495 |
songs.push_back(song); |
songs.push_back(song); |
| 495 |
496 |
if (filter_match(song)) |
if (filter_match(song)) |
| 496 |
497 |
filtersongs.push_back(song); |
filtersongs.push_back(song); |
|
498 |
|
song->pos = static_cast<song_t>(songs.size() - 1); |
| 497 |
499 |
} |
} |
| 498 |
500 |
else |
else |
| 499 |
501 |
{ |
{ |
| |
| ... |
... |
song_t Songlist::add(Song * song) |
| 508 |
510 |
/* FIXME: filtersongs does not get updated because of ->pos mismatch, but do we need it anyway? */ |
/* FIXME: filtersongs does not get updated because of ->pos mismatch, but do we need it anyway? */ |
| 509 |
511 |
} |
} |
| 510 |
512 |
|
|
| 511 |
|
if (song->pos == MPD_SONG_NO_NUM) |
|
| 512 |
|
{ |
|
| 513 |
|
song->pos = static_cast<song_t>(songs.size() - 1); |
|
| 514 |
|
} |
|
| 515 |
|
|
|
| 516 |
513 |
if (song->time != MPD_SONG_NO_TIME) |
if (song->time != MPD_SONG_NO_TIME) |
| 517 |
514 |
{ |
{ |
| 518 |
515 |
length += song->time; |
length += song->time; |
| |
| ... |
... |
bool Songlist::gotocurrent() |
| 723 |
720 |
|
|
| 724 |
721 |
if (!pms->cursong()) return false; |
if (!pms->cursong()) return false; |
| 725 |
722 |
|
|
| 726 |
|
if (pms->cursong()->pos != MPD_SONG_NO_NUM) |
|
|
723 |
|
if (pms->cursong()->pos != MPD_SONG_NO_NUM && role == LIST_ROLE_MAIN) |
| 727 |
724 |
i = match(Pms::tostring(pms->cursong()->pos), 0, end(), MATCH_POS | MATCH_EXACT); |
i = match(Pms::tostring(pms->cursong()->pos), 0, end(), MATCH_POS | MATCH_EXACT); |
| 728 |
725 |
if (i == MATCH_FAILED) |
if (i == MATCH_FAILED) |
| 729 |
726 |
i = match(pms->cursong()->file, 0, end(), MATCH_FILE | MATCH_EXACT); |
i = match(pms->cursong()->file, 0, end(), MATCH_FILE | MATCH_EXACT); |