mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
requests(pause recording): only compile recording pause function bodies when supported
This commit is contained in:
parent
0cc9378d05
commit
46a006ed54
@ -65,6 +65,10 @@ HandlerResponse WSRequestHandler::HandleStartRecording(WSRequestHandler* req) {
|
|||||||
* @since 4.7.0
|
* @since 4.7.0
|
||||||
*/
|
*/
|
||||||
HandlerResponse WSRequestHandler::HandlePauseRecording(WSRequestHandler* req) {
|
HandlerResponse WSRequestHandler::HandlePauseRecording(WSRequestHandler* req) {
|
||||||
|
// TODO runtime check
|
||||||
|
#if LIBOBS_API_VER < MAKE_SEMANTIC_VERSION(23, 2, 2)
|
||||||
|
return req->SendErrorResponse("recording pause not supported");
|
||||||
|
#else
|
||||||
if (!obs_frontend_recording_active()) {
|
if (!obs_frontend_recording_active()) {
|
||||||
return req->SendErrorResponse("recording is not active");
|
return req->SendErrorResponse("recording is not active");
|
||||||
}
|
}
|
||||||
@ -76,6 +80,7 @@ HandlerResponse WSRequestHandler::HandlePauseRecording(WSRequestHandler* req) {
|
|||||||
obs_frontend_recording_pause(true);
|
obs_frontend_recording_pause(true);
|
||||||
|
|
||||||
return req->SendOKResponse();
|
return req->SendOKResponse();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -88,6 +93,10 @@ HandlerResponse WSRequestHandler::HandlePauseRecording(WSRequestHandler* req) {
|
|||||||
* @since 4.7.0
|
* @since 4.7.0
|
||||||
*/
|
*/
|
||||||
HandlerResponse WSRequestHandler::HandleResumeRecording(WSRequestHandler* req) {
|
HandlerResponse WSRequestHandler::HandleResumeRecording(WSRequestHandler* req) {
|
||||||
|
// TODO runtime check
|
||||||
|
#if LIBOBS_API_VER < MAKE_SEMANTIC_VERSION(23, 2, 2)
|
||||||
|
return req->SendErrorResponse("recording resume not supported");
|
||||||
|
#else
|
||||||
if (!obs_frontend_recording_active()) {
|
if (!obs_frontend_recording_active()) {
|
||||||
return req->SendErrorResponse("recording is not active");
|
return req->SendErrorResponse("recording is not active");
|
||||||
}
|
}
|
||||||
@ -99,6 +108,7 @@ HandlerResponse WSRequestHandler::HandleResumeRecording(WSRequestHandler* req) {
|
|||||||
obs_frontend_recording_pause(false);
|
obs_frontend_recording_pause(false);
|
||||||
|
|
||||||
return req->SendOKResponse();
|
return req->SendOKResponse();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user