Midi Channel Filter

This can be fixed in the mod-ui client. Ugly, but it works :see_no_evil:

Following will put MIDI plugins to the MIDI category and unknown plugins to a new category called Other.

Modifiy /usr/share/mod/html/index.html and add following lines to the div called plugin-results-wrapper:

<div id="plugin-results-wrapper">
  (...)

  <div id="effect-content-MIDIPlugin" class="plugins-wrapper"></div>

  (...)

  <div id="effect-content-Other" class="plugins-wrapper"></div>

  (...)

</div>

and add following li’s to the js-category-tabs ul:

<ul class="clearfix js-category-tabs">

  (...)
  
  <li id="effect-tab-MIDIPlugin">MIDI</li>

  (...)

  <li id="effect-tab-Other">Other</li>

  (...)

</ul>

In /usr/share/mod/html/js/effects.js modify the function renderNextPlugin thats embedded in the showPlugins function to:

function renderNextPlugin(c) {
            if (self.data('showPluginsRenderId') != currentRenderId) {
                // another render is in place, stop this one
                if (callback) { callback() }
                return
            }

            if (renderedIndex >= pluginCount) {
                // if we get here it means we finished rendering
                self.effectBox('calculateNavigation')

                if (self.data('showPluginsRenderId') == currentRenderId) {
                    // no other renders in queue, take the chance and reset the id
                    self.data('showPluginsRenderId', 0)
                }
                if (callback) { callback() }
                return
            }

            plugin   = plugins[renderedIndex]
            category = plugin.category[0]

            self.effectBox('renderPlugin', plugin, self.find('#effect-content-All'))

            if (FAVORITES.indexOf(plugin.uri) >= 0) {
                self.effectBox('renderPlugin', plugin, self.find('#effect-content-Favorites'))
            }

            if(!category){
              category = (plugin.label.match(/MIDI/gi) || plugin.name.match(/MIDI/gi)) ? "MIDIPlugin" : "Other";
            }

            if (category && category != 'All') {
                self.effectBox('renderPlugin', plugin, self.find('#effect-content-' + category))
            }

            renderedIndex += 1

            c = c || 0;
            if (c < 20) renderNextPlugin(c+1);
            else setTimeout(renderNextPlugin, 1);
        }

Don’t know how to highlight code, so put this:

            if(!category){
              category = (plugin.label.match(/MIDI/gi) || plugin.name.match(/MIDI/gi)) ? "MIDIPlugin" : "Other";
            }

before:

            if (category && category != 'All') {
                self.effectBox('renderPlugin', plugin, self.find('#effect-content-' + category))
            }