Compare commits

...

9 Commits
4.3.0 ... 4.3.2

13 changed files with 70 additions and 61 deletions

View File

@ -19,7 +19,7 @@ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/2b121c9a96
cd .. cd ..
git clone --recursive https://github.com/jp9000/obs-studio git clone --recursive https://github.com/jp9000/obs-studio
cd obs-studio cd obs-studio
git checkout 20.1.0 git checkout 21.0.0
mkdir build && cd build mkdir build && cd build
cmake .. \ cmake .. \
-DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake \ -DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake \

View File

@ -48,7 +48,7 @@ apt-get install -y libqt5websockets5-dev
cd /root cd /root
git clone https://github.com/jp9000/obs-studio ./obs-studio git clone https://github.com/jp9000/obs-studio ./obs-studio
cd obs-studio cd obs-studio
git checkout 20.1.0 git checkout 21.0.0
mkdir build && cd build mkdir build && cd build
cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr .. cmake -DUNIX_STRUCTURE=1 -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4 make -j4

View File

@ -635,7 +635,7 @@
<key>OVERWRITE_PERMISSIONS</key> <key>OVERWRITE_PERMISSIONS</key>
<false/> <false/>
<key>VERSION</key> <key>VERSION</key>
<string>4.3.0</string> <string>4.3.2</string>
</dict> </dict>
<key>PROJECT_COMMENTS</key> <key>PROJECT_COMMENTS</key>
<dict> <dict>

View File

@ -1,9 +1,4 @@
# obs-websocket 4.2.1 protocol reference # obs-websocket 4.3.2 protocol reference
**This is the reference for the unreleased obs-websocket 4.2.1. See the list below for older versions.**
- [4.2.0 protocol reference](https://github.com/Palakis/obs-websocket/blob/4.2.0/docs/generated/protocol.md)
- [4.1.0 protocol reference](https://github.com/Palakis/obs-websocket/blob/4.1.0/PROTOCOL.md)
- [4.0.0 protocol reference](https://github.com/Palakis/obs-websocket/blob/4.0.0/PROTOCOL.md)
# General Introduction # General Introduction
Messages are exchanged between the client and the server as JSON objects. Messages are exchanged between the client and the server as JSON objects.

View File

@ -2,8 +2,8 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "obs-websocket" #define MyAppName "obs-websocket"
#define MyAppVersion "4.3.0" #define MyAppVersion "4.3.2"
#define MyAppPublisher "St<EFBFBD>phane Lepin" #define MyAppPublisher "Stephane Lepin"
#define MyAppURL "http://github.com/Palakis/obs-websocket" #define MyAppURL "http://github.com/Palakis/obs-websocket"
[Setup] [Setup]

View File

@ -34,6 +34,8 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include "Config.h" #include "Config.h"
#include "Utils.h" #include "Utils.h"
#define QT_TO_UTF8(str) str.toUtf8().constData()
Config* Config::_instance = new Config(); Config* Config::_instance = new Config();
Config::Config() : Config::Config() :
@ -62,9 +64,9 @@ Config::Config() :
config_set_default_bool(obsConfig, config_set_default_bool(obsConfig,
SECTION_NAME, PARAM_AUTHREQUIRED, AuthRequired); SECTION_NAME, PARAM_AUTHREQUIRED, AuthRequired);
config_set_default_string(obsConfig, config_set_default_string(obsConfig,
SECTION_NAME, PARAM_SECRET, qstring_data_copy(Secret)); SECTION_NAME, PARAM_SECRET, QT_TO_UTF8(Secret));
config_set_default_string(obsConfig, config_set_default_string(obsConfig,
SECTION_NAME, PARAM_SALT, qstring_data_copy(Salt)); SECTION_NAME, PARAM_SALT, QT_TO_UTF8(Salt));
} }
mbedtls_entropy_init(&entropy); mbedtls_entropy_init(&entropy);
@ -104,9 +106,9 @@ void Config::Save() {
config_set_bool(obsConfig, SECTION_NAME, PARAM_AUTHREQUIRED, AuthRequired); config_set_bool(obsConfig, SECTION_NAME, PARAM_AUTHREQUIRED, AuthRequired);
config_set_string(obsConfig, SECTION_NAME, PARAM_SECRET, config_set_string(obsConfig, SECTION_NAME, PARAM_SECRET,
qstring_data_copy(Secret)); QT_TO_UTF8(Secret));
config_set_string(obsConfig, SECTION_NAME, PARAM_SALT, config_set_string(obsConfig, SECTION_NAME, PARAM_SALT,
qstring_data_copy(Salt)); QT_TO_UTF8(Salt));
config_save(obsConfig); config_save(obsConfig);
} }

