Package nl.harm27.obswebsocket.sender
Class GeneralRequestSender
- java.lang.Object
-
- nl.harm27.obswebsocket.sender.RequestSender
-
- nl.harm27.obswebsocket.sender.GeneralRequestSender
-
public class GeneralRequestSender extends RequestSender
The RequestSender for the requests that are part of the General category.
-
-
Constructor Summary
Constructors Constructor Description GeneralRequestSender(OBSWebSocket obsWebSocket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
broadcastCustomMessage(String realm, Object data, Consumer<BroadcastCustomMessage.Response> responseConsumer)
Broadcast custom message to all connected WebSocket clientsvoid
getFilenameFormatting(Consumer<GetFilenameFormatting.Response> responseConsumer)
Get the filename formatting stringvoid
getStats(Consumer<GetStats.Response> responseConsumer)
Get OBS stats (almost the same info as provided in OBS' stats window)void
getVersion(Consumer<GetVersion.Response> responseConsumer)
Returns the latest version of the plugin and the API.void
getVideoInfo(Consumer<GetVideoInfo.Response> responseConsumer)
Get basic OBS video informationvoid
openProjector(OpenProjector.Type type, Integer monitor, String geometry, String name, Consumer<OpenProjector.Response> responseConsumer)
Open a projector window or create a projector on a monitor.void
setFilenameFormatting(String filenameFormatting, Consumer<SetFilenameFormatting.Response> responseConsumer)
Set the filename formatting stringvoid
setHeartbeat(boolean enable, Consumer<SetHeartbeat.Response> responseConsumer)
Enable/disable sending of the Heartbeat event-
Methods inherited from class nl.harm27.obswebsocket.sender.RequestSender
getNextMessageId, sendRequest
-
-
-
-
Constructor Detail
-
GeneralRequestSender
public GeneralRequestSender(OBSWebSocket obsWebSocket)
-
-
Method Detail
-
getVersion
public void getVersion(Consumer<GetVersion.Response> responseConsumer)
Returns the latest version of the plugin and the API.- Since:
- v0.3
- See Also:
- OBS WebSocket Documentation
-
setHeartbeat
public void setHeartbeat(boolean enable, Consumer<SetHeartbeat.Response> responseConsumer)
Enable/disable sending of the Heartbeat event- Parameters:
enable
- Starts/Stops emitting heartbeat messages- Since:
- v4.3.0
- See Also:
- OBS WebSocket Documentation
-
broadcastCustomMessage
public void broadcastCustomMessage(String realm, Object data, Consumer<BroadcastCustomMessage.Response> responseConsumer)
Broadcast custom message to all connected WebSocket clients- Parameters:
realm
- Identifier to be choosen by the clientdata
- User-defined data- Since:
- v4.7.0
- See Also:
- OBS WebSocket Documentation
-
setFilenameFormatting
public void setFilenameFormatting(String filenameFormatting, Consumer<SetFilenameFormatting.Response> responseConsumer)
Set the filename formatting string- Parameters:
filenameFormatting
- Filename formatting string to set.- Since:
- v4.3.0
- See Also:
- OBS WebSocket Documentation
-
getFilenameFormatting
public void getFilenameFormatting(Consumer<GetFilenameFormatting.Response> responseConsumer)
Get the filename formatting string- Since:
- v4.3.0
- See Also:
- OBS WebSocket Documentation
-
getStats
public void getStats(Consumer<GetStats.Response> responseConsumer)
Get OBS stats (almost the same info as provided in OBS' stats window)- Since:
- v4.6.0
- See Also:
- OBS WebSocket Documentation
-
getVideoInfo
public void getVideoInfo(Consumer<GetVideoInfo.Response> responseConsumer)
Get basic OBS video information- Since:
- v4.6.0
- See Also:
- OBS WebSocket Documentation
-
openProjector
public void openProjector(OpenProjector.Type type, Integer monitor, String geometry, String name, Consumer<OpenProjector.Response> responseConsumer)
Open a projector window or create a projector on a monitor. Requires OBS v24.0.4 or newer. All parameters for request are optional.- Parameters:
type
- Type of projectormonitor
- Monitor to open the projector on. If -1 or omitted, opens a window.geometry
- Size and position of the projector window (only if monitor is -1). Encoded in Base64 using Qt's geometry encoding (https://doc.qt.io/qt-5/qwidget.html#saveGeometry). Corresponds to OBS's saved projectors.name
- Name of the source or scene to be displayed (ignored for other projector types).- Since:
- v4.8.0
- See Also:
- OBS WebSocket Documentation
-
-