Skip to content

Commit 31a2e35

Browse files
authored
Merge pull request #374 from technosf/development
2.1.0
2 parents bfae090 + cefb065 commit 31a2e35

42 files changed

Lines changed: 2410 additions & 827 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

data/css/Tuner-system.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,50 @@
5656
border-style: ridge;
5757
}
5858

59+
/* Remove green focus/active outline during drag */
60+
.station-button:focus,
61+
.station-button:active,
62+
.station-button.reorderable:focus,
63+
.station-button.reorderable:active {
64+
outline-style: none;
65+
outline-width: 0;
66+
-gtk-outline-width: 0;
67+
box-shadow: none;
68+
}
69+
70+
/* Suppress FlowBox focus rings around station items */
71+
flowboxchild:focus,
72+
flowboxchild:active,
73+
flowboxchild:selected,
74+
flowboxchild:selected:focus,
75+
flowboxchild:selected:active {
76+
outline-style: none;
77+
outline-width: 0;
78+
-gtk-outline-width: 0;
79+
box-shadow: none;
80+
border: none;
81+
background: transparent;
82+
}
83+
84+
/* Suppress drag outlines within station lists */
85+
.station-list,
86+
.station-list flowboxchild,
87+
.station-list flowboxchild:focus,
88+
.station-list flowboxchild:active,
89+
.station-list flowboxchild:selected,
90+
.station-list flowboxchild:selected:focus,
91+
.station-list flowboxchild:selected:active,
92+
.station-list flowboxchild:drop(active),
93+
.station-list flowboxchild.drag-highlight {
94+
/* GTK3 focus ring removal for DnD; note this hides keyboard focus. */
95+
outline-style: none;
96+
outline-width: 0;
97+
-gtk-outline-width: 0;
98+
box-shadow: none;
99+
border: none;
100+
background: transparent;
101+
}
102+
59103
/* Spaces the station button image */
60104
.station-button image {
61105
background-color: darker(@bg_color);
@@ -84,3 +128,27 @@
84128
padding-bottom: 0px;
85129
}
86130

131+
tooltip {
132+
opacity: 0.65;
133+
background-color: black;
134+
}
135+
136+
.metadata-popover {
137+
opacity: 0.65;
138+
/* Match popover background to tooltip background. */
139+
background-color: black;
140+
}
141+
142+
.heart-favorited image {
143+
color: #d00000;
144+
}
145+
146+
/* Search revealer background to avoid transparency gaps */
147+
.search-revealer-bg {
148+
/* Use a solid, theme-safe color */
149+
background-color: shade(@theme_bg_color, 0.90);
150+
background-image: none;
151+
box-shadow: none;
152+
border: 2px solid shade(@theme_bg_color, 0.8);
153+
border-radius: 0;
154+
}

data/io.github.tuner_labs.tuner.gresource.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ SPDX-License-Identifier: GPL-3.0-or-later
2929

3030
</gresource>
3131

32-
</gresources>
32+
<gresource prefix="/io/github/tuner_labs/tuner/sounds">
33+
<file alias="tuner_startup.mp3">sounds/tuner_startup.mp3</file>
34+
</gresource>
3335

36+
</gresources>

data/io.github.tuner_labs.tuner.gschema.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ SPDX-License-Identifier: GPL-3.0-or-later
4848
<default>false</default>
4949
<summary>Faster cycling through stream info</summary>
5050
<description>Fast cycle through the metadata from the playing stream if show stream info is enabled</description>
51-
</key>
51+
</key>
52+
<key name="stream-info-image-popup" type="b">
53+
<default>false</default>
54+
<summary>Stream metadata image popup</summary>
55+
<description>Show a movable popup with images discovered in the stream metadata</description>
56+
</key>
5257
<key name="excluded-countries" type="as">
5358
<default>[]</default>
5459
<summary>Excluded Countries</summary>
@@ -94,5 +99,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
9499
<summary>Restart playing after a network interuption</summary>
95100
<description>If enabled, if there is an network interuption and Tuner was playing Tuner will automatically start to play the last played station</description>
96101
</key>
102+
<key name="source-list-expanded-mask" type="u">
103+
<default>2</default>
104+
<summary>Source list expansion state</summary>
105+
<description>Bitmask of expanded source list sections</description>
106+
</key>
97107
</schema>
98108
</schemalist>

data/sounds/tuner_startup.mp3

10.2 KB
Binary file not shown.

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
project (
1313
'io.github.tuner_labs.tuner',
1414
'vala', 'c',
15-
version: '2.0.3',
15+
version: '2.0.4-beta.1',
1616
meson_version: '>= 1.3.2',
1717
)
1818

scripts/helpers/tbrl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
set -e
1414

