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

Knobs with arcs #2275

Merged
merged 2 commits into from
Sep 13, 2019
Merged

Knobs with arcs #2275

merged 2 commits into from
Sep 13, 2019

Conversation

zezic
Copy link
Contributor

@zezic zezic commented Sep 10, 2019

This PR makes it possible to draw the knob arcs programmatically.

XML example:

<KnobComposed>
  <Size>40f,40f</Size>
  <Knob>handle.svg</Knob>
  <BackPath>bg.svg</BackPath>
  <MinAngle>-135</MinAngle>
  <MaxAngle>135</MaxAngle>
  <ArcThickness>2</ArcThickness>
  <ArcColor>#ffffff</ArcColor>
  <ArcUnipolar>true</ArcUnipolar>
  <Connection>
    <ConfigKey>[Master],gain</ConfigKey>
  </Connection>
</KnobComposed>

where new nodes are:
ArcThickness, ArcColor and ArcUnipolar

Demo:

mixxx-knob-arcs

@ronso0
Copy link
Member

ronso0 commented Sep 10, 2019

nice one!
did you test it with color schemes?

@zezic
Copy link
Contributor Author

zezic commented Sep 10, 2019

It works well with variable-based theming, but it does not work with filters. Should I make it work with filters too?

@ronso0
Copy link
Member

ronso0 commented Sep 10, 2019

It would just be nice-to-have feature if the entire scheming could be done in one place... I don't mind, and i can't estimate the effort to make it work with filters.
Right now it's only Shade (and future skins ;) that would benefit from this change, and Shade's color schemes work mostly with filters.

Besides, we recently discovered a SVG filter issue in #2130

@zezic
Copy link
Contributor Author

zezic commented Sep 10, 2019

It was pretty easy to add (d3b4abf).

I will look into that issue later, maybe I will be able to track it down but at least, I think, it should not affect this particular PR.

@daschuer
Copy link
Member

Thank you and welcome back. The changes are looking good to me.
Is this ready for merge?

@zezic
Copy link
Contributor Author

zezic commented Sep 13, 2019

Hi, @daschuer! Nice to see you.
Yes, it's ready for merge.

@daschuer daschuer merged commit 2bd0b21 into mixxxdj:master Sep 13, 2019
@daschuer
Copy link
Member

I have just noticed that there is no KnobComposed section here:
https://www.mixxx.org/wiki/doku.php/creating_skins
If you like you can create one, including your new fetaue.

@ferranpujolcamins
Copy link
Contributor

I opened a similar PR time ago. It might be worth checking for future directions on this topic.
For example how to handle knobs which should be unipolar sometimes but should not be other times, like the effect knobs.

#645

@ronso0 ronso0 mentioned this pull request Nov 4, 2019
2 tasks
@ronso0
Copy link
Member

ronso0 commented Nov 13, 2019

While doing a quick test how to make the arcs fit LateNight in #2342 I found they transform (stretch) with the knob's background path rectangle, and <KnobCenterYOffset> is not respected, thus they're elliptical and displaced in LateNight which has knobs with 34 x 40px:
image

@zezic Do you have time to fix this?

@ronso0
Copy link
Member

ronso0 commented Nov 14, 2019

And, for the knob arc wishlist:

  • It would be nice do draw a a background arc illustrating the span of the knob (like a groove), with width and color configurable separate from the 'position arc'.
  • @Be-ing also mentioned a configurable center gap / highlight as hint for the default position. Right now this would only make sense for EQs, QuickEffect and Master/Headphone knobs where we have static default positions.

@zezic
Copy link
Contributor Author

zezic commented Nov 21, 2019

Hi, @ronso0
I'm able to implement all the things you mentioned above but I'm a bit busy at the moment.
What's a deadline for this?

@ronso0
Copy link
Member

ronso0 commented Nov 21, 2019

Nice. Aahhm, no deadline as this is no company ;)
It's just that several users asked for this to be included in the LateNight redesign #2342

My guess is that we can merge #2342 before the beta release, any minor skin changes can be added during beta period. Actually beta = feature freeze, and afaict this will be after #2345 is merged. I'm not sure if that rule can be bent for innocuous changes to the knob widget. Otoh that would unleash quite some potential for skin designers.

@Holzhaus
Copy link
Member

@zezic Hey zezic, have you made any progress yet? The 2.3 release is finally getting closer 😉

@ronso0
Copy link
Member

ronso0 commented Apr 17, 2020

Hej @zezic !
I'm working on a daylight theme for LateNight and arcs would be a huge win for that.
So before I start wrapping my head around all that math going on for painting the arcs, I first want to check if you made any progress and if you might be able to tweak this for 2.3?

@zezic
Copy link
Contributor Author

zezic commented Apr 18, 2020

Hi, @ronso0!
Thank you for bumping that another time, as the issue has started to fade out in my TODO memory. I'm going to fix that today. Will link the corresponding PR here.

@ronso0
Copy link
Member

ronso0 commented Apr 18, 2020

Aahhm nevermind @zezic
I also started working on that because I was curious and wanted to add other features like

  • optional, customizable background arc (width, color, cap shape)
  • customizable cap shape for foreground arc?

Then I reworked the WKnobComposed a bit and moved some math from drawArc() to the setup(), maybe it needs a resizeEvent now.

I'll publish my branch maybe tomorrow I think.
Looks useable already:
image

@zezic
Copy link
Contributor Author

zezic commented Apr 18, 2020

Okay! I will not touch it then. Mixxx is on its way to the complete vector UI!

@Be-ing
Copy link
Contributor

Be-ing commented Apr 18, 2020

Mixxx has used all vectors since 2.1.

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.

6 participants