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

changed 'search' command to 'filter', which is more intuitive given 'clear-filters'
Author: Bart Nagel
Author date (UTC): 2010-05-13 15:49
Committer name: Bart Nagel
Committer date (UTC): 2010-05-13 15:49
Parent(s): 61908b4133b1485552fd6819799da56e2d231f7e
Signing key:
Tree: adce411fd75ecc046f7942d012c89159be5bde7b
File Lines added Lines deleted
ChangeLog 1 1
pms.1 3 3
src/action.cpp 6 6
src/command.cpp 2 2
src/command.h 1 1
src/input.cpp 4 4
src/input.h 1 1
src/pms.cpp 1 1
src/types.h 1 1
File ChangeLog changed (mode: 100644) (index a886fcd..9a08b81)
... ... Changes in 0.42~git
4 4
5 5 Kim Tore Jensen: Kim Tore Jensen:
6 6 2010-01-03: changed: the 'save' command now saves the current list view (with any filters applied) instead of the playlist. 2010-01-03: changed: the 'save' command now saves the current list view (with any filters applied) instead of the playlist.
7 2010-01-03: added: 'search' command which adds a list filter, and the 'clear-filters' command.
7 2010-01-03: added: 'filter' command which adds a list filter, and the 'clear-filters' command.
8 8 2009-10-11: fixed: the 'volume' command now correctly sets absolute values. 2009-10-11: fixed: the 'volume' command now correctly sets absolute values.
9 9 2009-10-10: added: the update-library command now accepts more parameters: this, thisdir, current, currentdir, and any arbitrary file or directory. 2009-10-10: added: the update-library command now accepts more parameters: this, thisdir, current, currentdir, and any arbitrary file or directory.
10 10 2009-10-10: dropped the 'follow' option. 2009-10-10: dropped the 'follow' option.
File pms.1 changed (mode: 100644) (index 30d92ad..c5ec5cc)
... ... Move the cursor to the end of the list
650 650 .B center-cursor .B center-cursor
651 651 .RB "Scroll the list such that the cursor is centered (only has an effect when " "scroll" " is set to " "normal" ")" .RB "Scroll the list such that the cursor is centered (only has an effect when " "scroll" " is set to " "normal" ")"
652 652 .TP .TP
653 .B search
654 Enter search mode: type to search for songs. Songs that don't match are removed from the view. Use the
653 .B filter
654 Enter filter mode: type to filter the current view for songs. Songs that don't match are removed from the view. Use the
655 655 .B clear-filters .B clear-filters
656 656 command to return to the original view. command to return to the original view.
657 657 .TP .TP
658 658 .B clear-filters .B clear-filters
659 Clear all search filters from the current playlist.
659 Clear all filters from the current playlist.
660 660 .TP .TP
661 661 .B quick-find .B quick-find
662 662 Enter quick-find mode: type to jump to next matched song Enter quick-find mode: type to jump to next matched song
File src/action.cpp changed (mode: 100644) (index 58d5901..38d78f2)
... ... bool Interface::check_events()
217 217
218 218
219 219
220 case PEND_SEARCHMODE:
221 set_input_mode(INPUT_SEARCH);
220 case PEND_FILTERMODE:
221 set_input_mode(INPUT_FILTER);
222 222 break; break;
223 223
224 224 case PEND_COMMANDMODE: case PEND_COMMANDMODE:
 