1515
meson compile -C builddir
16-
GSETTINGS_SCHEMA_DIR="builddir/data" ./builddir/io.github.tuner_labs.tuner
16+
G_MESSAGES_DEBUG=all GSETTINGS_SCHEMA_DIR="builddir/data" ./builddir/io.github.tuner_labs.tuner

scripts/helpers/trl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

1313
set -e
1414

15-
GSETTINGS_SCHEMA_DIR="builddir/data" ./builddir/io.github.tuner_labs.tuner
15+
G_MESSAGES_DEBUG=all GSETTINGS_SCHEMA_DIR="builddir/data" ./builddir/io.github.tuner_labs.tuner

src/Application.vala

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
using GLib;
13+
using Gst;
1314
using Tuner.Coordinators;
1415
using Tuner.Controllers;
1516
using Tuner.Events;
@@ -68,9 +69,6 @@ namespace Tuner {
6869
{
6970
private delegate void StringActionHandler(string value);
7071

71-
/** @brief Signal emitted when the shuffle mode changes */
72-
public signal void shuffle_mode_sig(bool shuffle);
73-
7472
public static string ENV_LANG = "LANGUAGE";
7573

7674
/** @brief Application version */
@@ -131,7 +129,7 @@ namespace Tuner {
131129
} catch (Error e) {
132130
warning(@"Error reading locale path: $(e.message)");
133131
}
134-
}
132+
} // static construct
135133

136134
// -------------------------------------
137135

@@ -227,7 +225,7 @@ namespace Tuner {
227225
_is_online = value;
228226
is_offline = !value;
229227
if (events != null)
230-
events.connectivity_changed(_is_online, is_offline);
228+
events.connectivity_changed_sig(_is_online );
231229
}
232230
}
233231

