Skip to content

Conversation

@milkdropper
Copy link
Collaborator

Enhancement to the preset navigation menu previously submitted. Hit return and start typing to filter to presets based on keyword (case sensitive). It's limited to a single page for now (hopefully good enough).

obligatory demo: https://streamable.com/f8gbf1

@milkdropper milkdropper marked this pull request as draft August 15, 2020 15:26
* Cmd/Ctrl-M: change *m*onitor
* Cmd/Ctrl-F: toggle *f*ull screen
* Mouse Scroll Up / Down: next or previous preset (hard transition)
* Return: search for preset (RETURN or ESCAPE to exit search)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe / too, vim-style?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started with this but gave up because of how SDL_StartTextInput will still grab the / key. I am likely missing something, but this could be a wish list.

{
case PROJECTM_K_HOME:
if (renderer->showmenu) { // pageup only does something when the preset menu is active.
if (renderer->showmenu && !isTextInputActive()) { // pageup only does something when the preset menu is active.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these could be all simplified to if (isTextInputActive()) break;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

const unsigned int PresetLoader::getPresetIndex(std::string &name) const
{
//Need a better structure than a vector for reverse lookup
for (int index = 0; index < _presetNames.size(); index++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there an indexOf() method or something like that in Vector?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

else {
if (highlightable && showsearch && searchText().length() > 1)
{
int offset = x;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can these be separate functions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

{
int offset = x;
std::string str_find = substring;
for (size_t pos = 0; ; pos += str_find.length()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactor with above to function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@milkdropper milkdropper force-pushed the search branch 2 times, most recently from 768cbfa to 71ea3b8 Compare September 1, 2020 05:31
@milkdropper milkdropper marked this pull request as ready for review September 2, 2020 11:26
@milkdropper milkdropper merged commit be446c4 into projectM-visualizer:master Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants