Skip to content

armgit / nota

Public Imported from GitHub
0

Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.

(fix) Double-click resets knobs and sliders again; ⌥-click types a value (#274)

Egor Khindikaynen92a0608bce4e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a4584046..b82e70cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -37,8 +37,8 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
- **Fold the browser's Built-in and Plug-ins sections** (nota-daw/nota#230): click a
**BUILT-IN** or **PLUG-INS** header in the Instruments, Effects or MIDI tab to collapse
it and click again to open it.
-- **Type an exact value into any knob, fader or slider** (#240): double-click the control
- or its value and type it in the units shown — `1.2k`, `-6`, `12 ms`, `30L`, `1/4`, `off`.
+- **Type an exact value into any knob, fader or slider** (#240): ⌥-click the control
+ (Alt-click on Windows and Linux) or double-click its value and type it in the units shown — `1.2k`, `-6`, `12 ms`, `30L`, `1/4`, `off`.
Enter or a click away applies it, Esc cancels, Tab moves to the next value on the card.
A typed value is one undo step and records into automation like a drag. Device cards,
instruments, racks, the mixer, track headers and the preview volume all work this way;
@@ -99,9 +99,8 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
in Explorer** on Windows and **Show in file manager** on Linux.
- **The audio clip editor says why nothing snaps with Warp off** (nota-daw/nota#269): an
unwarped clip has no beat grid, and the hint line under the wave now says to turn on Warp.
-- **Reset to default is now ⌥-click** (Alt-click on Windows and Linux) on knobs, faders,
- sliders and value boxes — double-click types a value instead. The mixer fader no longer
- jumps to where you click; drag it like any other control.
+- **The mixer fader no longer jumps to where you click**; drag it like any other control.
+ Double-click still resets knobs, faders and sliders to their default.
- **Context menus, redesigned**: every right-click menu in the app now follows the Studio
look and one order. A menu for a track, clip, device, scene, pad or version starts with
its name, colour and type; commands come in the same groups everywhere, with Copy, Cut,
diff --git a/FEATURES.md b/FEATURES.md
index 3ddfd7ff..4abd120c 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -1122,8 +1122,9 @@ audio effects after it keep running and keep their settings; saved with the proj
detaches it (the selected clip's piano roll on top, the device chain below, both at
once). The content moves across as-is: edits, meters and graphs all keep working live.
- **Popup rack editors** (full UI / Params).
-- **Typed values** — double-click the number next to a slider in a device card, the clip
- editor or a rack macro and type it: "−6", "1.5k", "250 ms", "L 30", "1/16".
+- **Typed values** — ⌥-click any knob, fader or slider (or double-click the number next to
+ it) and type the value: "−6", "1.5k", "250 ms", "L 30", "1/16". Double-click the control
+ itself resets it to the default.
- **User manual** (EN / RU, https://nota-daw.github.io/nota-docs/) — **Help ▸ Documentation**
opens it in the system language, the start window links to the first-track tutorial, and
each device header menu's **Documentation** item opens that device's page.
diff --git a/src/managed/Nota.App/Controls/ChordShiftTrack.cs b/src/managed/Nota.App/Controls/ChordShiftTrack.cs
index d8b64dfa..506ccb4f 100644
--- a/src/managed/Nota.App/Controls/ChordShiftTrack.cs
+++ b/src/managed/Nota.App/Controls/ChordShiftTrack.cs
@@ -7,8 +7,8 @@
// growing up (positive) or down (negative). Unlike the generic SliderTrack the value is
// positional — press or drag anywhere sets the semitone under the pointer — because the
// track is a pitch ruler. A switched-off slot draws its fill in Border strong.
-// GestureBegin / GestureEnd bracket the drag for automation writes; double-click types a
-// shift, ⌥-click resets to 0; right-click opens the parameter menu.
+// GestureBegin / GestureEnd bracket the drag for automation writes; double-click resets
+// to 0, ⌥-click types a shift; right-click opens the parameter menu.
using System;
using Avalonia;
@@ -41,7 +41,7 @@ internal sealed class ChordShiftTrack : Control
public event Action<int>? Changed;
- /// <summary>The track as a typeable value: semitones −12…+12 ("+3", "−5"), ⌥-click 0.</summary>
+ /// <summary>The track as a typeable value: semitones −12…+12 ("+3", "−5"), double-click 0.</summary>
internal ValueField EntryField(string name)
=> new(name, () => (_value + Range) / (2.0 * Range), n => Semis(Steps(n)), n => { int v = Steps(n); _value = v; InvalidateVisual(); Changed?.Invoke(v); },
() => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(), 0.5);
@@ -75,7 +75,7 @@ internal sealed class ChordShiftTrack : Control
{
if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;
e.Handled = true;
- if ((e.KeyModifiers & KeyModifiers.Alt) != 0) { _value = 0; InvalidateVisual(); GestureBegin?.Invoke(); Changed?.Invoke(0); GestureEnd?.Invoke(); return; }
+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { _value = 0; InvalidateVisual(); GestureBegin?.Invoke(); Changed?.Invoke(0); GestureEnd?.Invoke(); return; }
_drag = true;
e.Pointer.Capture(this);
GestureBegin?.Invoke();
diff --git a/src/managed/Nota.App/Controls/IValueEntryHost.cs b/src/managed/Nota.App/Controls/IValueEntryHost.cs
index 566fa34e..fbe6ca98 100644
--- a/src/managed/Nota.App/Controls/IValueEntryHost.cs
+++ b/src/managed/Nota.App/Controls/IValueEntryHost.cs
@@ -25,7 +25,7 @@ internal sealed record ValueField(string Name, Func<double> Get, Func<double, st
{
/// <summary>Resets by action instead of by position (a slider row's own reset).</summary>
public Action? Reset { get; init; }
- /// <summary>Removes instead of resetting (a matrix route, a cable): ⌥-click and the menu's Clear.</summary>
+ /// <summary>Removes instead of resetting (a matrix route, a cable): double-click and the menu's Clear.</summary>
public Action? Clear { get; init; }
/// <summary>Repaints the owner after a commit or a reset.</summary>
public Action? After { get; init; }
diff --git a/src/managed/Nota.App/Controls/Knob.cs b/src/managed/Nota.App/Controls/Knob.cs
index 8fbb030c..4d2e2616 100644
--- a/src/managed/Nota.App/Controls/Knob.cs
+++ b/src/managed/Nota.App/Controls/Knob.cs
@@ -6,7 +6,7 @@
// raised cap on a seam and a primary-ink pointer —
// all laid out on a 52-unit grid (groove r 21 · stroke 5, cap r 14, pointer 2.4 wide
// reaching the cap's edge) and scaled to the knob's size. Drag vertically to change
-// (up = increase; Ctrl/⌘/Shift = fine). Double-click types a value and ⌥-click resets
+// (up = increase; Ctrl/⌘/Shift = fine). Double-click resets and ⌥-click types a value
// (ValueEntry, attached by KnobCell once `Format` is set). Same public API as
// MiniFader (Value / max / Accent / ValueChanged / GestureBegin / GestureEnd) so it
// drops into the plugin editors.
@@ -79,7 +79,7 @@ public sealed class Knob : Control
public bool IsDim { get => _dim; set { if (_dim == value) return; _dim = value; InvalidateVisual(); } }
private bool _dim;
- /// <summary>Value restored on ⌥-click (NaN = no reset).</summary>
+ /// <summary>Value restored on double-click (NaN = no reset).</summary>
public double Default { get; set; } = double.NaN;
/// <summary>The read-out text at a value (0..max) — what the knob's value line shows. Pure:
@@ -148,9 +148,9 @@ public sealed class Knob : Control
{
// Left button only — let right-click bubble to a context menu (e.g. CV modulate).
if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;
- // ⌥-click restores the default — ValueEntry handles it first on an attached knob; this
- // keeps reset on a knob built without one.
- if ((e.KeyModifiers & KeyModifiers.Alt) != 0 && !double.IsNaN(Default))
+ // Double-click (or ⌥-click) restores the default — ValueEntry handles it first on an
+ // attached knob (⌥ types there); this keeps reset on a knob built without one.
+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0) && !double.IsNaN(Default))
{
GestureBegin?.Invoke();
SetByHand(Default);
diff --git a/src/managed/Nota.App/Controls/MiniFader.cs b/src/managed/Nota.App/Controls/MiniFader.cs
index 7d374760..bc3da485 100644
--- a/src/managed/Nota.App/Controls/MiniFader.cs
+++ b/src/managed/Nota.App/Controls/MiniFader.cs
@@ -25,7 +25,7 @@ public sealed class MiniFader : Control
/// <summary>On the audio path: neutral ink fill + cap instead of the quieter rule grey.</summary>
public bool Accent { get; init; }
- /// <summary>⌥-click target value, or negative to disable reset.</summary>
+ /// <summary>Double-click target value, or negative to disable reset.</summary>
public double Default { get; init; } = -1;
private readonly double _max;
@@ -60,9 +60,9 @@ public sealed class MiniFader : Control
{
// Left button only — right-click bubbles to the CV-modulate / MIDI Learn menu.
if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;
- // ⌥-click resets to the default value (e.g. 0 dB for a track volume) — ValueEntry
- // handles it first once attached; double-click types a value there.
- if ((e.KeyModifiers & KeyModifiers.Alt) != 0 && Default >= 0)
+ // Double-click resets to the default value (e.g. 0 dB for a track volume) — ValueEntry
+ // handles it first once attached; ⌥-click types a value there.
+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0) && Default >= 0)
{
GestureBegin?.Invoke();
SetValue(Default);
diff --git a/src/managed/Nota.App/Controls/PanBar.cs b/src/managed/Nota.App/Controls/PanBar.cs
index 50a33154..3cfc23d3 100644
--- a/src/managed/Nota.App/Controls/PanBar.cs
+++ b/src/managed/Nota.App/Controls/PanBar.cs
@@ -3,8 +3,8 @@
//
// A compact bipolar pan bar for the arrangement track header: a
// rounded field with a centre tick and a brass fill that grows from the centre
-// toward the panned side, "50L … C … 50R" text over it. Drag to set; double-click types
-// a value, ⌥-click centres it. Fires GestureBegin/End so callers can bracket an
+// toward the panned side, "50L … C … 50R" text over it. Drag to set; double-click centres
+// it, ⌥-click types a value. Fires GestureBegin/End so callers can bracket an
// automation write, like MiniFader / the gauge Knob.
using System;
@@ -55,7 +55,7 @@ public sealed class PanBar : Control
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return; // right-click bubbles
- if ((e.KeyModifiers & KeyModifiers.Alt) != 0) { GestureBegin?.Invoke(); Apply(0); GestureEnd?.Invoke(); e.Handled = true; return; } // centre
+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { GestureBegin?.Invoke(); Apply(0); GestureEnd?.Invoke(); e.Handled = true; return; } // centre
_drag = true;
_lastY = e.GetPosition(this).Y;
_raw = _pan;
@@ -95,7 +95,7 @@ public sealed class PanBar : Control
base.OnPointerCaptureLost(e);
}
- /// <summary>The bar as a typeable value ("30L", "C", "12R" on its own 50 scale); ⌥-click centres.</summary>
+ /// <summary>The bar as a typeable value ("30L", "C", "12R" on its own 50 scale); double-click centres.</summary>
internal ValueField EntryField(string name)
=> new(name, () => (_pan + 1) / 2, n => Label(Detent(n * 2 - 1)), n => Apply(n * 2 - 1),
() => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(), 0.5);
diff --git a/src/managed/Nota.App/Controls/PanKnob.cs b/src/managed/Nota.App/Controls/PanKnob.cs
index 8ac23107..e4022329 100644
--- a/src/managed/Nota.App/Controls/PanKnob.cs
+++ b/src/managed/Nota.App/Controls/PanKnob.cs
@@ -26,7 +26,7 @@ internal sealed class PanKnob : Control
public PanKnob(double pan) { _pan = Math.Clamp(pan, -1, 1); Width = 26; Height = 26; }
/// <summary>The knob as a typeable value; <paramref name="fmt"/> is its read-out at a pan
- /// (−1..1). ⌥-click centres it.</summary>
+ /// (−1..1). Double-click centres it.</summary>
internal ValueField EntryField(string name, Func<double, string> fmt)
=> new(name, () => (_pan + 1) / 2, n => fmt(n * 2 - 1), n => Set(n * 2 - 1),
() => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(), 0.5);
diff --git a/src/managed/Nota.App/Controls/PerformWheel.cs b/src/managed/Nota.App/Controls/PerformWheel.cs
index 306c859b..53ce119c 100644
--- a/src/managed/Nota.App/Controls/PerformWheel.cs
+++ b/src/managed/Nota.App/Controls/PerformWheel.cs
@@ -6,7 +6,7 @@
// neutral bar at the value (accent while dragged). Nota Operator's card keeps both on screen on every tab.
//
// Interaction matches the knob contract: vertical drag (up increases) over the wheel's own
-// height, Shift/Ctrl/⌘ for fine, a click never jumps the value, ⌥-click restores the
+// height, Shift/Ctrl/⌘ for fine, a click never jumps the value, double-click restores the
// default, and a spring wheel (pitch bend) returns to its default when released.
using System;
@@ -32,7 +32,7 @@ internal sealed class PerformWheel : Control
private bool _drag;
private double _startY, _startV;
- /// <summary>Value restored on ⌥-click, and sprung back to when <see cref="Spring"/>.</summary>
+ /// <summary>Value restored on double-click, and sprung back to when <see cref="Spring"/>.</summary>
public double Default { get; init; } = 0;
/// <summary>True for a pitch wheel: it snaps back to <see cref="Default"/> on release.</summary>
@@ -62,7 +62,7 @@ internal sealed class PerformWheel : Control
{
var pt = e.GetCurrentPoint(this);
if (!pt.Properties.IsLeftButtonPressed) return; // right-click bubbles to the CV / learn menu
- if ((e.KeyModifiers & KeyModifiers.Alt) != 0) { GestureBegin?.Invoke(); Write(Default); GestureEnd?.Invoke(); e.Handled = true; return; }
+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0)) { GestureBegin?.Invoke(); Write(Default); GestureEnd?.Invoke(); e.Handled = true; return; }
_drag = true; _startY = pt.Position.Y; _startV = _norm;
GestureBegin?.Invoke();
e.Pointer.Capture(this);
diff --git a/src/managed/Nota.App/Controls/RangeSliderTrack.cs b/src/managed/Nota.App/Controls/RangeSliderTrack.cs
index 0b2ac042..ba4a8ad2 100644
--- a/src/managed/Nota.App/Controls/RangeSliderTrack.cs
+++ b/src/managed/Nota.App/Controls/RangeSliderTrack.cs
@@ -5,7 +5,7 @@
// track, a brass fill between the handles and two 6×7 Brass Light handles. Works in
// normalised 0..1 (the caller maps to its units and keeps a minimum gap). A press picks the
// nearer handle and a horizontal drag moves it by the pointer's travel — a click never jumps
-// a value; Shift (or Ctrl/⌘) drags fine. ⌥-click resets. GestureBegin / GestureEnd
+// a value; Shift (or Ctrl/⌘) drags fine. Double-click resets. GestureBegin / GestureEnd
// (with the handle: 0 = low, 1 = high) bracket the drag for automation writes.
using System;
@@ -59,7 +59,7 @@ internal sealed class RangeSliderTrack : Control
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;
- if ((e.KeyModifiers & KeyModifiers.Alt) != 0 && Reset is not null)
+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0) && Reset is not null)
{
Reset();
e.Handled = true;
diff --git a/src/managed/Nota.App/Controls/SliderTrack.cs b/src/managed/Nota.App/Controls/SliderTrack.cs
index 26c9a723..2f2879cb 100644
--- a/src/managed/Nota.App/Controls/SliderTrack.cs
+++ b/src/managed/Nota.App/Controls/SliderTrack.cs
@@ -13,7 +13,7 @@
// a slider drags along its own axis (#115) — right increases and the handle follows the
// pointer — and a vertical drag still works as on a knob (up increases, full range over
// ~140px). Shift (or Ctrl/⌘) is fine on both; ew-resize; a click never jumps the value.
-// ⌥-click resets when a reset is supplied; double-click types a value (ValueEntry, attached
+// Double-click resets when a reset is supplied; ⌥-click types a value (ValueEntry, attached
// by the row); right-click opens the parameter menu.
// GestureBegin / GestureEnd bracket the drag so automation writes are recorded, and the
// row's live-follow refresher should skip while Dragging.
@@ -59,7 +59,7 @@ internal sealed class SliderTrack : Control
public double Marker { get => _marker; set { if (value.Equals(_marker)) return; _marker = value; InvalidateVisual(); } }
private double _marker = double.NaN;
- /// <summary>⌥-click handler (restore the default). Null disables reset. Double-click types a
+ /// <summary>Double-click handler (restore the default). Null disables reset. ⌥-click types a
/// value once the row attaches ValueEntry (DeviceCardKit.SliderRow does).</summary>
public Action? Reset { get; init; }
@@ -83,7 +83,7 @@ internal sealed class SliderTrack : Control
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) return;
- if ((e.KeyModifiers & KeyModifiers.Alt) != 0 && Reset is not null)
+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0) && Reset is not null)
{
GestureBegin?.Invoke();
Reset();
diff --git a/src/managed/Nota.App/Controls/VFader.cs b/src/managed/Nota.App/Controls/VFader.cs
index 0ccb523d..378b006c 100644
--- a/src/managed/Nota.App/Controls/VFader.cs
+++ b/src/managed/Nota.App/Controls/VFader.cs
@@ -32,7 +32,7 @@ internal sealed class VFader : Control
public void SetValueExternal(double v) { _value = Math.Clamp(v, 0, Max); InvalidateVisual(); }
/// <summary>The fader as a typeable value; <paramref name="fmt"/> is its read-out at a value
- /// (0..1.5), <paramref name="def"/> the value ⌥-click restores.</summary>
+ /// (0..1.5), <paramref name="def"/> the value a double-click restores.</summary>
internal ValueField EntryField(string name, Func<double, string> fmt, double? def)
=> new(name, () => _value / Max, n => fmt(n * Max), n => Set(n * Max),
() => GestureBegin?.Invoke(), () => GestureEnd?.Invoke(), def is { } d ? Math.Clamp(d, 0, Max) / Max : null);
@@ -45,7 +45,7 @@ internal sealed class VFader : Control
}
// Relative, like every value control (DESIGN.md § Interaction contract): a click never
- // jumps the value — so the first click of a double-click (type a value) moves nothing.
+ // jumps the value — so the first click of a double-click (reset) moves nothing.
private double _startY, _startV;
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
diff --git a/src/managed/Nota.App/Controls/ValueBar.cs b/src/managed/Nota.App/Controls/ValueBar.cs
index c911cb90..01d47c57 100644
--- a/src/managed/Nota.App/Controls/ValueBar.cs
+++ b/src/managed/Nota.App/Controls/ValueBar.cs
@@ -3,7 +3,7 @@
//
// A draggable value box: a rounded field showing the
// value text centered over a horizontal fill that tracks the normalized value. Drag
-// vertically to change (up = increase); double-click types a value, ⌥-click resets to the default. Fires
+// vertically to change (up = increase); double-click resets to the default, ⌥-click types a value. Fires
// GestureBegin/End so callers can bracket an automation write, like the gauge Knob.
using System;
@@ -33,7 +33,7 @@ public sealed class ValueBar : Control
public bool Accent { get; init; }
/// <summary>Value change per pixel of vertical drag.</summary>
public double Sensitivity { get; init; } = 0.006;
- /// <summary>⌥-click target (normalized), or negative to disable reset.</summary>
+ /// <summary>Double-click target (normalized), or negative to disable reset.</summary>
public double Default { get; init; } = -1;
public event Action<double>? ValueChanged;
@@ -62,7 +62,7 @@ public sealed class ValueBar : Control
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
- if ((e.KeyModifiers & KeyModifiers.Alt) != 0 && Default >= 0) { GestureBegin?.Invoke(); Apply(Default); GestureEnd?.Invoke(); e.Handled = true; return; }
+ if ((e.ClickCount == 2 || (e.KeyModifiers & KeyModifiers.Alt) != 0) && Default >= 0) { GestureBegin?.Invoke(); Apply(Default); GestureEnd?.Invoke(); e.Handled = true; return; }
_drag = true;
_lastY = e.GetPosition(this).Y;
e.Pointer.Capture(this);
diff --git a/src/managed/Nota.App/Controls/ValueEntry.cs b/src/managed/Nota.App/Controls/ValueEntry.cs
index b91b0ad8..4628db3c 100644
--- a/src/managed/Nota.App/Controls/ValueEntry.cs
+++ b/src/managed/Nota.App/Controls/ValueEntry.cs
@@ -5,12 +5,13 @@
// drag (vertical) and double-click-type"; specs/035-typed-value-entry). One gesture scheme
// for every knob, fader, slider, graph handle and matrix cell:
//
-// double-click turns the read-out itself editable — a borderless text box in its place
-// (an adorner, so it works whatever panel the read-out sits in) with a 1px
-// accent line under it and the number selected; Enter or a click away commits, Escape
-// cancels, Tab / Shift+Tab commit and move to the next / previous value on
-// the same card (the nearest Scope), wrapping
-// ⌥/Alt-click restores the default (or clears a route)
+// double-click on the control restores the default (or clears a route)
+// ⌥/Alt-click (and a double-click on the read-out) turns the read-out itself editable —
+// a borderless text box in its place (an adorner, so it works whatever panel
+// the read-out sits in) with a 1px accent line under it and the number
+// selected; Enter or a click away commits, Escape cancels, Tab / Shift+Tab
+// commit and move to the next / previous value on the same card (the nearest
+// Scope), wrapping
// right-click a parameter menu — Type value…, Reset to default / Clear — unless the
// control has its own menu, which then adds MenuItems itself
//
@@ -78,12 +79,13 @@ internal static partial class ValueEntry
Entries.AddOrUpdate(control, new Entry(control, () => fields, AnchorOf));
void Press(object? s, PointerPressedEventArgs e)
{
- if (Pressed(e, s as Visual ?? control, field)) Open(control, field, AnchorOf(field));
+ bool onReadout = control is TextBlock || readout is not null && ReferenceEquals(s, readout);
+ if (Pressed(e, s as Visual ?? control, field, onReadout: onReadout)) Open(control, field, AnchorOf(field));
}
control.AddHandler(InputElement.PointerPressedEvent, Press, RoutingStrategies.Tunnel);
if (readout is not null && !ReferenceEquals(readout, control))
{
- readout.Background ??= Brushes.Transparent; // the whole column takes the double-click, not just the glyphs
+ readout.Background ??= Brushes.Transparent; // the whole column takes the click, not just the glyphs
readout.AddHandler(InputElement.PointerPressedEvent, Press, RoutingStrategies.Tunnel);
}
if (!menu) return;
@@ -131,7 +133,7 @@ internal static partial class ValueEntry
/// <summary>A slider row's read-out, typed by probing the row's own setter (<paramref name="setNorm"/>
/// then <paramref name="text"/>). <paramref name="control"/> (its slider) takes the same gestures;
- /// <paramref name="reset"/> — by default the slider's own Reset — is what ⌥-click and the menu run.</summary>
+ /// <paramref name="reset"/> — by default the slider's own Reset — is what a double-click and the menu run.</summary>
public static void Attach(TextBlock readout, Func<double> norm, Action<double> setNorm, Func<string> text,
Action? begin = null, Action? end = null, Action? after = null, Action? reset = null, Control? control = null, string name = "Value")
=> Attach(control ?? readout, Probing(name, norm, setNorm, text, begin, end, after, reset ?? (control as SliderTrack)?.Reset), readout);
@@ -142,21 +144,23 @@ internal static partial class ValueEntry
=> new(name, norm, n => { setNorm(n); return text(); }, setNorm, begin, end)
{ Probes = true, After = after, Reset = reset };
- // A left press: ⌥ resets (every field of the handle), a double-click opens the box.
- private static bool Pressed(PointerPressedEventArgs e, Visual at, ValueField field, IReadOnlyList<ValueField>? all = null)
+ // A left press: ⌥ opens the box; a double-click resets (every field of the handle) — or,
+ // on the read-out, opens the box too.
+ private static bool Pressed(PointerPressedEventArgs e, Visual at, ValueField field, IReadOnlyList<ValueField>? all = null,
+ bool onReadout = false)
{
if (!e.GetCurrentPoint(at).Properties.IsLeftButtonPressed) return false;
- if ((e.KeyModifiers & KeyModifiers.Alt) != 0)
+ if ((e.KeyModifiers & KeyModifiers.Alt) != 0 || onReadout && e.ClickCount == 2)
{
- if (field.Clear is null && !(all ?? [field]).Any(f => f.CanReset)) return false; // ⌥ keeps the control's own meaning
e.Handled = true;
- if (field.Clear is not null) Clear(field);
- else foreach (var f in all ?? [field]) Reset(f);
- return false;
+ return true;
}
if (e.ClickCount != 2) return false;
+ if (field.Clear is null && !(all ?? [field]).Any(f => f.CanReset)) return false; // the control keeps its own double-click
e.Handled = true;
- return true;
+ if (field.Clear is not null) Clear(field);
+ else foreach (var f in all ?? [field]) Reset(f);
+ return false;
}
// ---- reset / clear / commit ----------------------------------------------------------
diff --git a/src/managed/Nota.App/DeviceCardKit.cs b/src/managed/Nota.App/DeviceCardKit.cs
index b00955b4..eb9e0203 100644
--- a/src/managed/Nota.App/DeviceCardKit.cs
+++ b/src/managed/Nota.App/DeviceCardKit.cs
@@ -78,7 +78,7 @@ internal static class DeviceCardKit
}
knob.ValueSet += Paint;
Paint();
- // Double-click the knob or its value to type one, ⌥-click to reset (specs/035). A knob
+ // ⌥-click the knob, or double-click its value, to type one; double-click the knob to reset (specs/035). A knob
// without a Format is typed by reading its value line back after each probe.
ValueEntry.Attach(knob, name, value);
return new StackPanel { Width = cellW, Spacing = 0, Children = { knob, lbl, value } };
@@ -195,8 +195,8 @@ internal static class DeviceCardKit
// parameter and does its own follow-up); `text` formats the value for display.
// `trackWidth` fixes the track, otherwise it stretches. An empty label drops the
// label column. `modulation` draws a modulation depth in teal. `sync` repaints from
- // `norm` and skips while the hand is on the slider. Double-clicking the slider or its
- // value types one in, ⌥-click runs `reset`. `textAt` (the read-out at a position, pure)
+ // `norm` and skips while the hand is on the slider. ⌥-clicking the slider or double-clicking
+ // its value types one in, a double-click on the slider runs `reset`. `textAt` (the read-out at a position, pure)
// lets typing search without writing the parameter; without it the row probes `setNorm`.
internal static Grid SliderRow(string label, Func<double> norm, Action<double> setNorm, Func<string> text, out Action sync,
Action? begin = null, Action? end = null, Action? reset = null, bool bipolar = false, Func<bool>? dim = null,
diff --git a/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs b/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs
index 811323e2..586c50b9 100644
--- a/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs
+++ b/src/managed/Nota.App/DeviceCards/Midi/ChordMidiBody.cs
@@ -501,7 +501,7 @@ internal sealed class ChordMidiBody : IMidiDeviceBody
bar.Changed += v => SetShift(s, v);
bar.GestureBegin += () => { Begin(pSt); Begin(pOn); }; bar.GestureEnd += () => { End(pSt); End(pOn); };
Learn(bar, pSt, $"Shift {s + 1}");
- ToolTip.SetTip(bar, $"Shift {s + 1}: drag up / down (±12 semitones) · double-click to type");
+ ToolTip.SetTip(bar, $"Shift {s + 1}: drag up / down (±12 semitones) · ⌥-click to type · double-click resets");
ValueEntry.Attach(bar, bar.EntryField($"Shift {s + 1}"));
var lbl = Mono("", Txt); lbl.HorizontalAlignment = HorizontalAlignment.Center;
var lblHit = new Border { Height = 11, Margin = new Thickness(0, 2, 0, 0), Background = Brushes.Transparent, Cursor = new Cursor(StandardCursorType.Hand), Child = lbl };
diff --git a/src/managed/Nota.App/DeviceCards/PluginCard.cs b/src/managed/Nota.App/DeviceCards/PluginCard.cs
index 95177ffe..5786a75a 100644
--- a/src/managed/Nota.App/DeviceCards/PluginCard.cs
+++ b/src/managed/Nota.App/DeviceCards/PluginCard.cs
@@ -298,7 +298,7 @@ internal static class PluginCard
}
// One plug-in parameter as the shared gauge knob: the plug-in's own value text, its
- // default on ⌥-click, typed values on double-click (KnobCell — probed, since a plug-in only
+ // default on double-click, typed values on ⌥-click (KnobCell — probed, since a plug-in only
// tells its text at the current value), automation-write gestures, MIDI Learn and live follow.
private static Control ParamKnob(DeviceCardContext ctx, int di, int p, string name, Func<bool> live)
{
diff --git a/src/managed/Nota.App/DeviceCards/Rack/MacroPanel.cs b/src/managed/Nota.App/DeviceCards/Rack/MacroPanel.cs
index e1883cea..caf17643 100644
--- a/src/managed/Nota.App/DeviceCards/Rack/MacroPanel.cs
+++ b/src/managed/Nota.App/DeviceCards/Rack/MacroPanel.cs
@@ -162,7 +162,7 @@ internal static class MacroPanel
};
tick.Add(() => { if (!knob.Dragging) { float v = Value(e, s, m); if (Math.Abs(v - knob.Value) > 1e-4) { knob.Value = v; value.Text = Pct(v); } } });
MidiLearn.Bind(knob, MidiTarget.PluginParam(track, di, pi), $"Macro {m + 1} · {s.MacroName(m)}");
- // Double-click types, ⌥-click resets; right-click stays the macro's own menu (the cell's).
+ // ⌥-click types, double-click resets; right-click stays the macro's own menu (the cell's).
ValueEntry.Attach(knob, $"Macro {m + 1}", value, menu: false);
string name = s.MacroName(m);
diff --git a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.Drum.cs b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.Drum.cs
index 07b9b8ce..13ccfa98 100644
--- a/src/managed/Nota.App/DeviceCards/Rack/RackCardView.Drum.cs
+++ b/src/managed/Nota.App/DeviceCards/Rack/RackCardView.Drum.cs
@@ -429,7 +429,7 @@ internal sealed partial class RackCardView
var vol = new SliderTrack { Norm = VolNorm(a.ChainGain(c)), Reset = () => a.SetChainGain(c, 1f) };
vol.Changed += v => a.SetChainGain(c, NormVol(v));
_irTick.Add(() => { if (!vol.Dragging) vol.Norm = VolNorm(a.ChainGain(c)); });
- ToolTip.SetTip(vol, "Pad volume · drag up or down, double-click to type, ⌥-click for 0\u2009dB");
+ ToolTip.SetTip(vol, "Pad volume · drag up or down, ⌥-click to type, double-click for 0\u2009dB");
ValueEntry.Attach(vol, new ValueField("Pad volume", () => VolNorm(a.ChainGain(c)), n => VolText(NormVol(n)),
n => { vol.Norm = n; a.SetChainGain(c, NormVol(n)); }, Default: VolNorm(1f)));
MidiLearn.Bind(vol, MidiTarget.RackChainGain(T, a.AutomationDeviceIndex, c), "Pad Volume");
diff --git a/src/managed/Nota.App/PreferencesWindow.cs b/src/managed/Nota.App/PreferencesWindow.cs
index 8515ff18..a568c3bc 100644
--- a/src/managed/Nota.App/PreferencesWindow.cs
+++ b/src/managed/Nota.App/PreferencesWindow.cs
@@ -1246,7 +1246,7 @@ public sealed partial class PreferencesWindow : NotaWindow
("Click waveform", "Play from that point"),
("Click WAVE / SPEC", "Switch the well between the waveform and a live spectrum"),
("Scroll on the track button", "Step through the demo tracks an effect preset is heard through"),
- ("Double-click volume", "Type the preview volume · ⌥-click resets it to 0\u2009dB"),
+ ("⌥-click volume", "Type the preview volume · double-click resets it to 0\u2009dB"),
}),
("Gamepad (macOS)", new[]
{
@@ -1286,9 +1286,9 @@ public sealed partial class PreferencesWindow : NotaWindow
("Drag clip + ⌥", "Position freely, ignoring the grid for this drag (the magnet in the transport latches the same thing)"),
("Drag knob", "Change a device value · hold ⌘ or ⇧ for fine steps"),
("Drag slider", "Left / right (or up / down) changes the value · hold ⌘ or ⇧ for fine steps"),
- ("Double-click a knob, fader or slider", "Type a value — on the control or its value (units like k, ms, dB, L / R work)"),
+ ("⌥-click a knob, fader or slider", "Type a value (units like k, ms, dB, L / R work) · double-click its value does the same"),
("Return · Esc · Tab / ⇧Tab (typing a value)", "Set it · cancel · set it and type the next / previous value on the card"),
- ("⌥-click a knob, fader or slider", "Reset the value to its default"),
+ ("Double-click a knob, fader or slider", "Reset the value to its default"),
("Right-click a knob, fader or slider", "Type value… · Reset to default"),
("Drag jack → jack", "Patch a cable in Nota Consort · ⌥-click a jack to pull its cables"),
("Click · ⇧ · ⌥ a Rhythm step", "Step on / off · accent · quiet step — drag across to paint, up / down (or scroll) for its velocity"),
diff --git a/src/managed/Nota.App/PreviewPlayer.cs b/src/managed/Nota.App/PreviewPlayer.cs
index 16dfd1ba..abbad2f4 100644
--- a/src/managed/Nota.App/PreviewPlayer.cs
+++ b/src/managed/Nota.App/PreviewPlayer.cs
@@ -6,8 +6,8 @@
// the name and format, the real waveform in a well (click = seek, hover = time tag, a brass
// playhead while it plays) or — WAVE / SPEC in the well's corner — a live spectrum of what
// the preview voice is playing, then Play/Stop, the time readout, the effect source (FX
-// presets only), Loop, Auto (selecting plays it) and a preview-volume fader (double-click
-// types a level, ⌥-click = 0 dB). A sample's waveform is decoded off the UI thread through the engine's background
+// presets only), Loop, Auto (selecting plays it) and a preview-volume fader (⌥-click
+// types a level, double-click = 0 dB). A sample's waveform is decoded off the UI thread through the engine's background
// import. A preset is rendered OFFLINE: IPresetAudition plans a phrase that suits it, a
// worker builds and renders a standalone rig (see IAuditionRig), and the engine keeps the
// result in its audition cache; the row below the selection is then pre-rendered, so
@@ -483,8 +483,8 @@ public sealed class PreviewPlayer : UserControl
try { _engine?.SetPreviewGain((float)(v * v)); } catch { }
_volWaves.Kind = v <= 0.001 ? GlyphKind.SpeakerMute : v < 0.5 ? GlyphKind.SpeakerLow : GlyphKind.SpeakerHigh;
var db = NotaNum.Db(v <= 0.001 ? double.NegativeInfinity : 40 * Math.Log10(v));
- ToolTip.SetTip(_volumeBox, $"Preview volume {db} · double-click to type · ⌥-click for 0{NotaNum.Thin}dB");
- ToolTip.SetTip(_volumePop, $"Preview volume {db} · double-click to type · ⌥-click for 0{NotaNum.Thin}dB");
+ ToolTip.SetTip(_volumeBox, $"Preview volume {db} · ⌥-click to type · double-click for 0{NotaNum.Thin}dB");
+ ToolTip.SetTip(_volumePop, $"Preview volume {db} · ⌥-click to type · double-click for 0{NotaNum.Thin}dB");
if (persist && _settings is not null) { _settings.Current.BrowserPreviewVolume = v; _settings.Save(); }
}
@@ -1115,7 +1115,7 @@ public sealed class PreviewWaveform : Control
}
/// <summary>The preview-volume fader: a thin track, a fill to the value and a small bar
-/// thumb. Drag anywhere to set; double-click types a level, ⌥-click resets to 0 dB (1.0).</summary>
+/// thumb. Drag anywhere to set; ⌥-click types a level, double-click resets to 0 dB (1.0).</summary>
public sealed class PreviewVolume : Control
{
private double _value = 0.7;