mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Requests: Add CloseMainWindow
Adds a new request called CloseMainWindow which closes the main window and cleanly shuts down OBS.
This commit is contained in:
parent
e3d0751385
commit
c989a941c5
@ -182,6 +182,7 @@ const std::unordered_map<std::string, RequestMethodHandler> RequestHandler::_han
|
||||
{"TriggerMediaInputAction", &RequestHandler::TriggerMediaInputAction},
|
||||
|
||||
// Ui
|
||||
{"CloseMainWindow", &RequestHandler::CloseMainWindow},
|
||||
{"GetStudioModeEnabled", &RequestHandler::GetStudioModeEnabled},
|
||||
{"SetStudioModeEnabled", &RequestHandler::SetStudioModeEnabled},
|
||||
{"OpenInputPropertiesDialog", &RequestHandler::OpenInputPropertiesDialog},
|
||||
|
@ -201,6 +201,7 @@ private:
|
||||
RequestResult TriggerMediaInputAction(const Request &);
|
||||
|
||||
// Ui
|
||||
RequestResult CloseMainWindow(const Request &);
|
||||
RequestResult GetStudioModeEnabled(const Request &);
|
||||
RequestResult SetStudioModeEnabled(const Request &);
|
||||
RequestResult OpenInputPropertiesDialog(const Request &);
|
||||
|
@ -24,6 +24,22 @@ with this program. If not, see <https://www.gnu.org/licenses/>
|
||||
|
||||
#include "RequestHandler.h"
|
||||
|
||||
/**
|
||||
* Closes the main window.
|
||||
*
|
||||
* @requestType CloseMainWindow
|
||||
* @complexity 1
|
||||
* @rpcVersion -1
|
||||
* @initialVersion 5.0.0
|
||||
* @category ui
|
||||
* @api requests
|
||||
*/
|
||||
RequestResult RequestHandler::CloseMainWindow(const Request &)
|
||||
{
|
||||
obs_frontend_close_main_window();
|
||||
return RequestResult::Success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether studio is enabled.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user