common-controller-scripts: add script.getPlaypositionSamples - #16797
Open
gary-gdbsystems wants to merge 1 commit into
Open
common-controller-scripts: add script.getPlaypositionSamples#16797gary-gdbsystems wants to merge 1 commit into
gary-gdbsystems wants to merge 1 commit into
Conversation
Add a mapping script helper that returns the current play position of a group as an absolute engine sample position (the same unit as loop_end_position and other absolute position controls), computed from the relative "playposition" control and "track_samples". In issue mixxxdj#12950 the maintainers (Holzhaus, ronso0) chose a JavaScript helper over a new sample-based ControlObject or new C++ engine API, since it is a simple multiplication and they are migrating to frame-based controls. This implements that decision and supersedes the closed PR mixxxdj#16786, which added a C++ engine method instead. Resolves mixxxdj#12950.
gary-gdbsystems
force-pushed
the
script-getplaypositionsamples-helper
branch
from
August 11, 2026 22:03
98bdd19 to
33337fa
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Resolves #12950.
Adds a mapping script helper
script.getPlaypositionSamples(group)that returns the current play position of a group as an absolute engine sample position — the same unit asloop_end_positionand other absolute position controls — computed from the relativeplaypositioncontrol andtrack_samples:Why a script helper (not a ControlObject or C++ API)
In the issue thread, @Holzhaus and @ronso0 explicitly chose a JavaScript helper over adding a new sample-based ControlObject:
This PR implements exactly that, and supersedes the closed #16786, which added a C++
engine.getPlaypositionSamples()method instead of the requested script helper.Changes
res/controllers/common-controller-scripts.js— one helper function (+8 lines).Testing
ControllerScriptEngineLegacyTestpasses (41/41), includingcommonScriptHasNoErrors, which evaluates the fullcommon-controller-scripts.jsin the JS engine.