usb_midi devices can be input-only or output-only. We failed to check
for this in some places leading to KDL on devices that are not
bidirectional.
Should fix#11810.
* Instead of the deprecated GroupLayoutBuilder.
* Ordered headers correctly, use headers directly instead of including
InterfaceKit.h.
* Also, guarded the profile sections in their ENABLE_PROFILES
definition.
In normal situations the midi_server opens all midi ports, so this
wouldn't be a problem. However, my new MIDI keyboard (Miditech
i²Control-25) sends some MIDI events immediately when it is connected to
an USB port. These would be handled before the MIDI server had a chance
to open the port, leading to a KDL.
A similar problem could be triggered by killing the midi_server then
sending MIDI events from any other USB device.
* These would be completely skipped before because of a bug in the USB
audio dumping code.
* Now they are decoded in human readable format
* Also fix a typo (Ttype instead of Type) in audio endpoints formatting.
* When a midi device is unplugged, the driver deletes all the MIDI
channels, and unblocks all pending accesses on those. The port
structureis freed but the device kept a pointer to it.
* When a transfer is cancelled, the driver would try to notify all
callers waiting on the ports that the device is gone. But it's too late
to access the port as it was already deleted (and the callers already
unlocked).
Reset the port pointer to NULL when deleting a port, so no further
access to it is possible.
Fixes#11533.
Also remove an unused field in the usb midi device structure.
* use ceilf() over ceil() and floorf() over floor()
* rename prevTab to previousTab
* check that tab pointer is valid in each loop
* use tabCount variable in each loop to check the end condition
No functional change intended, corrected in feature branch, but
unrelated to feature. Having this change in tree will make keeping
my Tracker feature branches up to date slightly easier.
Sorry this commit is so big, but I couldn't figure out how to do this
incrementally without breaking things.
I wasn't able to just merge Aldeck's branch, as it was a partial refactor
of Tracker and didn't just rewrite the UI creation code to use layouts,
and the changes for PM (e.g. addon loading, virtual directories) made it
very hard to merge (it doesn't even compile after an automerge) so rather
than spending time on that, I decided it'd be better to recreate his work.
Miscellaneous notes:
- This partially cleans up BPoseView & subclasses and BContainerWindow &
subclasses -- none of the subclasses and child views abuse the parent's
state, child views, or layout now.
- BFilePanel and BDeskWindow are not on layouts, because:
* BFilePanel docs in the Be Book instructed developers that wanted to
modify BFilePanel's layout to just use FindView() and then move the
views around. Obviously making it use layouts will break all BeOS
apps that do this, and there are a lot of them (Pe, WonderBrush are
just two examples.) I've added a note to the TODO list for R2 to create
a layout-compatible API for this.
* Some replicants (Workspaces, for example) rely on manipulating
BDeskWindow's drawing state. This is incompatible with layouts, as
at least in the case of Workspaces, it breaks a layouted version
of BDeskWindow entirely.
- I noticed a lot of #ifdef BEOS_VERSION ... gunk in the code. Tracker
probably didn't build on BeOS just before this commit, and now it
won't for sure, so I intend to go through and clean that out in the
near future.
This commit also fixes:
- enhancement #4996 (make Tracker's navigator use vector icons)
- bug #3039 (resizing OpenWithWindow flashes the blue border)
- bug #3889 (OpenWithWindow redraw errors)
- a regression that was a side effect of "dynamic_cast<BDeskWindow*>(this)"
always returning NULL when run in the constructor. I just added a "bool
isDeskWindow" to BContainerWindow's constructor that is only set to true
by BDeskWindow.
- a copy&paste error in VirtualDirectoryPoseView that was passing "uint32
resizeMode" as "uint32 viewMode".
Thanks to Alexandre for his original branch (it was a very useful
reference), Axel (for some miscellaneous advice & encouragement),
Adrien & Humdinger (for user interface review), and Diver (for user
interface review & testing).
Apparently not linking to libstdc++ correctly is causing an error.
Also, use new(std::nothrow) when creating the input server filter
to avoid an exception from being thrown by the constructor in the
case of low memory.
... for switching workspaces (removed from BWindow) and
minimize all (aka Show Desktop).
This moves the workspace switch behavior out of the BWindow class
and places it into it's own input server filter that does the same
thing. The difference is that you may now uninstall the workspace
switching filter to disable the behavior. These shortcuts were not
included in the BeOS R5 version of BWindow so represent additional
behavior added to Haiku.
minimize_all (aka Show Desktop) is a new input server filter that
allows you to minimize all windows by pressing cmd+ctrl+D. If
you do not like this behavior you may uninstall the minimize_all
input server filter.
* As it doesn't rely on BNetworkAddress anymore,
BNetworkInterfaceAddress must now take care of initializing the
addresses itself.
* Also add some input sanitization and and asserts to ease detecting
such problems.
* Fixes#11778.