@@ -251,6 +249,7 @@ namespace Tuner {
251249
private bool _has_started = false;
252250
// Coordinates startup-only cross-component flows (e.g., deferred autoplay).
253251
private StartupCoordinator _startup_coordinator;
252+
private Gst.Element? _startup_jingle;
254253
// Coordinates playback restart behavior after online/offline transitions.
255254
private PlaybackRecoveryCoordinator _playback_recovery_coordinator;
256255
// Coordinates provider click/vote updates from player events.
@@ -261,7 +260,7 @@ namespace Tuner {
261260
* @brief Constructor for the Application
262261
*/
263262
private Application () {
264-
Object (
263+
GLib.Object (
265264
application_id: APP_ID,
266265
flags: ApplicationFlags.FLAGS_NONE
267266
);
@@ -429,7 +428,7 @@ namespace Tuner {
429428
private void initialize_coordinators()
430429
{
431430
_playback_recovery_coordinator = new PlaybackRecoveryCoordinator(this, events, player, settings);
432-
_usage_tracking_coordinator = new UsageTrackingCoordinator(settings, player, provider);
431+
_usage_tracking_coordinator = new UsageTrackingCoordinator(settings, events, provider);
433432
}
434433

435434

@@ -548,16 +547,57 @@ namespace Tuner {
548547
private void create_main_window()
549548
{
550549
window = new Window (this, player, settings, directory);
550+
play_startup_jingle ();
551551
_startup_coordinator = new StartupCoordinator(this, events, window, settings, directory);
552552
_startup_coordinator.start();
553553

554554
// Flathub screenshot sizing
555-
window.resize(1000, 625); // Screenshot sizing - round corners 80, ds op 1
555+
//window.resize(1000, 625); // Screenshot sizing - round corners 80, ds op 1
556556

557557
add_window(window);
558558
}
559559

560560

561+
/**
562+
* @brief Play the startup jingle (resource-backed WAV) once per launch.
563+
*/
564+
private void play_startup_jingle ()
565+
{
566+
if (_startup_jingle != null)
567+
return;
568+
569+
var playbin = Gst.ElementFactory.make ("playbin", "startup-jingle");
570+
if (playbin == null)
571+
return;
572+
573+
var uri = "resource:///io/github/tuner_labs/tuner/sounds/tuner_startup.mp3";
574+
playbin.set ("uri", uri);
575+
playbin.set ("volume", settings.volume);
576+
_startup_jingle = playbin;
577+
578+
var bus = playbin.get_bus ();
579+
if (bus != null)
580+
{
581+
bus.add_signal_watch ();
582+
bus.message.connect ((message) => {
583+
switch (message.type)
584+
{
585+
case Gst.MessageType.EOS:
586+
case Gst.MessageType.ERROR:
587+
playbin.set_state (Gst.State.NULL);
588+
bus.remove_signal_watch ();
589+
_startup_jingle = null;
590+
break;
591+
default:
592+
break;
593+
}
594+
});
595+
}
596+
597+
playbin.set_state (Gst.State.PLAYING);
598+
}
599+
600+
561601
/**
562602
* @brief Create directory structure quietly
563603
*
@@ -589,7 +629,8 @@ namespace Tuner {
589629
{
590630
bool network_available = NETMON.get_network_available ();
591631

592-
if(_monitor_changed_id > 0)
632+
// Clean up the prior network monitor task
633+
if( _monitor_changed_id > 0)
593634
{
594635
Source.remove(_monitor_changed_id);
595636
_monitor_changed_id = 0;
@@ -600,7 +641,7 @@ namespace Tuner {
600641
wait 1 seconds before setting to online status
601642
to whatever the state is at that time
602643
*/
603-
if (network_available)
644+
if ( network_available )
604645
{
605646
if (is_online)
606647
return;
@@ -660,7 +701,6 @@ namespace Tuner {
660701
}
661702

662703
return { exe };
663-
}
664-
704+
} // build_restart_argv
665705
} // Application
666706
} // namespace Tuner

src/Controllers/DirectoryController.vala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,17 @@ public class Tuner.Controllers.DirectoryController : Object
245245
} // get_starred
246246

247247

248+
/**
249+
* @brief Reorders starred stations and persists the change.
250+
*
251+
* @param stationuuids The ordered list of station UUIDs.
252+
*/
253+
public void reorder_starred (Gee.List<string> stationuuids)
254+
{
255+
_star_store.reorder_stations (stationuuids);
256+
} // reorder_starred
257+
258+
248259
// --------------------------------------------------
249260

250261
/**

src/Controllers/PlayerController.vala

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,6 @@ public class Tuner.Controllers.PlayerController : GLib.Object
3434
} // Is
3535

3636

37-
/** Signal emitted when the station changes. */
38-
public signal void station_changed_sig (Station station);
39-
40-
/** Signal emitted when the player state changes. */
41-
public signal void state_changed_sig (Station station, Is state);
42-
43-
// /** Signal emitted when the title changes. */
44-
public signal void metadata_changed_sig (Station station, Metadata metadata);
45-
46-
/** Signal emitted when the volume changes. */
47-
public signal void volume_changed_sig (double volume);
48-
49-
/** Signal emitted every ten minutes that a station has been playing continuously. */
50-
public signal void tape_counter_sig (Station station);
51-
52-
/** @brief Signal emitted when the shuffle is requested */
53-
public signal void shuffle_requested_sig();
54-
5537
/** The error received when playing, if any */
5638
private bool _play_error = false;
5739
public bool play_error { get { return _play_error; } }
@@ -83,13 +65,13 @@ public class Tuner.Controllers.PlayerController : GLib.Object
8365
// Stream metadata received
8466
{
8567
if (_metadata.process_media_info_update (obj))
86-
metadata_changed_sig (_station, _metadata);
68+
app().events.metadata_changed_sig (_station, _metadata);
8769
});
8870

8971
_player.volume_changed.connect ((obj) =>
9072
// Volume changed
9173
{
92-
volume_changed_sig(obj.volume);
74+
app().events.volume_changed_sig(obj.volume);
9375
app().settings.volume = obj.volume;
9476
});
9577

@@ -181,7 +163,7 @@ public class Tuner.Controllers.PlayerController : GLib.Object
181163
private set {
182164
_player_state = value;
183165
if (_station != null)
184-
state_changed_sig(_station, value);
166+
app().events.state_changed_sig(_station, value);
185167

186168
if (value == Is.STOPPED || value == Is.STOPPED_ERROR)
187169
{
@@ -197,7 +179,7 @@ public class Tuner.Controllers.PlayerController : GLib.Object
197179
{
198180
if (_station == null)
199181
return Source.REMOVE;
200-
tape_counter_sig(_station);
182+
app().events.tape_counter_sig(_station);
201183
return Source.CONTINUE;
202184
});
203185
}
@@ -243,7 +225,7 @@ public class Tuner.Controllers.PlayerController : GLib.Object
243225
{
244226
_player.stop ();
245227
_station = station;
246-
station_changed_sig (_station);
228+
app().events.station_changed_sig (_station);
247229
_player.uri = (_station.urlResolved != null && _station.urlResolved != "") ? _station.urlResolved : _station.url;
248230
_play_error = false;
249231
Timeout.add (500, () =>
@@ -298,6 +280,6 @@ public class Tuner.Controllers.PlayerController : GLib.Object
298280
*/
299281
public void shuffle ()
300282
{
301-
shuffle_requested_sig();
283+
app().events.shuffle_requested_sig();
302284
} // shuffle
303285
} // PlayerController

0 commit comments

Comments
 (0)