mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Add error system to EnableStudioMode and DisableStudioMode
As talked about in #144 this adds a check to `EnableStudioMode` and `DisableStudioMode` in order to be consistent with `StartRecording`/`StopRecording`
This commit is contained in:
parent
b1df0dca97
commit
a3bc9f768a
@ -133,6 +133,9 @@ RpcResponse WSRequestHandler::TransitionToProgram(const RpcRequest& request) {
|
||||
* @since 4.1.0
|
||||
*/
|
||||
RpcResponse WSRequestHandler::EnableStudioMode(const RpcRequest& request) {
|
||||
if (obs_frontend_preview_program_mode_active()) {
|
||||
return request.failed("studio mode already active");
|
||||
}
|
||||
obs_queue_task(OBS_TASK_UI, [](void* param) {
|
||||
obs_frontend_set_preview_program_mode(true);
|
||||
|
||||
@ -150,6 +153,9 @@ RpcResponse WSRequestHandler::EnableStudioMode(const RpcRequest& request) {
|
||||
* @since 4.1.0
|
||||
*/
|
||||
RpcResponse WSRequestHandler::DisableStudioMode(const RpcRequest& request) {
|
||||
if (!obs_frontend_preview_program_mode_active()) {
|
||||
return request.failed("studio mode not active");
|
||||
}
|
||||
obs_queue_task(OBS_TASK_UI, [](void* param) {
|
||||
obs_frontend_set_preview_program_mode(false);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user