Last active
August 29, 2015 14:04
-
-
Save MattMcNam/0f806039189758e3b1b8 to your computer and use it in GitHub Desktop.
OBS API Draft
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nodecg.obs will be an OBSRemote object, defined below | |
It also has OBSScene and OBSSource objects, which are defined at the bottom. | |
-------------- | |
/** | |
* Try to connect to OBS | |
* Password is optional, NodeCG will check is auth is needed | |
* | |
* If connection fails, obs.onConnectionFailed is called | |
* succeeds, obs.onConnectionOpened is called | |
* later closes, obs.onConnectionClosed is called | |
* If authentication fails, obs.onAuthFailed is called | |
* Retry authentication with obs.authenticate() | |
*/ | |
OBSRemote.connect(String ipAddressAndPort, String password); | |
OBSRemote.apiVersion; | |
OBSRemote.getVersion(function (Number version) {...}); | |
OBSRemote.isAuthRequired(function (Boolean required) {...}); | |
OBSRemote.authenticate(String password, function (Boolean successful) {...}); | |
OBSRemote.getSceneList(function (String currentScene, Array[OBSScene] scenes) {...}); | |
OBSRemote.getCurrentScene(function (OBSScene scene) {...}); | |
OBSRemote.setCurrentScene(String sceneName); | |
OBSRemote.setSourcesOrder(Array[String] sourceNames); | |
OBSRemote.setSourceRender(String source, Boolean render); | |
/** | |
* This is defined in OBS Remote, but does nothing? | |
* This function will not be implemented, it is only for future reference | |
*/ | |
// OBSRemote.setSourcePositionAndSize(Number x, Number y, Number width, Number height); | |
OBSRemote.getStreamingStatus(function (Boolean streaming, Boolean previewOnly) {...}); | |
OBSRemote.toggleStream(Boolean previewOnly); | |
OBSRemote.getVolumes(function (Number micVolume, Boolean micMuted, Number desktopVolume, Boolean desktopMuted) {...}); | |
/** | |
* adjusting is optional, and defaults to false | |
*/ | |
OBSRemote.setMicVolume(Number volume, Boolean adjusting); | |
OBSRemote.toggleMicMute(); | |
OBSRemote.setDesktopVolume(Number volume, Boolean adjusting); | |
OBSRemote.toggleDesktopMute(); | |
/** | |
* Callbacks - from OBS Remote | |
*/ | |
OBSRemote.onStreamStarted = function (Boolean previewOnly) {...}; | |
OBSRemote.onStreamStopped = function (Boolean previewOnly) {...}; | |
OBSRemote.onStatusUpdate = | |
function (Boolean streaming, Boolean previewOnly, | |
Integer bytesPerSec, Number strain, | |
Integer totalStreamTime, Integer totalFrames, | |
Integer droppedFrames, Integer framesPerSec) {...}; | |
OBSRemote.onSceneSwitched = function (String sceneName) {...}; | |
OBSRemote.onScenesChanged = function () {...}; | |
OBSRemote.onSourceOrderChanged = function (Array[String] sourceNames) {...}; | |
// Better name? | |
OBSRemote.onSourceAddedOrRemoved = function (Array[String] sourceNames) {...}; | |
OBSRemote.onSourceChanged = function (String sourceName, OBSSource source) {...}; | |
OBSRemote.onMicVolumeChanged = function (Number volume, Boolean muted, Boolean adjusting) {...}; | |
OBSRemote.onDesktopVolumeChanged = function (Number volume, Boolean muted, Boolean adjusting) {...}; | |
/** | |
* Callbacks - NodeCG | |
*/ | |
OBSRemote.onConnectionOpened = function () {...}; | |
OBSRemote.onConnectionFailed = function (/* need to see what failure details we can pass here */) {...}; | |
OBSRemote.onConnectionClosed = function () {...}; | |
OBSRemote.onAuthFailed = function (Integer remainingAttempts) {...}; | |
/** | |
* OBSScene | |
* OBSSource | |
*/ | |
String OBSScene.name; | |
Array[OBSSource] OBSScene.sources; | |
Number OBSSource.width; | |
Number OBSSource.height; | |
Number OBSSource.x; | |
Number OBSSource.y; | |
String OSBSource.name; | |
Boolean OBSSource.render; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As any of this been implemented?