dictation-toolbox / natlinkcore

Other
4 stars 4 forks source link

Hide natlink timer? #40

Open dougransom opened 1 year ago

dougransom commented 1 year ago

so grammars don't call unitentnialllyto replace timer callback

drmfinlay commented 1 year ago

Do you mean the low-level Natlink function (setTimerCallback)?

dougransom commented 1 year ago

I think so, Quintijn has been working on a multiplexed timer and i think it will get confused if some other code sets the timer callback.

I think Quintijn's timer can replace the natlink timer.

drmfinlay commented 1 year ago

Okay then. There are a few Natlink functions that can be used to break natlinkcore functionality. SetTimerCallback is one, SetChangeCallback is another. This has been the case for some time. I don't know if it's really worth changing the lower-level API over this. It's up to you, but I would opt for warnings in the documentation instead.

Dragonfly currently uses the setTimerCallback function for its multiplexing timer. Once natlinktimer.py is released, it should be a simple matter to adjust the library to use it instead. I'll leave the old method in as a fallback for older versions of Natlink.

quintijn commented 1 year ago

The natlinktimer.py module directly calls setTimerCallback. When another module calls this same function, the natlinktimer multiplexing will be stopped. I will make a test, to make sure it does.