atsushieno / managed-midi

[Past project] Cross-platform MIDI processing library for mono and .NET (ALSA, CoreMIDI, Android, WinMM and UWP).
MIT License
194 stars 26 forks source link

appropriate (Almost)VirtualMidiTimeManager implementation #31

Closed atsushieno closed 5 years ago

atsushieno commented 5 years ago

There seems some confusion around what it should achieve (when I wrote that code). There should be two sides of time manipulation:

AdvanceBy() is called by MidiPlayer (or something else) whenever next set of MIDI events were processed. This method therefore should "block" until another thread manipulates the "virtual actual time" that is controlled by e.g. unit tests.

Considering the use cases where virtual actual time counter fails to run, there should be some safe-guard canceller within the virtual time manager that resumes the wait handle and throws exception.

atsushieno commented 5 years ago

Fixed by 2c30336 .