1
0
Fork 0
Commit graph

64 commits

Author SHA1 Message Date
Robbert van der Helm 32ad1212f1 Silence clippy::type_complexity
Clippy now wants us to move any usage of the Fn* traits to a typedef.
Doing so will almost certainly not help readability.
2022-07-01 15:50:23 +02:00
Robbert van der Helm ae31e416c2 Don't use baseview system scaling on Windows/Linux
Until the UI frameworks make it possible to get the size or scale for
the window, this would cause the window contents to be scaled
incorrectly if the host does not set a scale factor.
2022-04-27 18:33:08 +02:00
Robbert van der Helm bb3175f68e Return -> Returns at the start of a docstring
The imperative tense doesn't make any sense when the function is a mere
getter and doesn't actually perform a nontrivial task.
2022-04-26 19:39:51 +02:00
Robbert van der Helm 083885a40c Rework Params trait API with Arc instead of Pin
This is a breaking change requiring a small change to plugin
implementations.

The reason why `Pin<&dyn Params>` was used was more as a hint to
indicate that the object must last for the plugin's lifetime, but `Pin`
doesn't enforce that. It also makes the APIs a lot more awkward.
Requiring the use of `Arc` fixes the following problems:

- When storing the params object in the wrapper, the `ParamPtr`s are
  guaranteed to be stable.
- This makes it possible to access the `Params` object without acquiring
  a lock on the plugin, this is very important for implementing
  plugin-side preset management.
- It enforces immutability on the `Params` object.
- And of course the API is much nicer without a bunch of unsafe code to
  work around Pin's limitations.
