(source: str, *args: str, **kwargs)
| 69 | |
| 70 | |
| 71 | def _record_source(source: str, *args: str, **kwargs): |
| 72 | global last_recording_path |
| 73 | |
| 74 | if not recorder.is_available: |
| 75 | send_notification("No recorder", "gpu-screen-recorder was not found.") |
| 76 | return |
| 77 | |
| 78 | if recorder.active: |
| 79 | recorder.stop_recording() |
| 80 | return |
| 81 | |
| 82 | timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") |
| 83 | file_path = os.path.expanduser(f"~/Videos/recording_{timestamp}.mp4") |
| 84 | last_recording_path = file_path |
| 85 | |
| 86 | asyncio.create_task( |
| 87 | _start_recording_task( |
| 88 | source=source, |
| 89 | file_path=file_path, |
| 90 | audio_devices=["default_output"] if options.record_audio else None, |
| 91 | **kwargs, |
| 92 | ) |
| 93 | ) |
| 94 | |
| 95 | |
| 96 | def stop_recording(): |
no test coverage detected