Raffaello/sdl2-hyper-sonic-drivers

there can be more midi drivers simultaneously

Closed this issue · 3 comments

there can be more midi driver simultaneously, sharing the same midi device and OPL.

OPL can be only 1 instance.

MIDDrv having multiple instances can lead to the last playing setting up the midi instruments for the midi channels so making sound funny the previous already playing.

For consistency should have a single instance only.

no errors/problems at all anyway playing simultaneously 2 midi with the same shared OPL and Device.
but it might be better having an interface to allow to have just:

  • 1 midi device instance at time
  • 1 midi driver instance at time (detached #221)

So they could have a static boolean, instantiated, to set to true on the constructor, throwing if already instantiatied? and set to false on destructor.

otherwise to avoid throwing having a init method to return true when succesful.

splitting in 2 diffeent issues.