xaizek / pms (License: GPLv3+) (since 2018-12-07)
Older version of Practical Music Search written in C++.
Commit 9adfc20b4bafda332424a3e68b3e47cf979d52ca

Fix some compile problems when optimizing with -O2.
Author: Kim Tore Jensen
Author date (UTC): 2012-08-16 13:30
Committer name: Kim Tore Jensen
Committer date (UTC): 2012-08-16 13:30
Parent(s): c3a87ccac055c2c45dbf988235c53b5d362acddf
Signing key:
Tree: 882437dba291442eaa00d7dc95a0f51f2ef79c87
File Lines added Lines deleted
Makefile.am 1 1
src/field.cpp 2 2
src/mpd.cpp 1 1
src/song.cpp 0 12
src/window.cpp 1 1
src/wstatusbar.cpp 2 2
File Makefile.am changed (mode: 100644) (index a6f2830..820aea2)
1 1 SUBDIRS = src SUBDIRS = src
2 dist_doc_DATA = README.md
2 dist_doc_DATA = README
3 3 ACLOCAL_AMFLAGS = -I m4 --install ACLOCAL_AMFLAGS = -I m4 --install
File src/field.cpp changed (mode: 100644) (index fcd0dc7..9a73006)
... ... string Field::format(Song * song)
77 77
78 78 case FIELD_VOLUME: case FIELD_VOLUME:
79 79 if (mpd->status.volume == 0 && config->mute) if (mpd->status.volume == 0 && config->mute)
80 tmp = "Muted (" + tostring(config->volume) + "%%)";
80 tmp = "Muted (" + tostring(config->volume) + "%%%%)";
81 81 else else
82 tmp = tostring(mpd->status.volume) + "%%";
82 tmp = tostring(mpd->status.volume) + "%%%%";
83 83 return tmp; return tmp;
84 84
85 85 case FIELD_MODES: case FIELD_MODES:
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/window.cpp changed (mode: 100644) (index 74cbfb2..175dd8b)
... ... void Window::draw()
42 42 drawline(i); drawline(i);
43 43 } }
44 44
45 inline void Window::qdraw()
45 void Window::qdraw()
46 46 { {
47 47 need_draw = true; need_draw = true;
48 48 } }
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 } }
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/pms

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/pms

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master