A fairly simple feature - preferences for velocity sensitivity, but a
fair amount of UI infrastructure. This patch includes a new
KnobPreference, changes to KnobView to support a horizontal layout
(which works better in a layout with more compressed vertical space),
and of course the plumbing of the preference itself.
Also some rework of the touch handler in the KeyboardView. This patch
simplifies the logic a bit and fixes a long-standing bug in which the
pressure was always read from pointer index 0 rather than the pointer
index of the key being pressed.
The first setting is just the keyboard layout, but we'll add lots more
in time (velocity sensitivity). Plus, some synth state (program change
in particular) should persist, and this is a good mechanism.
There are some infelicities: the settings screen doesn't bind the synth
service, so sound pauses. Also, fullscreen is inconsistent and should be
rethought (maybe immersive on KitKat).
This patch wires up pressure sensitivity from the touchscreen. It also
adds simple USB Host mode for MIDI keyboards (tested on M-Audio KeyRig 49
and Akai MPK mini). Finally, it cleans up a bit.
The USB listening thread should be moved out of the activity and into a
service (there can be problems on multiple plug and unplug). But this
should be good enough to play with.