From eebbdf01820ff750bbde555b56d07b78830a7ccb Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Mon, 6 Oct 2025 23:52:46 -0700 Subject: [PATCH 1/1] Extract stop_streams() --- srec.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/srec.py b/srec.py index 3490695..7ef4d46 100644 --- a/srec.py +++ b/srec.py @@ -126,7 +126,7 @@ def on_start_button(_: Gtk.Button, stack: Gtk.Stack) -> None: ['-f', 'pulse', '-ac', '2', '-i', 'default', filename]) -def on_stop_button(_: Gtk.Button, stack: Gtk.Stack) -> None: +def stop_streams() -> None: global recording, sharing # pylint: disable=global-statement assert recording is not None recording.stop() @@ -134,6 +134,10 @@ def on_stop_button(_: Gtk.Button, stack: Gtk.Stack) -> None: if sharing is not None: sharing.stop() sharing = None + + +def on_stop_button(_: Gtk.Button, stack: Gtk.Stack) -> None: + stop_streams() stack.set_visible_child_name("not_recording") -- 2.51.2