mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
d519815a7e | |||
32932eacf5 | |||
1a057cf5a3 | |||
e3936dad9b | |||
4ec9b85506 | |||
fbae081c33 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
/build/
|
/build/
|
||||||
/build32/
|
/build32/
|
||||||
/build64/
|
/build64/
|
||||||
|
/release/
|
||||||
|
/installer/Output/
|
||||||
|
@ -3,7 +3,7 @@ obs-websocket
|
|||||||
Websocket API for OBS Studio.
|
Websocket API for OBS Studio.
|
||||||
|
|
||||||
## Downloads
|
## Downloads
|
||||||
Binaries for Windows are available in the [Releases](https://github.com/Palakis/obs-websocket/releases) section. Linux and OS X releases coming soon.
|
Binaries for Windows and Linux are available in the [Releases](https://github.com/Palakis/obs-websocket/releases) section.
|
||||||
|
|
||||||
## Using obs-websocket
|
## Using obs-websocket
|
||||||
The Websocket API server runs on port 4444 and a settings window is available in "Websocket server settings" under OBS' "Tools" menu. The obs-websocket protocol is documented in [PROTOCOL.md](PROTOCOL.md).
|
The Websocket API server runs on port 4444 and a settings window is available in "Websocket server settings" under OBS' "Tools" menu. The obs-websocket protocol is documented in [PROTOCOL.md](PROTOCOL.md).
|
||||||
|
15
WSEvents.cpp
15
WSEvents.cpp
@ -92,15 +92,28 @@ void WSEvents::broadcastUpdate(const char *updateType, obs_data_t *additionalFie
|
|||||||
|
|
||||||
void WSEvents::OnSceneChange() {
|
void WSEvents::OnSceneChange() {
|
||||||
// Implements an existing update type from bilhamil's OBS Remote
|
// Implements an existing update type from bilhamil's OBS Remote
|
||||||
|
|
||||||
|
// Default behavior : get the new scene from the running transition
|
||||||
obs_source_t *transition = obs_frontend_get_current_transition();
|
obs_source_t *transition = obs_frontend_get_current_transition();
|
||||||
obs_source_t *new_scene = obs_transition_get_source(transition, OBS_TRANSITION_SOURCE_B);
|
obs_source_t *new_scene = obs_transition_get_source(transition, OBS_TRANSITION_SOURCE_B);
|
||||||
if (!new_scene) {
|
if (!new_scene) {
|
||||||
obs_source_release(transition);
|
obs_source_release(transition);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *scene_name = obs_source_get_name(new_scene);
|
||||||
|
if (!scene_name) {
|
||||||
|
// Fallback behaviour : get the new scene straight from the API
|
||||||
|
obs_source_release(new_scene);
|
||||||
|
new_scene = obs_frontend_get_current_scene();
|
||||||
|
|
||||||
|
if (new_scene) {
|
||||||
|
scene_name = obs_source_get_name(new_scene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
obs_data_t *data = obs_data_create();
|
obs_data_t *data = obs_data_create();
|
||||||
obs_data_set_string(data, "scene-name", obs_source_get_name(new_scene));
|
obs_data_set_string(data, "scene-name", scene_name);
|
||||||
|
|
||||||
broadcastUpdate("SwitchScenes", data);
|
broadcastUpdate("SwitchScenes", data);
|
||||||
|
|
||||||
|
54
installer/installer.iss
Normal file
54
installer/installer.iss
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
; Script generated by the Inno Setup Script Wizard.
|
||||||
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
|
|
||||||
|
#define MyAppName "obs-websocket"
|
||||||
|
#define MyAppVersion "0.3.1"
|
||||||
|
#define MyAppPublisher "St<53>phane Lepin"
|
||||||
|
#define MyAppURL "http://github.com/Palakis/obs-websocket"
|
||||||
|
|
||||||
|
[Setup]
|
||||||
|
; NOTE: The value of AppId uniquely identifies this application.
|
||||||
|
; Do not use the same AppId value in installers for other applications.
|
||||||
|
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
||||||
|
AppId={{117EE44F-48E1-49E5-A381-CC8D9195CF35}
|
||||||
|
AppName={#MyAppName}
|
||||||
|
AppVersion={#MyAppVersion}
|
||||||
|
;AppVerName={#MyAppName} {#MyAppVersion}
|
||||||
|
AppPublisher={#MyAppPublisher}
|
||||||
|
AppPublisherURL={#MyAppURL}
|
||||||
|
AppSupportURL={#MyAppURL}
|
||||||
|
AppUpdatesURL={#MyAppURL}
|
||||||
|
DefaultDirName={code:GetDirName}
|
||||||
|
DefaultGroupName={#MyAppName}
|
||||||
|
OutputBaseFilename=obs-websocket-{#MyAppVersion}-Windows-Installer
|
||||||
|
Compression=lzma
|
||||||
|
SolidCompression=yes
|
||||||
|
LicenseFile=..\LICENSE
|
||||||
|
|
||||||
|
[Languages]
|
||||||
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
|
||||||
|
|
||||||
|
[Files]
|
||||||
|
Source: "..\release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||||
|
|
||||||
|
[Icons]
|
||||||
|
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
|
||||||
|
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
|
||||||
|
|
||||||
|
[Code]
|
||||||
|
// credit where it's due :
|
||||||
|
// following function come from https://github.com/Xaymar/obs-studio_amf-encoder-plugin/blob/master/%23Resources/Installer.in.iss#L45
|
||||||
|
function GetDirName(Value: string): string;
|
||||||
|
var
|
||||||
|
InstallPath: string;
|
||||||
|
begin
|
||||||
|
// initialize default path, which will be returned when the following registry
|
||||||
|
// key queries fail due to missing keys or for some different reason
|
||||||
|
Result := '{pf}\obs-studio';
|
||||||
|
// query the first registry value; if this succeeds, return the obtained value
|
||||||
|
if RegQueryStringValue(HKLM32, 'SOFTWARE\OBS Studio', '', InstallPath) then
|
||||||
|
Result := InstallPath
|
||||||
|
end;
|
||||||
|
|
@ -19,6 +19,6 @@ with this program. If not, see <https://www.gnu.org/licenses/>
|
|||||||
#ifndef OBSWEBSOCKET_H
|
#ifndef OBSWEBSOCKET_H
|
||||||
#define OBSWEBSOCKET_H
|
#define OBSWEBSOCKET_H
|
||||||
|
|
||||||
#define OBS_WEBSOCKET_VERSION "0.3.1"
|
#define OBS_WEBSOCKET_VERSION "0.3.2"
|
||||||
|
|
||||||
#endif // OBSWEBSOCKET_H
|
#endif // OBSWEBSOCKET_H
|
Reference in New Issue
Block a user