mirror of
https://github.com/onyx-and-iris/simple-recorder.git
synced 2025-08-06 19:21:44 +00:00
Compare commits
No commits in common. "0814678278f2770d6548100c197baf4aa3913901" and "bba2361964b1c93121c8d48a4176f3030fe34ee9" have entirely different histories.
0814678278
...
bba2361964
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "simple-recorder"
|
||||
version = "0.1.7"
|
||||
version = "0.1.5"
|
||||
description = "A simple OBS recorder"
|
||||
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
||||
dependencies = [
|
||||
|
@ -47,19 +47,10 @@ class SimpleRecorder(Command):
|
||||
env="OBS_THEME",
|
||||
help=f"GUI theme ({', '.join(themes)})",
|
||||
)
|
||||
debug: bool = arg(
|
||||
default=False,
|
||||
env="DEBUG",
|
||||
help="Enable debug logging",
|
||||
hidden=True,
|
||||
)
|
||||
|
||||
@override
|
||||
async def run(self):
|
||||
"""Run the Simple Recorder GUI."""
|
||||
if self.debug:
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
window = SimpleRecorderWindow(self.host, self.port, self.password, self.theme)
|
||||
await window.run()
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import logging
|
||||
|
||||
import FreeSimpleGUI as fsg
|
||||
from clypi import ClypiException
|
||||
|
||||
from .errors import SimpleRecorderError
|
||||
from .start import Start
|
||||
from .stop import Stop
|
||||
|
||||
@ -31,12 +31,11 @@ class SimpleRecorderWindow(fsg.Window):
|
||||
async def run(self):
|
||||
while True:
|
||||
event, values = self.read()
|
||||
self.logger.debug(f"Event: {event}, Values: {values}")
|
||||
if event == fsg.WIN_CLOSED:
|
||||
break
|
||||
|
||||
match e := event.split(" || "):
|
||||
case ["Start Recording"] | ["Start Recording" | "-FILENAME-", "RETURN"]:
|
||||
match event.split(" || "):
|
||||
case ["Start Recording", "RETURN" | None] | ["-FILENAME-", "RETURN"]:
|
||||
try:
|
||||
await Start(
|
||||
filename=values["-FILENAME-"],
|
||||
@ -47,12 +46,12 @@ class SimpleRecorderWindow(fsg.Window):
|
||||
self["-OUTPUT-"].update(
|
||||
"Recording started successfully", text_color="green"
|
||||
)
|
||||
except SimpleRecorderError as e:
|
||||
except ClypiException as e:
|
||||
self["-OUTPUT-"].update(
|
||||
f"Error: {e.raw_message}", text_color="red"
|
||||
)
|
||||
|
||||
case ["Stop Recording"] | ["Stop Recording", "RETURN"]:
|
||||
case ["Stop Recording", "RETURN" | None]:
|
||||
try:
|
||||
await Stop(
|
||||
host=self.host, port=self.port, password=self.password
|
||||
@ -60,12 +59,12 @@ class SimpleRecorderWindow(fsg.Window):
|
||||
self["-OUTPUT-"].update(
|
||||
"Recording stopped successfully", text_color="green"
|
||||
)
|
||||
except SimpleRecorderError as e:
|
||||
except ClypiException as e:
|
||||
self["-OUTPUT-"].update(
|
||||
f"Error: {e.raw_message}", text_color="red"
|
||||
)
|
||||
|
||||
case _:
|
||||
self.logger.warning(f"Unhandled event: {e}")
|
||||
self.logger.warning(f"Unhandled event: {event}")
|
||||
|
||||
self.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user