mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-05-16 06:20:23 +01:00
add virtualcam typer
This commit is contained in:
parent
5a8e733bbb
commit
e270e94756
43
obsws_cli/virtualcam.py
Normal file
43
obsws_cli/virtualcam.py
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
"""module containing commands for manipulating virtual camera in OBS."""
|
||||||
|
|
||||||
|
import typer
|
||||||
|
|
||||||
|
from .alias import AliasGroup
|
||||||
|
|
||||||
|
app = typer.Typer(cls=AliasGroup)
|
||||||
|
|
||||||
|
|
||||||
|
@app.callback()
|
||||||
|
def main():
|
||||||
|
"""Control virtual camera in OBS."""
|
||||||
|
|
||||||
|
|
||||||
|
@app.command()
|
||||||
|
def start(ctx: typer.Context):
|
||||||
|
"""Start the virtual camera."""
|
||||||
|
ctx.obj.start_virtual_cam()
|
||||||
|
typer.echo('Virtual camera started.')
|
||||||
|
|
||||||
|
|
||||||
|
@app.command()
|
||||||
|
def stop(ctx: typer.Context):
|
||||||
|
"""Stop the virtual camera."""
|
||||||
|
ctx.obj.stop_virtual_cam()
|
||||||
|
typer.echo('Virtual camera stopped.')
|
||||||
|
|
||||||
|
|
||||||
|
@app.command()
|
||||||
|
def toggle(ctx: typer.Context):
|
||||||
|
"""Toggle the virtual camera."""
|
||||||
|
ctx.obj.toggle_virtual_cam()
|
||||||
|
typer.echo('Virtual camera toggled.')
|
||||||
|
|
||||||
|
|
||||||
|
@app.command()
|
||||||
|
def status(ctx: typer.Context):
|
||||||
|
"""Get the status of the virtual camera."""
|
||||||
|
resp = ctx.obj.get_virtual_cam_status()
|
||||||
|
if resp.output_active:
|
||||||
|
typer.echo('Virtual camera is enabled.')
|
||||||
|
else:
|
||||||
|
typer.echo('Virtual camera is disabled.')
|
Loading…
x
Reference in New Issue
Block a user