Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5touch: add V5-like touchscreen keypad to the UI #501

Open
wants to merge 32 commits into
base: oram
Choose a base branch
from

Conversation

wanthalf
Copy link

Touchscreen V5 keypad implementation as discussed in https://discourse.zynthian.org/t/diy-upgrading-to-v5-or-the-question-of-new-buttons/9707
(NOT everything was tested in depth yet.)

Requirements and options:

  • python3-cairosvg to support SVG icons (should fall back to PNG if not available)
  • environment variable ZYNTHIAN_TOUCH_KEYPAD set to V5 to activate this extension (without this setting, the UI should behave exactly as before)
  • optional environment variable ZYNTHIAN_TOUCH_KEYPAD_SIDE_LEFT to activate the left side layout of the keypad (TRUE by default)
  • optional environment variables for setting custom onscreen buttons foreground colours (see zynthian_wsleds_v5touch.py)

@jofemodo
Copy link
Member

Hi @wanthalf !

Excuse the radio silence. I'm quite busy on summer and had little time to read your code and test the changes. I will do ASAP.

Regards,

@wanthalf
Copy link
Author

No problem. I see the tons of problems that must be finished and fixed ASAP! :)

@wanthalf
Copy link
Author

wanthalf commented Aug 7, 2024

A question: once I noticed a state (that I cannot reproduce nor find in the code) where the (on-screen) wsleds were all turned off except the one indicating the active screen, which was pulsing in green. If there is such a state, I would suggest to change the "wscolor_off" from black to grey, so that the labels remain partially visible on the black background even when "turned off". The physical buttons also have their labels to some degree visible when the LEDs are turned off.

@riban-bw
Copy link
Contributor

riban-bw commented Aug 8, 2024

That sounds like power save mode. In power save, the screen is switched off. I guess you may be testing via VNC, not to observe the lack of screen output?

@wanthalf
Copy link
Author

wanthalf commented Aug 10, 2024

I see I also overlooked a few more geometry settings in zynthian_gui_control_xy.py(never actually seen that screen). Also, many sizes are still computed from the full screen dimensions, not the reduced one in zynthian_gui_config.py (e.g. size of the font, logo image, top bar etc.). Not sure how to best deal with the reduced dimensions. Maybe it would be better to have two separate values for geometry such as zynthian_gui_config.display_width and zynthian_gui_config.full_display_width? (And not just subtracting the keypad width and height from the full display size in (nearly) every screen object - as I am doing now?)

The only screens really using the full display dimensions are probably the splash and the touchscreen calibration (and multitouch.py, of course)?

@wanthalf
Copy link
Author

wanthalf commented Sep 9, 2024

No feedback yet, so I tried to make the integration a bit cleaner myself by moving it into zynthian_gui_config and creating new attributes screen_width and screen_height, independent of the original display_width and display_height. (Hopefully also fixing the missing changes in zynthian_gui_control_xy.py.)

@@ -938,6 +938,14 @@ def get_state(self):
b64_data = base64.b64encode(binary_riff_data)
state['zynseq_riff_b64'] = b64_data.decode('utf-8')

# TouchKeypad config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any state/snapshot structure changes must be documented in zynthian_state_schema.py.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for hint!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants