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) Disable play with space button for preview player

Egor Khindikaynen0657f8b3eb47
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b59a122c..d14cafc1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -136,6 +136,8 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
- A project now finds its plug-ins even when they're installed in a different folder than on
the computer that saved it. Before, such a plug-in counted as missing.
- Rescanning plug-ins removes VST3 plug-ins that were deleted from disk from the browser.
+- Space always starts and stops the project, even while a sample or preset is selected in
+ the browser. The browser's preview plays and stops with its play button.
### Changed
- VST3 and AU plug-ins get a proper device card with two sizes. The header names the
diff --git a/src/managed/Nota.App/BrowserView.cs b/src/managed/Nota.App/BrowserView.cs
index 7306c36d..216e1292 100644
--- a/src/managed/Nota.App/BrowserView.cs
+++ b/src/managed/Nota.App/BrowserView.cs
@@ -192,7 +192,7 @@ public sealed class BrowserView : UserControl
// Pinned preview footer + the status line under it.
private readonly PreviewPlayer _previewFooter; // sample / preset auditioner — list tabs
- // The player stays hidden until the user works a list (click, arrow keys, Space) and hides
+ // The player stays hidden until the user works a list (click, arrow keys) and hides
// again once a row is dragged or double-clicked onto the project.
private bool _previewShown;
private bool _listPointerDown; // a single click is in progress on a list row
@@ -959,16 +959,6 @@ public sealed class BrowserView : UserControl
return mi;
}
- /// <summary>Space while the Files list has focus: the player's Play / Stop. False when
- /// the key isn't the browser's (another tab, nothing to play) so it falls to the transport.</summary>
- public bool TryTogglePreview(object? source)
- {
- if (_active > PresetsTab || !_previewFooter.HasSample) return false;
- for (var c = source as StyledElement; c is not null; c = c.Parent)
- if (c == _pages[_active] || c == _previewFooter) { ShowPreview(true); _previewFooter.Toggle(); return true; }
- return false;
- }
-
private void ShowPreview(bool shown)
{
_previewShown = shown;
diff --git a/src/managed/Nota.App/MainWindow.Input.cs b/src/managed/Nota.App/MainWindow.Input.cs
index 117d7a38..d5138a69 100644
--- a/src/managed/Nota.App/MainWindow.Input.cs
+++ b/src/managed/Nota.App/MainWindow.Input.cs
@@ -45,8 +45,6 @@ public partial class MainWindow
if (e.Key == Key.Space)
{
- // In the Files list Space auditions the selected sample instead.
- if (Browser.TryTogglePreview(e.Source)) { e.Handled = true; return; }
_vm.Transport.PlayStopCommand.Execute(null);
e.Handled = true;
}
diff --git a/src/managed/Nota.App/PreferencesWindow.cs b/src/managed/Nota.App/PreferencesWindow.cs
index 859576b3..9cd5dd94 100644
--- a/src/managed/Nota.App/PreferencesWindow.cs
+++ b/src/managed/Nota.App/PreferencesWindow.cs
@@ -932,7 +932,7 @@ public sealed partial class PreferencesWindow : NotaWindow
("BROWSER · PREVIEW", new[]
{
("↑ ↓", "Move through samples, presets and devices · with Auto on, each one plays as it is selected"),
- ("Space", "Play / stop the selected sample, preset or device (while a browser list has focus)"),
+ ("Click play button", "Play / stop the selected sample, preset or device"),
("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"),
diff --git a/src/managed/Nota.App/PreviewPlayer.cs b/src/managed/Nota.App/PreviewPlayer.cs
index 44dc7603..36c76c90 100644
--- a/src/managed/Nota.App/PreviewPlayer.cs
+++ b/src/managed/Nota.App/PreviewPlayer.cs
@@ -141,7 +141,7 @@ public sealed class PreviewPlayer : UserControl
HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,
};
_playBtn = Chip(new Panel { Children = { _playGlyph, _stopGlyph } }, 28, 28, 5);
- ToolTip.SetTip(_playBtn, "Play / Stop (Space)");
+ ToolTip.SetTip(_playBtn, "Play / Stop");
_playBtn.PointerPressed += (_, e) => { if (IsLeft(e)) { Toggle(); e.Handled = true; } };
_timeNow = new TextBlock { FontSize = 10, FontFamily = NotaFonts.MonoFamily, VerticalAlignment = VerticalAlignment.Center };
@@ -321,7 +321,7 @@ public sealed class PreviewPlayer : UserControl
Replan(play: _autoPresets, wasPlaying);
}
- /// <summary>Space in a browser list: play the selection, or stop it.</summary>
+ /// <summary>The play button: play the selection, or stop it. Mouse only — Space stays the transport's.</summary>
public void Toggle()
{
if (_playing) Stop();