File src/mpd.cpp changed (mode: 100644) (index c58c5c2..0348691) |
... |
... |
void update_library_statusbar() |
50 |
50 |
unsigned int percent; |
unsigned int percent; |
51 |
51 |
percent = round(((float)mpd->library.size() / mpd->stats.songs) * 100.00); |
percent = round(((float)mpd->library.size() / mpd->stats.songs) * 100.00); |
52 |
52 |
curses->wipe(&(curses->statusbar), config->colors.statusbar); |
curses->wipe(&(curses->statusbar), config->colors.statusbar); |
53 |
|
curses->print(&(curses->statusbar), config->colors.statusbar, 0, 0, "Retrieving library: %d%%", percent); |
|
|
53 |
|
curses->print(&(curses->statusbar), config->colors.statusbar, 0, 0, "Retrieving library: %d%%%%", percent); |
54 |
54 |
curses->flush(); |
curses->flush(); |
55 |
55 |
} |
} |
56 |
56 |
|
|
File src/song.cpp changed (mode: 100644) (index bacb4be..81eabad) |
... |
... |
void Song::init() |
102 |
102 |
f[FIELD_TRACKSHORT] = f[FIELD_TRACK]; |
f[FIELD_TRACKSHORT] = f[FIELD_TRACK]; |
103 |
103 |
} |
} |
104 |
104 |
|
|
105 |
|
/* replace % with %% for fast printing */ |
|
106 |
|
for (s = 0; s < FIELD_COLUMN_VALUES; ++s) |
|
107 |
|
escape_printf(f[s]); |
|
108 |
|
|
|
109 |
105 |
/* fill out empty fields that might be used for sorting */ |
/* fill out empty fields that might be used for sorting */ |
110 |
106 |
if (f[FIELD_ALBUMARTIST].empty()) |
if (f[FIELD_ALBUMARTIST].empty()) |
111 |
107 |
f[FIELD_ALBUMARTIST] = f[FIELD_ARTIST]; |
f[FIELD_ALBUMARTIST] = f[FIELD_ARTIST]; |
|
... |
... |
string tostring(unsigned long number) |
310 |
306 |
return s.str(); |
return s.str(); |
311 |
307 |
} |
} |
312 |
308 |
|
|
313 |
|
void escape_printf(string &src) |
|
314 |
|
{ |
|
315 |
|
size_t pos = -2; |
|
316 |
|
|
|
317 |
|
while ((pos = src.find('%', pos + 2)) != string::npos) |
|
318 |
|
src.replace(pos, 1, "%%"); |
|
319 |
|
} |
|
320 |
|
|
|
321 |
309 |
long songhash(string const &str) |
long songhash(string const &str) |
322 |
310 |
{ |
{ |
323 |
311 |
static locale loc; |
static locale loc; |
File src/wstatusbar.cpp changed (mode: 100644) (index 06baed4..a5b0b72) |
... |
... |
void Wreadout::drawline(int rely) |
131 |
131 |
else if (win->position >= win->content_size() - win->height() - 1) |
else if (win->position >= win->content_size() - win->height() - 1) |
132 |
132 |
strcpy(buf, "Bot"); |
strcpy(buf, "Bot"); |
133 |
133 |
else |
else |
134 |
|
sprintf(buf, "%2d%%%%", 100 * win->position / (win->content_size() - win->height() - 1)); |
|
|
134 |
|
sprintf(buf, "%2d", 100 * win->position / (win->content_size() - win->height() - 1)); |
135 |
135 |
|
|
136 |
|
curses->print(rect, config->colors.readout, 0, 0, buf); |
|
|
136 |
|
curses->print(rect, config->colors.readout, 0, 0, "%s%%%%", buf); |
137 |
137 |
} |
} |