Scripts should have access to a ControlObject like ScriptValue

Bug #398350 reported by RJ Skerry-Ryan
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Mixxx
Confirmed
Wishlist
Unassigned

Bug Description

Currently scripts only access control objects via a line like:

engine.getValue("[Channel1]","playposition");
engine.setValue("[Channel1]","playposition", foo);

Which inevitably leads to code like:

var add = 10;
var curVal = engine.getValue("[Channel1]","playposition");
engine.setValue("[Channel1]","playposition", curVal+add);

This is not ideal, at all. Especially considering ControlObjects support add/sub so you dont have to get the value first.

We should expose ControlObject functionality as objects in QtScript.

This involves writing a wrapper around ControlObjectThread that supports the various operations we would like to support in script. We may even be able to provide the ControlObjectThread itself, though we'll need to review how safe that is.

This will lead to more readable script code. Also it will make scripts slightly faster since they don't have to do a lookup for the COT every time you get or set the value.

Tags: midi
RJ Skerry-Ryan (rryan)
Changed in mixxx:
importance: Undecided → Wishlist
status: New → Confirmed
tags: added: midi
Be (be.ing)
Changed in mixxx:
milestone: none → 2.4.0
Be (be.ing)
Changed in mixxx:
milestone: 2.4.0 → none
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5190

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.