View File

@ -28,13 +28,6 @@ with this program. If not, see <https://www.gnu.org/licenses/>
Q_DECLARE_METATYPE(OBSScene); Q_DECLARE_METATYPE(OBSScene);
const char* qstring_data_copy(QString value) {
QByteArray stringData = value.toUtf8();
const char* constStringData = new const char[stringData.size()]();
memcpy((void*)constStringData, stringData.constData(), stringData.size());
return constStringData;
}
obs_data_array_t* Utils::StringListToArray(char** strings, char* key) { obs_data_array_t* Utils::StringListToArray(char** strings, char* key) {
if (!strings) if (!strings)
return obs_data_array_create(); return obs_data_array_create();
@ -315,13 +308,19 @@ QString Utils::OBSVersionString() {
QSystemTrayIcon* Utils::GetTrayIcon() { QSystemTrayIcon* Utils::GetTrayIcon() {
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window(); QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
if (!main) return nullptr;
return main->findChildren<QSystemTrayIcon*>().first(); return main->findChildren<QSystemTrayIcon*>().first();
} }
void Utils::SysTrayNotify(QString &text, void Utils::SysTrayNotify(QString &text,
QSystemTrayIcon::MessageIcon icon, QString title) { QSystemTrayIcon::MessageIcon icon, QString title) {
if (!Config::Current()->AlertsEnabled || !QSystemTrayIcon::supportsMessages()) if (!Config::Current()->AlertsEnabled ||
!QSystemTrayIcon::isSystemTrayAvailable() ||
!QSystemTrayIcon::supportsMessages())
{
return; return;
}
QSystemTrayIcon* trayIcon = GetTrayIcon(); QSystemTrayIcon* trayIcon = GetTrayIcon();
if (trayIcon) if (trayIcon)

View File

@ -32,8 +32,6 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include <obs-module.h> #include <obs-module.h>
#include <util/config-file.h> #include <util/config-file.h>
const char* qstring_data_copy(QString value);
class Utils { class Utils {
public: public:
static obs_data_array_t* StringListToArray(char** strings, char* key); static obs_data_array_t* StringListToArray(char** strings, char* key);
@ -49,8 +47,6 @@ class Utils {
static obs_data_array_t* GetScenes(); static obs_data_array_t* GetScenes();
static obs_data_t* GetSceneData(obs_source_t* source); static obs_data_t* GetSceneData(obs_source_t* source);
static obs_data_array_t* GetProfiles();
static QSpinBox* GetTransitionDurationControl(); static QSpinBox* GetTransitionDurationControl();
static int GetTransitionDuration(); static int GetTransitionDuration();
static void SetTransitionDuration(int ms); static void SetTransitionDuration(int ms);

View File

@ -84,8 +84,8 @@ WSEvents::WSEvents(WSServer* srv) {
connect(sceneList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), connect(sceneList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
this, SLOT(SelectedSceneChanged(QListWidgetItem*, QListWidgetItem*))); this, SLOT(SelectedSceneChanged(QListWidgetItem*, QListWidgetItem*)));
transitionHandler = nullptr; currentScene = nullptr;
sceneHandler = nullptr; currentTransition = nullptr;
QTimer::singleShot(1000, this, SLOT(deferredInitOperations())); QTimer::singleShot(1000, this, SLOT(deferredInitOperations()));
@ -187,6 +187,8 @@ void WSEvents::FrontendEventHandler(enum obs_frontend_event event, void* private
owner->OnStudioModeSwitched(false); owner->OnStudioModeSwitched(false);
} }
else if (event == OBS_FRONTEND_EVENT_EXIT) { else if (event == OBS_FRONTEND_EVENT_EXIT) {
owner->connectSceneSignals(nullptr);
owner->connectTransitionSignals(nullptr);
owner->OnExit(); owner->OnExit();
} }
} }
@ -221,43 +223,61 @@ void WSEvents::broadcastUpdate(const char* updateType,
} }
void WSEvents::connectTransitionSignals(obs_source_t* transition) { void WSEvents::connectTransitionSignals(obs_source_t* transition) {
if (transitionHandler) { signal_handler_t* sh = nullptr;
signal_handler_disconnect(transitionHandler,
if (currentTransition) {
sh = obs_source_get_signal_handler(currentTransition);
signal_handler_disconnect(sh,
"transition_start", OnTransitionBegin, this); "transition_start", OnTransitionBegin, this);
} }
currentTransition = transition;
if (currentTransition) {
if (!transitionIsCut(transition)) { if (!transitionIsCut(transition)) {
transitionHandler = obs_source_get_signal_handler(transition); currentTransition = transition;
signal_handler_connect(transitionHandler,
sh = obs_source_get_signal_handler(currentTransition);
signal_handler_connect(sh,
"transition_start", OnTransitionBegin, this); "transition_start", OnTransitionBegin, this);
} else { }
transitionHandler = nullptr; else {
currentTransition = nullptr;
}
} }
} }
void WSEvents::connectSceneSignals(obs_source_t* scene) { void WSEvents::connectSceneSignals(obs_source_t* scene) {
if (sceneHandler) { signal_handler_t* sh = nullptr;
signal_handler_disconnect(sceneHandler,
if (currentScene) {
sh = obs_source_get_signal_handler(currentScene);
signal_handler_disconnect(sh,
"reorder", OnSceneReordered, this); "reorder", OnSceneReordered, this);
signal_handler_disconnect(sceneHandler, signal_handler_disconnect(sh,
"item_add", OnSceneItemAdd, this); "item_add", OnSceneItemAdd, this);
signal_handler_disconnect(sceneHandler, signal_handler_disconnect(sh,
"item_remove", OnSceneItemDelete, this); "item_remove", OnSceneItemDelete, this);
signal_handler_disconnect(sceneHandler, signal_handler_disconnect(sh,
"item_visible", OnSceneItemVisibilityChanged, this); "item_visible", OnSceneItemVisibilityChanged, this);
} }
currentScene = scene;
if (currentScene) {
// TODO : connect to all scenes, not just the current one. // TODO : connect to all scenes, not just the current one.
sceneHandler = obs_source_get_signal_handler(scene); sh = obs_source_get_signal_handler(currentScene);
signal_handler_connect(sceneHandler, signal_handler_connect(sh,
"reorder", OnSceneReordered, this); "reorder", OnSceneReordered, this);
signal_handler_connect(sceneHandler, signal_handler_connect(sh,
"item_add", OnSceneItemAdd, this); "item_add", OnSceneItemAdd, this);
signal_handler_connect(sceneHandler, signal_handler_connect(sh,
"item_remove", OnSceneItemDelete, this); "item_remove", OnSceneItemDelete, this);
signal_handler_connect(sceneHandler, signal_handler_connect(sh,
"item_visible", OnSceneItemVisibilityChanged, this); "item_visible", OnSceneItemVisibilityChanged, this);
} }
}
uint64_t WSEvents::GetStreamingTime() { uint64_t WSEvents::GetStreamingTime() {
if (_streamingActive) if (_streamingActive)
@ -335,8 +355,8 @@ void WSEvents::OnSceneListChange() {
void WSEvents::OnSceneCollectionChange() { void WSEvents::OnSceneCollectionChange() {
broadcastUpdate("SceneCollectionChanged"); broadcastUpdate("SceneCollectionChanged");
sceneHandler = nullptr; currentScene = nullptr;
transitionHandler = nullptr; currentTransition = nullptr;
OnTransitionListChange(); OnTransitionListChange();
OnTransitionChange(); OnTransitionChange();

View File

@ -53,8 +53,8 @@ class WSEvents : public QObject {
private: private:
WSServer* _srv; WSServer* _srv;
signal_handler_t* transitionHandler; OBSSource currentScene;
signal_handler_t* sceneHandler; OBSSource currentTransition;
bool pulse; bool pulse;

View File

@ -22,7 +22,6 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include "../Config.h" #include "../Config.h"
#include "../WSServer.h" #include "../WSServer.h"
#include "settings-dialog.h" #include "settings-dialog.h"
#include "ui_settings-dialog.h"
#define CHANGE_ME "changeme" #define CHANGE_ME "changeme"

View File

@ -21,9 +21,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include <QDialog> #include <QDialog>
namespace Ui { #include "ui_settings-dialog.h"
class SettingsDialog;
}
class SettingsDialog : public QDialog class SettingsDialog : public QDialog
{ {

View File

@ -39,7 +39,7 @@ using OBSOutputAutoRelease =
OBSRef<obs_output_t*, ___output_dummy_addref, obs_output_release>; OBSRef<obs_output_t*, ___output_dummy_addref, obs_output_release>;
#define PROP_AUTHENTICATED "wsclient_authenticated" #define PROP_AUTHENTICATED "wsclient_authenticated"
#define OBS_WEBSOCKET_VERSION "4.3.0" #define OBS_WEBSOCKET_VERSION "4.3.2"
#define blog(level, msg, ...) blog(level, "[obs-websocket] " msg, ##__VA_ARGS__) #define blog(level, msg, ...) blog(level, "[obs-websocket] " msg, ##__VA_ARGS__)