Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDDrv simplifying #202

Open
Raffaello opened this issue Sep 7, 2022 · 0 comments
Open

MIDDrv simplifying #202

Raffaello opened this issue Sep 7, 2022 · 0 comments
Assignees
Labels
driver driver related enhancement New feature or request refactor refactoring code, same functionality, but better code

Comments

@Raffaello
Copy link
Owner

Raffaello commented Sep 7, 2022

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.

@Raffaello Raffaello added enhancement New feature or request refactor refactoring code, same functionality, but better code driver driver related labels Sep 7, 2022
@Raffaello Raffaello self-assigned this Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
driver driver related enhancement New feature or request refactor refactoring code, same functionality, but better code
Projects
None yet
Development

No branches or pull requests

1 participant