Commit Graph

12 Commits

Author SHA1 Message Date
Mike Lockwood
5569aa5011 Merge "MidiManager: minor Javadoc tweaks" 2015-01-30 18:33:02 +00:00
Mike Lockwood
c9adb14afd Merge "MidiManager: fix output port close" 2015-01-30 18:19:49 +00:00
Mike Lockwood
a7e348eb4d MidiManager: minor Javadoc tweaks
Change-Id: I8b8f93907b2f456267dee153122d46c6b6e25b80
2015-01-30 10:14:23 -08:00
Mike Lockwood
cb09627373 MIDI Manager: Remove message packetization from MIDI transport
Instead of attempting to package exactly one MIDI message in each call to
MidiReceiver.onPost(), we now pass messages as a raw stream of bytes.
This means we may now receive multiple MIDI messages in MidiReceiver.onPost().

We make this change to avoid the complexity of taking the single message approach
with SysEx and realtime messages. This shifts some of the burden of parsing
MIDI messages to the client application. But the parsing is best handled in the
application anyway, rather than having the framework impose its own policy
on how the messages are parsed.

Change-Id: Idb6c200037f827cc618bc7d9455a7aa864b494a7
2015-01-29 09:09:00 -08:00
Phil Burk
70a8147012 MidiManager: fix output port close
Clear array entry when MidiOutputPort closed and EndOfStream
is detected.

Change-Id: I47e38ac3a46039d950c66381eac55e2dd10bf9fb
Signed-off-by: Phil Burk <philburk@google.com>
2015-01-16 16:46:31 -08:00
Mike Lockwood
98cc8e5a64 MidiManager bug fixing:
- fix off by one error that caused failure handling one byte messages

- poll thread now terminates properly in UsbMidiDevice

- fix cleanup logic in MidiDeviceServer

Change-Id: I0c13a98b6542cfb271b51678e81d1822c8da2985
2015-01-15 16:07:28 -08:00
Mike Lockwood
10024b3dc1 MidiManager updates:
MIDI ports are now implemented as file descriptors directly between the sender
and receiver, so the MidiService is no longer in the message path.

To facilitate the above, each port has its own file descriptor, rather than multiplexing
all ports on a device through a single socket.

Added a new class MidiDeviceServer, which is used by implementors of MIDI devices.
This replaces the MidiVirtualDevice class (which only was included in changes that were reviewed but never submitted).

The USB MIDI implementation has moved from the MIDI service to the USB service.
The USB MIDI implementation uses MidiDeviceServer as its interface, so we now have a common
interface for all MIDI device implementations.

Change-Id: I8effd1583f344beb6c940c3a24dbf20b477a6436
2015-01-14 16:51:54 -08:00
Mike Lockwood
43bbe4a1e7 Merge "MidiManager: Improve Javadoc" 2014-12-11 17:26:40 +00:00
Mike Lockwood
78beecffc3 MidiManager: Improve Javadoc
Change-Id: Ia1c457de96152029676676464f1ebb896e58bea8
2014-12-11 09:15:23 -08:00
Glenn Kasten
4fe8ff3166 Remove constructor
Change-Id: Ie2c29a92a2fd7c546e314a610a2e8c2506f18511
2014-12-10 15:40:34 -08:00
Mike Lockwood
b6b9a91c02 MIDI: API changes to support multiple ports per device
Add MidiInputPort and MidiOutputPort classes (with MidiPort base class)
A MidiDevice can now have multiple input and output ports.
Multiple ports are currently supported only for virtual devices, USB support coming later.

Change-Id: Ib55076aa1374aa46ae4ae76ad93bd717df6d7e21
2014-12-08 17:09:14 -08:00
Mike Lockwood
67f8e8bd89 MIDI Manager work in progress
Still to do:

Add MidiInputPort and MidiOutputPort classes
Schedule sending MIDI events in the future
Security/permissions
Reconsider interface for virtual devices
Look into performance optimizations

Change-Id: I9b7d63b196996a04be0a830efa913043da1328a8
2014-12-08 10:45:37 -08:00