Skip to content

Commit 3c03789

Browse files
authored
Merge pull request #92 from NickvisionApps/beta2
2023.8.1-rc1
2 parents b6b5897 + dbfabb2 commit 3c03789

28 files changed

+2156
-1331
lines changed

NickvisionCavalier.GNOME/Blueprints/drawing_view.blp

+13
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ Gtk.Stack _root {
1515
};
1616
}
1717

18+
Gtk.StackPage _welcomePage {
19+
name: "welcome";
20+
child: Adw.Bin {
21+
Adw.StatusPage {
22+
icon-name: "man-dancing";
23+
title: _("Let's dance!");
24+
description: _("Cavalier listens to your system sound. Play some music or watch a video and see your sound come to life!");
25+
}
26+
27+
styles ["load-bin"]
28+
};
29+
}
30+
1831
Gtk.StackPage _glPage {
1932
name: "gl";
2033
child: Gtk.GLArea _glArea {

NickvisionCavalier.GNOME/Blueprints/preferences_dialog.blp

+52-7
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ Adw.PreferencesWindow _root {
9393
}
9494

9595
Adw.PreferencesGroup {
96+
visible: bind _boxButton.active inverted;
97+
9698
Adw.ActionRow {
9799
title: _("Radius");
98-
visible: bind _boxButton.active inverted;
99100

100101
[suffix]
101102
Gtk.Scale _radiusScale {
@@ -108,6 +109,21 @@ Adw.PreferencesWindow _root {
108109
};
109110
}
110111
}
112+
113+
Adw.ActionRow {
114+
title: _("Rotation");
115+
116+
[suffix]
117+
Gtk.Scale _rotationScale {
118+
width-request: 150;
119+
draw-value: false;
120+
adjustment: Gtk.Adjustment {
121+
lower: 0;
122+
upper: 6.284;
123+
step-increment: 0.01;
124+
};
125+
}
126+
}
111127
}
112128

113129
Adw.PreferencesGroup {
@@ -132,7 +148,6 @@ Adw.PreferencesWindow _root {
132148
model: Gtk.StringList {
133149
strings [_("Top to bottom"), _("Bottom to top"), _("Left to right"), _("Right to left") ]
134150
};
135-
sensitive: bind _boxButton.active;
136151
}
137152

138153
Adw.ActionRow {
@@ -153,6 +168,36 @@ Adw.PreferencesWindow _root {
153168
}
154169
}
155170

171+
Adw.ActionRow {
172+
title: _("Drawing area X offset");
173+
174+
[suffix]
175+
Gtk.Scale _areaOffsetXScale {
176+
width-request: 150;
177+
draw-value: false;
178+
adjustment: Gtk.Adjustment {
179+
lower: -0.5;
180+
upper: 0.5;
181+
step-increment: 0.01;
182+
};
183+
}
184+
}
185+
186+
Adw.ActionRow {
187+
title: _("Drawing area Y offset");
188+
189+
[suffix]
190+
Gtk.Scale _areaOffsetYScale {
191+
width-request: 150;
192+
draw-value: false;
193+
adjustment: Gtk.Adjustment {
194+
lower: -0.5;
195+
upper: 0.5;
196+
step-increment: 0.01;
197+
};
198+
}
199+
}
200+
156201
Adw.ActionRow _offsetRow {
157202
title: _("Offset between items");
158203
subtitle: _("The size of spaces between elements (in percent).");
@@ -367,14 +412,14 @@ Adw.PreferencesWindow _root {
367412

368413
[suffix]
369414
Gtk.Scale _noiseReductionScale {
370-
width-request: 190;
415+
width-request: 180;
371416
draw-value: true;
372417
value-pos: left;
373-
digits: 2;
418+
digits: 0;
374419
adjustment: Gtk.Adjustment {
375-
lower: 0.15;
376-
upper: 0.95;
377-
step-increment: 0.01;
420+
lower: 15;
421+
upper: 95;
422+
step-increment: 1;
378423
};
379424
}
380425
}

NickvisionCavalier.GNOME/Blueprints/shortcuts_dialog.blp

+16-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Gtk.ShortcutsWindow _shortcuts {
2222
accelerator: "U <Shift>U";
2323
}
2424

25+
Gtk.ShortcutsShortcut {
26+
title: _("Change rotation in Circle modes");
27+
accelerator: "O <Shift>O";
28+
}
29+
2530
Gtk.ShortcutsShortcut {
2631
title: _("Change Mirror Mode");
2732
accelerator: "M <Shift>M";
@@ -37,9 +42,19 @@ Gtk.ShortcutsWindow _shortcuts {
3742
accelerator: "N <Shift>N";
3843
}
3944

45+
Gtk.ShortcutsShortcut {
46+
title: _("Change Drawing Area X Offset");
47+
accelerator: "X <Shift>X";
48+
}
49+
50+
Gtk.ShortcutsShortcut {
51+
title: _("Change Drawing Area Y Offset");
52+
accelerator: "Y <Shift>Y";
53+
}
54+
4055
Gtk.ShortcutsShortcut {
4156
title: _("Change Drawing Direction");
42-
accelerator: "O <Shift>O";
57+
accelerator: "G <Shift>G";
4358
}
4459

4560
Gtk.ShortcutsShortcut {

NickvisionCavalier.GNOME/Blueprints/window.blp

+17-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,23 @@ Adw.ApplicationWindow _root {
1616
[overlay]
1717
Adw.Bin _resizeBin {
1818
visible: false;
19-
child: Gtk.Image {
20-
icon-name: "org.nickvision.cavalier";
21-
pixel-size: 128;
19+
child: Gtk.Box {
20+
orientation: vertical;
21+
spacing: 12;
22+
valign: center;
23+
24+
Gtk.Image {
25+
icon-name: "org.nickvision.cavalier";
26+
pixel-size: 128;
27+
}
28+
29+
Adw.ButtonContent {
30+
halign: center;
31+
icon-name: "view-fullscreen-symbolic";
32+
label: _("Resizing...");
33+
34+
styles ["dim-label", "title-3"]
35+
}
2236
};
2337

2438
styles [ "background" ]

NickvisionCavalier.GNOME/Program.cs

+3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ public Program(string[] args)
3737
@"* Added Cairo backend that can be used in case of problems with OpenGL. To activate, run the program with environment variable CAVALIER_RENDERER=cairo
3838
* All drawing modes except Splitter now have Circle variants
3939
* Added an easter egg (run the program with --help to find how to activate it)
40+
* Added welcome screen that is shown on start until any sound gets detected
4041
* Fixed an issue where the app wasn't drawing correctly with >100% display scaling
42+
* CAVA updated to 0.9.0
43+
* Pipewire is now used as default input method, you can still change back to Pulse Audio using environment variable CAVALIER_INPUT_METHOD=pulse
4144
* Updated translations (Thanks everyone on Weblate!)";
4245
_application.OnActivate += OnActivate;
4346
if (File.Exists(Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)) + "/org.nickvision.cavalier.gresource"))
Loading

NickvisionCavalier.GNOME/Resources/org.nickvision.cavalier.gresource.xml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
</gresource>
66
<gresource prefix="/org/nickvision/cavalier/icons/scalable/status/">
77
<file preprocess="xml-stripblanks">cross-symbolic.svg</file>
8+
<file preprocess="xml-stripblanks">man-dancing.svg</file>
89
<file preprocess="xml-stripblanks">x-circular-symbolic.svg</file>
910
</gresource>
1011
</gresources>

NickvisionCavalier.GNOME/Views/DrawingView.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using NickvisionCavalier.Shared.Controllers;
33
using SkiaSharp;
44
using System;
5+
using System.Linq;
56
using System.Runtime.InteropServices;
67
using System.Timers;
78

@@ -28,6 +29,7 @@ public partial class DrawingView : Gtk.Stack, IDisposable
2829
private readonly GSourceFunc _showGl;
2930
private readonly GSourceFunc _queueRender;
3031
private readonly Timer _renderTimer;
32+
private bool _showWelcome;
3133
private GRContext? _ctx;
3234
private SKImageInfo? _imgInfo;
3335
private SKSurface? _glSurface;
@@ -39,6 +41,7 @@ private DrawingView(Gtk.Builder builder, DrawingViewController controller) : bas
3941
{
4042
_disposed = false;
4143
_controller = controller;
44+
_showWelcome = true;
4245
//Build UI
4346
builder.Connect(this);
4447
if (Environment.GetEnvironmentVariable("CAVALIER_RENDERER")?.ToLower() == "cairo")
@@ -62,9 +65,17 @@ private DrawingView(Gtk.Builder builder, DrawingViewController controller) : bas
6265
_controller.CAVA.OutputReceived += (sender, sample) =>
6366
{
6467
_sample = sample;
68+
if (_showWelcome && sample.Any(s => s != 0))
69+
{
70+
_showWelcome = false;
71+
}
6572
GLib.Functions.IdleAdd(0, () =>
6673
{
67-
if (GetVisibleChildName() != (_useCairo ? "cairo" : "gl"))
74+
if (_showWelcome && GetVisibleChildName() != "welcome")
75+
{
76+
SetVisibleChildName("welcome");
77+
}
78+
if (!_showWelcome && GetVisibleChildName() != (_useCairo ? "cairo" : "gl"))
6879
{
6980
SetVisibleChildName(_useCairo ? "cairo" : "gl");
7081
}

0 commit comments

Comments
 (0)