Need MIDI scripting timer(s)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Fix Released
|
Wishlist
|
Sean M. Pappalardo |
Bug Description
We should probably implement a way for certain MIDI script functions to be called at regular intervals whether or not the controller was manipulated or a ControlObject:
A few script developers have asked about this functionality.
The current workaround involves connecting a function to [ChannelX] playposition (whose valueChanged signal fires every latency period) and setting/checking a global variable with the current time in milliseconds like so:
if (StantonSCS1m.
if (new Date() - StantonSCS1m.
StantonSCS
...
}
It works, but it's inaccurate and only works while the track is playing.
Changed in mixxx: | |
assignee: | nobody → pegasus-renegadetech |
importance: | Undecided → Wishlist |
milestone: | none → 1.8.0 |
status: | New → Confirmed |
description: | updated |
Changed in mixxx: | |
status: | Fix Committed → Fix Released |
Possible implementation:
Have something like a QMap in the MIDIScriptEngine that stores objects which contain the values passed to initTimer as well as a 'run' flag and a 'next trigger' value which is the interval value plus the current time (in ms) as the key. Then the event loop can continually check the QMap for time values that match the current time. When one does (and the 'run' flag is set,) update the 'next trigger' value and call the specified script function. startTimer and stopTimer would obviously just set and clear the 'run' flag respectively (and update the 'next trigger' value.)
Any problems with this?