mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 17:26:09 +03:00
gtk custom bell audio: optional -> required
This commit is contained in:
@ -2408,9 +2408,9 @@ pub fn ringBell(self: *Surface) !void {
|
|||||||
if (features.audio) audio: {
|
if (features.audio) audio: {
|
||||||
// Play a user-specified audio file.
|
// Play a user-specified audio file.
|
||||||
|
|
||||||
const pathname, const optional = switch (self.app.config.@"bell-audio-path" orelse break :audio) {
|
const pathname, const required = switch (self.app.config.@"bell-audio-path" orelse break :audio) {
|
||||||
.optional => |path| .{ path, true },
|
.optional => |path| .{ path, false },
|
||||||
.required => |path| .{ path, false },
|
.required => |path| .{ path, true },
|
||||||
};
|
};
|
||||||
|
|
||||||
const volume = std.math.clamp(self.app.config.@"bell-audio-volume", 0.0, 1.0);
|
const volume = std.math.clamp(self.app.config.@"bell-audio-volume", 0.0, 1.0);
|
||||||
@ -2418,7 +2418,7 @@ pub fn ringBell(self: *Surface) !void {
|
|||||||
std.debug.assert(std.fs.path.isAbsolute(pathname));
|
std.debug.assert(std.fs.path.isAbsolute(pathname));
|
||||||
const media_file = gtk.MediaFile.newForFilename(pathname);
|
const media_file = gtk.MediaFile.newForFilename(pathname);
|
||||||
|
|
||||||
if (!optional) {
|
if (required) {
|
||||||
_ = gobject.Object.signals.notify.connect(
|
_ = gobject.Object.signals.notify.connect(
|
||||||
media_file,
|
media_file,
|
||||||
?*anyopaque,
|
?*anyopaque,
|
||||||
|
Reference in New Issue
Block a user