obsproject / obs-websocket

Remote-control of OBS Studio through WebSocket
GNU General Public License v2.0
3.8k stars 701 forks source link

Requests: Add CloseMainWindow #1138

Open BenJuan26 opened 1 year ago

BenJuan26 commented 1 year ago

depends on https://github.com/obsproject/obs-studio/pull/8889

Description

Adds a new request called CloseMainWindow which closes the main window and cleanly shuts down OBS.

Motivation and Context

This request allows external applications to cleanly shut down OBS.

It implements https://github.com/obsproject/obs-websocket/issues/511

How Has This Been Tested?

Tested OS(s): Windows 10 Testing method: Postman

After connecting and handshaking, I sent this payload:

{
    "op": 6,
    "d": {
        "requestType": "CloseMainWindow",
        "requestId": "19b2e634-67b8-470a-a216-fc0f6a87160e"
    }
}

OBS (with the changes in the obs-studio PR linked at the top) responded by cleaning up its resources and shutting down. The events of the shutdown can be seen through the websocket:

image

Types of changes

Checklist: