Hi Sean,

I had a long chat on the IRC about separating midi backend initialization in 
new controllers code, when you were away. Of course ask RJ about how he feels 
about it before coding of course and do this before merging the controller 
abstraction to main, I'm just spitting ideas

The point is, I was thinking about extensions, which could be implemented, 
including creating an MIDI virtual port device to send MIDI events to anyone, 
not just controllers. We are not  planning to do this right now, but I noticed 
issues with portmidi code which could be fixed now cleanly.

Right now Pm_ calls are done in portmidicontroller.cpp and tied to the 
controller implementation, and since portmidi must be only initialized once per 
application, this is a problem for code which is not a controller.

So, my suggestion is to do something like:

- Create src/midibackends directory for any midi enumeration and backend 
initialization code
- Create new midibackends/portmididevice.cpp module, which implements opening 
all Pm_ calls 
- Make sure portmidi enumerator is not calling any Pm_ calls directly and 
create appropriate modules to midibackends
- Call the new portmididevice.cpp module from cleaned up 
portmidicontroller.cpp, removing any Pm_ functions from the controller side 
itself, implementing only the 'controller' part of it

Goal would be simply to encapsulate MIDI device access cleanly to one place, 
which is not in the controller code.

This would allow any other part than controllers to open the 
PortMidiEnumerator() and PortMidiDevice() instances as well, list midi devices, 
open midi ports etc  cleanly. This also allows debugging portmidi without even 
thinking about controllers.

I think now is the right time to implement this, when your controller 
abstraction changes the tree drastically anyway, it does not seem to require 
much new coding, just code separation and encapsulation for portmidi.

     *hile*


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to