Commit Graph

22 Commits

Author SHA1 Message Date
Geoffrey D. Bennett
7c44f15428 Make GtkDial look better 2024-02-20 23:26:09 +10:30
Geoffrey D. Bennett
df5d0960dd Add support for piecewise linear interpolation taper to GtkDial
This commit adds support for piecewise linear interpolation tapers to
GtkDial and the gain widget so that the 4th Gen 4i4 volume knob taper
can be modelled correctly.
2024-02-11 21:46:22 +10:30
Geoffrey D. Bennett
492c348897 Add configurable taper to GtkDial
The taper was previously set to a log function which matched the
Clarett volume knob. Add linear option to match the Scarlett 4th Gen
input gain knobs and hardware level meters.
2024-02-08 19:04:53 +10:30
Geoffrey D. Bennett
189b9ff6f6 Move valp clamp and scale from calc_valp_log() to calc_valp() 2024-02-08 18:08:34 +10:30
Geoffrey D. Bennett
a77cb0e258 Remove inline from functions in gtkdial.c 2024-02-08 18:08:34 +10:30
Geoffrey D. Bennett
64ca9f78da Fix typo range->dial in gtkdial.[ch] 2024-02-08 18:08:34 +10:30
Geoffrey D. Bennett
d91c9d5687 Add page argument to gtk_dial_new_with_range()
Make gain widget page_incr 3dB.
2024-02-08 18:08:34 +10:30
Geoffrey D. Bennett
1164845b3c Allow for continuous dials
Update gtk_dial_new_with_range() to set round_digits to -1 if step is
zero.

Update create_levels_controls() to set step to zero.
2024-02-08 18:08:34 +10:30
Geoffrey D. Bennett
e40ce4d5ad Fix gtk_dial_new_with_range() to use calculated round_digits 2024-02-08 18:08:34 +10:30
Geoffrey D. Bennett
3740d7ee2d Fix GtkDial:zero_db property comment 2024-02-08 18:08:34 +10:30
Geoffrey D. Bennett
28604f08a3 Reformat gtkdial.c to match rest of code 2024-02-08 18:08:34 +10:30
Geoffrey D. Bennett
9587e2f494 Remove unused guint8 and gsize from gtkdial.c 2024-02-08 18:08:34 +10:30
Geoffrey D. Bennett
b2823e79be Bump copyright year 2024-02-08 18:08:34 +10:30
Geoffrey D. Bennett
4a123f5df6 Simplify GtkDial calculations 2024-02-08 18:07:44 +10:30
Geoffrey D. Bennett
770ce1cc23 Add bindings for pgup/pgdn/home/end to GtkDial 2024-02-05 20:04:58 +10:30
Geoffrey D. Bennett
1ebd6de6a1 Add missing GtkDial scroll_begin() implementation 2024-02-05 20:04:58 +10:30
Geoffrey D. Bennett
0c3bc30439 Fix dial to display focus indication
Partial cherry-pick from 5dc3ab Sebastian Kaminski
"dial ... shows focus indication".

Use has_focus() rather than has_visible_focus() as I found
has_visible_focus() to be unreliable.
2023-12-15 03:17:04 +10:30
Geoffrey D. Bennett
945ccc874d Fix dial to grab focus when clicked
Partial cherry-pick from 5dc3ab Sebastian Kaminski
"dial grabs focus when being clicked".
2023-12-15 03:14:23 +10:30
Geoffrey D. Bennett
fef139be64 Split calc_valp() into calc_valp() and calc_valp_log()
gtk_dial_drag_gesture_begin() needs a linear calc_valp().
2023-12-15 02:55:42 +10:30
Jason A. Donenfeld
d81f9ca2bb gtkdial: use fabs() for double
Passing a double to abs() truncates it to an integer, which is probably
not intended, and also causes fatal errors on clang.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-12-05 12:29:49 +10:30
Geoffrey D. Bennett
ea920d6343 Apply correction curve to the dials
Display the volume levels on the dials with a correction curve that
resembles what the volume knob on the hardware does.
2023-10-09 02:05:21 +10:30
Geoffrey D. Bennett
17b4d2f055 Initial revision 2022-03-14 09:24:43 +10:30