From 5a8e733bbb9fd7294c9d831f245437643e39718e Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sat, 26 Apr 2025 14:18:19 +0100 Subject: [PATCH] add studiomode typer --- obsws_cli/studiomode.py | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 obsws_cli/studiomode.py diff --git a/obsws_cli/studiomode.py b/obsws_cli/studiomode.py new file mode 100644 index 0000000..8d668e3 --- /dev/null +++ b/obsws_cli/studiomode.py @@ -0,0 +1,46 @@ +"""module containing commands for manipulating studio mode in OBS.""" + +import typer + +from .alias import AliasGroup + +app = typer.Typer(cls=AliasGroup) + + +@app.callback() +def main(): + """Control studio mode in OBS.""" + + +@app.command() +def enable(ctx: typer.Context): + """Enable studio mode.""" + ctx.obj.set_studio_mode_enabled(True) + + +@app.command() +def disable(ctx: typer.Context): + """Disable studio mode.""" + ctx.obj.set_studio_mode_enabled(False) + + +@app.command() +def toggle(ctx: typer.Context): + """Toggle studio mode.""" + resp = ctx.obj.get_studio_mode_enabled() + if resp.studio_mode_enabled: + ctx.obj.set_studio_mode_enabled(False) + typer.echo('Studio mode is now disabled.') + else: + ctx.obj.set_studio_mode_enabled(True) + typer.echo('Studio mode is now enabled.') + + +@app.command() +def status(ctx: typer.Context): + """Get the status of studio mode.""" + resp = ctx.obj.get_studio_mode_enabled() + if resp.studio_mode_enabled: + typer.echo('Studio mode is enabled.') + else: + typer.echo('Studio mode is disabled.')