Comment 1 for bug 368992

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

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?