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

The Slider API, Juce patches, and sldierClicked/triggerClick #12

Open
baconpaul opened this issue Dec 12, 2021 · 6 comments
Open

The Slider API, Juce patches, and sldierClicked/triggerClick #12

baconpaul opened this issue Dec 12, 2021 · 6 comments
Labels
Code Cleanup General code cleanup issues like names, unused variables, warnings, fixme Infrastructure

Comments

@baconpaul
Copy link
Collaborator

Monique had modified JUCE to add a couple of methods to slider, including 'sliderClicked' and 'triggerClick'. In the port to juce 6 unpatched, I commented these out for now while we figure out the right juce 6 strategy.

Where I did I used

 { static bool fix_oss_port_issue = false; jassert(fix_oss_port_issue); fix_oss_port_issue = true; }

before the commented out code so we can find a lot of them and will see them in the debugger at runtime.

@baconpaul
Copy link
Collaborator Author

Looking at this code, if I was going to fix this with juce 6 I would

  1. Make a subclass of juce::Slider which adds these methods
  2. Change all the code to refer to that subclass either in the bare modes or as a subclass

basically. The mouseEvent stuff that subclass could do with an override and pass to parent trick too

I think that's the approach from the diff. Not working on it now, just read the diff and wanted to toss that here

@mkruselj mkruselj added Code Cleanup General code cleanup issues like names, unused variables, warnings, fixme Infrastructure labels Dec 12, 2021
@TommmyArn
Copy link
Collaborator

After a little research, it seems there is no need to reimplement the patched slider API. The main purpose for the patch was an advanced and complex slider context menu with the features listed below. The global features could be moved to a global dialogue. Any suggestion for the individual ones?

Global:

Value:

  • on [slider double click] set value from [custom], [patch], [factory default], [undo-redo switch]

Slider behaviour:

  • velocity sensitive linear sliders [switch] [default: on] [shortcut if off: CTRL+slide]

  • velocity sensitive linear slider acceleration [value]

  • use rotary sliders instead of linear sliders (ENV sections and dialogues) [switch]

  • velocity sensitive rotary slider acceleration [switch] [default: off] [shortcut if off: CTRL+slide]

  • rotary slider sensitivity [value]

  • rotary slider dragging: [up+down], [circular]

  • global slider input smoothing [value] (to avoid crackles related to jumpy user inputs)

Animations:

  • animate envelopes on buttons [switch] [default: on] (is also in SETUP dialogue) (for performance reasons, render many buttons is not cheap)
  • animate morph states on sliders [switch] [default: on] (is also in SETUP dialogue) (for performance reasons, render many sliders is not cheap)
  • animate arpeggiator buttons [switch] [default: on] (for performance reasons, render many buttons is not cheap)

Help:

  • help: show wiring diagram [shortcut: CTRL+W]
  • help: force show tool tips [switch] [default: off] (no delay, tips shows always on mouse over)
  • help: show tool tips [switch] [default: on] (is also in SETUP dialogue)
    (tips shows after 1000ms on mouse over)

Persistence:

  • manually load and save global settings (will be done automatically on app start and shut down)

Engine:

  • stereo processing [switch] [default: on] (mono or stereo output and processing)

Individual slider settings:

Value:

  • set slider value from [custom], [from patch], [factory default], [undo] (nice to have for performances and design)
  • update [custom] value from current slider state (nice to have for performances and design)

MIDI:

  • map midi controller to slider [shortcut if off: CTRL+M]
  • snap to midi input [value]

@baconpaul
Copy link
Collaborator Author

So on the individual ones, we should still be able to pop them up on the slider menu, just we need to intercept it at a different point, no? (Although I haven't been that deeply in the code structure to understand why). The problem is you aren't getting the chance at the mouseDown event basically so you can't just popup a menu with showMenuAsync?

@TommmyArn
Copy link
Collaborator

There was and is still no way to customize the slider popupMenu. There is just one method to enable it as it is (void setPopupMenuEnabled (bool menuEnabled))

@baconpaul
Copy link
Collaborator Author

Right

So I have little project called 'toy-juce' i use to experiment with the juce api. right now it is a plugin with a bunch of params that shows sliders about those params.

I just modified the slider class I use to have a custom popup menu. Critically it doesn't use setPopupMenuEnabled but instead overrides mouseDown on the class

https://github.com/baconpaul/toy-juce/blob/085dc527137bece8f9a30355bf8aba52117d5b7a/src/PluginEditor.h#L43

there's the class

So when I run that the slider works normally unless I dod a popup menu gesture, in which case it shows me my menu rather than the default one.

Does that help at all? Perhaps introduce a monique_BaseSlider which is subclass of juce::Slider with that override in place and use that everywhere else in monique as your slider base class?

@TommmyArn
Copy link
Collaborator

Thanks, Paul! Yes, this helps. Easy and simple solution – great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup General code cleanup issues like names, unused variables, warnings, fixme Infrastructure
Projects
None yet
Development

No branches or pull requests

3 participants