fix(config): reimplement muting
This commit is contained in:
parent
8f5a0cab9c
commit
16c3eceffd
|
@ -56,7 +56,7 @@ pub const State = struct {
|
||||||
|
|
||||||
return .{
|
return .{
|
||||||
.title = handleTitle(title_opt),
|
.title = handleTitle(title_opt),
|
||||||
.emulation = if (title_opt == null) .Inactive else .Active,
|
.emulation = if (title_opt == null) .Inactive else .{ .Transition = .Active },
|
||||||
.fps_hist = RingBuffer(u32).init(history),
|
.fps_hist = RingBuffer(u32).init(history),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,7 +196,7 @@ pub const Gui = struct {
|
||||||
_ = channel.gui.pop();
|
_ = channel.gui.pop();
|
||||||
|
|
||||||
channel.emu.push(.Resume);
|
channel.emu.push(.Resume);
|
||||||
SDL.SDL_PauseAudioDevice(self.audio.device, 0);
|
if (!config.config().host.mute) SDL.SDL_PauseAudioDevice(self.audio.device, 0);
|
||||||
|
|
||||||
self.state.emulation = .Active;
|
self.state.emulation = .Active;
|
||||||
},
|
},
|
||||||
|
@ -310,11 +310,6 @@ const Audio = struct {
|
||||||
const device = SDL.SDL_OpenAudioDevice(null, 0, &want, &have, 0);
|
const device = SDL.SDL_OpenAudioDevice(null, 0, &want, &have, 0);
|
||||||
if (device == 0) panic();
|
if (device == 0) panic();
|
||||||
|
|
||||||
if (!config.config().host.mute) {
|
|
||||||
SDL.SDL_PauseAudioDevice(device, 0); // Unpause Audio
|
|
||||||
log.info("Unpaused Device", .{});
|
|
||||||
}
|
|
||||||
|
|
||||||
return .{ .device = device };
|
return .{ .device = device };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue