-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Numark-Mixtrack-3-scripts.js #14180
Open
endcredits33
wants to merge
6
commits into
mixxxdj:2.5
Choose a base branch
from
endcredits33:2.5
base: 2.5
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9351e0c
Update Numark-Mixtrack-3-scripts.js
endcredits33 5334a1c
Update res/controllers/Numark-Mixtrack-3-scripts.js
endcredits33 d12c564
Update Numark-Mixtrack-3-scripts.js
endcredits33 71c9352
Mixtrack3: add option for Library navigation mode: Focus | Classic
ronso0 ec8b021
Merge pull request #2 from ronso0/mixtrack-browse-settings
endcredits33 a5e443c
Update Numark-Mixtrack-3-scripts.js
endcredits33 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 | ||||||
// ===================================================================== | ||||||
|
||||||
|
@@ -1078,36 +1085,55 @@ NumarkMixtrack3.PlayButton = function(channel, control, value, status, group) { | |||||
}; | ||||||
|
||||||
NumarkMixtrack3.BrowseButton = function(channel, control, value, status, group) { | ||||||
var shifted = (NumarkMixtrack3.decks.D1.shiftKey || NumarkMixtrack3.decks. | ||||||
D2.shiftKey || NumarkMixtrack3.decks.D3.shiftKey || NumarkMixtrack3.decks.D4.shiftKey); | ||||||
const shifted = ( | ||||||
NumarkMixtrack3.decks.D1.shiftKey || NumarkMixtrack3.decks.D2.shiftKey || | ||||||
NumarkMixtrack3.decks.D3.shiftKey || NumarkMixtrack3.decks.D4.shiftKey | ||||||
); | ||||||
|
||||||
if (value === ON) { | ||||||
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 | ||||||
if (value === ON) { | ||||||
script.toggleControl("[Skin]", "show_maximized_library"); | ||||||
} | ||||||
} | ||||||
if (LibraryMode === libraryModes.focus) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
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) { | ||||||
var shifted = ( | ||||||
const shifted = ( | ||||||
NumarkMixtrack3.decks.D1.shiftKey || NumarkMixtrack3.decks.D2.shiftKey || | ||||||
NumarkMixtrack3.decks.D3.shiftKey || NumarkMixtrack3.decks.D4.shiftKey | ||||||
); | ||||||
|
||||||
// value = 1 / 2 / 3 ... for positive //value = 1 / 2 / 3 | ||||||
var nval = (value > 0x40 ? value - 0x80 : value); | ||||||
|
||||||
// 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); | ||||||
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); | ||||||
} | ||||||
} | ||||||
}; | ||||||
|
||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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. | ||||||||||
Comment on lines
+23
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
</description> | ||||||||||
</option> | ||||||||||
</group> | ||||||||||
</settings> | ||||||||||
<controller id="Mixtrack3"> | ||||||||||
<scriptfiles> | ||||||||||
<file functionprefix="NumarkMixtrack3" filename="Numark-Mixtrack-3-scripts.js" /> | ||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove this part entirely if you do the below instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the benefit of querying the settings each time compared to this const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simplicity. As long as its not done in a tight loop, querying the setting should not be expensive. Doing all of this mapping is unnecessarily weird IMO. Additionally, global
const
s in mappings are kind off iffy (can suddenly break other things due to the way JS modules work, so thats why its always been encouraged to only add properties to the controller object instead of the global one).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmokay.
tight loop = called at high frequency?
So
NumarkMixtrack3.libraryMode = engine.getSetting()..
would be okay?And settings is not an object of NumarkMixtrack3 here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
Yes, better than the current one... But I won't insist on this.