Raffaello/sdl2-hyper-sonic-drivers

MIDDrv simplifying

Opened this issue · 0 comments

instead of a thread and delaying until the next ticks,
can use a callbacks to increase the delta_time ticks instead?
this can be done either in the onTimer function of the opl...

review and simplyfing MIDDrv and the other secondary "MIDI Drv" like using a OplDriver from devices

can be simplified with less going around classes and wrapper.

Also to emulate hardware interrupt, SDL2 could be used to push the event to the SDL2 queue? (or implement it's own?)


need better thoughts on this ticket in general, as the thread is ok.
the waiting/ thread sleep algorithm part might be improved to try to be most precise as possible.

The classes to be reduces, not sure how can be reduces,
Probably instead of MIDDrv it should be instead having another wrapper around ADLDriver too and create a sort of MusicDriver ? not sure yet. so quite premature at the moment.


The only thing that could be done is improving sthe subroutine of the delay, waiting:

the best approach is to get the start time adding the delay and wait until the end time is >= start time + delay.
so if there are some quick operation in between, like preventing very long delays where it could not neither stop until the delay is over, it can be quite precise.