... ... int Interface::set_input_mode(Input_mode mode)
441 441 { {
442 442 Songlist * list; Songlist * list;
443 443
444 if (mode == INPUT_JUMP || mode == INPUT_SEARCH)
444 if (mode == INPUT_JUMP || mode == INPUT_FILTER)
445 445 { {
446 446 if (!pms->disp->actwin() || pms->disp->actwin()->type() != WIN_ROLE_PLAYLIST) if (!pms->disp->actwin() || pms->disp->actwin()->type() != WIN_ROLE_PLAYLIST)
447 447 { {
 
... ... bool handle_command(pms_pending_keys action)
1394 1394
1395 1395 //else do nothing so the search command is left visible //else do nothing so the search command is left visible
1396 1396 } }
1397 else if (mode == INPUT_SEARCH)
1397 else if (mode == INPUT_FILTER)
1398 1398 { {
1399 1399 if (!list) break; if (!list) break;
1400 1400 list->filter_add(pms->input->text, MATCH_ALL); list->filter_add(pms->input->text, MATCH_ALL);
 
... ... bool init_commandmap()
2050 2050 pms->commands->add("quick-find", "Go to jump mode", PEND_JUMPMODE); pms->commands->add("quick-find", "Go to jump mode", PEND_JUMPMODE);
2051 2051 pms->commands->add("next-of", "Jump to next of given field", PEND_NEXTOF); pms->commands->add("next-of", "Jump to next of given field", PEND_NEXTOF);
2052 2052 pms->commands->add("prev-of", "Jump to previous of given field", PEND_PREVOF); pms->commands->add("prev-of", "Jump to previous of given field", PEND_PREVOF);
2053 pms->commands->add("search", "Go to search/filtering mode", PEND_SEARCHMODE);
2054 pms->commands->add("clear-filters", "Clear search filters", PEND_CLEARFILTERS);
2053 pms->commands->add("filter", "Go to filtering mode", PEND_FILTERMODE);
2054 pms->commands->add("clear-filters", "Clear filters", PEND_CLEARFILTERS);
2055 2055
2056 2056 /* Playback */ /* Playback */
2057 2057 pms->commands->add("play", "Play song under cursor", PEND_PLAY); pms->commands->add("play", "Play song under cursor", PEND_PLAY);
File src/command.cpp changed (mode: 100644) (index 2914814..ca09c0f)
... ... void Control::get_available_commands()
378 378 commands.rm = true; commands.rm = true;
379 379 else if (s == "save") else if (s == "save")
380 380 commands.save = true; commands.save = true;
381 else if (s == "search")
382 commands.search = true;
381 else if (s == "filter")
382 commands.filter = true;
383 383 else if (s == "seek") else if (s == "seek")
384 384 commands.seek = true; commands.seek = true;
385 385 else if (s == "seekid") else if (s == "seekid")
File src/command.h changed (mode: 100644) (index e6c5372..5c42924)
... ... typedef struct
100 100 bool repeat; bool repeat;
101 101 bool rm; bool rm;
102 102 bool save; bool save;
103 bool search;
103 bool filter;
104 104 bool seek; bool seek;
105 105 bool seekid; bool seekid;
106 106 bool setvol; bool setvol;
File src/input.cpp changed (mode: 100644) (index 3f78caf..3395d08)
... ... bool Input::gonext()
84 84 { {
85 85 vector<string>::const_iterator e; vector<string>::const_iterator e;
86 86
87 if (_mode == INPUT_JUMP || _mode == INPUT_SEARCH)
87 if (_mode == INPUT_JUMP || _mode == INPUT_FILTER)
88 88 e = searchhistory.end(); e = searchhistory.end();
89 89 else if (_mode == INPUT_COMMAND) else if (_mode == INPUT_COMMAND)
90 90 e = cmdhistory.end(); e = cmdhistory.end();
 
... ... bool Input::goprev()
112 112 { {
113 113 vector<string>::const_iterator e; vector<string>::const_iterator e;
114 114
115 if (_mode == INPUT_JUMP || _mode == INPUT_SEARCH)
115 if (_mode == INPUT_JUMP || _mode == INPUT_FILTER)
116 116 e = searchhistory.begin(); e = searchhistory.begin();
117 117 else if (_mode == INPUT_COMMAND) else if (_mode == INPUT_COMMAND)
118 118 e = cmdhistory.begin(); e = cmdhistory.begin();
 
... ... void Input::mode(Input_mode m)
142 142 break; break;
143 143
144 144 case INPUT_JUMP: case INPUT_JUMP:
145 case INPUT_SEARCH:
145 case INPUT_FILTER:
146 146 text.clear(); text.clear();
147 147 searchterm.clear(); searchterm.clear();
148 148 historypos = searchhistory.end(); historypos = searchhistory.end();
 
... ... void Input::savehistory()
599 599 switch(_mode) switch(_mode)
600 600 { {
601 601 case INPUT_JUMP: case INPUT_JUMP:
602 case INPUT_SEARCH:
602 case INPUT_FILTER:
603 603 searchhistory.push_back(text); searchhistory.push_back(text);
604 604 historypos = searchhistory.end(); historypos = searchhistory.end();
605 605 break; break;
File src/input.h changed (mode: 100644) (index 2297fb9..4e1c609)
... ... typedef enum Input_mode
41 41 { {
42 42 INPUT_NORMAL, INPUT_NORMAL,
43 43 INPUT_JUMP, INPUT_JUMP,
44 INPUT_SEARCH,
44 INPUT_FILTER,
45 45 INPUT_COMMAND, INPUT_COMMAND,
46 46 INPUT_LIST INPUT_LIST
47 47
File src/pms.cpp changed (mode: 100644) (index 219d8f7..3d09c6b)
... ... void Pms::drawstatus()
774 774 { {
775 775 if (input->mode() == INPUT_JUMP) if (input->mode() == INPUT_JUMP)
776 776 log(MSG_STATUS, STOK, "/%s", formtext(input->text).c_str()); log(MSG_STATUS, STOK, "/%s", formtext(input->text).c_str());
777 else if (input->mode() == INPUT_SEARCH)
777 else if (input->mode() == INPUT_FILTER)
778 778 log(MSG_STATUS, STOK, ":g/%s", formtext(input->text).c_str()); log(MSG_STATUS, STOK, ":g/%s", formtext(input->text).c_str());
779 779 else if (input->mode() == INPUT_COMMAND) else if (input->mode() == INPUT_COMMAND)
780 780 log(MSG_STATUS, STOK, ":%s", formtext(input->text).c_str()); log(MSG_STATUS, STOK, ":%s", formtext(input->text).c_str());
File src/types.h changed (mode: 100644) (index 3c5e078..91c7b26)
... ... typedef enum
70 70 PEND_RETURN_ESCAPE, PEND_RETURN_ESCAPE,
71 71
72 72 PEND_JUMPMODE, PEND_JUMPMODE,
73 PEND_SEARCHMODE,
73 PEND_FILTERMODE,
74 74 PEND_CLEARFILTERS, PEND_CLEARFILTERS,
75 75 PEND_PREVOF, PEND_PREVOF,
76 76 PEND_NEXTOF, PEND_NEXTOF,
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