Skip to content

Commit

Permalink
Mixtrack3: add option for Library navigation mode: Focus | Classic
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Jan 24, 2025
1 parent d12c564 commit 71c9352
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 13 deletions.
52 changes: 39 additions & 13 deletions res/controllers/Numark-Mixtrack-3-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ var PADcolors = {
"purple": 127
};

// Two modes for the library controls
const libraryModes = {
focus: 0,
classic: 1,
};
const LibraryMode = libraryModes[engine.getSetting("libraryMode")] || libraryModes.focus;

// Utilities
// =====================================================================

Expand Down Expand Up @@ -1084,14 +1091,24 @@ NumarkMixtrack3.BrowseButton = function(channel, control, value, status, group)
);

if (value === ON) {
if (shifted) {
// SHIFT + BROWSE push : maximize/minimize library view
script.toggleControl("[Skin]", "show_maximized_library");
} else {
// Browse push : expand sidebar item or load track when in track table
engine.setValue("[Library]", "GoToItem", true);
}
}
if (LibraryMode === libraryModes.classic) {
if (shifted) {
// SHIFT + BROWSE push : maximize/minimize library view
script.toggleControl("[Skin]", "show_maximized_library");
} else {
// Browse push : expand sidebar item or load track when in track table
engine.setValue("[Library]", "GoToItem", true);
}
} else { // Classic mode
if (shifted) {
// SHIFT + BROWSE push : directory mode -- > Open/Close selected side bar item
engine.setValue("[Library]", "GoToItem", true);
} else {
// Browse push : maximize/minimize library view
script.toggleControl("[Skin]", "show_maximized_library");
}
}
}
};

NumarkMixtrack3.BrowseKnob = function(channel, control, value, status, group) {
Expand All @@ -1103,11 +1120,20 @@ NumarkMixtrack3.BrowseKnob = function(channel, control, value, status, group) {
// value = 1 / 2 / 3 ... for positive //value = 1 / 2 / 3
var nval = (value > 0x40 ? value - 0x80 : value);

// SHIFT+Turn BROWSE Knob : change focus between search, track table, and sidebar
if (shifted) {
engine.setValue("[Library]", "MoveFocus", nval);
} else {
engine.setValue("[Library]", "MoveVertical", nval);
if (LibraryMode === libraryModes.focus) {
// SHIFT+Turn BROWSE Knob : change focus between search, track table, and sidebar
if (shifted) {
engine.setValue("[Library]", "MoveFocus", nval);
} else {
engine.setValue("[Library]", "MoveVertical", nval);
}
} else { // Classic mode
// SHIFT+Turn BROWSE Knob : directory mode --> select Play List/Side bar item
if (shifted) {
engine.setValue("[Playlist]", "SelectPlaylist", nval);
} else {
engine.setValue("[Playlist]", "SelectTrackKnob", nval);
}
}
};

Expand Down
18 changes: 18 additions & 0 deletions res/controllers/Numark-Mixtrack-3.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@
<forums>https://mixxx.discourse.group/t/mixtrack-pro-3/15165</forums>
<wiki>http://www.mixxx.org/wiki/doku.php/numark_mixtrack_pro_3</wiki>
</info>
<settings>
<group label="Library navigation">
<option
variable="libraryMode"
label="Navigation mode"
type="enum">
<value label="Focus" default="true">focus</value>
<value label="Classic">classic</value>
<description>
In Focus mode the Browse encoder affects the library widget which currently has keyboard focus.
This requires the Mixxx window to have focus and allows to control the searchbar, too.

In Classic mode the Browse encoder can select items in the sidebar and tracks table only, but independent
of keyboadr focus.
</description>
</option>
</group>
</settings>
<controller id="Mixtrack3">
<scriptfiles>
<file functionprefix="NumarkMixtrack3" filename="Numark-Mixtrack-3-scripts.js" />
Expand Down

0 comments on commit 71c9352

Please sign in to comment.