From: Scott Worley Date: Tue, 7 Oct 2025 06:52:46 +0000 (-0700) Subject: Extract stop_streams() X-Git-Url: http://git.scottworley.com/srec/commitdiff_plain/eebbdf01820ff750bbde555b56d07b78830a7ccb?ds=inline;hp=99c6dc78ff64331f53e626354c4900a3f539a25d Extract stop_streams() --- 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")