Opened 12 years ago

Closed 11 years ago

#492 closed Bug Report (fixed)

Port control rects are not re-enabled when switching back to horizontal (patch attached)

Reported by: lars.luthman@… Owned by: David Robillard
Priority: minor Component: FlowCanvas
Keywords: Cc:

Description

When a Module is switched from horizontal to vertical mode it calls hide_control() for each port. This means that a program that has called show_control() for a port (e.g. Ingen) has to know this and call show_control() for the same port again when it switches back to horizontal mode. The attached patch fixes this by adding a member function Port::hide_control_override(bool) that works orthogonally to Port::hide_control() and Port::show_control(). Module is changed to use this function instead so that programs can use show_control() and hide_control() and have the state of the control rect restored when they switch back to horizontal mode.

I discovered this when playing around with Ingen and the Peak meter plugin - in horizontal mode the output ports work as meters on their own without the LV2 GUI, but if you switch to vertical mode and then back to horizontal they don't.

This patch breaks the ABI but since you already have bumped the library version for the next release I didn't touch it.

Attachments (4)

control_port_fix.patch (2.5 KB) - added by lars.luthman@… 12 years ago.
control_port_fix.2.patch (2.7 KB) - added by lars.luthman@… 12 years ago.
Updated patch, forgot to initialise _hide_control_rect_override
controlrect_signal.patch (4.6 KB) - added by lars.luthman@… 12 years ago.
controlrect_always.patch (871 bytes) - added by lars.luthman@… 12 years ago.

Download all attachments as: .zip

Change History (8)

Changed 12 years ago by lars.luthman@…

Attachment: control_port_fix.patch added

Changed 12 years ago by lars.luthman@…

Attachment: control_port_fix.2.patch added

Updated patch, forgot to initialise _hide_control_rect_override

comment:1 Changed 12 years ago by David Robillard

API is a bit strange.

Seems more natural to make show_control and hide_control just change a setting, and show the control whenever possible if it's enabled?

comment:2 Changed 12 years ago by lars.luthman@…

What if two signals are added to Module for enabling and disabling the port controls? The ports would then connect those signals to a protected or private function in the constructor, and Module would emit the signals when it wants to enable or disable all port controls. The advantage is that there is no publically avaliable API that makes things confusing, and other classes can also connect to those signals if they want to do something when controls are enabled or disabled.

Patch attached (controlrect_signal.patch).

Changed 12 years ago by lars.luthman@…

Attachment: controlrect_signal.patch added

comment:3 Changed 12 years ago by lars.luthman@…

Or, alternatively, the control rects can be shown in vertical mode as well as horizontal mode. There's really no reason not to and it gives the program using the library complete control over when the controls are shown.

In Ingen the controls are actually usable in vertical mode if you zoom in a bit, and it's nice to have MIDI blinkenlights in both modes.

Patch attached (controlrect_always.patch).

Changed 12 years ago by lars.luthman@…

Attachment: controlrect_always.patch added

comment:4 Changed 11 years ago by David Robillard

Resolution: fixed
Status: newclosed

Fixed in r2693, thanks.

Opted for the controlrect_always option, they are useful in vertical mode. If anything, the ports should be mad a tad bigger to make them more usable...

Note: See TracTickets for help on using tickets.