2022-04-07 15:31:46 +02:00
Robbert van der Helm 144e30239e Use ParamFlags::HIDE_IN_GENERIC_UI in generic UIs 2022-03-23 13:16:56 +01:00
Robbert van der Helm 9e3149b931 Move ParamPtr to the prelude 2022-03-23 12:46:46 +01:00
Robbert van der Helm 021d175264 Use a default implementation for Param::normalized_value() 2022-03-21 13:28:59 +01:00
Robbert van der Helm f084f14095 Refactor GUIs to use param's own default value
This removes the need to pass a lot of these `ParamSetter`s and
`GuiContext`s around. We also don't need explicit events to reset a
parameter anymore since you can get this information from the parameter
itself.
2022-03-21 13:11:36 +01:00
Robbert van der Helm d5d54f0c06 Fix generic UIs after last commit 2022-03-20 13:37:01 +01:00
Robbert van der Helm b9d79771cc Use String instead of &'static str in Params
This may hurt performance in generic UIs a bit, but it will allow you to
programatically generate custom Params implementations for repeated
Parameters structs.
2022-03-20 02:14:18 +01:00
Robbert van der Helm 4e9ee27c19 Finish the drawing for the iced param slider 2022-03-14 13:17:19 +01:00
Robbert van der Helm 5711f77cc7 Remove old todo about adding an egui generic UI 2022-03-13 23:33:43 +01:00
Robbert van der Helm 1fa2b5f74f Add an Editor callback to notify parameter changes
This will be needed to allow iced to be reactive in our model.
2022-03-13 18:03:23 +01:00
Robbert van der Helm 3ebe34c870 Add most bits and pieces for iced support 2022-03-12 23:15:33 +01:00
Robbert van der Helm d7ea21f597 Fix clippy lints 2022-03-06 15:41:35 +01:00
Robbert van der Helm 02d513b043 Disable the Alt+Click for now
Since it doesn't really work anyways, need to dive into egui's internals
to figure out why it doesn't work.
2022-03-05 22:22:17 +01:00
Robbert van der Helm ec41ba5394 Add an attempt at an Alt+Click to open text entry
This does not work correctly unless you move your mouse, for some reason.
2022-03-05 22:11:29 +01:00
Robbert van der Helm 458f22248a Initialize the text entry with the value 2022-03-05 21:37:16 +01:00
Robbert van der Helm 6db2b528da Add basic text entry using built in widget 2022-03-05 21:32:37 +01:00
Robbert van der Helm 0dd71cf644 Fix slider same value check with discrete params
Because the check was done against the normalized value, before
snapping. This required adding `PartialEq` to the `Plain` type.
2022-03-05 19:51:06 +01:00
Robbert van der Helm 9b9799eb35 Allow overriding slider width 2022-03-05 19:39:39 +01:00
Robbert van der Helm cab6be5167 Add padding to the generic UI 2022-03-05 19:39:28 +01:00
Robbert van der Helm 2c56646cc9 Take up all remaining space in generic UI 2022-03-05 19:24:40 +01:00
Robbert van der Helm 05d97bb71e Add a super simple egui generic UI widget 2022-03-05 19:16:20 +01:00
Robbert van der Helm 9267a8371c Add DPI scaling support
That hopefully works.
2022-03-05 13:37:35 +01:00
Robbert van der Helm 4c0b07c578 💥 Move re-exports to a prelude module
So you can import everything at once, because you're likely going to
need at least 90% of it anyways.
2022-03-03 23:23:51 +01:00
Robbert van der Helm f581294d7b Update rustdoc formatting for links
Apparently it showed this text verbatim, and not in monospace.
2022-03-03 23:05:12 +01:00
Robbert van der Helm be4bbd4400 Allow nested parameter structs
See the Parameters docstring for the caveats.
2022-03-03 20:38:28 +01:00
Robbert van der Helm d688174b8b Require Send+Sync on the editor handle 2022-03-03 15:40:16 +01:00
Robbert van der Helm 07d8f81f44 Update to egui 0.17 2022-02-27 16:49:18 +01:00
Robbert van der Helm b40c43a862 Temporarily use egui's system scale factor
Until we support HiDPI ourselves. This fixes #1.
2022-02-27 12:59:41 +01:00
Robbert van der Helm e1f80e203a Render the ParamSlider value 2022-02-09 19:45:54 +01:00
Robbert van der Helm 87b31f4c2f Move the main slider to a function 2022-02-09 19:17:46 +01:00
Robbert van der Helm cd50d5bb77 Remove todo about wonky modifiers
This has been fixed by https://github.com/RustAudio/baseview/pull/117.
2022-02-09 19:10:58 +01:00
Robbert van der Helm 64da9c52c2 Add todo about modifier handling in egui-baseview 2022-02-09 12:28:38 +01:00
Robbert van der Helm 7eb8622736 Drag very granularly with Shift+Drag 2022-02-09 12:24:01 +01:00
Robbert van der Helm 9dfac991c8 Also reset parameters with Ctrl+Click 2022-02-09 11:51:42 +01:00
Robbert van der Helm fe3ea5d9f8 Don't change a parmeter if it wouldn't do anything 2022-02-09 11:51:30 +01:00
Robbert van der Helm cd683187e0 Allow resetting parameters by double clicking 2022-02-09 11:51:30 +01:00
Robbert van der Helm 882ba8f61d Don't use smart aim
Probably not needed here
2022-02-09 11:36:10 +01:00
Robbert van der Helm 8e7a86262f Handle parameter edit begin and release 2022-02-09 11:34:58 +01:00
Robbert van der Helm a1c6d1d30a Scale the dragged slider color based on original 2022-02-09 11:32:19 +01:00
Robbert van der Helm 7a50cc3383 Add HSV scaling utilities 2022-02-09 11:31:59 +01:00
Robbert van der Helm dbc6bf993b Don't fill the slider if it's empty 2022-02-09 11:19:49 +01:00
Robbert van der Helm e2524a2d81 Handle stepped non-float parameters
The widget now snaps to the correct range. This would always be
displayed this way internally, but now we also won't tell the host about
the invalid values.
2022-02-09 11:18:38 +01:00
Robbert van der Helm 46a7d8a261 Make the ParamSlider generic over all param types 2022-02-09 11:13:51 +01:00
Robbert van der Helm 857cf876e8 Add the beginnings of a parameter slider widget 2022-02-09 01:07:57 +01:00
Robbert van der Helm 5e65f5b77a Permissively license the egui integration crate
The widgets that are going to be there are probably going to be useful
to others and may need some modification, so this makes more sense.
2022-02-08 23:27:46 +01:00
Robbert van der Helm 2417f9e8c0 Remove AtomicCell re-export
This is no longer part of the public API.
2022-02-08 20:38:10 +01:00
Robbert van der Helm 07f9a18d3d Rename EguiState::open to is_open
This makes it more clear that it doesn't actually open the editor.
2022-02-08 20:33:08 +01:00