From c741a7389322cbe54a6051dc22515284a98c7e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Wed, 18 Mar 2020 01:18:20 +0100 Subject: [PATCH 001/178] request(SetTBarPosition): wip --- src/WSRequestHandler.cpp | 1 + src/WSRequestHandler.h | 1 + src/WSRequestHandler_StudioMode.cpp | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index f2ae6c47..a5914744 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -130,6 +130,7 @@ const QHash WSRequestHandler::messageMap { { "EnableStudioMode", &WSRequestHandler::EnableStudioMode }, { "DisableStudioMode", &WSRequestHandler::DisableStudioMode }, { "ToggleStudioMode", &WSRequestHandler::ToggleStudioMode }, + { "SetTBarPosition", &WSRequestHandler::SetTBarPosition }, { "SetTextGDIPlusProperties", &WSRequestHandler::SetTextGDIPlusProperties }, { "GetTextGDIPlusProperties", &WSRequestHandler::GetTextGDIPlusProperties }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index d17384ee..a644bca4 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -148,6 +148,7 @@ class WSRequestHandler { RpcResponse EnableStudioMode(const RpcRequest&); RpcResponse DisableStudioMode(const RpcRequest&); RpcResponse ToggleStudioMode(const RpcRequest&); + RpcResponse SetTBarPosition(const RpcRequest&); RpcResponse SetTextGDIPlusProperties(const RpcRequest&); RpcResponse GetTextGDIPlusProperties(const RpcRequest&); diff --git a/src/WSRequestHandler_StudioMode.cpp b/src/WSRequestHandler_StudioMode.cpp index fb958f3b..219435ed 100644 --- a/src/WSRequestHandler_StudioMode.cpp +++ b/src/WSRequestHandler_StudioMode.cpp @@ -177,3 +177,30 @@ RpcResponse WSRequestHandler::ToggleStudioMode(const RpcRequest& request) { return request.success(); } + +/** + * Set the position of the T-Bar (in Studio Mode) to the specified value. Will return an error if OBS is not in studio mode + * or if the current transition doesn't support T-Bar control. + * + * @param {double} `position` T-Bar position. This value will be clamped between 0.0 and 1.0. + * + * @api requests + * @name TransitionToProgram + * @category studio mode + * @since 4.8.0 + */ +RpcResponse WSRequestHandler::SetTBarPosition(const RpcRequest& request) { + if (!obs_frontend_preview_program_mode_active()) { + return request.failed("studio mode not enabled"); + } + + OBSSourceAutoRelease currentTransition = obs_frontend_get_current_transition(); + if (obs_transition_fixed(currentTransition)) { + return request.failed("current transition doesn't support t-bar control"); + } + + double position = obs_data_get_double(request.parameters(), "position"); + obs_transition_set_manual_time(currentTransition, position); + + return request.success(); +} From 297d920fdc679452883d24651ef5f1dfd18b9f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Wed, 18 Mar 2020 01:19:02 +0100 Subject: [PATCH 002/178] fix --- src/WSRequestHandler_StudioMode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WSRequestHandler_StudioMode.cpp b/src/WSRequestHandler_StudioMode.cpp index 219435ed..cd103c83 100644 --- a/src/WSRequestHandler_StudioMode.cpp +++ b/src/WSRequestHandler_StudioMode.cpp @@ -185,7 +185,7 @@ RpcResponse WSRequestHandler::ToggleStudioMode(const RpcRequest& request) { * @param {double} `position` T-Bar position. This value will be clamped between 0.0 and 1.0. * * @api requests - * @name TransitionToProgram + * @name SetTBarPosition * @category studio mode * @since 4.8.0 */ From 631a008fa0274b1187fa37e116f59fe4f25fc7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Wed, 15 Apr 2020 10:36:12 +0200 Subject: [PATCH 003/178] readme: fixes --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 83862294..e1b775a8 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ It is **highly recommended** to protect obs-websocket with a password against un ### Possible use cases - Remote control OBS from a phone or tablet on the same local network -- Change your stream overlay/graphics based on the current scene (like the AGDQ overlay does) +- Change your stream overlay/graphics based on the current scene - Automate scene switching with a third-party program (e.g. : auto-pilot, foot pedal, ...) ### For developers @@ -46,19 +46,14 @@ See the [build instructions](BUILDING.md). ### Branches -The two main development branches are: - -- `4.x-current`: actively-maintained codebase for 4.x releases. Backwards-compatible (unless stated otherwise) with existing clients until 5.0. -- `5.x`: upcoming 5.0 version - -**New features and fixes must be based off and contributed to `4.x-current`**, as obs-websocket 5.0 is not in active development yet. +Development happens on `4.x-current` ### Pull Requests -Pull Requests must never be based off your fork's main branch (in our case, `4.x-current` or `5.x`). Start your work in a new branch +Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). Start your work in a new branch based on the main one (e.g.: `cool-new-feature`, `fix-palakis-mistakes`, ...) and open a Pull Request once you feel ready to show your work. -If your Pull Request is not ready to merge yet, tag it with the `work in progress` label. You can also use the `help needed` label if you have questions, need a hand or want to ask for input. +**If your Pull Request is not ready to merge yet, create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). ### Code style & formatting From 758441d65d47581281ad83bf91eb8af4f5ad193a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 17 Apr 2020 15:00:51 +0200 Subject: [PATCH 004/178] readme: fix CI badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1b775a8..ac081832 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ WebSockets API for OBS Studio. Follow the main author on Twitter for news & updates : [@LePalakis](https://twitter.com/LePalakis) -[![Build Status - Windows](https://ci.appveyor.com/api/projects/status/github/Palakis/obs-websocket)](https://ci.appveyor.com/project/Palakis/obs-websocket/history) [![Build Status - Linux](https://travis-ci.org/Palakis/obs-websocket.svg?branch=master)](https://travis-ci.org/Palakis/obs-websocket) +[![Build Status](https://dev.azure.com/Palakis/obs-websocket/_apis/build/status/Palakis.obs-websocket?branchName=4.x-current)](https://dev.azure.com/Palakis/obs-websocket/_build/latest?definitionId=2&branchName=4.x-current) ## Downloads From 05baf6b8ac58483d3cdc9c84cbdd9ef2ffc60424 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Tue, 21 Apr 2020 05:30:21 -0700 Subject: [PATCH 005/178] Add simpleobsws to list of language APIs I've created a simple async Python library for people who just want the simple stuff. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ac081832..a0afb404 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Here's a list of available language APIs for obs-websocket : - C#/VB.NET: [obs-websocket-dotnet](https://github.com/Palakis/obs-websocket-dotnet) - Python 2 and 3: [obs-websocket-py](https://github.com/Elektordi/obs-websocket-py) by Guillaume Genty a.k.a Elektordi - Python 3.5+ with asyncio: [obs-ws-rc](https://github.com/KirillMysnik/obs-ws-rc) by Kirill Mysnik +- Python 3.6+ with asyncio: [simpleobsws](https://github.com/IRLToolkit/simpleobsws) by tt2468 - Java 8+: [obs-websocket-java](https://github.com/Twasi/websocket-obs-java) by TwasiNET - Golang: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf From 76635ff31ba9fb173071af3ca15f95956e1b6809 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Tue, 21 Apr 2020 17:29:59 +0200 Subject: [PATCH 006/178] CI: Add Github Actions workflow for PRs and pushes to main branch --- .github/workflows/pr_push.yml | 412 ++++++++++++++++++++++++++++++++++ CI/macos/Brewfile | 10 + 2 files changed, 422 insertions(+) create mode 100644 .github/workflows/pr_push.yml create mode 100644 CI/macos/Brewfile diff --git a/.github/workflows/pr_push.yml b/.github/workflows/pr_push.yml new file mode 100644 index 00000000..62836706 --- /dev/null +++ b/.github/workflows/pr_push.yml @@ -0,0 +1,412 @@ +name: 'CI Multiplatform Build' + +on: + push: + paths-ignore: + - 'docs/**' + branches: + - 4.x-current + pull_request: + paths-ignore: + - '**.md' + branches: + - 4.x-current + +jobs: + windows: + name: 'Windows 32+64bit' + runs-on: [windows-latest] + if: contains(github.event.head_commit.message, '[skip ci]') != true + env: + QT_VERSION: '5.10.1' + WINDOWS_DEPS_VERSION: '2017' + CMAKE_GENERATOR: "Visual Studio 16 2019" + CMAKE_SYSTEM_VERSION: "10.0" + steps: + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.0 + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-websocket + submodules: 'recursive' + - name: 'Checkout OBS' + uses: actions/checkout@v2 + with: + repository: obsproject/obs-studio + path: ${{ github.workspace }}/obs-studio + submodules: 'recursive' + - name: 'Get OBS-Studio git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git fetch --prune --unshallow + echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git checkout ${{ env.OBS_GIT_TAG }} + git submodule update + - name: 'Get obs-websocket git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-websocket + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install prerequisite: QT' + run: | + curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C - + 7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}\cmbuild\QT" + - name: 'Install prerequisite: Pre-built OBS dependencies' + run: | + curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -f --retry 5 -C - + 7z x dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -o"${{ github.workspace }}\cmbuild\deps" + - name: 'Restore OBS 32-bit build v${{ env.OBS_GIT_TAG }} from cache' + id: build-cache-obs-32 + uses: actions/cache@v1 + env: + CACHE_NAME: 'build-cache-obs-32' + with: + path: ${{ github.workspace }}/obs-studio/build32 + key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }} + restore-keys: | + ${{ runner.os }}-${{ env.CACHE_NAME }}- + - name: 'Configure OBS 32-bit' + if: steps.build-cache-obs-32.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + mkdir .\build32 + cd .\build32 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + - name: 'Build OBS-Studio 32-bit' + if: steps.build-cache-obs-32.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + msbuild /m /p:Configuration=RelWithDebInfo .\build32\libobs\libobs.vcxproj + msbuild /m /p:Configuration=RelWithDebInfo .\build32\UI\obs-frontend-api\obs-frontend-api.vcxproj + - name: 'Restore OBS 64-bit build v${{ env.OBS_GIT_TAG }} from cache' + id: build-cache-obs-64 + uses: actions/cache@v1 + env: + CACHE_NAME: 'build-cache-obs-64' + with: + path: ${{ github.workspace }}/obs-studio/build64 + key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }} + restore-keys: | + ${{ runner.os }}-${{ env.CACHE_NAME }}- + - name: 'Configure OBS 64-bit' + if: steps.build-cache-obs-64.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + mkdir .\build64 + cd .\build64 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + - name: 'Build OBS-Studio 64-bit' + if: steps.build-cache-obs-64.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + msbuild /m /p:Configuration=RelWithDebInfo .\build64\libobs\libobs.vcxproj + msbuild /m /p:Configuration=RelWithDebInfo .\build64\UI\obs-frontend-api\obs-frontend-api.vcxproj + - name: 'Configure obs-websocket 64-bit' + working-directory: ${{ github.workspace }}/obs-websocket + run: | + mkdir .\build64 + cd .\build64 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build64\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build64\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build64\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" .. + - name: 'Configure obs-websocket 32-bit' + working-directory: ${{ github.workspace }}/obs-websocket + run: | + mkdir .\build32 + cd .\build32 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build32\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build32\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build32\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" .. + - name: 'Build obs-websocket 64-bit' + working-directory: ${{ github.workspace }}/obs-websocket + run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-websocket.sln + - name: 'Build obs-websocket 32-bit' + working-directory: ${{ github.workspace }}/obs-websocket + run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-websocket.sln + - name: 'Set PR artifact filename' + shell: bash + run: | + FILENAME="obs-websocket-${{ env.GIT_HASH }}-Windows" + echo "::set-env name=FILENAME::$FILENAME" + - name: 'Package obs-websocket' + working-directory: ${{ github.workspace }}/obs-websocket + run: | + mkdir package + cd package + 7z a "${{ env.WIN_FILENAME }}.zip" "..\release\*" + iscc ..\installer\installer.iss /O. /F"${{ env.WIN_FILENAME }}-Installer" + - name: 'Publish ${{ env.WIN_FILENAME }}.zip' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_HASH }}-Windows' + path: ${{ github.workspace }}/obs-websocket/package/*.zip + - name: 'Publish ${{ env.WIN_FILENAME }}-Installer.exe' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_HASH }}-Windows-Installer' + path: ${{ github.workspace }}/obs-websocket/package/*.exe + ubuntu64: + name: "Linux/Ubuntu 64-bit" + runs-on: [ubuntu-latest] + if: contains(github.event.head_commit.message, '[skip ci]') != true + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-websocket + submodules: 'recursive' + - name: 'Checkout OBS' + uses: actions/checkout@v2 + with: + repository: obsproject/obs-studio + path: ${{ github.workspace }}/obs-studio + submodules: 'recursive' + - name: 'Get OBS-Studio git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git fetch --prune --unshallow + echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git checkout ${{ env.OBS_GIT_TAG }} + git submodule update + - name: 'Get obs-websocket git info' + working-directory: ${{ github.workspace }}/obs-websocket + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install prerequisites (Apt)' + shell: bash + run: | + sudo dpkg --add-architecture amd64 + sudo apt-get -qq update + sudo apt-get install -y \ + build-essential \ + checkinstall \ + cmake \ + libasound2-dev \ + libavcodec-dev \ + libavdevice-dev \ + libavfilter-dev \ + libavformat-dev \ + libavutil-dev \ + libcurl4-openssl-dev \ + libfdk-aac-dev \ + libfontconfig-dev \ + libfreetype6-dev \ + libgl1-mesa-dev \ + libjack-jackd2-dev \ + libjansson-dev \ + libluajit-5.1-dev \ + libpulse-dev \ + libqt5x11extras5-dev \ + libspeexdsp-dev \ + libswresample-dev \ + libswscale-dev \ + libudev-dev \ + libv4l-dev \ + libva-dev \ + libvlc-dev \ + libx11-dev \ + libx264-dev \ + libxcb-randr0-dev \ + libxcb-shm0-dev \ + libxcb-xinerama0-dev \ + libxcomposite-dev \ + libxinerama-dev \ + libmbedtls-dev \ + pkg-config \ + python3-dev \ + qtbase5-dev \ + libqt5svg5-dev \ + swig + - name: 'Configure OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + mkdir ./build + cd ./build + cmake -DBUILD_CAPTIONS=YES -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES -DCMAKE_INSTALL_PREFIX=/usr .. + - name: 'Build OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + set -e + cd ./build + make -j4 libobs obs-frontend-api + - name: 'Install OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + cd ./build + sudo cp ./libobs/libobs.so /usr/lib + sudo cp ./UI/obs-frontend-api/libobs-frontend-api.so /usr/lib + sudo mkdir -p /usr/include/obs + sudo cp ../UI/obs-frontend-api/obs-frontend-api.h /usr/include/obs/obs-frontend-api.h + - name: 'Configure obs-websocket' + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + mkdir ./build + cd ./build + cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr .. + - name: 'Build obs-websocket' + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + set -e + cd ./build + make -j4 + - name: 'Set PR artifact filename' + shell: bash + run: | + FILENAME="obs-websocket-1-${{ env.GIT_HASH }}-1_amd64.deb" + echo "::set-env name=FILENAME::$FILENAME" + - name: 'Package ${{ env.FILENAME }}' + if: success() + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + VERSION="1-${{ env.GIT_HASH }}-git" + cd ./build + sudo checkinstall -y --type=debian --fstrans=no -nodoc \ + --backup=no --deldoc=yes --install=no --pkgname=obs-websocket --pkgversion=$VERSION \ + --pkglicense="GPLv2.0" --maintainer="${{ github.event.pusher.email }}" --pkggroup="video" \ + --pkgsource="${{ github.event.repository.html_url }}" \ + --requires="obs-studio,libqt5core5a,libqt5widgets5,qt5-image-formats-plugins" \ + --pakdir="../package" + sudo chmod ao+r ../package/* + cd - + - name: 'Publish ${{ env.FILENAME }}' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_HASH }}-linux' + path: '${{ github.workspace }}/obs-websocket/package/*.deb' + macos64: + name: "macOS 64-bit" + runs-on: [macos-latest] + if: contains(github.event.head_commit.message, '[skip ci]') != true + env: + MACOS_DEPS_VERSION: '2020-04-18' + QT_VERSION: '5.14.1' + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-websocket + submodules: 'recursive' + - name: 'Checkout OBS' + uses: actions/checkout@v2 + with: + repository: obsproject/obs-studio + path: ${{ github.workspace }}/obs-studio + submodules: 'recursive' + - name: 'Get OBS-Studio git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git fetch --prune --unshallow + echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git checkout ${{ env.OBS_GIT_TAG }} + git submodule update + - name: 'Get obs-websocket git info' + working-directory: ${{ github.workspace }}/obs-websocket + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install prerequisites (Homebrew)' + shell: bash + run: | + brew bundle --file ${{ github.workspace }}/obs-websocket/CI/macos/Brewfile + - name: 'Install prerequisite: Pre-built OBS dependencies' + shell: bash + run: | + curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz + tar -xf ${{ github.workspace }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp" + - name: 'Configure OBS Studio' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + mkdir build + cd build + cmake -DBUILD_CAPTIONS=YES -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DENABLE_SCRIPTING=NO -DDepsPath=/tmp/obsdeps -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/${{ env.QT_VERSION }}/lib/cmake .. + - name: 'Build OBS Studio libraries' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + set -e + cd ./build + make -j4 libobs obs-frontend-api + - name: 'Configure obs-websocket' + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + mkdir build + cd build + cmake -DQTDIR=/usr/local/Cellar/qt/${{ env.QT_VERSION }} -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DLIBOBS_LIB=${{ github.workspace }}/obs-studio/libobs -DOBS_FRONTEND_LIB="${{ github.workspace }}/obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr .. + - name: 'Build obs-websocket' + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + set -e + cd ./build + make -j4 + - name: 'Install prerequisite: Packages app' + if: success() + shell: bash + run: | + curl -L -O https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg + sudo installer -pkg ${{ github.workspace }}/Packages.pkg -target / + - name: 'Set PR artifact filename' + shell: bash + run: | + FILENAME_UNSIGNED="obs-websocket-${{ env.GIT_HASH }}-macOS-Unsigned.pkg" + echo "::set-env name=FILENAME_UNSIGNED::$FILENAME_UNSIGNED" + - name: 'Fix linked dynamic library paths' + if: success() + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ./build/obs-websocket.so + install_name_tool -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ./build/obs-websocket.so + install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./build/obs-websocket.so + echo "Dependencies for obs-websocket" + otool -L ./build/obs-websocket.so + - name: 'Package ${{ env.FILENAME }}' + if: success() + working-directory: ./obs-websocket + shell: bash + run: | + packagesbuild ./CI/macos/obs-websocket.pkgproj + mv ./release/obs-websocket.pkg ./release/${{ env.FILENAME_UNSIGNED }} + - name: 'Publish ${{ env.FILENAME_UNSIGNED }} artifact' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_HASH }}-macOS' + path: ${{ github.workspace }}/obs-websocket/release/*.pkg diff --git a/CI/macos/Brewfile b/CI/macos/Brewfile new file mode 100644 index 00000000..20fabb71 --- /dev/null +++ b/CI/macos/Brewfile @@ -0,0 +1,10 @@ +tap "akeru-inc/tap" +brew "jack" +brew "speexdsp" +brew "cmake" +brew "freetype" +brew "fdk-aac" +brew "https://gist.githubusercontent.com/DDRBoxman/9c7a2b08933166f4b61ed9a44b242609/raw/ef4de6c587c6bd7f50210eccd5bd51ff08e6de13/qt.rb" +brew "swig", link: false +brew "https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb" +brew "akeru-inc/tap/xcnotary" \ No newline at end of file From a479f529af1e5bf4214d39cec36fad6e6f101a14 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Tue, 21 Apr 2020 17:42:07 +0200 Subject: [PATCH 007/178] CI: Add Github Actions workflow for release tags --- .github/workflows/tag_release.yml | 484 ++++++++++++++++++++++++++++++ CI/macos/Brewfile | 10 + 2 files changed, 494 insertions(+) create mode 100644 .github/workflows/tag_release.yml create mode 100644 CI/macos/Brewfile diff --git a/.github/workflows/tag_release.yml b/.github/workflows/tag_release.yml new file mode 100644 index 00000000..698ce49a --- /dev/null +++ b/.github/workflows/tag_release.yml @@ -0,0 +1,484 @@ +name: 'CI Multiplatform Release' + +on: + push: + paths-ignore: + - 'docs/**' + tags: + - '[45].[0-9]+.[0-9]+' + +jobs: + windows: + name: 'Windows 32+64bit' + runs-on: [windows-latest] + env: + QT_VERSION: '5.10.1' + WINDOWS_DEPS_VERSION: '2017' + CMAKE_GENERATOR: "Visual Studio 16 2019" + CMAKE_SYSTEM_VERSION: "10.0" + steps: + - name: 'Add msbuild to PATH' + uses: microsoft/setup-msbuild@v1.0.0 + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-websocket + submodules: 'recursive' + - name: 'Checkout OBS' + uses: actions/checkout@v2 + with: + repository: obsproject/obs-studio + path: ${{ github.workspace }}/obs-studio + submodules: 'recursive' + - name: 'Get OBS-Studio git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git fetch --prune --unshallow + echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git checkout ${{ env.OBS_GIT_TAG }} + git submodule update + - name: 'Get obs-websocket git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-websocket + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install prerequisite: QT' + run: | + curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C - + 7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}\cmbuild\QT" + - name: 'Install prerequisite: Pre-built OBS dependencies' + run: | + curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -f --retry 5 -C - + 7z x dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -o"${{ github.workspace }}\cmbuild\deps" + - name: 'Restore OBS 32-bit build v${{ env.OBS_GIT_TAG }} from cache' + id: build-cache-obs-32 + uses: actions/cache@v1 + env: + CACHE_NAME: 'build-cache-obs-32' + with: + path: ${{ github.workspace }}/obs-studio/build32 + key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }} + restore-keys: | + ${{ runner.os }}-${{ env.CACHE_NAME }}- + - name: 'Configure OBS 32-bit' + if: steps.build-cache-obs-32.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + mkdir .\build32 + cd .\build32 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + - name: 'Build OBS-Studio 32-bit' + if: steps.build-cache-obs-32.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + msbuild /m /p:Configuration=RelWithDebInfo .\build32\libobs\libobs.vcxproj + msbuild /m /p:Configuration=RelWithDebInfo .\build32\UI\obs-frontend-api\obs-frontend-api.vcxproj + - name: 'Restore OBS 64-bit build v${{ env.OBS_GIT_TAG }} from cache' + id: build-cache-obs-64 + uses: actions/cache@v1 + env: + CACHE_NAME: 'build-cache-obs-64' + with: + path: ${{ github.workspace }}/obs-studio/build64 + key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }} + restore-keys: | + ${{ runner.os }}-${{ env.CACHE_NAME }}- + - name: 'Configure OBS 64-bit' + if: steps.build-cache-obs-64.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + mkdir .\build64 + cd .\build64 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + - name: 'Build OBS-Studio 64-bit' + if: steps.build-cache-obs-64.outputs.cache-hit != 'true' + working-directory: ${{ github.workspace }}/obs-studio + run: | + msbuild /m /p:Configuration=RelWithDebInfo .\build64\libobs\libobs.vcxproj + msbuild /m /p:Configuration=RelWithDebInfo .\build64\UI\obs-frontend-api\obs-frontend-api.vcxproj + - name: 'Configure obs-websocket 64-bit' + working-directory: ${{ github.workspace }}/obs-websocket + run: | + mkdir .\build64 + cd .\build64 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build64\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build64\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build64\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" .. + - name: 'Configure obs-websocket 32-bit' + working-directory: ${{ github.workspace }}/obs-websocket + run: | + mkdir .\build32 + cd .\build32 + cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build32\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build32\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build32\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" .. + - name: 'Build obs-websocket 64-bit' + working-directory: ${{ github.workspace }}/obs-websocket + run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-websocket.sln + - name: 'Build obs-websocket 32-bit' + working-directory: ${{ github.workspace }}/obs-websocket + run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-websocket.sln + - name: 'Set release filename' + shell: bash + run: | + FILENAME="obs-websocket-${{ env.GIT_TAG }}-Windows" + echo "::set-env name=WIN_FILENAME::$FILENAME" + - name: 'Package obs-websocket' + working-directory: ${{ github.workspace }}/obs-websocket + run: | + mkdir package + cd package + 7z a "${{ env.WIN_FILENAME }}.zip" "..\release\*" + iscc ..\installer\installer.iss /O. /F"${{ env.WIN_FILENAME }}-Installer" + - name: 'Publish ${{ env.WIN_FILENAME }}.zip' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_TAG }}-Windows' + path: ${{ github.workspace }}/obs-websocket/package/*.zip + - name: 'Publish ${{ env.WIN_FILENAME }}-Installer.exe' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_TAG }}-Windows-Installer' + path: ${{ github.workspace }}/obs-websocket/package/*.exe + ubuntu64: + name: "Linux/Ubuntu 64-bit" + runs-on: [ubuntu-latest] + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-websocket + submodules: 'recursive' + - name: 'Checkout OBS' + uses: actions/checkout@v2 + with: + repository: obsproject/obs-studio + path: ${{ github.workspace }}/obs-studio + submodules: 'recursive' + - name: 'Get OBS-Studio git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git fetch --prune --unshallow + echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git checkout ${{ env.OBS_GIT_TAG }} + git submodule update + - name: 'Get obs-websocket git info' + working-directory: ${{ github.workspace }}/obs-websocket + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install prerequisites (Apt)' + shell: bash + run: | + sudo dpkg --add-architecture amd64 + sudo apt-get -qq update + sudo apt-get install -y \ + build-essential \ + checkinstall \ + cmake \ + libasound2-dev \ + libavcodec-dev \ + libavdevice-dev \ + libavfilter-dev \ + libavformat-dev \ + libavutil-dev \ + libcurl4-openssl-dev \ + libfdk-aac-dev \ + libfontconfig-dev \ + libfreetype6-dev \ + libgl1-mesa-dev \ + libjack-jackd2-dev \ + libjansson-dev \ + libluajit-5.1-dev \ + libpulse-dev \ + libqt5x11extras5-dev \ + libspeexdsp-dev \ + libswresample-dev \ + libswscale-dev \ + libudev-dev \ + libv4l-dev \ + libva-dev \ + libvlc-dev \ + libx11-dev \ + libx264-dev \ + libxcb-randr0-dev \ + libxcb-shm0-dev \ + libxcb-xinerama0-dev \ + libxcomposite-dev \ + libxinerama-dev \ + libmbedtls-dev \ + pkg-config \ + python3-dev \ + qtbase5-dev \ + libqt5svg5-dev \ + swig + - name: 'Configure OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + mkdir ./build + cd ./build + cmake -DBUILD_CAPTIONS=YES -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES -DCMAKE_INSTALL_PREFIX=/usr .. + - name: 'Build OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + set -e + cd ./build + make -j4 libobs obs-frontend-api + - name: 'Install OBS-Studio' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + cd ./build + sudo cp ./libobs/libobs.so /usr/lib + sudo cp ./UI/obs-frontend-api/libobs-frontend-api.so /usr/lib + sudo mkdir -p /usr/include/obs + sudo cp ../UI/obs-frontend-api/obs-frontend-api.h /usr/include/obs/obs-frontend-api.h + - name: 'Configure obs-websocket' + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + mkdir ./build + cd ./build + cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr .. + - name: 'Build obs-websocket' + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + set -e + cd ./build + make -j4 + - name: 'Set release filename' + shell: bash + run: | + FILENAME="obs-websocket-${{ env.GIT_TAG }}-1_amd64.deb" + echo "::set-env name=LINUX_FILENAME::$FILENAME" + - name: 'Package ${{ env.LINUX_FILENAME }}' + if: success() + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + VERSION="${{ env.GIT_TAG }}" + cd ./build + sudo checkinstall -y --type=debian --fstrans=no -nodoc \ + --backup=no --deldoc=yes --install=no --pkgname=obs-websocket --pkgversion=$VERSION \ + --pkglicense="GPLv2.0" --maintainer="${{ github.event.pusher.email }}" --pkggroup="video" \ + --pkgsource="${{ github.event.repository.html_url }}" \ + --requires="obs-studio,libqt5core5a,libqt5widgets5,qt5-image-formats-plugins" \ + --pakdir="../package" + sudo chmod ao+r ../package/* + cd - + - name: 'Publish ${{ env.LINUX_FILENAME }}' + if: success() + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_TAG }}-linux' + path: '${{ github.workspace }}/obs-websocket/package/*.deb' + macos64: + name: "macOS 64-bit" + runs-on: [macos-latest] + env: + MACOS_DEPS_VERSION: '2020-04-18' + QT_VERSION: '5.14.1' + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + with: + path: ${{ github.workspace }}/obs-websocket + submodules: 'recursive' + - name: 'Checkout OBS' + uses: actions/checkout@v2 + with: + repository: obsproject/obs-studio + path: ${{ github.workspace }}/obs-studio + submodules: 'recursive' + - name: 'Get OBS-Studio git info' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git fetch --prune --unshallow + echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD) + echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + git checkout ${{ env.OBS_GIT_TAG }} + git submodule update + - name: 'Get obs-websocket git info' + working-directory: ${{ github.workspace }}/obs-websocket + run: | + git fetch --prune --unshallow + echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }} + echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD) + echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0) + - name: 'Install prerequisites (Homebrew)' + shell: bash + run: | + brew bundle --file ${{ github.workspace }}/obs-websocket/CI/macos/Brewfile + - name: 'Install prerequisite: Pre-built OBS dependencies' + shell: bash + run: | + curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz + tar -xf ${{ github.workspace }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp" + - name: 'Configure OBS Studio' + shell: bash + working-directory: ${{ github.workspace }}/obs-studio + run: | + mkdir build + cd build + cmake -DBUILD_CAPTIONS=YES -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DENABLE_SCRIPTING=NO -DDepsPath=/tmp/obsdeps -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/${{ env.QT_VERSION }}/lib/cmake .. + - name: 'Build OBS Studio libraries' + working-directory: ${{ github.workspace }}/obs-studio + shell: bash + run: | + set -e + cd ./build + make -j4 libobs obs-frontend-api + - name: 'Configure obs-websocket' + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + mkdir build + cd build + cmake -DQTDIR=/usr/local/Cellar/qt/${{ env.QT_VERSION }} -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DLIBOBS_LIB=${{ github.workspace }}/obs-studio/libobs -DOBS_FRONTEND_LIB="${{ github.workspace }}/obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr .. + - name: 'Build obs-websocket' + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + set -e + cd ./build + make -j4 + - name: 'Install prerequisite: Packages app' + if: success() + shell: bash + run: | + curl -L -O https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg + sudo installer -pkg ${{ github.workspace }}/Packages.pkg -target / + - name: 'Set release filename' + if: success() && startsWith(github.ref, 'refs/tags') + shell: bash + run: | + FILENAME_UNSIGNED="obs-websocket-${{ env.GIT_TAG }}-macOS-Unsigned.pkg" + FILENAME="obs-websocket-${{ env.GIT_TAG }}-macOS.pkg" + echo "::set-env name=MAC_FILENAME_UNSIGNED::$FILENAME_UNSIGNED" + echo "::set-env name=MAC_FILENAME::$FILENAME" + - name: 'Fix linked dynamic library paths' + if: success() + working-directory: ${{ github.workspace }}/obs-websocket + shell: bash + run: | + install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ./build/obs-websocket.so + install_name_tool -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ./build/obs-websocket.so + install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./build/obs-websocket.so + echo "Dependencies for obs-websocket" + otool -L ./build/obs-websocket.so + - name: 'Install Apple Developer Certificate' + if: success() + uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071 + with: + p12-file-base64: ${{ secrets.MACOS_CERT_CODESIGN }} + p12-password: ${{ secrets.MACOS_CERT_PASS }} + - name: 'Code signing' + if: success() + working-directory: ./obs-websocket + shell: bash + run: | + set -e + codesign --sign "${{ secrets.MACOS_IDENT_CODESIGN }}" ./build/obs-websocket.so + packagesbuild ./CI/macos/obs-websocket.pkgproj + mv ./release/obs-websocket.pkg ./release/${{ env.MAC_FILENAME_UNSIGNED }} + productsign --sign "${{ secrets.MACOS_IDENT_INSTALLER }}" ./release/${{ env.MAC_FILENAME_UNSIGNED }} ./release/${{ env.MAC_FILENAME }} + rm ./release/${{ env.MAC_FILENAME_UNSIGNED }} + - name: 'Notarization' + if: success() + working-directory: ./obs-websocket + shell: bash + run: | + set -e + xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.MACOS_IDENT_USER }}" -p "${{ secrets.MACOS_IDENT_PASS }}" + xcnotary precheck ./release/${{ env.MAC_FILENAME }} + if [ "$?" -eq 0 ]; then xcnotary notarize ./release/${{ env.MAC_FILENAME }} --developer-account "${{ secrets.MACOS_IDENT_USER }}" --developer-password-keychain-item "AC_PASSWORD" --provider "${{ secrets.MACOS_IDENT_PROVIDER }}"; fi + - name: 'Publish ${{ env.MAC_FILENAME }} artifact' + if: success() && startsWith(github.ref, 'refs/tags') + uses: actions/upload-artifact@v2-preview + with: + name: '${{ env.GIT_TAG }}-macOS' + path: ${{ github.workspace }}/obs-websocket/release/*.pkg + make-release: + name: 'Create and upload release' + runs-on: [ubuntu-latest] + needs: [windows, ubuntu64, macos64] + steps: + - name: 'Get the version' + shell: bash + id: get_version + run: | + echo ::set-env name=TAG_VERSION::${GITHUB_REF/refs\/tags\//} + - name: 'Create Release' + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.TAG_VERSION }} + release_name: obs-websocket ${{ env.TAG_VERSION }} + draft: false + prerelease: false + - name: 'Download release artifacts' + uses: actions/download-artifact@v2-preview + - name: 'Upload Windows .zip artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-Windows/obs-websocket-${{ env.TAG_VERSION }}-Windows.zip + asset_name: obs-websocket-${{ env.TAG_VERSION }}-Windows.zip + asset_content_type: application/zip + - name: 'Upload Windows .exe artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-Windows-Installer/obs-websocket-${{ env.TAG_VERSION }}-Windows-Installer.exe + asset_name: obs-websocket-${{ env.TAG_VERSION }}-Windows-Installer.exe + asset_content_type: application/zip + - name: 'Upload Linux artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-linux/obs-websocket_${{ env.TAG_VERSION }}-1_amd64.deb + asset_name: obs-websocket-${{ env.TAG_VERSION }}-1_amd64.deb + asset_content_type: application/octet-stream + - name: 'Upload macOS artifact to release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-macOS/obs-websocket-${{ env.TAG_VERSION }}-macOS.pkg + asset_name: obs-websocket-${{ env.TAG_VERSION }}-macOS.pkg + asset_content_type: application/octet-stream diff --git a/CI/macos/Brewfile b/CI/macos/Brewfile new file mode 100644 index 00000000..20fabb71 --- /dev/null +++ b/CI/macos/Brewfile @@ -0,0 +1,10 @@ +tap "akeru-inc/tap" +brew "jack" +brew "speexdsp" +brew "cmake" +brew "freetype" +brew "fdk-aac" +brew "https://gist.githubusercontent.com/DDRBoxman/9c7a2b08933166f4b61ed9a44b242609/raw/ef4de6c587c6bd7f50210eccd5bd51ff08e6de13/qt.rb" +brew "swig", link: false +brew "https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb" +brew "akeru-inc/tap/xcnotary" \ No newline at end of file From 19f9593ac19bdae5f4bed624c8c097be2946a617 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Tue, 21 Apr 2020 19:55:43 -0700 Subject: [PATCH 008/178] Supress websocketpp logging entries --- src/WSServer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/WSServer.cpp b/src/WSServer.cpp index c9f09362..c3b164e7 100644 --- a/src/WSServer.cpp +++ b/src/WSServer.cpp @@ -44,6 +44,7 @@ WSServer::WSServer() _connections(), _clMutex(QMutex::Recursive) { + _server.get_alog().clear_channels(websocketpp::log::alevel::frame_header | websocketpp::log::alevel::frame_payload | websocketpp::log::alevel::control); _server.init_asio(); #ifndef _WIN32 _server.set_reuse_addr(true); From f61bc809ddd38b530954a94eaefb63d423ceb6d6 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Mon, 27 Apr 2020 08:30:39 -0700 Subject: [PATCH 009/178] [Bug Fix] Fix FreeType2 source type recognition OBS appears to be using a new format for the FreeType2 source, so we add the new kinds. One thing I'm unsure on is if anything still uses the old naming stuff `text_ft2`/`text_ft2_v2`, since if not then we should not check --- src/WSRequestHandler_Sources.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 579f76b4..8dfdef98 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -15,7 +15,7 @@ bool isTextGDIPlusSource(const QString& sourceKind) bool isTextFreeType2Source(const QString& sourceKind) { - return (sourceKind == "text_ft2" || sourceKind == "text_ft2_v2"); + return (sourceKind == "text_ft2" || sourceKind == "text_ft2_v2" || sourceKind == "text_ft2_source" || sourceKind == "text_ft2_source_v2"); } /** From 2719da3685907bc71bbe7d693c491711da87ff96 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Mon, 27 Apr 2020 10:55:16 -0700 Subject: [PATCH 010/178] [Bug Fix] Don't build with captions on MacOS According to [this](https://github.com/obsproject/obs-studio/blob/master/UI/frontend-plugins/frontend-tools/CMakeLists.txt#L73), captions support is not active on MacOS, so we should not build it here. --- CI/install-build-obs-macos.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/CI/install-build-obs-macos.sh b/CI/install-build-obs-macos.sh index 0dc610aa..4af63b49 100755 --- a/CI/install-build-obs-macos.sh +++ b/CI/install-build-obs-macos.sh @@ -34,7 +34,6 @@ git checkout $OBSLatestTag mkdir build && cd build echo "[obs-websocket] Building obs-studio.." cmake .. \ - -DBUILD_CAPTIONS=true \ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \ -DDISABLE_PLUGINS=true \ -DENABLE_SCRIPTING=0 \ From 4fbc45b40bdd36ea4b07b3b648d8b8151d0b15fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 28 Apr 2020 09:34:41 +0200 Subject: [PATCH 011/178] ci(linux): make the deb package require OBS 25.0.7 --- CI/package-ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/package-ubuntu.sh b/CI/package-ubuntu.sh index 367e002c..08323bc0 100755 --- a/CI/package-ubuntu.sh +++ b/CI/package-ubuntu.sh @@ -17,7 +17,7 @@ PAGER="cat" sudo checkinstall -y --type=debian --fstrans=no --nodoc \ --pkglicense="GPLv2.0" --maintainer="stephane.lepin@gmail.com" \ --pkggroup="video" \ --pkgsource="https://github.com/Palakis/obs-websocket" \ - --requires="obs-studio,libqt5core5a,libqt5widgets5,qt5-image-formats-plugins" \ + --requires="obs-studio>=25.0.7,libqt5core5a,libqt5widgets5,qt5-image-formats-plugins" \ --pakdir="../package" sudo chmod ao+r ../package/* From 5843521cf145dc39f43ad36c0306c6aaa0ff4bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 28 Apr 2020 09:46:45 +0200 Subject: [PATCH 012/178] cmake(linux): use the standard LIBDIR and DATAROOTDIR install locations --- CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3273367c..8a6c3871 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,13 +187,10 @@ if(UNIX AND NOT APPLE) execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE UNAME_MACHINE) install(TARGETS obs-websocket - LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/obs-plugins") - # Dirty fix for Ubuntu - install(TARGETS obs-websocket - LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/${UNAME_MACHINE}-linux-gnu/obs-plugins") + LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins") install(FILES ${locale_files} - DESTINATION "${CMAKE_INSTALL_PREFIX}/share/obs/obs-plugins/obs-websocket/locale") + DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/obs/obs-plugins/obs-websocket/locale") endif() # --- End of section --- From b2d39ab2d7264ce6936db385212f4ee00fb23553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 28 Apr 2020 09:52:11 +0200 Subject: [PATCH 013/178] cmake(linux): include GNUInstallDirs --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a6c3871..5648a963 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,11 +180,12 @@ endif() # --- Linux-specific build settings and tasks --- if(UNIX AND NOT APPLE) + include(GNUInstallDirs) + set_target_properties(obs-websocket PROPERTIES PREFIX "") target_link_libraries(obs-websocket obs-frontend-api) file(GLOB locale_files data/locale/*.ini) - execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE UNAME_MACHINE) install(TARGETS obs-websocket LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins") From 645cbf988893a5336a1709e938b19bfc44734e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 28 Apr 2020 10:18:54 +0200 Subject: [PATCH 014/178] ci(linux): fix debian package requires --- CI/package-ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/package-ubuntu.sh b/CI/package-ubuntu.sh index 08323bc0..5f6998d6 100755 --- a/CI/package-ubuntu.sh +++ b/CI/package-ubuntu.sh @@ -17,7 +17,7 @@ PAGER="cat" sudo checkinstall -y --type=debian --fstrans=no --nodoc \ --pkglicense="GPLv2.0" --maintainer="stephane.lepin@gmail.com" \ --pkggroup="video" \ --pkgsource="https://github.com/Palakis/obs-websocket" \ - --requires="obs-studio>=25.0.7,libqt5core5a,libqt5widgets5,qt5-image-formats-plugins" \ + --requires="obs-studio \(\>= 25.0.7\), libqt5core5a, libqt5widgets5, qt5-image-formats-plugins" \ --pakdir="../package" sudo chmod ao+r ../package/* From a7d02a79a96d26e29b60a918d6c649b3fb6de82f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 28 Apr 2020 10:29:48 +0200 Subject: [PATCH 015/178] ci(linux): set package summary --- CI/package-ubuntu.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/CI/package-ubuntu.sh b/CI/package-ubuntu.sh index 5f6998d6..0f7f3c6d 100755 --- a/CI/package-ubuntu.sh +++ b/CI/package-ubuntu.sh @@ -14,6 +14,7 @@ cd ./build PAGER="cat" sudo checkinstall -y --type=debian --fstrans=no --nodoc \ --backup=no --deldoc=yes --install=no \ --pkgname=obs-websocket --pkgversion="$PKG_VERSION" \ + --summary="WebSockets Remote Control API for OBS Studio" \ --pkglicense="GPLv2.0" --maintainer="stephane.lepin@gmail.com" \ --pkggroup="video" \ --pkgsource="https://github.com/Palakis/obs-websocket" \ From 1ce0fd643c0070785810e7ceaf9017788d2f77aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 28 Apr 2020 10:29:48 +0200 Subject: [PATCH 016/178] Revert "ci(linux): set package summary" This reverts commit a7d02a79a96d26e29b60a918d6c649b3fb6de82f. --- CI/package-ubuntu.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/CI/package-ubuntu.sh b/CI/package-ubuntu.sh index 0f7f3c6d..5f6998d6 100755 --- a/CI/package-ubuntu.sh +++ b/CI/package-ubuntu.sh @@ -14,7 +14,6 @@ cd ./build PAGER="cat" sudo checkinstall -y --type=debian --fstrans=no --nodoc \ --backup=no --deldoc=yes --install=no \ --pkgname=obs-websocket --pkgversion="$PKG_VERSION" \ - --summary="WebSockets Remote Control API for OBS Studio" \ --pkglicense="GPLv2.0" --maintainer="stephane.lepin@gmail.com" \ --pkggroup="video" \ --pkgsource="https://github.com/Palakis/obs-websocket" \ From 47492c3fa267ed5686b46779489921bea19e127f Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 30 Apr 2020 09:46:22 -0700 Subject: [PATCH 017/178] Implement fix for Ubuntu users #478 Broke building on linux. This implements a new variable to apply the fix. --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5648a963..a6bbd38f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,8 +187,13 @@ if(UNIX AND NOT APPLE) file(GLOB locale_files data/locale/*.ini) - install(TARGETS obs-websocket - LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins") + if(${USE_UBUNTU_FIX}) + install(TARGETS obs-websocket + LIBRARY DESTINATION "/usr/lib/obs-plugins") + else() + install(TARGETS obs-websocket + LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins") + endif() install(FILES ${locale_files} DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/obs/obs-plugins/obs-websocket/locale") From ba75c45cee1d7d6fcf0a7c251fe78e618b0569be Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 30 Apr 2020 09:58:10 -0700 Subject: [PATCH 018/178] Update build docs to add Ubuntu fix flag --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index 83f93a99..0770fd59 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -24,7 +24,7 @@ sudo apt-get install libboost-all-dev git clone --recursive https://github.com/Palakis/obs-websocket.git cd obs-websocket mkdir build && cd build -cmake -DLIBOBS_INCLUDE_DIR="" -DCMAKE_INSTALL_PREFIX=/usr .. +cmake -DLIBOBS_INCLUDE_DIR="" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_UBUNTU_FIX=true .. make -j4 sudo make install ``` From 0f434004a8fe9faf66a15ba240fba5dcf08873d6 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 30 Apr 2020 10:08:56 -0700 Subject: [PATCH 019/178] Add websocketpp error message to error dialog box --- data/locale/en-US.ini | 4 ++-- src/WSServer.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index 8725e18d..607ab2f2 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -10,7 +10,7 @@ OBSWebsocket.NotifyConnect.Message="Client %1 connected" OBSWebsocket.NotifyDisconnect.Title="WebSocket client disconnected" OBSWebsocket.NotifyDisconnect.Message="Client %1 disconnected" OBSWebsocket.Server.StartFailed.Title="WebSockets Server failure" -OBSWebsocket.Server.StartFailed.Message="The WebSockets server failed to start, maybe because:\n - TCP port %1 may currently be in use elsewhere on this system, possibly by another application. Try setting a different TCP port in the WebSocket server settings, or stop any application that could be using this port.\n - An unknown network error happened on your system. Try again by changing settings, restarting OBS or restarting your system." +OBSWebsocket.Server.StartFailed.Message="The WebSockets server failed to start, maybe because:\n - TCP port %1 may currently be in use elsewhere on this system, possibly by another application. Try setting a different TCP port in the WebSocket server settings, or stop any application that could be using this port.\n - Error message: %2" OBSWebsocket.ProfileChanged.Started="WebSockets server enabled in this profile. Server started." OBSWebsocket.ProfileChanged.Stopped="WebSockets server disabled in this profile. Server stopped." -OBSWebsocket.ProfileChanged.Restarted="WebSockets server port changed in this profile. Server restarted." \ No newline at end of file +OBSWebsocket.ProfileChanged.Restarted="WebSockets server port changed in this profile. Server restarted." diff --git a/src/WSServer.cpp b/src/WSServer.cpp index c9f09362..effb935d 100644 --- a/src/WSServer.cpp +++ b/src/WSServer.cpp @@ -83,7 +83,7 @@ void WSServer::start(quint16 port) obs_frontend_push_ui_translation(obs_module_get_string); QString errorTitle = tr("OBSWebsocket.Server.StartFailed.Title"); - QString errorMessage = tr("OBSWebsocket.Server.StartFailed.Message").arg(_serverPort); + QString errorMessage = tr("OBSWebsocket.Server.StartFailed.Message").arg(_serverPort).arg(errorCodeMessage.c_str()); obs_frontend_pop_ui_translation(); QMainWindow* mainWindow = reinterpret_cast(obs_frontend_get_main_window()); From 97836cc5eb402921ccc7f110a7c9abfb10376d91 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 30 Apr 2020 10:58:10 -0700 Subject: [PATCH 020/178] Remove extra source type strings --- src/WSRequestHandler_Sources.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 8dfdef98..ae926ef6 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -15,7 +15,7 @@ bool isTextGDIPlusSource(const QString& sourceKind) bool isTextFreeType2Source(const QString& sourceKind) { - return (sourceKind == "text_ft2" || sourceKind == "text_ft2_v2" || sourceKind == "text_ft2_source" || sourceKind == "text_ft2_source_v2"); + return (sourceKind == "text_ft2_source" || sourceKind == "text_ft2_source_v2"); } /** From b2aa54f3f8ac145bea11bbadd42dc1c00d994543 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 30 Apr 2020 16:25:31 -0700 Subject: [PATCH 021/178] Add obs-websocket-http obs-websocket-http is a simple python script which allows users to run obs-websocket requests using an http-based api system. It is very simple and is a useful converter. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a0afb404..1c210f96 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ It is **highly recommended** to protect obs-websocket with a password against un ### For developers The server is a typical Websockets server running by default on port 4444 (the port number can be changed in the Settings dialog). -The protocol understood by the server is documented in [PROTOCOL.md](docs/generated/protocol.md). +The protocol understood by the server is documented in [PROTOCOL.md](docs/generated/protocol.md). Here's a list of available language APIs for obs-websocket : - Javascript (browser & nodejs): [obs-websocket-js](https://github.com/haganbmj/obs-websocket-js) by Brendan Hagan @@ -36,6 +36,7 @@ Here's a list of available language APIs for obs-websocket : - Python 3.6+ with asyncio: [simpleobsws](https://github.com/IRLToolkit/simpleobsws) by tt2468 - Java 8+: [obs-websocket-java](https://github.com/Twasi/websocket-obs-java) by TwasiNET - Golang: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf +- HTTP API: [obs-websocket-http](https://github.com/IRLToolkit/obs-websocket-http) by tt2468 I'd like to know what you're building with or for obs-websocket. If you do something in this fashion, feel free to drop me an email at `stephane /dot/ lepin /at/ gmail /dot/ com` ! From 4ded810ba97c0d721590148e0c55cd5e5de18951 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 30 Apr 2020 20:09:13 -0700 Subject: [PATCH 022/178] Add optional `fileFormat` and `fileCompressionRatio` parameters to `TakeSourceScreenshot` --- src/WSRequestHandler_Sources.cpp | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 579f76b4..29ee2882 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -1437,6 +1437,8 @@ RpcResponse WSRequestHandler::SetSourceFilterVisibility(const RpcRequest& reques * @param {String} `sourceName` Source name. Note that, since scenes are also sources, you can also provide a scene name. * @param {String (optional)} `embedPictureFormat` Format of the Data URI encoded picture. Can be "png", "jpg", "jpeg" or "bmp" (or any other value supported by Qt's Image module) * @param {String (optional)} `saveToFilePath` Full file path (file extension included) where the captured image is to be saved. Can be in a format different from `pictureFormat`. Can be a relative path. +* @param {String (optional)} `fileFormat` Format to save the image file as. If not specified, tries to guess based on file extension. +* @param {int (optional)} `fileCompressionQuality` Compression ratio between -1 and 100 to save the file with. -1 is automatic, 1 is smallest file/most compression, 100 is largest file/least compression. Varies with image type. * @param {int (optional)} `width` Screenshot width. Defaults to the source's base width. * @param {int (optional)} `height` Screenshot height. Defaults to the source's base height. * @@ -1544,7 +1546,7 @@ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) { QByteArrayList supportedFormats = QImageWriter::supportedImageFormats(); if (!supportedFormats.contains(pictureFormat)) { - QString errorMessage = QString("Unsupported picture format: %1").arg(pictureFormat); + QString errorMessage = QString("unsupported picture format: %1").arg(pictureFormat); return request.failed(errorMessage.toUtf8()); } @@ -1552,7 +1554,7 @@ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) { QBuffer buffer(&encodedImgBytes); buffer.open(QBuffer::WriteOnly); if (!sourceImage.save(&buffer, pictureFormat)) { - return request.failed("Embed image encoding failed"); + return request.failed("embed image encoding failed"); } buffer.close(); @@ -1569,7 +1571,31 @@ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) { QFileInfo filePathInfo(filePathStr); QString absoluteFilePath = filePathInfo.absoluteFilePath(); - if (!sourceImage.save(absoluteFilePath)) { + const char* fileFormat; + if (request.hasField("fileFormat")) { + fileFormat = obs_data_get_string(request.parameters(), "fileFormat"); + QByteArrayList supportedFormats = QImageWriter::supportedImageFormats(); + + if (!supportedFormats.contains(fileFormat)) { + QString errorMessage = QString("unsupported file format: %1").arg(fileFormat); + return request.failed(errorMessage.toUtf8()); + } + } + else { + fileFormat = nullptr; + } + + int fileCompressionQuality {-1}; + if (request.hasField("fileCompressionQuality")) { + fileCompressionQuality = obs_data_get_int(request.parameters(), "fileCompressionQuality"); + + if (fileCompressionQuality < -1 || fileCompressionQuality > 100) { + QString errorMessage = QString("compression quality out of range: %1").arg(fileCompressionQuality); + return request.failed(errorMessage.toUtf8()); + } + } + + if (!sourceImage.save(absoluteFilePath, fileFormat, fileCompressionQuality)) { return request.failed("Image save failed"); } obs_data_set_string(response, "imageFile", absoluteFilePath.toUtf8()); From 333ffa0e895fb16300b84b9b0c4acf7125534334 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 30 Apr 2020 20:17:11 -0700 Subject: [PATCH 023/178] `compressionQuality` should be for embed and file saving --- src/WSRequestHandler_Sources.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 29ee2882..06f33380 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -1438,7 +1438,7 @@ RpcResponse WSRequestHandler::SetSourceFilterVisibility(const RpcRequest& reques * @param {String (optional)} `embedPictureFormat` Format of the Data URI encoded picture. Can be "png", "jpg", "jpeg" or "bmp" (or any other value supported by Qt's Image module) * @param {String (optional)} `saveToFilePath` Full file path (file extension included) where the captured image is to be saved. Can be in a format different from `pictureFormat`. Can be a relative path. * @param {String (optional)} `fileFormat` Format to save the image file as. If not specified, tries to guess based on file extension. -* @param {int (optional)} `fileCompressionQuality` Compression ratio between -1 and 100 to save the file with. -1 is automatic, 1 is smallest file/most compression, 100 is largest file/least compression. Varies with image type. +* @param {int (optional)} `compressionQuality` Compression ratio between -1 and 100 to write the image with. -1 is automatic, 1 is smallest file/most compression, 100 is largest file/least compression. Varies with image type. * @param {int (optional)} `width` Screenshot width. Defaults to the source's base width. * @param {int (optional)} `height` Screenshot height. Defaults to the source's base height. * @@ -1541,6 +1541,16 @@ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) { OBSDataAutoRelease response = obs_data_create(); + int compressionQuality {-1}; + if (request.hasField("compressionQuality")) { + compressionQuality = obs_data_get_int(request.parameters(), "compressionQuality"); + + if (compressionQuality < -1 || compressionQuality > 100) { + QString errorMessage = QString("compression quality out of range: %1").arg(compressionQuality); + return request.failed(errorMessage.toUtf8()); + } + } + if (request.hasField("embedPictureFormat")) { const char* pictureFormat = obs_data_get_string(request.parameters(), "embedPictureFormat"); @@ -1553,7 +1563,7 @@ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) { QByteArray encodedImgBytes; QBuffer buffer(&encodedImgBytes); buffer.open(QBuffer::WriteOnly); - if (!sourceImage.save(&buffer, pictureFormat)) { + if (!sourceImage.save(&buffer, pictureFormat, compressionQuality)) { return request.failed("embed image encoding failed"); } buffer.close(); @@ -1585,17 +1595,7 @@ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) { fileFormat = nullptr; } - int fileCompressionQuality {-1}; - if (request.hasField("fileCompressionQuality")) { - fileCompressionQuality = obs_data_get_int(request.parameters(), "fileCompressionQuality"); - - if (fileCompressionQuality < -1 || fileCompressionQuality > 100) { - QString errorMessage = QString("compression quality out of range: %1").arg(fileCompressionQuality); - return request.failed(errorMessage.toUtf8()); - } - } - - if (!sourceImage.save(absoluteFilePath, fileFormat, fileCompressionQuality)) { + if (!sourceImage.save(absoluteFilePath, fileFormat, compressionQuality)) { return request.failed("Image save failed"); } obs_data_set_string(response, "imageFile", absoluteFilePath.toUtf8()); From 8d88bc19eda31a3c0a0826afbd3539f760fa336f Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 8 May 2020 13:15:24 -0700 Subject: [PATCH 024/178] Deprecate SetBrowserSourceProperties and GetBrowserSourceProperties Both of these requests are doing essentially the same thing as `GetSourceSettings` and `SetSourceSettings`, so there is no reason to have the extra bloat. --- src/WSRequestHandler_Sources.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 579f76b4..0d49053d 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -919,6 +919,7 @@ RpcResponse WSRequestHandler::SetTextFreetype2Properties(const RpcRequest& reque * @name GetBrowserSourceProperties * @category sources * @since 4.1.0 + * @deprecated Since 4.8.0. Prefer the use of GetSourceSettings. */ RpcResponse WSRequestHandler::GetBrowserSourceProperties(const RpcRequest& request) { @@ -960,6 +961,7 @@ RpcResponse WSRequestHandler::GetBrowserSourceProperties(const RpcRequest& reque * @api requests * @name SetBrowserSourceProperties * @category sources + * @deprecated Since 4.8.0. Prefer the use of SetSourceSettings. * @since 4.1.0 */ RpcResponse WSRequestHandler::SetBrowserSourceProperties(const RpcRequest& request) From a3bc9f768ab0e1d071b1daa5b5cba40c900986dd Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 8 May 2020 15:30:40 -0700 Subject: [PATCH 025/178] Add error system to EnableStudioMode and DisableStudioMode As talked about in #144 this adds a check to `EnableStudioMode` and `DisableStudioMode` in order to be consistent with `StartRecording`/`StopRecording` --- src/WSRequestHandler_StudioMode.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/WSRequestHandler_StudioMode.cpp b/src/WSRequestHandler_StudioMode.cpp index fb958f3b..badae29d 100644 --- a/src/WSRequestHandler_StudioMode.cpp +++ b/src/WSRequestHandler_StudioMode.cpp @@ -133,6 +133,9 @@ RpcResponse WSRequestHandler::TransitionToProgram(const RpcRequest& request) { * @since 4.1.0 */ RpcResponse WSRequestHandler::EnableStudioMode(const RpcRequest& request) { + if (obs_frontend_preview_program_mode_active()) { + return request.failed("studio mode already active"); + } obs_queue_task(OBS_TASK_UI, [](void* param) { obs_frontend_set_preview_program_mode(true); @@ -150,6 +153,9 @@ RpcResponse WSRequestHandler::EnableStudioMode(const RpcRequest& request) { * @since 4.1.0 */ RpcResponse WSRequestHandler::DisableStudioMode(const RpcRequest& request) { + if (!obs_frontend_preview_program_mode_active()) { + return request.failed("studio mode not active"); + } obs_queue_task(OBS_TASK_UI, [](void* param) { obs_frontend_set_preview_program_mode(false); From 728ea1670185972bbf21a46a447c80521f34350d Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 10 May 2020 18:39:24 -0700 Subject: [PATCH 026/178] Introduce `useDecibel` bool to `GetVolume` and `SetVolume` to give a better, built-in option for people to use decibels of attenuation instead of amplitude. --- src/WSRequestHandler_Sources.cpp | 53 +++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 579f76b4..44bf1b7c 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -156,12 +156,13 @@ RpcResponse WSRequestHandler::GetSourceTypesList(const RpcRequest& request) } /** -* Get the volume of the specified source. +* Get the volume of the specified source. Default response uses mul format, NOT SLIDER PERCENTAGE. * * @param {String} `source` Source name. +* @param {boolean (optional)} `useDecibel` Output volume in decibels of attenuation instead of amplitude/mul. * * @return {String} `name` Source name. -* @return {double} `volume` Volume of the source. Between `0.0` and `1.0`. +* @return {double} `volume` Volume of the source. Between `0.0` and `1.0` if using mul, under `0.0` if using dB (since it is attenuating). * @return {boolean} `muted` Indicates whether the source is muted. * * @api requests @@ -175,6 +176,11 @@ RpcResponse WSRequestHandler::GetVolume(const RpcRequest& request) return request.failed("missing request parameters"); } + bool useDecibel = false; + if (request.hasField("useDecibel")) { + useDecibel = obs_data_get_bool(request.parameters(), "useDecibel"); + } + QString sourceName = obs_data_get_string(request.parameters(), "source"); if (sourceName.isEmpty()) { return request.failed("invalid request parameters"); @@ -187,33 +193,45 @@ RpcResponse WSRequestHandler::GetVolume(const RpcRequest& request) OBSDataAutoRelease response = obs_data_create(); obs_data_set_string(response, "name", obs_source_get_name(source)); - obs_data_set_double(response, "volume", obs_source_get_volume(source)); + if (!useDecibel) { + obs_data_set_double(response, "volume", obs_source_get_volume(source)); + } else { + float volume = obs_source_get_volume(source); + obs_data_set_double(response, "volume", obs_mul_to_db(volume)); + } obs_data_set_bool(response, "muted", obs_source_muted(source)); return request.success(response); } /** - * Set the volume of the specified source. - * - * @param {String} `source` Source name. - * @param {double} `volume` Desired volume. Must be between `0.0` and `1.0`. - * - * @api requests - * @name SetVolume - * @category sources - * @since 4.0.0 - */ +* Set the volume of the specified source. Default request format uses mul, NOT SLIDER PERCENTAGE. +* +* @param {String} `source` Source name. +* @param {double} `volume` Desired volume. Must be between `0.0` and `1.0` for mul, and under 0.0 for dB. Note: OBS will interpret dB values under -100.0 as Inf. +* @param {boolean (optional)} `useDecibel` Interperet `volume` data as decibels instead of amplitude/mul. +* +* @api requests +* @name SetVolume +* @category sources +* @since 4.0.0 +*/ RpcResponse WSRequestHandler::SetVolume(const RpcRequest& request) { if (!request.hasField("source") || !request.hasField("volume")) { return request.failed("missing request parameters"); } + bool useDecibel = false; + if (request.hasField("useDecibel")) { + useDecibel = obs_data_get_bool(request.parameters(), "useDecibel"); + } + QString sourceName = obs_data_get_string(request.parameters(), "source"); float sourceVolume = obs_data_get_double(request.parameters(), "volume"); - if (sourceName.isEmpty() || sourceVolume < 0.0 || sourceVolume > 1.0) { + if ((useDecibel && sourceVolume > 0.0) || +(!useDecibel && (sourceVolume < 0.0 || sourceVolume > 1.0)) || (sourceName.isEmpty())) { return request.failed("invalid request parameters"); } @@ -222,7 +240,12 @@ RpcResponse WSRequestHandler::SetVolume(const RpcRequest& request) return request.failed("specified source doesn't exist"); } - obs_source_set_volume(source, sourceVolume); + if (!useDecibel) { + obs_source_set_volume(source, sourceVolume); + } else { + float mul = obs_db_to_mul(sourceVolume); + obs_source_set_volume(source, mul); + } return request.success(); } From 88c72cd80a2d3f2405bdab23ca5c757617c7f151 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 10 May 2020 20:07:57 -0700 Subject: [PATCH 027/178] Add audio monitoring request items. --- src/WSRequestHandler.cpp | 2 + src/WSRequestHandler.h | 2 + src/WSRequestHandler_Sources.cpp | 93 ++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index f2ae6c47..58cddc23 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -97,6 +97,8 @@ const QHash WSRequestHandler::messageMap { { "GetSourceTypesList", &WSRequestHandler::GetSourceTypesList }, { "GetSourceSettings", &WSRequestHandler::GetSourceSettings }, { "SetSourceSettings", &WSRequestHandler::SetSourceSettings }, + { "GetAudioMonitor", &WSRequestHandler::GetAudioMonitor }, + { "SetAudioMonitor", &WSRequestHandler::SetAudioMonitor }, { "TakeSourceScreenshot", &WSRequestHandler::TakeSourceScreenshot }, { "GetSourceFilters", &WSRequestHandler::GetSourceFilters }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index d17384ee..b55c2fb5 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -112,6 +112,8 @@ class WSRequestHandler { RpcResponse GetSourceTypesList(const RpcRequest&); RpcResponse GetSourceSettings(const RpcRequest&); RpcResponse SetSourceSettings(const RpcRequest&); + RpcResponse GetAudioMonitor(const RpcRequest&); + RpcResponse SetAudioMonitor(const RpcRequest&); RpcResponse TakeSourceScreenshot(const RpcRequest&); RpcResponse GetSourceFilters(const RpcRequest&); diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 579f76b4..12bce74c 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -1424,6 +1424,99 @@ RpcResponse WSRequestHandler::SetSourceFilterVisibility(const RpcRequest& reques return request.success(); } +/** +* Get the audio monitoring type of the specified source. +* +* @param {String} `sourceName` Source name. +* +* @return {String} `monitorType` The monitor type in use. Options: `none`, `monitor_only`, `monitor_and_output`. +* +* @api requests +* @name GetAudioMonitor +* @category sources +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::GetAudioMonitor(const RpcRequest& request) + { + if (!request.hasField("sourceName")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + OBSDataAutoRelease response = obs_data_create(); + + QString monitorType; + enum obs_monitoring_type mtype = obs_source_get_monitoring_type(source); + switch (mtype) { + case OBS_MONITORING_TYPE_NONE: + monitorType = "none"; + break; + case OBS_MONITORING_TYPE_MONITOR_ONLY: + monitorType = "monitor_only"; + break; + case OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT: + monitorType = "monitor_and_output"; + break; + default: + monitorType = "unknown"; + break; + } + obs_data_set_string(response, "monitorType", monitorType.toUtf8()); + + return request.success(response); +} + +/** +* Set the audio monitoring type of the specified source. +* +* @param {String} `sourceName` Source name. +* @param {String} `monitorType` The monitor type to use. Options: `none`, `monitor_only`, `monitor_and_output`. +* +* @api requests +* @name SetAudioMonitor +* @category sources +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::SetAudioMonitor(const RpcRequest& request) + { + if (!request.hasField("sourceName") || !request.hasField("monitorType")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + QString monitorType = obs_data_get_string(request.parameters(), "monitorType"); + + if (sourceName.isEmpty() || monitorType.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + if (monitorType == "none") { + obs_source_set_monitoring_type(source, OBS_MONITORING_TYPE_NONE); + } else if (monitorType == "monitor_only") { + obs_source_set_monitoring_type(source, OBS_MONITORING_TYPE_MONITOR_ONLY); + } else if (monitorType == "monitor_and_output") { + obs_source_set_monitoring_type(source, OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT); + } else { + return request.failed("invalid monitorType"); + } + return request.success(); +} + /** * Takes a picture snapshot of a source and then can either or both: * - Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request) From 1c6670c9b01a01277fbe627a2d6ef2f78543f636 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 10 May 2020 21:03:38 -0700 Subject: [PATCH 028/178] Create new category and add `MediaPlayPause` request --- CMakeLists.txt | 1 + src/WSRequestHandler.cpp | 5 +++- src/WSRequestHandler.h | 2 ++ src/WSRequestHandler_MediaControl.cpp | 35 +++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/WSRequestHandler_MediaControl.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 5648a963..c7e34a88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ set(obs-websocket_SOURCES src/WSRequestHandler_StudioMode.cpp src/WSRequestHandler_Transitions.cpp src/WSRequestHandler_Outputs.cpp + src/WSRequestHandler_MediaControl.cpp src/WSEvents.cpp src/Config.cpp src/Utils.cpp diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index f2ae6c47..1325a73b 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -143,7 +143,10 @@ const QHash WSRequestHandler::messageMap { { "ListOutputs", &WSRequestHandler::ListOutputs }, { "GetOutputInfo", &WSRequestHandler::GetOutputInfo }, { "StartOutput", &WSRequestHandler::StartOutput }, - { "StopOutput", &WSRequestHandler::StopOutput } + { "StopOutput", &WSRequestHandler::StopOutput }, + + { "MediaPlayPause", &WSRequestHandler::MediaPlayPause } + }; const QSet WSRequestHandler::authNotRequired { diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index d17384ee..deef55bb 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -162,4 +162,6 @@ class WSRequestHandler { RpcResponse GetOutputInfo(const RpcRequest&); RpcResponse StartOutput(const RpcRequest&); RpcResponse StopOutput(const RpcRequest&); + + RpcResponse MediaPlayPause(const RpcRequest&); }; diff --git a/src/WSRequestHandler_MediaControl.cpp b/src/WSRequestHandler_MediaControl.cpp new file mode 100644 index 00000000..e72fe197 --- /dev/null +++ b/src/WSRequestHandler_MediaControl.cpp @@ -0,0 +1,35 @@ +#include "Utils.h" + +#include "WSRequestHandler.h" + +/** +* Pause or play a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) +* +* @param {String} `sourceName` Source name. +* @param {boolean} `playPause` Whether to pause or play the source. `false` for play, `true` for pause. +* +* @api requests +* @name MediaPlayPause +* @category media control +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::MediaPlayPause(const RpcRequest& request) { + if ((!request.hasField("sourceName")) || (!request.hasField("playPause"))) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + bool playPause = obs_data_get_bool(request.parameters(), "playPause"); + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + obs_source_media_play_pause(source, playPause); + return request.success(); + +} From 37cf8e9d29d9d3c63d83e7f1c519901add72ea63 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 10 May 2020 21:13:48 -0700 Subject: [PATCH 029/178] Rename `MediaPlayPause` to `PlayPauseMedia` Works better with the other upcoming media control request names --- src/WSRequestHandler.cpp | 3 +-- src/WSRequestHandler.h | 2 +- src/WSRequestHandler_MediaControl.cpp | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 1325a73b..2049e27e 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -145,8 +145,7 @@ const QHash WSRequestHandler::messageMap { { "StartOutput", &WSRequestHandler::StartOutput }, { "StopOutput", &WSRequestHandler::StopOutput }, - { "MediaPlayPause", &WSRequestHandler::MediaPlayPause } - + { "PlayPauseMedia", &WSRequestHandler::PlayPauseMedia } }; const QSet WSRequestHandler::authNotRequired { diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index deef55bb..cf79f214 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -163,5 +163,5 @@ class WSRequestHandler { RpcResponse StartOutput(const RpcRequest&); RpcResponse StopOutput(const RpcRequest&); - RpcResponse MediaPlayPause(const RpcRequest&); + RpcResponse PlayPauseMedia(const RpcRequest&); }; diff --git a/src/WSRequestHandler_MediaControl.cpp b/src/WSRequestHandler_MediaControl.cpp index e72fe197..019e5f7e 100644 --- a/src/WSRequestHandler_MediaControl.cpp +++ b/src/WSRequestHandler_MediaControl.cpp @@ -9,11 +9,11 @@ * @param {boolean} `playPause` Whether to pause or play the source. `false` for play, `true` for pause. * * @api requests -* @name MediaPlayPause +* @name PlayPauseMedia * @category media control * @since 4.8.0 */ -RpcResponse WSRequestHandler::MediaPlayPause(const RpcRequest& request) { +RpcResponse WSRequestHandler::PlayPauseMedia(const RpcRequest& request) { if ((!request.hasField("sourceName")) || (!request.hasField("playPause"))) { return request.failed("missing request parameters"); } @@ -31,5 +31,5 @@ RpcResponse WSRequestHandler::MediaPlayPause(const RpcRequest& request) { obs_source_media_play_pause(source, playPause); return request.success(); - } + From acfdb2613522cede1a03c9cc9becd440d2b5d132 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 10 May 2020 23:21:24 -0700 Subject: [PATCH 030/178] A lot more requests. --- src/WSRequestHandler.cpp | 11 +- src/WSRequestHandler.h | 9 + src/WSRequestHandler_MediaControl.cpp | 312 ++++++++++++++++++++++++++ 3 files changed, 331 insertions(+), 1 deletion(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 2049e27e..6f637d19 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -145,7 +145,16 @@ const QHash WSRequestHandler::messageMap { { "StartOutput", &WSRequestHandler::StartOutput }, { "StopOutput", &WSRequestHandler::StopOutput }, - { "PlayPauseMedia", &WSRequestHandler::PlayPauseMedia } + { "PlayPauseMedia", &WSRequestHandler::PlayPauseMedia }, + { "RestartMedia", &WSRequestHandler::RestartMedia }, + { "StopMedia", &WSRequestHandler::StopMedia }, + { "NextMedia", &WSRequestHandler::NextMedia }, + { "PreviousMedia", &WSRequestHandler::PreviousMedia }, + { "GetMediaDuration", &WSRequestHandler::GetMediaDuration }, + { "GetMediaTime", &WSRequestHandler::GetMediaTime }, + { "SetMediaTime", &WSRequestHandler::SetMediaTime }, + { "ScrubMedia", &WSRequestHandler::ScrubMedia }, + { "GetMediaState", &WSRequestHandler::GetMediaState } }; const QSet WSRequestHandler::authNotRequired { diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index cf79f214..6b82eb0d 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -164,4 +164,13 @@ class WSRequestHandler { RpcResponse StopOutput(const RpcRequest&); RpcResponse PlayPauseMedia(const RpcRequest&); + RpcResponse RestartMedia(const RpcRequest&); + RpcResponse StopMedia(const RpcRequest&); + RpcResponse NextMedia(const RpcRequest&); + RpcResponse PreviousMedia(const RpcRequest&); + RpcResponse GetMediaDuration(const RpcRequest&); + RpcResponse GetMediaTime(const RpcRequest&); + RpcResponse SetMediaTime(const RpcRequest&); + RpcResponse ScrubMedia(const RpcRequest&); + RpcResponse GetMediaState(const RpcRequest&); }; diff --git a/src/WSRequestHandler_MediaControl.cpp b/src/WSRequestHandler_MediaControl.cpp index 019e5f7e..0298e533 100644 --- a/src/WSRequestHandler_MediaControl.cpp +++ b/src/WSRequestHandler_MediaControl.cpp @@ -33,3 +33,315 @@ RpcResponse WSRequestHandler::PlayPauseMedia(const RpcRequest& request) { return request.success(); } +/** +* Restart a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) +* +* @param {String} `sourceName` Source name. +* +* @api requests +* @name RestartMedia +* @category media control +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::RestartMedia(const RpcRequest& request) { + if (!request.hasField("sourceName")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + obs_source_media_restart(source); + return request.success(); +} + +/** +* Stop a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) +* +* @param {String} `sourceName` Source name. +* +* @api requests +* @name StopMedia +* @category media control +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::StopMedia(const RpcRequest& request) { + if (!request.hasField("sourceName")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + obs_source_media_stop(source); + return request.success(); +} + +/** +* Skip to the next media item in the playlist. Supports only vlc media source (as of OBS v25.0.8) +* +* @param {String} `sourceName` Source name. +* +* @api requests +* @name NextMedia +* @category media control +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::NextMedia(const RpcRequest& request) { + if (!request.hasField("sourceName")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + obs_source_media_next(source); + return request.success(); +} + +/** +* Go to the previous media item in the playlist. Supports only vlc media source (as of OBS v25.0.8) +* +* @param {String} `sourceName` Source name. +* +* @api requests +* @name PreviousMedia +* @category media control +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::PreviousMedia(const RpcRequest& request) { + if (!request.hasField("sourceName")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + obs_source_media_previous(source); + return request.success(); +} + +/** +* Get the length of media in milliseconds. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) +* Note: For some reason, for the first 5 or so seconds that the media is playing, the total duration can be off by upwards of 50ms. +* +* @param {String} `sourceName` Source name. +* +* @return {int} `mediaDuration` The total length of media in milliseconds.. +* +* @api requests +* @name GetMediaDuration +* @category media control +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::GetMediaDuration(const RpcRequest& request) { + if (!request.hasField("sourceName")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + OBSDataAutoRelease response = obs_data_create(); + obs_data_set_int(response, "timeStamp", obs_source_media_get_duration(source)); + return request.success(response); +} + +/** +* Get the current timestamp of media in milliseconds. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) +* +* @param {String} `sourceName` Source name. +* +* @return {int} `timeStamp` The time in milliseconds since the start of the media. +* +* @api requests +* @name GetMediaTime +* @category media control +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::GetMediaTime(const RpcRequest& request) { + if (!request.hasField("sourceName")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + OBSDataAutoRelease response = obs_data_create(); + obs_data_set_int(response, "timeStamp", obs_source_media_get_time(source)); + return request.success(response); +} + +/** +* Set the timestamp of a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) +* +* @param {String} `sourceName` Source name. +* @param {int} `timeStamp` Milliseconds to set the timestamp to. +* +* @api requests +* @name SetMediaTime +* @category media control +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::SetMediaTime(const RpcRequest& request) { + if (!request.hasField("sourceName") || !request.hasField("timeStamp")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + int64_t timeStamp = (int64_t)obs_data_get_int(request.parameters(), "timeStamp"); + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + obs_source_media_set_time(source, timeStamp); + return request.success(); +} + +/** +* Scrub media using a supplied offset. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) +* Note: Due to processing/network delays, this request is not perfect. The processing rate of this request has also not been tested. +* +* @param {String} `sourceName` Source name. +* @param {int} `timeOffset` Millisecond offset (positive or negative) to offset the current media position. +* +* @api requests +* @name ScrubMedia +* @category media control +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::ScrubMedia(const RpcRequest& request) { + if (!request.hasField("sourceName") || !request.hasField("timeOffset")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + int64_t timeOffset = (int64_t)obs_data_get_int(request.parameters(), "timeOffset"); + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + int64_t newTime = obs_source_media_get_time(source) + timeOffset; + if (newTime < 0) { + newTime = 0; + } + + obs_source_media_set_time(source, newTime); + return request.success(); +} + +/** +* Get the current playing state of a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) +* +* @param {String} `sourceName` Source name. +* +* @return {String} `mediaState` The media state of the provided source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error` +* +* @api requests +* @name GetMediaState +* @category media control +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::GetMediaState(const RpcRequest& request) { + if (!request.hasField("sourceName")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + QString mediaState; + enum obs_media_state mstate = obs_source_media_get_state(source); + switch (mstate) { + case OBS_MEDIA_STATE_NONE: + mediaState = "none"; + break; + case OBS_MEDIA_STATE_PLAYING: + mediaState = "playing"; + break; + case OBS_MEDIA_STATE_OPENING: + mediaState = "opening"; + break; + case OBS_MEDIA_STATE_BUFFERING: + mediaState = "buffering"; + break; + case OBS_MEDIA_STATE_PAUSED: + mediaState = "paused"; + break; + case OBS_MEDIA_STATE_STOPPED: + mediaState = "stopped"; + break; + case OBS_MEDIA_STATE_ENDED: + mediaState = "ended"; + break; + case OBS_MEDIA_STATE_ERROR: + mediaState = "error"; + break; + default: + mediaState = "unknown"; + } + + OBSDataAutoRelease response = obs_data_create(); + obs_data_set_string(response, "mediaState", mediaState.toUtf8()); + + return request.success(response); +} From f9c81f99f2f5987d88b63334771817eb30d9deb8 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Tue, 12 May 2020 02:24:27 -0700 Subject: [PATCH 031/178] Install into both dirs on Ubuntu instead of only one --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6bbd38f..56130453 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,10 +190,9 @@ if(UNIX AND NOT APPLE) if(${USE_UBUNTU_FIX}) install(TARGETS obs-websocket LIBRARY DESTINATION "/usr/lib/obs-plugins") - else() - install(TARGETS obs-websocket - LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins") endif() + install(TARGETS obs-websocket + LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins") install(FILES ${locale_files} DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/obs/obs-plugins/obs-websocket/locale") From ff21f5b3571c49483cb421f6bd69f3abf2258d2b Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Tue, 12 May 2020 09:37:41 +0000 Subject: [PATCH 032/178] docs(ci): Update protocol.md - 98db248 [skip ci] --- docs/generated/comments.json | 14 ++++++++++++++ docs/generated/protocol.md | 2 ++ 2 files changed, 16 insertions(+) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 0731d3d7..28f82e48 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -6870,6 +6870,7 @@ "name": "GetBrowserSourceProperties", "category": "sources", "since": "4.1.0", + "deprecated": "Since 4.8.0. Prefer the use of GetSourceSettings.", "returns": [ { "type": "String", @@ -6942,6 +6943,12 @@ "description": "4.1.0" } ], + "deprecateds": [ + { + "name": "", + "description": "Since 4.8.0. Prefer the use of GetSourceSettings." + } + ], "heading": { "level": 2, "text": "GetBrowserSourceProperties" @@ -6968,6 +6975,7 @@ "api": "requests", "name": "SetBrowserSourceProperties", "category": "sources", + "deprecated": "Since 4.8.0. Prefer the use of SetSourceSettings.", "since": "4.1.0", "params": [ { @@ -7033,6 +7041,12 @@ "description": "sources" } ], + "deprecateds": [ + { + "name": "", + "description": "Since 4.8.0. Prefer the use of SetSourceSettings." + } + ], "sinces": [ { "name": "", diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 5325ee13..e5f47ec1 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -2643,6 +2643,7 @@ _No additional response items._ ### GetBrowserSourceProperties +- **⚠️ Deprecated. Since 4.8.0. Prefer the use of GetSourceSettings. ⚠️** - Added in v4.1.0 @@ -2674,6 +2675,7 @@ Get current properties for a Browser Source. ### SetBrowserSourceProperties +- **⚠️ Deprecated. Since 4.8.0. Prefer the use of SetSourceSettings. ⚠️** - Added in v4.1.0 From 4eb7bed2ff139932a50ae44c3f38930bdbe036dd Mon Sep 17 00:00:00 2001 From: tt2468 Date: Tue, 12 May 2020 15:44:57 -0700 Subject: [PATCH 033/178] Lots of changes - Move `SetTBarPosition` to transitions category - Add another check to `SetTBarPosition` so that we dont break the fabric of time with the wrong values - Create `GetTransitionPosition` request in transitions category --- src/WSRequestHandler.cpp | 3 +- src/WSRequestHandler.h | 8 ++--- src/WSRequestHandler_StudioMode.cpp | 29 +--------------- src/WSRequestHandler_Transitions.cpp | 50 ++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 33 deletions(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index a5914744..018b2638 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -84,6 +84,8 @@ const QHash WSRequestHandler::messageMap { { "SetCurrentTransition", &WSRequestHandler::SetCurrentTransition }, { "SetTransitionDuration", &WSRequestHandler::SetTransitionDuration }, { "GetTransitionDuration", &WSRequestHandler::GetTransitionDuration }, + { "SetTBarPosition", &WSRequestHandler::SetTBarPosition }, + { "GetTransitionPosition", &WSRequestHandler::GetTransitionPosition }, { "SetVolume", &WSRequestHandler::SetVolume }, { "GetVolume", &WSRequestHandler::GetVolume }, @@ -130,7 +132,6 @@ const QHash WSRequestHandler::messageMap { { "EnableStudioMode", &WSRequestHandler::EnableStudioMode }, { "DisableStudioMode", &WSRequestHandler::DisableStudioMode }, { "ToggleStudioMode", &WSRequestHandler::ToggleStudioMode }, - { "SetTBarPosition", &WSRequestHandler::SetTBarPosition }, { "SetTextGDIPlusProperties", &WSRequestHandler::SetTextGDIPlusProperties }, { "GetTextGDIPlusProperties", &WSRequestHandler::GetTextGDIPlusProperties }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index a644bca4..5dc30894 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -99,6 +99,10 @@ class WSRequestHandler { RpcResponse GetTransitionList(const RpcRequest&); RpcResponse GetCurrentTransition(const RpcRequest&); RpcResponse SetCurrentTransition(const RpcRequest&); + RpcResponse SetTransitionDuration(const RpcRequest&); + RpcResponse GetTransitionDuration(const RpcRequest&); + RpcResponse SetTBarPosition(const RpcRequest&); + RpcResponse GetTransitionPosition(const RpcRequest&); RpcResponse SetVolume(const RpcRequest&); RpcResponse GetVolume(const RpcRequest&); @@ -138,9 +142,6 @@ class WSRequestHandler { RpcResponse SendCaptions(const RpcRequest&); #endif - RpcResponse SetTransitionDuration(const RpcRequest&); - RpcResponse GetTransitionDuration(const RpcRequest&); - RpcResponse GetStudioModeStatus(const RpcRequest&); RpcResponse GetPreviewScene(const RpcRequest&); RpcResponse SetPreviewScene(const RpcRequest&); @@ -148,7 +149,6 @@ class WSRequestHandler { RpcResponse EnableStudioMode(const RpcRequest&); RpcResponse DisableStudioMode(const RpcRequest&); RpcResponse ToggleStudioMode(const RpcRequest&); - RpcResponse SetTBarPosition(const RpcRequest&); RpcResponse SetTextGDIPlusProperties(const RpcRequest&); RpcResponse GetTextGDIPlusProperties(const RpcRequest&); diff --git a/src/WSRequestHandler_StudioMode.cpp b/src/WSRequestHandler_StudioMode.cpp index cd103c83..042db61b 100644 --- a/src/WSRequestHandler_StudioMode.cpp +++ b/src/WSRequestHandler_StudioMode.cpp @@ -176,31 +176,4 @@ RpcResponse WSRequestHandler::ToggleStudioMode(const RpcRequest& request) { }, nullptr, true); return request.success(); -} - -/** - * Set the position of the T-Bar (in Studio Mode) to the specified value. Will return an error if OBS is not in studio mode - * or if the current transition doesn't support T-Bar control. - * - * @param {double} `position` T-Bar position. This value will be clamped between 0.0 and 1.0. - * - * @api requests - * @name SetTBarPosition - * @category studio mode - * @since 4.8.0 - */ -RpcResponse WSRequestHandler::SetTBarPosition(const RpcRequest& request) { - if (!obs_frontend_preview_program_mode_active()) { - return request.failed("studio mode not enabled"); - } - - OBSSourceAutoRelease currentTransition = obs_frontend_get_current_transition(); - if (obs_transition_fixed(currentTransition)) { - return request.failed("current transition doesn't support t-bar control"); - } - - double position = obs_data_get_double(request.parameters(), "position"); - obs_transition_set_manual_time(currentTransition, position); - - return request.success(); -} +} \ No newline at end of file diff --git a/src/WSRequestHandler_Transitions.cpp b/src/WSRequestHandler_Transitions.cpp index 7c22687c..a2ba2125 100644 --- a/src/WSRequestHandler_Transitions.cpp +++ b/src/WSRequestHandler_Transitions.cpp @@ -120,3 +120,53 @@ RpcResponse WSRequestHandler::GetTransitionDuration(const RpcRequest& request) { obs_data_set_int(response, "transition-duration", obs_frontend_get_transition_duration()); return request.success(response); } + +/** + * Set the manual position of the T-Bar (in Studio Mode) to the specified value. Will return an error if OBS is not in studio mode + * or if the current transition doesn't support T-Bar control. + * + * @param {double} `position` T-Bar position. This value must be between 0.0 and 1.0. + * + * @api requests + * @name SetTBarPosition + * @category transitions + * @since 4.8.0 + */ +RpcResponse WSRequestHandler::SetTBarPosition(const RpcRequest& request) { + if (!obs_frontend_preview_program_mode_active()) { + return request.failed("studio mode not enabled"); + } + + OBSSourceAutoRelease currentTransition = obs_frontend_get_current_transition(); + if (obs_transition_fixed(currentTransition)) { + return request.failed("current transition doesn't support t-bar control"); + } + + double position = obs_data_get_double(request.parameters(), "position"); + if (position < 0.0 || position > 1.0) { + return request.failed("position is out of range"); + } + + obs_transition_set_manual_time(currentTransition, position); + + return request.success(); +} + +/** + * Get the position of the current transition. + * + * @return {double} `position` current transition position. This value will be between 0.0 and 1.0. Note: Transition returns 1.0 when not active. + * + * @api requests + * @name GetTransitionPosition + * @category transitions + * @since 4.8.0 + */ +RpcResponse WSRequestHandler::GetTransitionPosition(const RpcRequest& request) { + OBSSourceAutoRelease currentTransition = obs_frontend_get_current_transition(); + + OBSDataAutoRelease response = obs_data_create(); + obs_data_set_double(response, "position", obs_transition_get_time(currentTransition)); + + return request.success(response); +} \ No newline at end of file From 71392613b2ad56248aa54e4a3733f2b682165fd6 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Tue, 12 May 2020 17:46:49 -0700 Subject: [PATCH 034/178] [Docs] Bump version to 4.8 --- docs/partials/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/partials/introduction.md b/docs/partials/introduction.md index c8de4503..c63a52cd 100644 --- a/docs/partials/introduction.md +++ b/docs/partials/introduction.md @@ -1,4 +1,4 @@ -# obs-websocket 4.7.0 protocol reference +# obs-websocket 4.8.0 protocol reference # General Introduction Messages are exchanged between the client and the server as JSON objects. From 10ed2738f53e4cff6de8f3e810460d6910143dfc Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 13 May 2020 00:10:57 -0700 Subject: [PATCH 035/178] Add `ReleaseTBar` request and update `SetTBarPosition` to depend on OBS pr 2927 --- src/WSRequestHandler.cpp | 1 + src/WSRequestHandler.h | 1 + src/WSRequestHandler_Transitions.cpp | 41 +++++++++++++++++++++++++--- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 018b2638..660ed2c4 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -84,6 +84,7 @@ const QHash WSRequestHandler::messageMap { { "SetCurrentTransition", &WSRequestHandler::SetCurrentTransition }, { "SetTransitionDuration", &WSRequestHandler::SetTransitionDuration }, { "GetTransitionDuration", &WSRequestHandler::GetTransitionDuration }, + { "ReleaseTBar", &WSRequestHandler::ReleaseTBar }, { "SetTBarPosition", &WSRequestHandler::SetTBarPosition }, { "GetTransitionPosition", &WSRequestHandler::GetTransitionPosition }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index 5dc30894..a6c7804c 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -101,6 +101,7 @@ class WSRequestHandler { RpcResponse SetCurrentTransition(const RpcRequest&); RpcResponse SetTransitionDuration(const RpcRequest&); RpcResponse GetTransitionDuration(const RpcRequest&); + RpcResponse ReleaseTBar(const RpcRequest&); RpcResponse SetTBarPosition(const RpcRequest&); RpcResponse GetTransitionPosition(const RpcRequest&); diff --git a/src/WSRequestHandler_Transitions.cpp b/src/WSRequestHandler_Transitions.cpp index a2ba2125..443b3fcd 100644 --- a/src/WSRequestHandler_Transitions.cpp +++ b/src/WSRequestHandler_Transitions.cpp @@ -121,6 +121,28 @@ RpcResponse WSRequestHandler::GetTransitionDuration(const RpcRequest& request) { return request.success(response); } +/** + * Release the T-Bar. YOU MUST CALL THIS IF YOU SPECIFY `release = false` IN `SetTBarPosition`. + * + * @api requests + * @name ReleaseTBar + * @category transitions + * @since 4.8.0 + */ +RpcResponse WSRequestHandler::ReleaseTBar(const RpcRequest& request) { + if (!obs_frontend_preview_program_mode_active()) { + return request.failed("studio mode not enabled"); + } + + if (obs_transition_fixed(obs_frontend_get_current_transition())) { + return request.failed("current transition doesn't support t-bar control"); + } + + obs_frontend_release_tbar(); + + return request.success(); +} + /** * Set the manual position of the T-Bar (in Studio Mode) to the specified value. Will return an error if OBS is not in studio mode * or if the current transition doesn't support T-Bar control. @@ -137,17 +159,28 @@ RpcResponse WSRequestHandler::SetTBarPosition(const RpcRequest& request) { return request.failed("studio mode not enabled"); } - OBSSourceAutoRelease currentTransition = obs_frontend_get_current_transition(); - if (obs_transition_fixed(currentTransition)) { + if (obs_transition_fixed(obs_frontend_get_current_transition())) { return request.failed("current transition doesn't support t-bar control"); } + if (!request.hasField("position")) { + return request.failed("missing request parameters"); + } + double position = obs_data_get_double(request.parameters(), "position"); if (position < 0.0 || position > 1.0) { return request.failed("position is out of range"); } - - obs_transition_set_manual_time(currentTransition, position); + + bool release = true; + if (request.hasField("release")) { + release = obs_data_get_bool(request.parameters(), "release"); + } + + obs_frontend_set_tbar_position((int)((float)position * 1024.0)); + if (release) { + obs_frontend_release_tbar(); + } return request.success(); } From 7ca902e39a7beecb161016d57c4d72cba98719cf Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 13 May 2020 20:48:54 -0700 Subject: [PATCH 036/178] A few formatting fixes --- src/WSRequestHandler_Transitions.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/WSRequestHandler_Transitions.cpp b/src/WSRequestHandler_Transitions.cpp index 443b3fcd..5aaadfb7 100644 --- a/src/WSRequestHandler_Transitions.cpp +++ b/src/WSRequestHandler_Transitions.cpp @@ -81,7 +81,7 @@ RpcResponse WSRequestHandler::SetCurrentTransition(const RpcRequest& request) { if (!success) { return request.failed("requested transition does not exist"); } - + return request.success(); } @@ -171,12 +171,12 @@ RpcResponse WSRequestHandler::SetTBarPosition(const RpcRequest& request) { if (position < 0.0 || position > 1.0) { return request.failed("position is out of range"); } - + bool release = true; if (request.hasField("release")) { release = obs_data_get_bool(request.parameters(), "release"); } - + obs_frontend_set_tbar_position((int)((float)position * 1024.0)); if (release) { obs_frontend_release_tbar(); @@ -197,9 +197,9 @@ RpcResponse WSRequestHandler::SetTBarPosition(const RpcRequest& request) { */ RpcResponse WSRequestHandler::GetTransitionPosition(const RpcRequest& request) { OBSSourceAutoRelease currentTransition = obs_frontend_get_current_transition(); - + OBSDataAutoRelease response = obs_data_create(); obs_data_set_double(response, "position", obs_transition_get_time(currentTransition)); return request.success(response); -} \ No newline at end of file +} From 2810787156f6902af1d2a268fd83ffaccff78412 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Thu, 14 May 2020 08:04:35 +0000 Subject: [PATCH 037/178] docs(ci): Update protocol.md - 6b53cb5 [skip ci] --- docs/generated/protocol.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index e5f47ec1..92db4587 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -1,6 +1,6 @@ -# obs-websocket 4.7.0 protocol reference +# obs-websocket 4.8.0 protocol reference # General Introduction Messages are exchanged between the client and the server as JSON objects. From 56371a7d80211241372e1dfad47f2edf9bf24091 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 13 May 2020 23:33:59 -0700 Subject: [PATCH 038/178] Add `GetTransitionPosition` Gets the current position of the active transition. Works on manual and also auto transition modes --- src/WSRequestHandler.cpp | 1 + src/WSRequestHandler.h | 6 +++--- src/WSRequestHandler_Transitions.cpp | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index f2ae6c47..de6aea06 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -84,6 +84,7 @@ const QHash WSRequestHandler::messageMap { { "SetCurrentTransition", &WSRequestHandler::SetCurrentTransition }, { "SetTransitionDuration", &WSRequestHandler::SetTransitionDuration }, { "GetTransitionDuration", &WSRequestHandler::GetTransitionDuration }, + { "GetTransitionPosition", &WSRequestHandler::GetTransitionPosition }, { "SetVolume", &WSRequestHandler::SetVolume }, { "GetVolume", &WSRequestHandler::GetVolume }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index d17384ee..bf89998d 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -99,6 +99,9 @@ class WSRequestHandler { RpcResponse GetTransitionList(const RpcRequest&); RpcResponse GetCurrentTransition(const RpcRequest&); RpcResponse SetCurrentTransition(const RpcRequest&); + RpcResponse SetTransitionDuration(const RpcRequest&); + RpcResponse GetTransitionDuration(const RpcRequest&); + RpcResponse GetTransitionPosition(const RpcRequest&); RpcResponse SetVolume(const RpcRequest&); RpcResponse GetVolume(const RpcRequest&); @@ -138,9 +141,6 @@ class WSRequestHandler { RpcResponse SendCaptions(const RpcRequest&); #endif - RpcResponse SetTransitionDuration(const RpcRequest&); - RpcResponse GetTransitionDuration(const RpcRequest&); - RpcResponse GetStudioModeStatus(const RpcRequest&); RpcResponse GetPreviewScene(const RpcRequest&); RpcResponse SetPreviewScene(const RpcRequest&); diff --git a/src/WSRequestHandler_Transitions.cpp b/src/WSRequestHandler_Transitions.cpp index 7c22687c..9bcee450 100644 --- a/src/WSRequestHandler_Transitions.cpp +++ b/src/WSRequestHandler_Transitions.cpp @@ -120,3 +120,22 @@ RpcResponse WSRequestHandler::GetTransitionDuration(const RpcRequest& request) { obs_data_set_int(response, "transition-duration", obs_frontend_get_transition_duration()); return request.success(response); } + +/** + * Get the position of the current transition. + * + * @return {double} `position` current transition position. This value will be between 0.0 and 1.0. Note: Transition returns 1.0 when not active. + * + * @api requests + * @name GetTransitionPosition + * @category transitions + * @since 4.8.0 + */ +RpcResponse WSRequestHandler::GetTransitionPosition(const RpcRequest& request) { + OBSSourceAutoRelease currentTransition = obs_frontend_get_current_transition(); + + OBSDataAutoRelease response = obs_data_create(); + obs_data_set_double(response, "position", obs_transition_get_time(currentTransition)); + + return request.success(response); +} From 121d9f492056eea33a2e340e53537914fc7c47dd Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 13 May 2020 23:32:14 -0700 Subject: [PATCH 039/178] Remove `GetTransitionPosition` Moving it to its own PR since this PR will not make it into 4.8 --- src/WSRequestHandler.cpp | 1 - src/WSRequestHandler.h | 1 - src/WSRequestHandler_Transitions.cpp | 19 ------------------- 3 files changed, 21 deletions(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 660ed2c4..514cf455 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -86,7 +86,6 @@ const QHash WSRequestHandler::messageMap { { "GetTransitionDuration", &WSRequestHandler::GetTransitionDuration }, { "ReleaseTBar", &WSRequestHandler::ReleaseTBar }, { "SetTBarPosition", &WSRequestHandler::SetTBarPosition }, - { "GetTransitionPosition", &WSRequestHandler::GetTransitionPosition }, { "SetVolume", &WSRequestHandler::SetVolume }, { "GetVolume", &WSRequestHandler::GetVolume }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index a6c7804c..c01ed313 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -103,7 +103,6 @@ class WSRequestHandler { RpcResponse GetTransitionDuration(const RpcRequest&); RpcResponse ReleaseTBar(const RpcRequest&); RpcResponse SetTBarPosition(const RpcRequest&); - RpcResponse GetTransitionPosition(const RpcRequest&); RpcResponse SetVolume(const RpcRequest&); RpcResponse GetVolume(const RpcRequest&); diff --git a/src/WSRequestHandler_Transitions.cpp b/src/WSRequestHandler_Transitions.cpp index 5aaadfb7..56505738 100644 --- a/src/WSRequestHandler_Transitions.cpp +++ b/src/WSRequestHandler_Transitions.cpp @@ -184,22 +184,3 @@ RpcResponse WSRequestHandler::SetTBarPosition(const RpcRequest& request) { return request.success(); } - -/** - * Get the position of the current transition. - * - * @return {double} `position` current transition position. This value will be between 0.0 and 1.0. Note: Transition returns 1.0 when not active. - * - * @api requests - * @name GetTransitionPosition - * @category transitions - * @since 4.8.0 - */ -RpcResponse WSRequestHandler::GetTransitionPosition(const RpcRequest& request) { - OBSSourceAutoRelease currentTransition = obs_frontend_get_current_transition(); - - OBSDataAutoRelease response = obs_data_create(); - obs_data_set_double(response, "position", obs_transition_get_time(currentTransition)); - - return request.success(response); -} From 497443f012a968f469355a3c507ca9695da5c2bb Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 14 May 2020 01:47:55 -0700 Subject: [PATCH 040/178] Update CI scripts to use ubuntu fix --- CI/build-ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/build-ubuntu.sh b/CI/build-ubuntu.sh index b19158ae..498840ef 100755 --- a/CI/build-ubuntu.sh +++ b/CI/build-ubuntu.sh @@ -2,5 +2,5 @@ set -ex mkdir build && cd build -cmake -DCMAKE_INSTALL_PREFIX=/usr .. +cmake -DCMAKE_INSTALL_PREFIX=/usr -DUSE_UBUNTU_FIX=true .. make -j4 From bed6a1b1e28519e0cc7ccb2225f361f9b0a1fe4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 14 May 2020 11:02:51 +0200 Subject: [PATCH 041/178] ci(windows): simplified OBS Preparation script + shorter build times --- CI/checkout-cmake-obs-windows.cmd | 137 ------------------------------ CI/prepare-obs-windows.cmd | 37 ++++++++ azure-pipelines.yml | 2 +- 3 files changed, 38 insertions(+), 138 deletions(-) delete mode 100644 CI/checkout-cmake-obs-windows.cmd create mode 100644 CI/prepare-obs-windows.cmd diff --git a/CI/checkout-cmake-obs-windows.cmd b/CI/checkout-cmake-obs-windows.cmd deleted file mode 100644 index 0fc6c12c..00000000 --- a/CI/checkout-cmake-obs-windows.cmd +++ /dev/null @@ -1,137 +0,0 @@ -@echo off -SETLOCAL EnableDelayedExpansion - -REM Check if obs-studio build exists. -REM If the obs-studio directory does exist, check if the last OBS tag built -REM matches the latest OBS tag. -REM If the tags match, do not build obs-studio. -REM If the tags do not match, build obs-studio. -REM If the obs-studio directory doesn't exist, build obs-studio. -echo Checking for obs-studio build... - -set OBSLatestTagPrePull=0 -set OBSLatestTagPostPull=0 -echo Latest tag pre-pull: %OBSLatestTagPrePull% -echo Latest tag post-pull: %OBSLatestTagPostPull% - -REM Set up the build flag as undefined. -set "BuildOBS=" - -REM Check the last tag successfully built by CI. -if exist "%OBSPath%\obs-studio-last-tag-built.txt" ( - set /p OBSLastTagBuilt=<"%OBSPath%\obs-studio-last-tag-built.txt" -) else ( - set OBSLastTagBuilt=0 -) - -REM If obs-studio directory exists, run git pull and get the latest tag number. -if exist %OBSPath% ( - echo obs-studio directory exists - echo Updating tag info - cd /D %OBSPath% - git describe --tags --abbrev=0 --exclude="*-rc*" > "%OBSPath%\latest-obs-studio-tag-pre-pull.txt" - set /p OBSLatestTagPrePull=<"%OBSPath%\latest-obs-studio-tag-pre-pull.txt" - git checkout master - git pull - git describe --tags --abbrev=0 --exclude="*-rc*" > "%OBSPath%\latest-obs-studio-tag-post-pull.txt" - set /p OBSLatestTagPostPull=<"%OBSPath%\latest-obs-studio-tag-post-pull.txt" - set /p OBSLatestTag=<"%OBSPath%\latest-obs-studio-tag-post-pull.txt" - echo %OBSLatestTagPostPull%> "%OBSPath%\latest-obs-studio-tag.txt" -) - -REM Check the obs-studio tags for mismatches. -REM If a new tag was pulled, set the build flag. -if not %OBSLatestTagPrePull%==%OBSLatestTagPostPull% ( - echo Latest tag pre-pull: %OBSLatestTagPrePull% - echo Latest tag post-pull: %OBSLatestTagPostPull% - echo Tags do not match. Need to rebuild OBS. - set BuildOBS=true -) - -REM If the latest git tag doesn't match the last built tag, set the build flag. -if not %OBSLatestTagPostPull%==%OBSLastTagBuilt% ( - echo Last built OBS tag: %OBSLastTagBuilt% - echo Latest tag post-pull: %OBSLatestTagPostPull% - echo Tags do not match. Need to rebuild OBS. - set BuildOBS=true -) - -REM If obs-studio directory does not exist, clone the git repo, get the latest -REM tag number, and set the build flag. -if not exist %OBSPath% ( - echo obs-studio directory does not exist - git clone https://github.com/obsproject/obs-studio %OBSPath% - cd /D %OBSPath%\ - git describe --tags --abbrev=0 --exclude="*-rc*" > "%OBSPath%\obs-studio-latest-tag.txt" - set /p OBSLatestTag=<"%OBSPath%\obs-studio-latest-tag.txt" - set BuildOBS=true -) - -REM If the needed obs-studio libs for this build_config do not exist, -REM set the build flag. -if not exist %OBSPath%\build32\libobs\%build_config%\obs.lib ( - echo obs-studio\build32\libobs\%build_config%\obs.lib does not exist - set BuildOBS=true -) -if not exist %OBSPath%\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib ( - echo obs-studio\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib does not exist - set BuildOBS=true -) - -REM Some debug info -echo: -echo Latest tag pre-pull: %OBSLatestTagPrePull% -echo Latest tag post-pull: %OBSLatestTagPostPull% -echo Latest tag: %OBSLatestTag% -echo Last built OBS tag: %OBSLastTagBuilt% - -if defined BuildOBS ( - echo BuildOBS: true -) else ( - echo BuildOBS: false -) -echo: - -REM If the build flag is set, build obs-studio. -if defined BuildOBS ( - echo Building obs-studio... - cd /D %OBSPath% - echo git checkout %OBSLatestTag% - git checkout %OBSLatestTag% - echo: - - echo Removing previous build dirs... - if exist build32 rmdir /s /q "%OBSPath%\build32" - if exist build64 rmdir /s /q "%OBSPath%\build64" - - echo Making new build dirs... - mkdir build32 - mkdir build64 - - echo Running cmake for obs-studio %OBSLatestTag% 32-bit... - cd build32 - cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -DDepsPath="%DepsPath32%" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. - echo: - echo: - - echo Running cmake for obs-studio %OBSLatestTag% 64-bit... - cd ..\build64 - cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -DDepsPath="%DepsPath64%" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. - echo: - echo: - - REM echo Building obs-studio %OBSLatestTag% 32-bit ^(Build Config: %build_config%^)... - REM call msbuild /m /p:Configuration=%build_config% %OBSPath%\build32\obs-studio.sln - - REM echo Building obs-studio %OBSLatestTag% 64-bit ^(Build Config: %build_config%^)... - REM call msbuild /m /p:Configuration=%build_config% %OBSPath%\build64\obs-studio.sln - - cd .. - git describe --tags --abbrev=0 > "%OBSPath%\obs-studio-last-tag-built.txt" - set /p OBSLastTagBuilt=<"%OBSPath%\obs-studio-last-tag-built.txt" -) else ( - echo Last OBS tag built is: %OBSLastTagBuilt% - echo No need to rebuild OBS. -) - -dir "%OBSPath%\libobs" diff --git a/CI/prepare-obs-windows.cmd b/CI/prepare-obs-windows.cmd new file mode 100644 index 00000000..961fbe17 --- /dev/null +++ b/CI/prepare-obs-windows.cmd @@ -0,0 +1,37 @@ + +@echo off +SETLOCAL EnableDelayedExpansion + +REM If obs-studio directory does not exist, clone the git repo +if not exist %OBSPath% ( + echo obs-studio directory does not exist + git clone https://github.com/obsproject/obs-studio %OBSPath% + cd /D %OBSPath%\ + git describe --tags --abbrev=0 --exclude="*-rc*" > "%OBSPath%\obs-studio-latest-tag.txt" + set /p OBSLatestTag=<"%OBSPath%\obs-studio-latest-tag.txt" +) + +REM Prepare OBS Studio builds + +echo Running CMake... +cd /D %OBSPath% +echo git checkout %OBSLatestTag% +git checkout %OBSLatestTag% +echo: + +if not exist build32 mkdir build32 +if not exist build64 mkdir build64 + +echo Running cmake for obs-studio %OBSLatestTag% 32-bit... +cd build32 +cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -DDepsPath="%DepsPath32%" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. +echo: +echo: + +echo Running cmake for obs-studio %OBSLatestTag% 64-bit... +cd ..\build64 +cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -DDepsPath="%DepsPath64%" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. +echo: +echo: + +dir "%OBSPath%\libobs" \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0f3f10b9..7fce0542 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -68,7 +68,7 @@ jobs: obs | "$(Agent.OS)" path: $(OBSPath) - - script: ./CI/checkout-cmake-obs-windows.cmd + - script: ./CI/prepare-obs-windows.cmd displayName: 'Checkout & CMake OBS Studio' env: build_config: $(build_config) From 353a9aa671c32f4a5dab8eb41e75b07a57f05f87 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 14 May 2020 02:13:50 -0700 Subject: [PATCH 042/178] Update docs - initial pr draft commit --- BUILDING.md | 12 ++++++++---- CONTRIBUTING.md | 38 ++++++++++++++++++++++++++++++++++++++ README.md | 42 ++++-------------------------------------- 3 files changed, 50 insertions(+), 42 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/BUILDING.md b/BUILDING.md index 83f93a99..67c0c01c 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -29,12 +29,18 @@ make -j4 sudo make install ``` +On other linux OS's, use this cmake command instead: + +```shell +cmake -DLIBOBS_INCLUDE_DIR="" -DCMAKE_INSTALL_PREFIX=/usr .. +``` + ## OS X As a prerequisite, you will need Xcode for your current OSX version, the Xcode command line tools, and [Homebrew](https://brew.sh/). Homebrew's setup will guide you in getting your system set up, you should be good to go once Homebrew is successfully up and running. -Use of the Travis macOS CI scripts is recommended. Please note that these +Use of the macOS CI scripts is recommended. Please note that these scripts install new software and can change several settings on your system. An existing obs-studio development environment is not required, as `install-build-obs-macos.sh` will install it for you. If you already have a @@ -57,6 +63,4 @@ This will result in a ready-to-use `obs-websocket.pkg` installer in the `release ## Automated Builds -- Windows: [![Automated Build status for Windows](https://ci.appveyor.com/api/projects/status/github/Palakis/obs-websocket)](https://ci.appveyor.com/project/Palakis/obs-websocket/history) -- Linux: [![Automated Build status for Linux](https://travis-ci.org/Palakis/obs-websocket.svg?branch=master)](https://travis-ci.org/Palakis/obs-websocket) -- macOS: [![Automated Build status for macOS](https://img.shields.io/azure-devops/build/Palakis/obs-websocket/Palakis.obs-websocket.svg)](https://dev.azure.com/Palakis/obs-websocket/_build) +[![Build Status](https://dev.azure.com/Palakis/obs-websocket/_apis/build/status/Palakis.obs-websocket?branchName=4.x-current)](https://dev.azure.com/Palakis/obs-websocket/_build/latest?definitionId=2&branchName=4.x-current) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..792211b8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Contributing + +### Branches + +Development happens on `4.x-current` + +### Pull Requests + +Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). Start your work in a new branch +based on the upstream main one (e.g.: `cool-new-feature`, `fix-palakis-mistakes`, ...) and open a Pull Request once you feel ready to show your work. + +**If your Pull Request is not ready to merge yet, create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). + +### Code style & formatting + +Source code is indented with tabs, with spaces allowed for alignment. + +Regarding protocol changes: new and updated request types / events must always come with accompanying documentation comments (see existing protocol elements for examples). +These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). + +Among other recommendations: favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: + +```cpp +if (success) { + return req->SendOKResponse(); +} else { + return req->SendErrorResponse("something went wrong"); +} +``` + +is better like this: + +```cpp +if (!success) { + return req->SendErrorResponse("something went wrong"); +} +return req->SendOKResponse(); +``` diff --git a/README.md b/README.md index 1c210f96..0eab8873 100644 --- a/README.md +++ b/README.md @@ -46,47 +46,13 @@ See the [build instructions](BUILDING.md). ## Contributing -### Branches - -Development happens on `4.x-current` - -### Pull Requests - -Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). Start your work in a new branch -based on the main one (e.g.: `cool-new-feature`, `fix-palakis-mistakes`, ...) and open a Pull Request once you feel ready to show your work. - -**If your Pull Request is not ready to merge yet, create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). - -### Code style & formatting - -Source code is indented with tabs, with spaces allowed for alignment. - -Regarding protocol changes: new and updated request types / events must always come with accompanying documentation comments (see existing protocol elements for examples). -These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). - -Among other recommendations: favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: - -```cpp -if (success) { - return req->SendOKResponse(); -} else { - return req->SendErrorResponse("something went wrong"); -} -``` - -is better like this: - -```cpp -if (!success) { - return req->SendErrorResponse("something went wrong"); -} -return req->SendOKResponse(); -``` - +See [the contributing document](/CONTRIBUTING.md) ## Translations -**Your help is welcome on translations**. Please join the localization project on Crowdin: https://crowdin.com/project/obs-websocket +**Your help is welcome on translations.** + +Please join the localization project on Crowdin: https://crowdin.com/project/obs-websocket ## Special thanks From 27f82434b69b2d4b8b4e2d46f778ff168388770d Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 14 May 2020 03:01:28 -0700 Subject: [PATCH 043/178] Docs: More work on various things --- .github/CONTRIBUTING.md | 22 -------------- .github/FUNDING.yml | 3 ++ CONTRIBUTING.md | 63 ++++++++++++++++++++++++++++++----------- 3 files changed, 50 insertions(+), 38 deletions(-) delete mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/FUNDING.yml diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index ea45e450..00000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,22 +0,0 @@ -## Contributing to obs-websocket - -### Translating obs-websocket to your language -Localization happens on Crowdin: https://crowdin.com/project/obs-websocket - -### Writing code for obs-websocket -#### Coding Guidelines -- Function and variable names: snake_case for C names, CamelCase for C++ names -- Tabs are 8 columns wide -- 80 columns max. - -#### Commit Guidelines -- Commits follow the 50/72 standard: - - 50 characters max for the title - - One empty line after the title - - Description wrapped to 72 columns max per line. -- Commit titles: - - Use present tense - - Prefix the title with a "scope" name - - e.g: "CI: fix wrong behaviour when packaging for OS X" - - Typical scopes: CI, General, Request, Event, Server - - Look at existing commits for more examples diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..69945f88 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +open_collective: obs-websocket +github: Palakis +custom: https://www.paypal.me/stephanelepin diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 792211b8..0dfd2fa5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,25 +1,28 @@ -# Contributing +# Contributing to obs-websocket + +### Translating obs-websocket to your language + +Localization happens on Crowdin: https://crowdin.com/project/obs-websocket ### Branches -Development happens on `4.x-current` +**Development happens on `4.x-current`** -### Pull Requests +### Writing code for obs-websocket -Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). Start your work in a new branch -based on the upstream main one (e.g.: `cool-new-feature`, `fix-palakis-mistakes`, ...) and open a Pull Request once you feel ready to show your work. +#### Code Formatting Guidelines -**If your Pull Request is not ready to merge yet, create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). +- Function and variable names: snake_case for C names, MixedCaps for C++ names +- Request and Event names should use MixedCaps names +- Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) +- Tabs are 8 columns wide +- 80 columns max code width. (Docs can be larger) +- New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples). + These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). -### Code style & formatting - -Source code is indented with tabs, with spaces allowed for alignment. - -Regarding protocol changes: new and updated request types / events must always come with accompanying documentation comments (see existing protocol elements for examples). -These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). - -Among other recommendations: favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: +#### Code Best-Practices +- Favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: ```cpp if (success) { return req->SendOKResponse(); @@ -27,12 +30,40 @@ if (success) { return req->SendErrorResponse("something went wrong"); } ``` - is better like this: - ```cpp if (!success) { return req->SendErrorResponse("something went wrong"); } return req->SendOKResponse(); ``` + +#### Commit Guidelines + +- Commits follow the 50/72 standard: + - 50 characters max for the commit title (excluding scope name) + - One empty line after the title + - Description wrapped to 72 columns max width per line. +- Commit titles: + - Use present tense + - Prefix the title with a "scope" name + - e.g: "CI: fix wrong behaviour when packaging for OS X" + - Typical scopes: CI, General, Requests, Events, Server + +**Example commit:** + +``` +Requests: Add GetTransitionPosition + +Adds a new request called `GetTransitionPosition` which gets the current +transition's state from 0.0f to 1.0f. Works with both auto and manual +transitions. +``` + +#### Pull Requests + +- Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). + - Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) +- Only open a pull request if you are ready to show off your work. +- If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers), + create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). From 100565081cd60a5387ad8f066dc370d515ed428f Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 14 May 2020 03:11:17 -0700 Subject: [PATCH 044/178] Docs: More changes --- CONTRIBUTING.md | 60 ++++++++++++++++++++++++++++--------------------- README.md | 2 +- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0dfd2fa5..a319e63d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,26 +1,31 @@ # Contributing to obs-websocket -### Translating obs-websocket to your language +## Translating obs-websocket to your language -Localization happens on Crowdin: https://crowdin.com/project/obs-websocket +Localization happens on [Crowdin](https://crowdin.com/project/obs-websocket) -### Branches +## Branches **Development happens on `4.x-current`** -### Writing code for obs-websocket +## Writing code for obs-websocket -#### Code Formatting Guidelines +### Code Formatting Guidelines -- Function and variable names: snake_case for C names, MixedCaps for C++ names -- Request and Event names should use MixedCaps names -- Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) -- Tabs are 8 columns wide -- 80 columns max code width. (Docs can be larger) -- New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples). + - Function and variable names: snake_case for C names, MixedCaps for C++ names + + - Request and Event names should use MixedCaps names + + - Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) + + - Tabs are 8 columns wide + + - 80 columns max code width. (Docs can be larger) + + - New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples). These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). -#### Code Best-Practices +### Code Best-Practices - Favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: ```cpp @@ -38,17 +43,18 @@ if (!success) { return req->SendOKResponse(); ``` -#### Commit Guidelines +### Commit Guidelines -- Commits follow the 50/72 standard: - - 50 characters max for the commit title (excluding scope name) - - One empty line after the title - - Description wrapped to 72 columns max width per line. -- Commit titles: - - Use present tense - - Prefix the title with a "scope" name - - e.g: "CI: fix wrong behaviour when packaging for OS X" - - Typical scopes: CI, General, Requests, Events, Server + - Commits follow the 50/72 standard: + - 50 characters max for the commit title (excluding scope name) + - One empty line after the title + - Description wrapped to 72 columns max width per line. + + - Commit titles: + - Use present tense + - Prefix the title with a "scope" name + - e.g: "CI: fix wrong behaviour when packaging for OS X" + - Typical scopes: CI, General, Requests, Events, Server **Example commit:** @@ -60,10 +66,12 @@ transition's state from 0.0f to 1.0f. Works with both auto and manual transitions. ``` -#### Pull Requests +### Pull Requests -- Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). + - Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). - Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) -- Only open a pull request if you are ready to show off your work. -- If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers), + + - Only open a pull request if you are ready to show off your work. + + - If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers), create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). diff --git a/README.md b/README.md index 0eab8873..8fc8c1a7 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ See [the contributing document](/CONTRIBUTING.md) **Your help is welcome on translations.** -Please join the localization project on Crowdin: https://crowdin.com/project/obs-websocket +Please join the localization project on [Crowdin](https://crowdin.com/project/obs-websocket) ## Special thanks From 7a7a8b7ed123f52fb7467cba64b27be9bc4c5e28 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 14 May 2020 03:19:14 -0700 Subject: [PATCH 045/178] Docs: Even more changes --- CONTRIBUTING.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a319e63d..2b2fff1d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,22 +12,22 @@ Localization happens on [Crowdin](https://crowdin.com/project/obs-websocket) ### Code Formatting Guidelines - - Function and variable names: snake_case for C names, MixedCaps for C++ names +- Function and variable names: snake_case for C names, MixedCaps for C++ names - - Request and Event names should use MixedCaps names +- Request and Event names should use MixedCaps names - - Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) +- Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) - - Tabs are 8 columns wide +- Tabs are 8 columns wide - - 80 columns max code width. (Docs can be larger) +- 80 columns max code width. (Docs can be larger) - - New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples). +- New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples). These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). ### Code Best-Practices -- Favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: +- Favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: ```cpp if (success) { return req->SendOKResponse(); @@ -45,16 +45,16 @@ return req->SendOKResponse(); ### Commit Guidelines - - Commits follow the 50/72 standard: - - 50 characters max for the commit title (excluding scope name) - - One empty line after the title - - Description wrapped to 72 columns max width per line. +- Commits follow the 50/72 standard: + - 50 characters max for the commit title (excluding scope name) + - One empty line after the title + - Description wrapped to 72 columns max width per line. - - Commit titles: - - Use present tense - - Prefix the title with a "scope" name - - e.g: "CI: fix wrong behaviour when packaging for OS X" - - Typical scopes: CI, General, Requests, Events, Server +- Commit titles: + - Use present tense + - Prefix the title with a "scope" name + - e.g: "CI: fix wrong behaviour when packaging for OS X" + - Typical scopes: CI, General, Requests, Events, Server **Example commit:** @@ -68,10 +68,10 @@ transitions. ### Pull Requests - - Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). - - Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) +- Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). + - Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) - - Only open a pull request if you are ready to show off your work. +- Only open a pull request if you are ready to show off your work. - - If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers), +- If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers), create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). From 60d9b72fea1e0c81e102a28ed89262614605a1c2 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 14 May 2020 03:25:34 -0700 Subject: [PATCH 046/178] Docs: Maybe it will complain less now --- CONTRIBUTING.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2b2fff1d..9871f1dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,22 +12,22 @@ Localization happens on [Crowdin](https://crowdin.com/project/obs-websocket) ### Code Formatting Guidelines -- Function and variable names: snake_case for C names, MixedCaps for C++ names +- Function and variable names: snake_case for C names, MixedCaps for C++ names -- Request and Event names should use MixedCaps names +- Request and Event names should use MixedCaps names -- Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) +- Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) -- Tabs are 8 columns wide +- Tabs are 8 columns wide -- 80 columns max code width. (Docs can be larger) +- 80 columns max code width. (Docs can be larger) -- New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples). - These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). +- New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples). + These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). ### Code Best-Practices -- Favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: +- Favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: ```cpp if (success) { return req->SendOKResponse(); @@ -45,16 +45,16 @@ return req->SendOKResponse(); ### Commit Guidelines -- Commits follow the 50/72 standard: - - 50 characters max for the commit title (excluding scope name) - - One empty line after the title - - Description wrapped to 72 columns max width per line. +- Commits follow the 50/72 standard: + - 50 characters max for the commit title (excluding scope name) + - One empty line after the title + - Description wrapped to 72 columns max width per line. -- Commit titles: - - Use present tense - - Prefix the title with a "scope" name - - e.g: "CI: fix wrong behaviour when packaging for OS X" - - Typical scopes: CI, General, Requests, Events, Server +- Commit titles: + - Use present tense + - Prefix the title with a "scope" name + - e.g: "CI: fix wrong behaviour when packaging for OS X" + - Typical scopes: CI, General, Requests, Events, Server **Example commit:** @@ -68,10 +68,10 @@ transitions. ### Pull Requests -- Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). - - Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) +- Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). + - Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) -- Only open a pull request if you are ready to show off your work. +- Only open a pull request if you are ready to show off your work. -- If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers), - create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). +- If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers), + create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). From 1da7f47af95e1df776e50ca1d8a8f4aea74c2750 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 14 May 2020 03:43:18 -0700 Subject: [PATCH 047/178] Docs: Add pr template --- .github/pull_request_template.md | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..36c332c5 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,35 @@ + + + + +### Description + + +### Motivation and Context + + + + +### How Has This Been Tested? + +Tested OS(s): + +### Types of changes + + + + + + + + + +### Checklist: + + +- [ ] I have read the [**contributing** document](https://github.com/Palakis/obs-websocket/blob/4.x-current/CONTRIBUTING.md). +- [ ] My code is not on the master branch. +- [ ] The code has been tested. +- [ ] All commit messages are properly formatted and commits squashed where appropriate. +- [ ] I have included updates to all appropriate documentation. + From baba8790bc0e54842779afd9a35fc672c0847837 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 14 May 2020 04:28:57 -0700 Subject: [PATCH 048/178] testing --- CONTRIBUTING.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9871f1dc..60654035 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,22 +12,22 @@ Localization happens on [Crowdin](https://crowdin.com/project/obs-websocket) ### Code Formatting Guidelines -- Function and variable names: snake_case for C names, MixedCaps for C++ names +- Function and variable names: snake_case for C names, MixedCaps for C++ names -- Request and Event names should use MixedCaps names +- Request and Event names should use MixedCaps names -- Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) +- Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) -- Tabs are 8 columns wide +- Tabs are 8 columns wide -- 80 columns max code width. (Docs can be larger) +- 80 columns max code width. (Docs can be larger) -- New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples). - These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). +- New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples). + These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). ### Code Best-Practices -- Favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: +- Favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: ```cpp if (success) { return req->SendOKResponse(); @@ -45,16 +45,16 @@ return req->SendOKResponse(); ### Commit Guidelines -- Commits follow the 50/72 standard: - - 50 characters max for the commit title (excluding scope name) - - One empty line after the title - - Description wrapped to 72 columns max width per line. +- Commits follow the 50/72 standard: + - 50 characters max for the commit title (excluding scope name) + - One empty line after the title + - Description wrapped to 72 columns max width per line. -- Commit titles: - - Use present tense - - Prefix the title with a "scope" name - - e.g: "CI: fix wrong behaviour when packaging for OS X" - - Typical scopes: CI, General, Requests, Events, Server +- Commit titles: + - Use present tense + - Prefix the title with a "scope" name + - e.g: "CI: fix wrong behaviour when packaging for OS X" + - Typical scopes: CI, General, Requests, Events, Server **Example commit:** @@ -68,10 +68,10 @@ transitions. ### Pull Requests -- Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). - - Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) +- Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). + - Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) -- Only open a pull request if you are ready to show off your work. +- Only open a pull request if you are ready to show off your work. -- If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers), - create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). +- If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers), + create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). From a1ea84b28669f679a2e914151bea09129ea67384 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 14 May 2020 04:46:12 -0700 Subject: [PATCH 049/178] Docs: Its finally complaining less --- .github/pull_request_template.md | 10 +++++----- CONTRIBUTING.md | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 36c332c5..d6fe377d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -27,9 +27,9 @@ Tested OS(s): ### Checklist: -- [ ] I have read the [**contributing** document](https://github.com/Palakis/obs-websocket/blob/4.x-current/CONTRIBUTING.md). -- [ ] My code is not on the master branch. -- [ ] The code has been tested. -- [ ] All commit messages are properly formatted and commits squashed where appropriate. -- [ ] I have included updates to all appropriate documentation. +- [ ] I have read the [**contributing** document](https://github.com/Palakis/obs-websocket/blob/4.x-current/CONTRIBUTING.md). +- [ ] My code is not on the master branch. +- [ ] The code has been tested. +- [ ] All commit messages are properly formatted and commits squashed where appropriate. +- [ ] I have included updates to all appropriate documentation. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 60654035..1931c0c6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,15 +46,15 @@ return req->SendOKResponse(); ### Commit Guidelines - Commits follow the 50/72 standard: - - 50 characters max for the commit title (excluding scope name) - - One empty line after the title - - Description wrapped to 72 columns max width per line. + - 50 characters max for the commit title (excluding scope name) + - One empty line after the title + - Description wrapped to 72 columns max width per line. - Commit titles: - - Use present tense - - Prefix the title with a "scope" name - - e.g: "CI: fix wrong behaviour when packaging for OS X" - - Typical scopes: CI, General, Requests, Events, Server + - Use present tense + - Prefix the title with a "scope" name + - e.g: "CI: fix wrong behaviour when packaging for OS X" + - Typical scopes: CI, General, Requests, Events, Server **Example commit:** @@ -69,7 +69,7 @@ transitions. ### Pull Requests - Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). - - Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) + - Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) - Only open a pull request if you are ready to show off your work. From 5534f9a2486d7370dda42212815855600435f3bd Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Thu, 14 May 2020 20:15:44 +0000 Subject: [PATCH 050/178] docs(ci): Update protocol.md - eb20654 [skip ci] --- docs/generated/comments.json | 41 ++++++++++++++++++++++++++++++++++++ docs/generated/protocol.md | 21 ++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 28f82e48..dc7f68c2 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -8678,6 +8678,47 @@ "lead": "", "type": "class", "examples": [] + }, + { + "subheads": [], + "description": "Get the position of the current transition.", + "return": "{double} `position` current transition position. This value will be between 0.0 and 1.0. Note: Transition returns 1.0 when not active.", + "api": "requests", + "name": "GetTransitionPosition", + "category": "transitions", + "since": "4.8.0", + "returns": [ + { + "type": "double", + "name": "position", + "description": "current transition position. This value will be between 0.0 and 1.0. Note: Transition returns 1.0 when not active." + } + ], + "names": [ + { + "name": "", + "description": "GetTransitionPosition" + } + ], + "categories": [ + { + "name": "", + "description": "transitions" + } + ], + "sinces": [ + { + "name": "", + "description": "4.8.0" + } + ], + "heading": { + "level": 2, + "text": "GetTransitionPosition" + }, + "lead": "", + "type": "class", + "examples": [] } ] } diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 92db4587..2f553495 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -215,6 +215,7 @@ auth_response = base64_encode(auth_response_hash) + [SetCurrentTransition](#setcurrenttransition) + [SetTransitionDuration](#settransitionduration) + [GetTransitionDuration](#gettransitionduration) + + [GetTransitionPosition](#gettransitionposition) @@ -3372,3 +3373,23 @@ _No specified parameters._ --- +### GetTransitionPosition + + +- Added in v4.8.0 + +Get the position of the current transition. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `position` | _double_ | current transition position. This value will be between 0.0 and 1.0. Note: Transition returns 1.0 when not active. | + + +--- + From ba4e5959b10d274eb3498afdd7981fb310331d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 14 May 2020 22:24:58 +0200 Subject: [PATCH 051/178] requests(Get/SetVolume): code nitpicks --- src/WSRequestHandler_Sources.cpp | 34 ++++++++++++-------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 44bf1b7c..3ca1a82b 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -176,11 +176,6 @@ RpcResponse WSRequestHandler::GetVolume(const RpcRequest& request) return request.failed("missing request parameters"); } - bool useDecibel = false; - if (request.hasField("useDecibel")) { - useDecibel = obs_data_get_bool(request.parameters(), "useDecibel"); - } - QString sourceName = obs_data_get_string(request.parameters(), "source"); if (sourceName.isEmpty()) { return request.failed("invalid request parameters"); @@ -191,16 +186,17 @@ RpcResponse WSRequestHandler::GetVolume(const RpcRequest& request) return request.failed("specified source doesn't exist"); } + float volume = obs_source_get_volume(source); + + bool useDecibel = obs_data_get_bool(request.parameters(), "useDecibel"); + if (useDecibel) { + volume = obs_mul_to_db(volume); + } + OBSDataAutoRelease response = obs_data_create(); obs_data_set_string(response, "name", obs_source_get_name(source)); - if (!useDecibel) { - obs_data_set_double(response, "volume", obs_source_get_volume(source)); - } else { - float volume = obs_source_get_volume(source); - obs_data_set_double(response, "volume", obs_mul_to_db(volume)); - } + obs_data_set_double(response, "volume", volume); obs_data_set_bool(response, "muted", obs_source_muted(source)); - return request.success(response); } @@ -222,10 +218,7 @@ RpcResponse WSRequestHandler::SetVolume(const RpcRequest& request) return request.failed("missing request parameters"); } - bool useDecibel = false; - if (request.hasField("useDecibel")) { - useDecibel = obs_data_get_bool(request.parameters(), "useDecibel"); - } + bool useDecibel = obs_data_get_bool(request.parameters(), "useDecibel"); QString sourceName = obs_data_get_string(request.parameters(), "source"); float sourceVolume = obs_data_get_double(request.parameters(), "volume"); @@ -240,12 +233,11 @@ RpcResponse WSRequestHandler::SetVolume(const RpcRequest& request) return request.failed("specified source doesn't exist"); } - if (!useDecibel) { - obs_source_set_volume(source, sourceVolume); - } else { - float mul = obs_db_to_mul(sourceVolume); - obs_source_set_volume(source, mul); + if (useDecibel) { + sourceVolume = obs_db_to_mul(sourceVolume); } + obs_source_set_volume(source, sourceVolume); + return request.success(); } From 1c85894472f88cbb4c9c409d6379f13d4ddbb6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 14 May 2020 22:31:10 +0200 Subject: [PATCH 052/178] request(SetVolume): simplified params check --- src/WSRequestHandler_Sources.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 3ca1a82b..7f4df0d1 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -223,8 +223,9 @@ RpcResponse WSRequestHandler::SetVolume(const RpcRequest& request) QString sourceName = obs_data_get_string(request.parameters(), "source"); float sourceVolume = obs_data_get_double(request.parameters(), "volume"); - if ((useDecibel && sourceVolume > 0.0) || -(!useDecibel && (sourceVolume < 0.0 || sourceVolume > 1.0)) || (sourceName.isEmpty())) { + bool isNotValidDecibel = (useDecibel && sourceVolume > 0.0); + bool isNotValidMul = (!useDecibel && (sourceVolume < 0.0 || sourceVolume > 1.0)); + if (sourceName.isEmpty() || isNotValidDecibel || isNotValidMul) { return request.failed("invalid request parameters"); } From 344f5bda697869513bf133279c09a0887777072a Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Thu, 14 May 2020 20:48:16 +0000 Subject: [PATCH 053/178] docs(ci): Update protocol.md - 33b080b [skip ci] --- docs/generated/comments.json | 28 +++++++++++++++++++++------- docs/generated/protocol.md | 10 ++++++---- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index dc7f68c2..6bc300a7 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -5642,11 +5642,14 @@ }, { "subheads": [], - "description": "Get the volume of the specified source.", - "param": "{String} `source` Source name.", + "description": "Get the volume of the specified source. Default response uses mul format, NOT SLIDER PERCENTAGE.", + "param": [ + "{String} `source` Source name.", + "{boolean (optional)} `useDecibel` Output volume in decibels of attenuation instead of amplitude/mul." + ], "return": [ "{String} `name` Source name.", - "{double} `volume` Volume of the source. Between `0.0` and `1.0`.", + "{double} `volume` Volume of the source. Between `0.0` and `1.0` if using mul, under `0.0` if using dB (since it is attenuating).", "{boolean} `muted` Indicates whether the source is muted." ], "api": "requests", @@ -5662,7 +5665,7 @@ { "type": "double", "name": "volume", - "description": "Volume of the source. Between `0.0` and `1.0`." + "description": "Volume of the source. Between `0.0` and `1.0` if using mul, under `0.0` if using dB (since it is attenuating)." }, { "type": "boolean", @@ -5675,6 +5678,11 @@ "type": "String", "name": "source", "description": "Source name." + }, + { + "type": "boolean (optional)", + "name": "useDecibel", + "description": "Output volume in decibels of attenuation instead of amplitude/mul." } ], "names": [ @@ -5705,10 +5713,11 @@ }, { "subheads": [], - "description": "Set the volume of the specified source.", + "description": "Set the volume of the specified source. Default request format uses mul, NOT SLIDER PERCENTAGE.", "param": [ "{String} `source` Source name.", - "{double} `volume` Desired volume. Must be between `0.0` and `1.0`." + "{double} `volume` Desired volume. Must be between `0.0` and `1.0` for mul, and under 0.0 for dB. Note: OBS will interpret dB values under -100.0 as Inf.", + "{boolean (optional)} `useDecibel` Interperet `volume` data as decibels instead of amplitude/mul." ], "api": "requests", "name": "SetVolume", @@ -5723,7 +5732,12 @@ { "type": "double", "name": "volume", - "description": "Desired volume. Must be between `0.0` and `1.0`." + "description": "Desired volume. Must be between `0.0` and `1.0` for mul, and under 0.0 for dB. Note: OBS will interpret dB values under -100.0 as Inf." + }, + { + "type": "boolean (optional)", + "name": "useDecibel", + "description": "Interperet `volume` data as decibels instead of amplitude/mul." } ], "names": [ diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 2f553495..08b8efe5 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -2267,13 +2267,14 @@ _No specified parameters._ - Added in v4.0.0 -Get the volume of the specified source. +Get the volume of the specified source. Default response uses mul format, NOT SLIDER PERCENTAGE. **Request Fields:** | Name | Type | Description | | ---- | :---: | ------------| | `source` | _String_ | Source name. | +| `useDecibel` | _boolean (optional)_ | Output volume in decibels of attenuation instead of amplitude/mul. | **Response Items:** @@ -2281,7 +2282,7 @@ Get the volume of the specified source. | Name | Type | Description | | ---- | :---: | ------------| | `name` | _String_ | Source name. | -| `volume` | _double_ | Volume of the source. Between `0.0` and `1.0`. | +| `volume` | _double_ | Volume of the source. Between `0.0` and `1.0` if using mul, under `0.0` if using dB (since it is attenuating). | | `muted` | _boolean_ | Indicates whether the source is muted. | @@ -2292,14 +2293,15 @@ Get the volume of the specified source. - Added in v4.0.0 -Set the volume of the specified source. +Set the volume of the specified source. Default request format uses mul, NOT SLIDER PERCENTAGE. **Request Fields:** | Name | Type | Description | | ---- | :---: | ------------| | `source` | _String_ | Source name. | -| `volume` | _double_ | Desired volume. Must be between `0.0` and `1.0`. | +| `volume` | _double_ | Desired volume. Must be between `0.0` and `1.0` for mul, and under 0.0 for dB. Note: OBS will interpret dB values under -100.0 as Inf. | +| `useDecibel` | _boolean (optional)_ | Interperet `volume` data as decibels instead of amplitude/mul. | **Response Items:** From 0eaa9187ead361d78079d874a181401b3f1400f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 15 May 2020 02:35:53 +0200 Subject: [PATCH 054/178] requests(TakeSourceScreenshot): improved docs --- src/WSRequestHandler_Sources.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 06f33380..5e90e158 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -1437,7 +1437,7 @@ RpcResponse WSRequestHandler::SetSourceFilterVisibility(const RpcRequest& reques * @param {String} `sourceName` Source name. Note that, since scenes are also sources, you can also provide a scene name. * @param {String (optional)} `embedPictureFormat` Format of the Data URI encoded picture. Can be "png", "jpg", "jpeg" or "bmp" (or any other value supported by Qt's Image module) * @param {String (optional)} `saveToFilePath` Full file path (file extension included) where the captured image is to be saved. Can be in a format different from `pictureFormat`. Can be a relative path. -* @param {String (optional)} `fileFormat` Format to save the image file as. If not specified, tries to guess based on file extension. +* @param {String (optional)} `fileFormat` Format to save the image file as (one of the values provided in the `supported-image-export-formats` response field of `GetVersion`). If not specified, tries to guess based on file extension. * @param {int (optional)} `compressionQuality` Compression ratio between -1 and 100 to write the image with. -1 is automatic, 1 is smallest file/most compression, 100 is largest file/least compression. Varies with image type. * @param {int (optional)} `width` Screenshot width. Defaults to the source's base width. * @param {int (optional)} `height` Screenshot height. Defaults to the source's base height. @@ -1581,7 +1581,7 @@ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) { QFileInfo filePathInfo(filePathStr); QString absoluteFilePath = filePathInfo.absoluteFilePath(); - const char* fileFormat; + const char* fileFormat = nullptr; if (request.hasField("fileFormat")) { fileFormat = obs_data_get_string(request.parameters(), "fileFormat"); QByteArrayList supportedFormats = QImageWriter::supportedImageFormats(); @@ -1591,9 +1591,6 @@ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) { return request.failed(errorMessage.toUtf8()); } } - else { - fileFormat = nullptr; - } if (!sourceImage.save(absoluteFilePath, fileFormat, compressionQuality)) { return request.failed("Image save failed"); From 133d3fdda7bdd974c3774a917728cbaf337b9330 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Fri, 15 May 2020 00:48:51 +0000 Subject: [PATCH 055/178] docs(ci): Update protocol.md - 53e98db [skip ci] --- docs/generated/comments.json | 12 ++++++++++++ docs/generated/protocol.md | 2 ++ 2 files changed, 14 insertions(+) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 6bc300a7..d2929e46 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -7631,6 +7631,8 @@ "{String} `sourceName` Source name. Note that, since scenes are also sources, you can also provide a scene name.", "{String (optional)} `embedPictureFormat` Format of the Data URI encoded picture. Can be \"png\", \"jpg\", \"jpeg\" or \"bmp\" (or any other value supported by Qt's Image module)", "{String (optional)} `saveToFilePath` Full file path (file extension included) where the captured image is to be saved. Can be in a format different from `pictureFormat`. Can be a relative path.", + "{String (optional)} `fileFormat` Format to save the image file as (one of the values provided in the `supported-image-export-formats` response field of `GetVersion`). If not specified, tries to guess based on file extension.", + "{int (optional)} `compressionQuality` Compression ratio between -1 and 100 to write the image with. -1 is automatic, 1 is smallest file/most compression, 100 is largest file/least compression. Varies with image type.", "{int (optional)} `width` Screenshot width. Defaults to the source's base width.", "{int (optional)} `height` Screenshot height. Defaults to the source's base height." ], @@ -7676,6 +7678,16 @@ "name": "saveToFilePath", "description": "Full file path (file extension included) where the captured image is to be saved. Can be in a format different from `pictureFormat`. Can be a relative path." }, + { + "type": "String (optional)", + "name": "fileFormat", + "description": "Format to save the image file as (one of the values provided in the `supported-image-export-formats` response field of `GetVersion`). If not specified, tries to guess based on file extension." + }, + { + "type": "int (optional)", + "name": "compressionQuality", + "description": "Compression ratio between -1 and 100 to write the image with. -1 is automatic, 1 is smallest file/most compression, 100 is largest file/least compression. Varies with image type." + }, { "type": "int (optional)", "name": "width", diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 08b8efe5..13b7c50b 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -2935,6 +2935,8 @@ preserved if only one of these two parameters is specified. | `sourceName` | _String_ | Source name. Note that, since scenes are also sources, you can also provide a scene name. | | `embedPictureFormat` | _String (optional)_ | Format of the Data URI encoded picture. Can be "png", "jpg", "jpeg" or "bmp" (or any other value supported by Qt's Image module) | | `saveToFilePath` | _String (optional)_ | Full file path (file extension included) where the captured image is to be saved. Can be in a format different from `pictureFormat`. Can be a relative path. | +| `fileFormat` | _String (optional)_ | Format to save the image file as (one of the values provided in the `supported-image-export-formats` response field of `GetVersion`). If not specified, tries to guess based on file extension. | +| `compressionQuality` | _int (optional)_ | Compression ratio between -1 and 100 to write the image with. -1 is automatic, 1 is smallest file/most compression, 100 is largest file/least compression. Varies with image type. | | `width` | _int (optional)_ | Screenshot width. Defaults to the source's base width. | | `height` | _int (optional)_ | Screenshot height. Defaults to the source's base height. | From 0b0560019a3426539f7b67ef49cfda92b3bba2e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 15 May 2020 04:08:40 +0200 Subject: [PATCH 056/178] requests(Get/SetAudioMonitor): change values to camelCase for consistency --- src/WSRequestHandler_Sources.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 26db95f6..73ddae9f 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -1431,7 +1431,7 @@ RpcResponse WSRequestHandler::SetSourceFilterVisibility(const RpcRequest& reques * * @param {String} `sourceName` Source name. * -* @return {String} `monitorType` The monitor type in use. Options: `none`, `monitor_only`, `monitor_and_output`. +* @return {String} `monitorType` The monitor type in use. Options: `none`, `monitorOnly`, `monitorAndOutput`. * * @api requests * @name GetAudioMonitor @@ -1464,10 +1464,10 @@ RpcResponse WSRequestHandler::GetAudioMonitor(const RpcRequest& request) monitorType = "none"; break; case OBS_MONITORING_TYPE_MONITOR_ONLY: - monitorType = "monitor_only"; + monitorType = "monitorOnly"; break; case OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT: - monitorType = "monitor_and_output"; + monitorType = "monitorAndOutput"; break; default: monitorType = "unknown"; @@ -1482,7 +1482,7 @@ RpcResponse WSRequestHandler::GetAudioMonitor(const RpcRequest& request) * Set the audio monitoring type of the specified source. * * @param {String} `sourceName` Source name. -* @param {String} `monitorType` The monitor type to use. Options: `none`, `monitor_only`, `monitor_and_output`. +* @param {String} `monitorType` The monitor type to use. Options: `none`, `monitorOnly`, `monitorAndOutput`. * * @api requests * @name SetAudioMonitor @@ -1509,9 +1509,9 @@ RpcResponse WSRequestHandler::SetAudioMonitor(const RpcRequest& request) if (monitorType == "none") { obs_source_set_monitoring_type(source, OBS_MONITORING_TYPE_NONE); - } else if (monitorType == "monitor_only") { + } else if (monitorType == "monitorOnly") { obs_source_set_monitoring_type(source, OBS_MONITORING_TYPE_MONITOR_ONLY); - } else if (monitorType == "monitor_and_output") { + } else if (monitorType == "monitorAndOutput") { obs_source_set_monitoring_type(source, OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT); } else { return request.failed("invalid monitorType"); From f8c8e42ae97675298b5bf1b874a2d65c96d6c602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 15 May 2020 04:10:40 +0200 Subject: [PATCH 057/178] requests: rename Get/SetAudioMonitor to Get/SetAudioMonitorType --- src/WSRequestHandler.cpp | 4 ++-- src/WSRequestHandler.h | 4 ++-- src/WSRequestHandler_Sources.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 58cddc23..86a9df70 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -97,8 +97,8 @@ const QHash WSRequestHandler::messageMap { { "GetSourceTypesList", &WSRequestHandler::GetSourceTypesList }, { "GetSourceSettings", &WSRequestHandler::GetSourceSettings }, { "SetSourceSettings", &WSRequestHandler::SetSourceSettings }, - { "GetAudioMonitor", &WSRequestHandler::GetAudioMonitor }, - { "SetAudioMonitor", &WSRequestHandler::SetAudioMonitor }, + { "GetAudioMonitorType", &WSRequestHandler::GetAudioMonitorType }, + { "SetAudioMonitorType", &WSRequestHandler::SetAudioMonitorType }, { "TakeSourceScreenshot", &WSRequestHandler::TakeSourceScreenshot }, { "GetSourceFilters", &WSRequestHandler::GetSourceFilters }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index b55c2fb5..300915e7 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -112,8 +112,8 @@ class WSRequestHandler { RpcResponse GetSourceTypesList(const RpcRequest&); RpcResponse GetSourceSettings(const RpcRequest&); RpcResponse SetSourceSettings(const RpcRequest&); - RpcResponse GetAudioMonitor(const RpcRequest&); - RpcResponse SetAudioMonitor(const RpcRequest&); + RpcResponse GetAudioMonitorType(const RpcRequest&); + RpcResponse SetAudioMonitorType(const RpcRequest&); RpcResponse TakeSourceScreenshot(const RpcRequest&); RpcResponse GetSourceFilters(const RpcRequest&); diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 73ddae9f..f71a3518 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -1434,11 +1434,11 @@ RpcResponse WSRequestHandler::SetSourceFilterVisibility(const RpcRequest& reques * @return {String} `monitorType` The monitor type in use. Options: `none`, `monitorOnly`, `monitorAndOutput`. * * @api requests -* @name GetAudioMonitor +* @name GetAudioMonitorType * @category sources * @since 4.8.0 */ -RpcResponse WSRequestHandler::GetAudioMonitor(const RpcRequest& request) +RpcResponse WSRequestHandler::GetAudioMonitorType(const RpcRequest& request) { if (!request.hasField("sourceName")) { return request.failed("missing request parameters"); @@ -1485,11 +1485,11 @@ RpcResponse WSRequestHandler::GetAudioMonitor(const RpcRequest& request) * @param {String} `monitorType` The monitor type to use. Options: `none`, `monitorOnly`, `monitorAndOutput`. * * @api requests -* @name SetAudioMonitor +* @name SetAudioMonitorType * @category sources * @since 4.8.0 */ -RpcResponse WSRequestHandler::SetAudioMonitor(const RpcRequest& request) +RpcResponse WSRequestHandler::SetAudioMonitorType(const RpcRequest& request) { if (!request.hasField("sourceName") || !request.hasField("monitorType")) { return request.failed("missing request parameters"); From 590943ed957386a483ec6fca2a8178f7bbd5a0d3 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Fri, 15 May 2020 02:20:46 +0000 Subject: [PATCH 058/178] docs(ci): Update protocol.md - e9c17c9 [skip ci] --- docs/generated/comments.json | 98 ++++++++++++++++++++++++++++++++++++ docs/generated/protocol.md | 46 +++++++++++++++++ 2 files changed, 144 insertions(+) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index d2929e46..a6e24f82 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -7624,6 +7624,104 @@ "type": "class", "examples": [] }, + { + "subheads": [], + "description": "Get the audio monitoring type of the specified source.", + "param": "{String} `sourceName` Source name.", + "return": "{String} `monitorType` The monitor type in use. Options: `none`, `monitorOnly`, `monitorAndOutput`.", + "api": "requests", + "name": "GetAudioMonitorType", + "category": "sources", + "since": "4.8.0", + "returns": [ + { + "type": "String", + "name": "monitorType", + "description": "The monitor type in use. Options: `none`, `monitorOnly`, `monitorAndOutput`." + } + ], + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + } + ], + "names": [ + { + "name": "", + "description": "GetAudioMonitorType" + } + ], + "categories": [ + { + "name": "", + "description": "sources" + } + ], + "sinces": [ + { + "name": "", + "description": "4.8.0" + } + ], + "heading": { + "level": 2, + "text": "GetAudioMonitorType" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Set the audio monitoring type of the specified source.", + "param": [ + "{String} `sourceName` Source name.", + "{String} `monitorType` The monitor type to use. Options: `none`, `monitorOnly`, `monitorAndOutput`." + ], + "api": "requests", + "name": "SetAudioMonitorType", + "category": "sources", + "since": "4.8.0", + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + }, + { + "type": "String", + "name": "monitorType", + "description": "The monitor type to use. Options: `none`, `monitorOnly`, `monitorAndOutput`." + } + ], + "names": [ + { + "name": "", + "description": "SetAudioMonitorType" + } + ], + "categories": [ + { + "name": "", + "description": "sources" + } + ], + "sinces": [ + { + "name": "", + "description": "4.8.0" + } + ], + "heading": { + "level": 2, + "text": "SetAudioMonitorType" + }, + "lead": "", + "type": "class", + "examples": [] + }, { "subheads": [], "description": "\n\nAt least `embedPictureFormat` or `saveToFilePath` must be specified.\n\nClients can specify `width` and `height` parameters to receive scaled pictures. Aspect ratio is\npreserved if only one of these two parameters is specified.", diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 13b7c50b..b7ff296b 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -191,6 +191,8 @@ auth_response = base64_encode(auth_response_hash) + [MoveSourceFilter](#movesourcefilter) + [SetSourceFilterSettings](#setsourcefiltersettings) + [SetSourceFilterVisibility](#setsourcefiltervisibility) + + [GetAudioMonitorType](#getaudiomonitortype) + + [SetAudioMonitorType](#setaudiomonitortype) + [TakeSourceScreenshot](#takesourcescreenshot) * [Streaming](#streaming-1) + [GetStreamingStatus](#getstreamingstatus) @@ -2910,6 +2912,50 @@ Change the visibility/enabled state of a filter | `filterEnabled` | _Boolean_ | New filter state | +**Response Items:** + +_No additional response items._ + +--- + +### GetAudioMonitorType + + +- Added in v4.8.0 + +Get the audio monitoring type of the specified source. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `monitorType` | _String_ | The monitor type in use. Options: `none`, `monitorOnly`, `monitorAndOutput`. | + + +--- + +### SetAudioMonitorType + + +- Added in v4.8.0 + +Set the audio monitoring type of the specified source. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | +| `monitorType` | _String_ | The monitor type to use. Options: `none`, `monitorOnly`, `monitorAndOutput`. | + + **Response Items:** _No additional response items._ From 631ed022ed99856632b29998b458c594d2391cdd Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 15 May 2020 16:13:24 -0700 Subject: [PATCH 059/178] Requests: Add SetSourceName (renaming sources) Adds the `SetSourceName` request which can be used to rename sources. Also works on scenes since scenes in OBS are also sources. --- src/WSRequestHandler.cpp | 1 + src/WSRequestHandler.h | 1 + src/WSRequestHandler_Sources.cpp | 40 ++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 05528676..e07b099c 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -91,6 +91,7 @@ const QHash WSRequestHandler::messageMap { { "ToggleMute", &WSRequestHandler::ToggleMute }, { "SetMute", &WSRequestHandler::SetMute }, { "GetMute", &WSRequestHandler::GetMute }, + { "SetSourceName", &WSRequestHandler::SetSourceName }, { "SetSyncOffset", &WSRequestHandler::SetSyncOffset }, { "GetSyncOffset", &WSRequestHandler::GetSyncOffset }, { "GetSpecialSources", &WSRequestHandler::GetSpecialSources }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index e5f6e173..3ff9576b 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -108,6 +108,7 @@ class WSRequestHandler { RpcResponse ToggleMute(const RpcRequest&); RpcResponse SetMute(const RpcRequest&); RpcResponse GetMute(const RpcRequest&); + RpcResponse SetSourceName(const RpcRequest&); RpcResponse SetSyncOffset(const RpcRequest&); RpcResponse GetSyncOffset(const RpcRequest&); RpcResponse GetSpecialSources(const RpcRequest&); diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index a9ef5bef..2564460f 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -341,6 +341,46 @@ RpcResponse WSRequestHandler::ToggleMute(const RpcRequest& request) return request.success(); } +/** +* Sets (aka rename) the name of a source. Also works with scenes since scenes are technically sources in OBS. +* +* Note: If the new name already exists as a source, OBS will automatically modify the name to not interfere. +* +* @param {String} `sourceName` Source name. +* @param {String} `newName` New source name. +* +* @api requests +* @name SetSourceName +* @category sources +* @since 4.8.0 +*/ +RpcResponse WSRequestHandler::SetSourceName(const RpcRequest& request) +{ + if (!request.hasField("sourceName") || !request.hasField("newName")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + QString newName = obs_data_get_string(request.parameters(), "newName"); + if (sourceName.isEmpty() || newName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + OBSSourceAutoRelease existingSource = obs_get_source_by_name(newName.toUtf8()); + if (!existingSource) { // OBS is supposed to automatically rename colliding source names, but it doesn't. So this gets to be the solution for now. + obs_source_set_name(source, newName.toUtf8()); + + return request.success(); + } else { + return request.failed("a source with that newSourceName already exists"); + } +} + /** * Set the audio sync offset of a specified source. * From e3e62c3903f7142bad93042abc4b660fa0c945bd Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 15 May 2020 16:52:08 -0700 Subject: [PATCH 060/178] General: Fix a few warnings Fix a few build warnings on windows because im ocd --- src/WSEvents.cpp | 4 ++-- src/WSRequestHandler_Scenes.cpp | 2 +- src/WSRequestHandler_Sources.cpp | 2 +- src/WSRequestHandler_Streaming.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 37ada8ee..38257bb1 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -348,7 +348,7 @@ void WSEvents::hookTransitionPlaybackEvents() { obs_frontend_source_list transitions = {}; obs_frontend_get_transitions(&transitions); - for (int i = 0; i < transitions.sources.num; i++) { + for (uint i = 0; i < transitions.sources.num; i++) { obs_source_t* transition = transitions.sources.array[i]; signal_handler_t* sh = obs_source_get_signal_handler(transition); signal_handler_disconnect(sh, "transition_start", OnTransitionBegin, this); @@ -366,7 +366,7 @@ void WSEvents::unhookTransitionPlaybackEvents() { obs_frontend_source_list transitions = {}; obs_frontend_get_transitions(&transitions); - for (int i = 0; i < transitions.sources.num; i++) { + for (uint i = 0; i < transitions.sources.num; i++) { obs_source_t* transition = transitions.sources.array[i]; signal_handler_t* sh = obs_source_get_signal_handler(transition); signal_handler_disconnect(sh, "transition_start", OnTransitionBegin, this); diff --git a/src/WSRequestHandler_Scenes.cpp b/src/WSRequestHandler_Scenes.cpp index 40693a78..5fffdb51 100644 --- a/src/WSRequestHandler_Scenes.cpp +++ b/src/WSRequestHandler_Scenes.cpp @@ -121,7 +121,7 @@ RpcResponse WSRequestHandler::ReorderSceneItems(const RpcRequest& request) { struct obs_sceneitem_order_info info; size_t itemCount = obs_data_array_count(ctx->items); - for (int i = 0; i < itemCount; i++) { + for (uint i = 0; i < itemCount; i++) { OBSDataAutoRelease item = obs_data_array_item(ctx->items, i); OBSSceneItemAutoRelease sceneItem = Utils::GetSceneItemFromItem(scene, item); diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index a9ef5bef..c5d1cf9f 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -1633,7 +1633,7 @@ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) { gs_stage_texture(stagesurface, gs_texrender_get_texture(texrender)); if (gs_stagesurface_map(stagesurface, &videoData, &videoLinesize)) { int linesize = sourceImage.bytesPerLine(); - for (int y = 0; y < imgHeight; y++) { + for (uint y = 0; y < imgHeight; y++) { memcpy(sourceImage.scanLine(y), videoData + (y * videoLinesize), linesize); } gs_stagesurface_unmap(stagesurface); diff --git a/src/WSRequestHandler_Streaming.cpp b/src/WSRequestHandler_Streaming.cpp index 744a691f..c8f5732e 100644 --- a/src/WSRequestHandler_Streaming.cpp +++ b/src/WSRequestHandler_Streaming.cpp @@ -103,10 +103,10 @@ RpcResponse WSRequestHandler::StartStreaming(const RpcRequest& request) { && obs_data_has_user_value(newSettings, "key")) { const char* key = obs_data_get_string(newSettings, "key"); - int keylen = strlen(key); + size_t keylen = strlen(key); bool hasQuestionMark = false; - for (int i = 0; i < keylen; i++) { + for (size_t i = 0; i < keylen; i++) { if (key[i] == '?') { hasQuestionMark = true; break; From 7bb91da1d094efc8f00a8d1aa26f4b6198bcd775 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 15 May 2020 16:30:01 -0700 Subject: [PATCH 061/178] Events: Add sourceType string to SourceRenamed Since sources in OBS are also scenes, provide the user a string so that they can differentiate. --- src/WSEvents.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 37ada8ee..4cf069d3 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -1177,6 +1177,7 @@ void WSEvents::OnSourceAudioMixersChanged(void* param, calldata_t* data) { * * @return {String} `previousName` Previous source name * @return {String} `newName` New source name + * @return {String} `sourceType` Type of source (input, scene, filter, transition) * * @api events * @name SourceRenamed @@ -1201,6 +1202,8 @@ void WSEvents::OnSourceRename(void* param, calldata_t* data) { OBSDataAutoRelease fields = obs_data_create(); obs_data_set_string(fields, "previousName", previousName); obs_data_set_string(fields, "newName", newName); + obs_data_set_string(fields, "sourceType", + sourceTypeToString(obs_source_get_type(source))); // TODO: Split into dedicated events for source/scene. Only doing it this way for backwards compatability until 5.0 self->broadcastUpdate("SourceRenamed", fields); } From 31a085db736a3252216305fc1d2944af1dcc9964 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 16 May 2020 12:11:26 -0700 Subject: [PATCH 062/178] Docs: Update `@since` items --- src/WSRequestHandler_MediaControl.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/WSRequestHandler_MediaControl.cpp b/src/WSRequestHandler_MediaControl.cpp index 0298e533..89ff5f35 100644 --- a/src/WSRequestHandler_MediaControl.cpp +++ b/src/WSRequestHandler_MediaControl.cpp @@ -11,7 +11,7 @@ * @api requests * @name PlayPauseMedia * @category media control -* @since 4.8.0 +* @since 4.9.0 */ RpcResponse WSRequestHandler::PlayPauseMedia(const RpcRequest& request) { if ((!request.hasField("sourceName")) || (!request.hasField("playPause"))) { @@ -41,7 +41,7 @@ RpcResponse WSRequestHandler::PlayPauseMedia(const RpcRequest& request) { * @api requests * @name RestartMedia * @category media control -* @since 4.8.0 +* @since 4.9.0 */ RpcResponse WSRequestHandler::RestartMedia(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -70,7 +70,7 @@ RpcResponse WSRequestHandler::RestartMedia(const RpcRequest& request) { * @api requests * @name StopMedia * @category media control -* @since 4.8.0 +* @since 4.9.0 */ RpcResponse WSRequestHandler::StopMedia(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -99,7 +99,7 @@ RpcResponse WSRequestHandler::StopMedia(const RpcRequest& request) { * @api requests * @name NextMedia * @category media control -* @since 4.8.0 +* @since 4.9.0 */ RpcResponse WSRequestHandler::NextMedia(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -128,7 +128,7 @@ RpcResponse WSRequestHandler::NextMedia(const RpcRequest& request) { * @api requests * @name PreviousMedia * @category media control -* @since 4.8.0 +* @since 4.9.0 */ RpcResponse WSRequestHandler::PreviousMedia(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -160,7 +160,7 @@ RpcResponse WSRequestHandler::PreviousMedia(const RpcRequest& request) { * @api requests * @name GetMediaDuration * @category media control -* @since 4.8.0 +* @since 4.9.0 */ RpcResponse WSRequestHandler::GetMediaDuration(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -192,7 +192,7 @@ RpcResponse WSRequestHandler::GetMediaDuration(const RpcRequest& request) { * @api requests * @name GetMediaTime * @category media control -* @since 4.8.0 +* @since 4.9.0 */ RpcResponse WSRequestHandler::GetMediaTime(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -223,7 +223,7 @@ RpcResponse WSRequestHandler::GetMediaTime(const RpcRequest& request) { * @api requests * @name SetMediaTime * @category media control -* @since 4.8.0 +* @since 4.9.0 */ RpcResponse WSRequestHandler::SetMediaTime(const RpcRequest& request) { if (!request.hasField("sourceName") || !request.hasField("timeStamp")) { @@ -255,7 +255,7 @@ RpcResponse WSRequestHandler::SetMediaTime(const RpcRequest& request) { * @api requests * @name ScrubMedia * @category media control -* @since 4.8.0 +* @since 4.9.0 */ RpcResponse WSRequestHandler::ScrubMedia(const RpcRequest& request) { if (!request.hasField("sourceName") || !request.hasField("timeOffset")) { @@ -292,7 +292,7 @@ RpcResponse WSRequestHandler::ScrubMedia(const RpcRequest& request) { * @api requests * @name GetMediaState * @category media control -* @since 4.8.0 +* @since 4.9.0 */ RpcResponse WSRequestHandler::GetMediaState(const RpcRequest& request) { if (!request.hasField("sourceName")) { From 7918438747d4aa555d8415a012b7fd09c5058b00 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 16 May 2020 12:56:42 -0700 Subject: [PATCH 063/178] Events: Add media events Adds the following events: - `MediaPlaying` - `MediaPaused` - `MediaRestarted` - `MediaStopped` - `MediaNext` - `MediaPrevious` - `MediaStarted` - `MediaEnded` --- src/WSEvents.cpp | 208 +++++++++++++++++++++++++++++++++++++++++++++++ src/WSEvents.h | 9 ++ 2 files changed, 217 insertions(+) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 37ada8ee..166f424a 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -275,6 +275,15 @@ void WSEvents::connectSourceSignals(obs_source_t* source) { signal_handler_connect(sh, "filter_add", OnSourceFilterAdded, this); signal_handler_connect(sh, "filter_remove", OnSourceFilterRemoved, this); signal_handler_connect(sh, "reorder_filters", OnSourceFilterOrderChanged, this); + + signal_handler_connect(sh, "media_play", OnMediaPlaying, this); + signal_handler_connect(sh, "media_pause", OnMediaPaused, this); + signal_handler_connect(sh, "media_restart", OnMediaRestarted, this); + signal_handler_connect(sh, "media_stopped", OnMediaStopped, this); + signal_handler_connect(sh, "media_next", OnMediaNext, this); + signal_handler_connect(sh, "media_previous", OnMediaPrevious, this); + signal_handler_connect(sh, "media_started", OnMediaStarted, this); + signal_handler_connect(sh, "media_ended", OnMediaEnded, this); if (sourceType == OBS_SOURCE_TYPE_SCENE) { signal_handler_connect(sh, "reorder", OnSceneReordered, this); @@ -322,6 +331,15 @@ void WSEvents::disconnectSourceSignals(obs_source_t* source) { signal_handler_disconnect(sh, "transition_start", OnTransitionBegin, this); signal_handler_disconnect(sh, "transition_stop", OnTransitionEnd, this); signal_handler_disconnect(sh, "transition_video_stop", OnTransitionVideoEnd, this); + + signal_handler_disconnect(sh, "media_play", OnMediaPlaying, this); + signal_handler_disconnect(sh, "media_pause", OnMediaPaused, this); + signal_handler_disconnect(sh, "media_restart", OnMediaRestarted, this); + signal_handler_disconnect(sh, "media_stopped", OnMediaStopped, this); + signal_handler_disconnect(sh, "media_next", OnMediaNext, this); + signal_handler_disconnect(sh, "media_previous", OnMediaPrevious, this); + signal_handler_disconnect(sh, "media_started", OnMediaStarted, this); + signal_handler_disconnect(sh, "media_ended", OnMediaEnded, this); } void WSEvents::connectFilterSignals(obs_source_t* filter) { @@ -1335,6 +1353,196 @@ void WSEvents::OnSourceFilterOrderChanged(void* param, calldata_t* data) { self->broadcastUpdate("SourceFiltersReordered", fields); } +/** + * A media source has started playing. + * + * @return {String} `sourceName` Source name + * + * @api events + * @name MediaPlaying + * @category media + * @since 4.9.0 + */ +void WSEvents::OnMediaPlaying(void* param, calldata_t* data) { + auto self = reinterpret_cast(param); + + OBSSource source = calldata_get_pointer(data, "source"); + if (!source) { + return; + } + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); + self->broadcastUpdate("MediaPlaying", fields); +} + +/** + * A media source has been paused. + * + * @return {String} `sourceName` Source name + * + * @api events + * @name MediaPaused + * @category media + * @since 4.9.0 + */ +void WSEvents::OnMediaPaused(void* param, calldata_t* data) { + auto self = reinterpret_cast(param); + + OBSSource source = calldata_get_pointer(data, "source"); + if (!source) { + return; + } + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); + self->broadcastUpdate("MediaPaused", fields); +} + +/** + * A media source has been restarted. + * + * @return {String} `sourceName` Source name + * + * @api events + * @name MediaRestarted + * @category media + * @since 4.9.0 + */ +void WSEvents::OnMediaRestarted(void* param, calldata_t* data) { + auto self = reinterpret_cast(param); + + OBSSource source = calldata_get_pointer(data, "source"); + if (!source) { + return; + } + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); + self->broadcastUpdate("MediaRestarted", fields); +} + +/** + * A media source has been stopped. + * + * @return {String} `sourceName` Source name + * + * @api events + * @name MediaStopped + * @category media + * @since 4.9.0 + */ +void WSEvents::OnMediaStopped(void* param, calldata_t* data) { + auto self = reinterpret_cast(param); + + OBSSource source = calldata_get_pointer(data, "source"); + if (!source) { + return; + } + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); + self->broadcastUpdate("MediaStopped", fields); +} + +/** + * A media source has gone to the next item in the playlist. + * + * @return {String} `sourceName` Source name + * + * @api events + * @name MediaNext + * @category media + * @since 4.9.0 + */ +void WSEvents::OnMediaNext(void* param, calldata_t* data) { + auto self = reinterpret_cast(param); + + OBSSource source = calldata_get_pointer(data, "source"); + if (!source) { + return; + } + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); + self->broadcastUpdate("MediaNext", fields); +} + +/** + * A media source has gone to the previous item in the playlist. + * + * @return {String} `sourceName` Source name + * + * @api events + * @name MediaPrevious + * @category media + * @since 4.9.0 + */ +void WSEvents::OnMediaPrevious(void* param, calldata_t* data) { + auto self = reinterpret_cast(param); + + OBSSource source = calldata_get_pointer(data, "source"); + if (!source) { + return; + } + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); + self->broadcastUpdate("MediaPrevious", fields); +} + +/** + * A media source has been started. (Does not mean that it is playing. See [`MediaPlaying`](#mediaplaying)) + * + * Note: For VLC, this means that the source and therefore playlist has started. + * For the normal Media Source, this just means that the source has been started. + * + * @return {String} `sourceName` Source name + * + * @api events + * @name MediaStarted + * @category media + * @since 4.9.0 + */ +void WSEvents::OnMediaStarted(void* param, calldata_t* data) { + auto self = reinterpret_cast(param); + + OBSSource source = calldata_get_pointer(data, "source"); + if (!source) { + return; + } + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); + self->broadcastUpdate("MediaStarted", fields); +} + +/** + * A media source has ended. + * + * Note: For VLC, this means that the source and therefore playlist has ended. + * For the normal Media Source, this just means that the source has been stopped/ended. + * + * @return {String} `sourceName` Source name + * + * @api events + * @name MediaEnded + * @category media + * @since 4.9.0 + */ +void WSEvents::OnMediaEnded(void* param, calldata_t* data) { + auto self = reinterpret_cast(param); + + OBSSource source = calldata_get_pointer(data, "source"); + if (!source) { + return; + } + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); + self->broadcastUpdate("MediaEnded", fields); +} + /** * Scene items have been reordered. * diff --git a/src/WSEvents.h b/src/WSEvents.h index 06ce7f2c..0d3a04cb 100644 --- a/src/WSEvents.h +++ b/src/WSEvents.h @@ -133,6 +133,15 @@ private: static void OnSourceFilterRemoved(void* param, calldata_t* data); static void OnSourceFilterVisibilityChanged(void* param, calldata_t* data); static void OnSourceFilterOrderChanged(void* param, calldata_t* data); + + static void OnMediaPlaying(void* param, calldata_t* data); + static void OnMediaPaused(void* param, calldata_t* data); + static void OnMediaRestarted(void* param, calldata_t* data); + static void OnMediaStopped(void* param, calldata_t* data); + static void OnMediaNext(void* param, calldata_t* data); + static void OnMediaPrevious(void* param, calldata_t* data); + static void OnMediaStarted(void* param, calldata_t* data); + static void OnMediaEnded(void* param, calldata_t* data); static void OnSceneReordered(void* param, calldata_t* data); static void OnSceneItemAdd(void* param, calldata_t* data); From 19b33a8558182ce7ab748c764d8f15dd30d5f412 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Mon, 18 May 2020 14:44:25 -0700 Subject: [PATCH 064/178] Requests: Add scene transition override requests Adds these requests: - `SetSceneTransitionOverride` - `RemoveSceneTransitionOverride` - `GetSceneTransitionOverride` --- src/WSRequestHandler.cpp | 3 + src/WSRequestHandler.h | 3 + src/WSRequestHandler_Scenes.cpp | 116 ++++++++++++++++++++++++++++++++ 3 files changed, 122 insertions(+) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 05528676..29d8e652 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -46,6 +46,9 @@ const QHash WSRequestHandler::messageMap { { "SetCurrentScene", &WSRequestHandler::SetCurrentScene }, { "GetCurrentScene", &WSRequestHandler::GetCurrentScene }, { "GetSceneList", &WSRequestHandler::GetSceneList }, + { "SetSceneTransitionOverride", &WSRequestHandler::SetSceneTransitionOverride }, + { "RemoveSceneTransitionOverride", &WSRequestHandler::RemoveSceneTransitionOverride }, + { "GetSceneTransitionOverride", &WSRequestHandler::GetSceneTransitionOverride }, { "SetSourceRender", &WSRequestHandler::SetSceneItemRender }, // Retrocompat { "SetSceneItemRender", &WSRequestHandler::SetSceneItemRender }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index e5f6e173..ed7faaed 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -64,6 +64,9 @@ class WSRequestHandler { RpcResponse SetCurrentScene(const RpcRequest&); RpcResponse GetCurrentScene(const RpcRequest&); RpcResponse GetSceneList(const RpcRequest&); + RpcResponse SetSceneTransitionOverride(const RpcRequest&); + RpcResponse RemoveSceneTransitionOverride(const RpcRequest&); + RpcResponse GetSceneTransitionOverride(const RpcRequest&); RpcResponse SetSceneItemRender(const RpcRequest&); RpcResponse SetSceneItemPosition(const RpcRequest&); diff --git a/src/WSRequestHandler_Scenes.cpp b/src/WSRequestHandler_Scenes.cpp index 40693a78..ec4f74b0 100644 --- a/src/WSRequestHandler_Scenes.cpp +++ b/src/WSRequestHandler_Scenes.cpp @@ -148,3 +148,119 @@ RpcResponse WSRequestHandler::ReorderSceneItems(const RpcRequest& request) { return request.success(); } + +/** + * Set a scene to use a specific transition override. + * + * @param {String} `sceneName` Name of the scene to switch to. + * @param {String} `transitionName` Name of the transition to use. + * @param {int (Optional)} `transitionDuration` Duration in milliseconds of the transition if transition is not fixed. Defaults 300 if there is no current override and this value is not given. + * + * @api requests + * @name SetSceneTransitionOverride + * @category scenes + * @since 4.9.0 + */ +RpcResponse WSRequestHandler::SetSceneTransitionOverride(const RpcRequest& request) { + if (!request.hasField("sceneName") || !request.hasField("transitionName")) { + return request.failed("missing request parameters"); + } + + QString sceneName = obs_data_get_string(request.parameters(), "sceneName"); + OBSSourceAutoRelease source = obs_get_source_by_name(sceneName.toUtf8()); + if (!source) { + return request.failed("requested scene does not exist"); + } else if (!(obs_source_get_type(source) == OBS_SOURCE_TYPE_SCENE)) { + return request.failed("requested scene is invalid"); + } + + QString transitionName = obs_data_get_string(request.parameters(), "transitionName"); + if (!Utils::GetTransitionFromName(transitionName)) { + return request.failed("requested transition does not exist"); + } + + obs_data_t *sourceData = obs_source_get_private_settings(source); + + int transitionDuration = obs_data_get_int(sourceData, "transition_duration"); + if (request.hasField("transitionDuration")) { + transitionDuration = obs_data_get_int(request.parameters(), "transitionDuration"); + } else if (!transitionDuration) { + transitionDuration = 300; + } + + obs_data_set_string(sourceData, "transition", transitionName.toUtf8()); + obs_data_set_int(sourceData, "transition_duration", transitionDuration); + obs_data_release(sourceData); + + return request.success(); +} + +/** + * Remove any transition override on a scene. + * + * @param {String} `sceneName` Name of the scene to switch to. + * + * @api requests + * @name RemoveSceneTransitionOverride + * @category scenes + * @since 4.9.0 + */ +RpcResponse WSRequestHandler::RemoveSceneTransitionOverride(const RpcRequest& request) { + if (!request.hasField("sceneName")) { + return request.failed("missing request parameters"); + } + + QString sceneName = obs_data_get_string(request.parameters(), "sceneName"); + OBSSourceAutoRelease source = obs_get_source_by_name(sceneName.toUtf8()); + if (!source) { + return request.failed("requested scene does not exist"); + } else if (!(obs_source_get_type(source) == OBS_SOURCE_TYPE_SCENE)) { + return request.failed("requested scene is invalid"); + } + + obs_data_t *sourceData = obs_source_get_private_settings(source); + obs_data_erase(sourceData, "transition"); + obs_data_erase(sourceData, "transition_duration"); + obs_data_release(sourceData); + + return request.success(); +} + +/** + * Get the current scene transition override. + * + * @param {String} `sceneName` Name of the scene to switch to. + * + * @return {String} `transitionName` Name of the current overriding transition. Empty string if no override is set. + * @return {int} `transitionDuration` Transition duration. `-1` if no override is set. + * + * @api requests + * @name GetSceneTransitionOverride + * @category scenes + * @since 4.9.0 + */ +RpcResponse WSRequestHandler::GetSceneTransitionOverride(const RpcRequest& request) { + if (!request.hasField("sceneName")) { + return request.failed("missing request parameters"); + } + + QString sceneName = obs_data_get_string(request.parameters(), "sceneName"); + OBSSourceAutoRelease source = obs_get_source_by_name(sceneName.toUtf8()); + if (!source) { + return request.failed("requested scene does not exist"); + } else if (!(obs_source_get_type(source) == OBS_SOURCE_TYPE_SCENE)) { + return request.failed("requested scene is invalid"); + } + + OBSDataAutoRelease data = obs_data_create(); + obs_data_t *sourceData = obs_source_get_private_settings(source); + obs_data_set_string(data, "transitionName", obs_data_get_string(sourceData, "transition")); + if (!obs_data_get_int(sourceData, "transition_duration")) { + obs_data_set_int(data, "transitionDuration", -1); + } else { + obs_data_set_int(data, "transitionDuration", obs_data_get_int(sourceData, "transition_duration")); + } + obs_data_release(sourceData); + + return request.success(data); +} \ No newline at end of file From b00a93dd6b76b42030b13ddd0c4aa66bf1f36867 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Tue, 19 May 2020 20:20:35 -0700 Subject: [PATCH 065/178] Requests: Add GetMediaSourcesList and minor refactor Adds `GetMediaSourcesList` which returns a list of all media sources, along with their individual media playback states. In the process I refactored a switch which coverts the enum to a QString into its own helper function. --- src/WSRequestHandler.cpp | 3 +- src/WSRequestHandler.h | 1 + src/WSRequestHandler_MediaControl.cpp | 115 ++++++++++++++++++-------- 3 files changed, 85 insertions(+), 34 deletions(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 702d75fc..3ef985df 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -157,7 +157,8 @@ const QHash WSRequestHandler::messageMap { { "GetMediaTime", &WSRequestHandler::GetMediaTime }, { "SetMediaTime", &WSRequestHandler::SetMediaTime }, { "ScrubMedia", &WSRequestHandler::ScrubMedia }, - { "GetMediaState", &WSRequestHandler::GetMediaState } + { "GetMediaState", &WSRequestHandler::GetMediaState }, + { "GetMediaSourcesList", &WSRequestHandler::GetMediaSourcesList } }; const QSet WSRequestHandler::authNotRequired { diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index 6f31265b..7b98b314 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -175,4 +175,5 @@ class WSRequestHandler { RpcResponse SetMediaTime(const RpcRequest&); RpcResponse ScrubMedia(const RpcRequest&); RpcResponse GetMediaState(const RpcRequest&); + RpcResponse GetMediaSourcesList(const RpcRequest&); }; diff --git a/src/WSRequestHandler_MediaControl.cpp b/src/WSRequestHandler_MediaControl.cpp index 89ff5f35..ea754c6a 100644 --- a/src/WSRequestHandler_MediaControl.cpp +++ b/src/WSRequestHandler_MediaControl.cpp @@ -2,6 +2,46 @@ #include "WSRequestHandler.h" +bool isMediaSource(const QString& sourceKind) +{ + return (sourceKind == "vlc_source" || sourceKind == "ffmpeg_source"); +} + +QString getSourceMediaState(obs_source_t *source) +{ + QString mediaState; + enum obs_media_state mstate = obs_source_media_get_state(source); + switch (mstate) { + case OBS_MEDIA_STATE_NONE: + mediaState = "none"; + break; + case OBS_MEDIA_STATE_PLAYING: + mediaState = "playing"; + break; + case OBS_MEDIA_STATE_OPENING: + mediaState = "opening"; + break; + case OBS_MEDIA_STATE_BUFFERING: + mediaState = "buffering"; + break; + case OBS_MEDIA_STATE_PAUSED: + mediaState = "paused"; + break; + case OBS_MEDIA_STATE_STOPPED: + mediaState = "stopped"; + break; + case OBS_MEDIA_STATE_ENDED: + mediaState = "ended"; + break; + case OBS_MEDIA_STATE_ERROR: + mediaState = "error"; + break; + default: + mediaState = "unknown"; + } + return mediaState; +} + /** * Pause or play a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) * @@ -287,7 +327,7 @@ RpcResponse WSRequestHandler::ScrubMedia(const RpcRequest& request) { * * @param {String} `sourceName` Source name. * -* @return {String} `mediaState` The media state of the provided source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error` +* @return {String} `mediaState` The media state of the provided source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error`, `unknown` * * @api requests * @name GetMediaState @@ -309,39 +349,48 @@ RpcResponse WSRequestHandler::GetMediaState(const RpcRequest& request) { return request.failed("specified source doesn't exist"); } - QString mediaState; - enum obs_media_state mstate = obs_source_media_get_state(source); - switch (mstate) { - case OBS_MEDIA_STATE_NONE: - mediaState = "none"; - break; - case OBS_MEDIA_STATE_PLAYING: - mediaState = "playing"; - break; - case OBS_MEDIA_STATE_OPENING: - mediaState = "opening"; - break; - case OBS_MEDIA_STATE_BUFFERING: - mediaState = "buffering"; - break; - case OBS_MEDIA_STATE_PAUSED: - mediaState = "paused"; - break; - case OBS_MEDIA_STATE_STOPPED: - mediaState = "stopped"; - break; - case OBS_MEDIA_STATE_ENDED: - mediaState = "ended"; - break; - case OBS_MEDIA_STATE_ERROR: - mediaState = "error"; - break; - default: - mediaState = "unknown"; - } - OBSDataAutoRelease response = obs_data_create(); - obs_data_set_string(response, "mediaState", mediaState.toUtf8()); + obs_data_set_string(response, "mediaState", getSourceMediaState(source).toUtf8()); return request.success(response); } + +/** +* List the media state of all media sources (vlc and media source) +* +* @return {Array} `mediaSources` Array of sources +* @return {String} `mediaSources.*.sourceName` Unique source name +* @return {String} `mediaSources.*.sourceTypeId` Non-unique source internal type (a.k.a `ffmpeg_source` or `vlc_source`) +* @return {String} `mediaSources.*.mediaState` The current state of media for that source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error`, `unknown` +* +* @api requests +* @name GetMediaSourcesList +* @category sources +* @since 4.9.0 +*/ +RpcResponse WSRequestHandler::GetMediaSourcesList(const RpcRequest& request) +{ + OBSDataArrayAutoRelease sourcesArray = obs_data_array_create(); + + auto sourceEnumProc = [](void* privateData, obs_source_t* source) -> bool { + obs_data_array_t* sourcesArray = (obs_data_array_t*)privateData; + + QString sourceTypeId = obs_source_get_id(source); + if (isMediaSource(sourceTypeId)) { + OBSDataAutoRelease sourceData = obs_data_create(); + obs_data_set_string(sourceData, "sourceName", obs_source_get_name(source)); + obs_data_set_string(sourceData, "sourceTypeId", sourceTypeId.toUtf8()); + + QString mediaState = getSourceMediaState(source); + obs_data_set_string(sourceData, "mediaState", mediaState.toUtf8()); + + obs_data_array_push_back(sourcesArray, sourceData); + } + return true; + }; + obs_enum_sources(sourceEnumProc, sourcesArray); + + OBSDataAutoRelease response = obs_data_create(); + obs_data_set_array(response, "mediaSources", sourcesArray); + return request.success(response); +} \ No newline at end of file From 1f75b305c34be783c531016e8cbb45f275ba509f Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Tue, 26 May 2020 07:42:47 +0000 Subject: [PATCH 066/178] docs(ci): Update protocol.md - 0802d03 [skip ci] --- docs/generated/comments.json | 8 +++++++- docs/generated/protocol.md | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index a6e24f82..5c74beb4 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -2198,7 +2198,8 @@ "description": "A source has been renamed.", "return": [ "{String} `previousName` Previous source name", - "{String} `newName` New source name" + "{String} `newName` New source name", + "{String} `sourceType` Type of source (input, scene, filter, transition)" ], "api": "events", "name": "SourceRenamed", @@ -2214,6 +2215,11 @@ "type": "String", "name": "newName", "description": "New source name" + }, + { + "type": "String", + "name": "sourceType", + "description": "Type of source (input, scene, filter, transition)" } ], "names": [ diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index b7ff296b..5ea71f45 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -930,6 +930,7 @@ A source has been renamed. | ---- | :---: | ------------| | `previousName` | _String_ | Previous source name | | `newName` | _String_ | New source name | +| `sourceType` | _String_ | Type of source (input, scene, filter, transition) | --- From ed29ec528d7169ea68695652183292fa83a9fe99 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Tue, 26 May 2020 11:58:51 +0000 Subject: [PATCH 067/178] docs(ci): Update protocol.md - 481b26d [skip ci] --- docs/generated/comments.json | 49 ++++++++++++++++++++++++++++++++++++ docs/generated/protocol.md | 24 ++++++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 5c74beb4..104a2167 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -5919,6 +5919,55 @@ "type": "class", "examples": [] }, + { + "subheads": [], + "description": "\n\nNote: If the new name already exists as a source, OBS will automatically modify the name to not interfere.", + "param": [ + "{String} `sourceName` Source name.", + "{String} `newName` New source name." + ], + "api": "requests", + "name": "SetSourceName", + "category": "sources", + "since": "4.8.0", + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + }, + { + "type": "String", + "name": "newName", + "description": "New source name." + } + ], + "names": [ + { + "name": "", + "description": "SetSourceName" + } + ], + "categories": [ + { + "name": "", + "description": "sources" + } + ], + "sinces": [ + { + "name": "", + "description": "4.8.0" + } + ], + "heading": { + "level": 2, + "text": "SetSourceName" + }, + "lead": "Sets (aka rename) the name of a source. Also works with scenes since scenes are technically sources in OBS.", + "type": "class", + "examples": [] + }, { "subheads": [], "description": "Set the audio sync offset of a specified source.", diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 5ea71f45..deefbb4c 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -172,6 +172,7 @@ auth_response = base64_encode(auth_response_hash) + [GetMute](#getmute) + [SetMute](#setmute) + [ToggleMute](#togglemute) + + [SetSourceName](#setsourcename) + [SetSyncOffset](#setsyncoffset) + [GetSyncOffset](#getsyncoffset) + [GetSourceSettings](#getsourcesettings) @@ -2372,6 +2373,29 @@ Inverts the mute status of a specified source. | `source` | _String_ | Source name. | +**Response Items:** + +_No additional response items._ + +--- + +### SetSourceName + + +- Added in v4.8.0 + + + +Note: If the new name already exists as a source, OBS will automatically modify the name to not interfere. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | +| `newName` | _String_ | New source name. | + + **Response Items:** _No additional response items._ From 517788e86abd04a05d734b41b20103adce3d6ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 26 May 2020 23:26:37 +0200 Subject: [PATCH 068/178] request(scenes): refactor Set/Get/RemoveSceneTransitionOverride + use current transition duration --- src/WSRequestHandler_Scenes.cpp | 63 ++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/src/WSRequestHandler_Scenes.cpp b/src/WSRequestHandler_Scenes.cpp index ec4f74b0..bebea23f 100644 --- a/src/WSRequestHandler_Scenes.cpp +++ b/src/WSRequestHandler_Scenes.cpp @@ -154,7 +154,7 @@ RpcResponse WSRequestHandler::ReorderSceneItems(const RpcRequest& request) { * * @param {String} `sceneName` Name of the scene to switch to. * @param {String} `transitionName` Name of the transition to use. - * @param {int (Optional)} `transitionDuration` Duration in milliseconds of the transition if transition is not fixed. Defaults 300 if there is no current override and this value is not given. + * @param {int (Optional)} `transitionDuration` Duration in milliseconds of the transition if transition is not fixed. Defaults to the current transition duration specified in the UI if this value is not given. * * @api requests * @name SetSceneTransitionOverride @@ -170,7 +170,10 @@ RpcResponse WSRequestHandler::SetSceneTransitionOverride(const RpcRequest& reque OBSSourceAutoRelease source = obs_get_source_by_name(sceneName.toUtf8()); if (!source) { return request.failed("requested scene does not exist"); - } else if (!(obs_source_get_type(source) == OBS_SOURCE_TYPE_SCENE)) { + } + + enum obs_source_type sourceType = obs_source_get_type(source); + if (sourceType != OBS_SOURCE_TYPE_SCENE) { return request.failed("requested scene is invalid"); } @@ -179,18 +182,15 @@ RpcResponse WSRequestHandler::SetSceneTransitionOverride(const RpcRequest& reque return request.failed("requested transition does not exist"); } - obs_data_t *sourceData = obs_source_get_private_settings(source); + int transitionOverrideDuration = ( + request.hasField("transitionDuration") + ? obs_data_get_int(request.parameters(), "transitionDuration") + : obs_frontend_get_transition_duration() + ); - int transitionDuration = obs_data_get_int(sourceData, "transition_duration"); - if (request.hasField("transitionDuration")) { - transitionDuration = obs_data_get_int(request.parameters(), "transitionDuration"); - } else if (!transitionDuration) { - transitionDuration = 300; - } - - obs_data_set_string(sourceData, "transition", transitionName.toUtf8()); - obs_data_set_int(sourceData, "transition_duration", transitionDuration); - obs_data_release(sourceData); + OBSDataAutoRelease sourceData = obs_source_get_private_settings(source); + obs_data_set_string(sourceData, "transition", transitionName.toUtf8().constData()); + obs_data_set_int(sourceData, "transition_duration", transitionOverrideDuration); return request.success(); } @@ -214,14 +214,16 @@ RpcResponse WSRequestHandler::RemoveSceneTransitionOverride(const RpcRequest& re OBSSourceAutoRelease source = obs_get_source_by_name(sceneName.toUtf8()); if (!source) { return request.failed("requested scene does not exist"); - } else if (!(obs_source_get_type(source) == OBS_SOURCE_TYPE_SCENE)) { + } + + enum obs_source_type sourceType = obs_source_get_type(source); + if (sourceType != OBS_SOURCE_TYPE_SCENE) { return request.failed("requested scene is invalid"); } - obs_data_t *sourceData = obs_source_get_private_settings(source); + OBSDataAutoRelease sourceData = obs_source_get_private_settings(source); obs_data_erase(sourceData, "transition"); obs_data_erase(sourceData, "transition_duration"); - obs_data_release(sourceData); return request.success(); } @@ -248,19 +250,24 @@ RpcResponse WSRequestHandler::GetSceneTransitionOverride(const RpcRequest& reque OBSSourceAutoRelease source = obs_get_source_by_name(sceneName.toUtf8()); if (!source) { return request.failed("requested scene does not exist"); - } else if (!(obs_source_get_type(source) == OBS_SOURCE_TYPE_SCENE)) { + } + + enum obs_source_type sourceType = obs_source_get_type(source); + if (sourceType != OBS_SOURCE_TYPE_SCENE) { return request.failed("requested scene is invalid"); } - OBSDataAutoRelease data = obs_data_create(); - obs_data_t *sourceData = obs_source_get_private_settings(source); - obs_data_set_string(data, "transitionName", obs_data_get_string(sourceData, "transition")); - if (!obs_data_get_int(sourceData, "transition_duration")) { - obs_data_set_int(data, "transitionDuration", -1); - } else { - obs_data_set_int(data, "transitionDuration", obs_data_get_int(sourceData, "transition_duration")); - } - obs_data_release(sourceData); + OBSDataAutoRelease sourceData = obs_source_get_private_settings(source); + const char* transitionOverrideName = obs_data_get_string(sourceData, "transition"); - return request.success(data); -} \ No newline at end of file + bool hasDurationOverride = obs_data_has_autoselect_value(sourceData, "transition_duration"); + int transitionOverrideDuration = obs_data_get_int(sourceData, "transition_duration"); + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "transitionName", transitionOverrideName); + obs_data_set_int(fields, "transitionDuration", + (hasDurationOverride ? transitionOverrideDuration : -1) + ); + + return request.success(fields); +} From 9ddc22fa940d43d667bd0c585300854d615dd0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 26 May 2020 23:36:18 +0200 Subject: [PATCH 069/178] request(SetSceneTransitionOverride): override duration only if it is explicity set so or not already defined --- src/WSRequestHandler_Scenes.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/WSRequestHandler_Scenes.cpp b/src/WSRequestHandler_Scenes.cpp index bebea23f..27e0cf3c 100644 --- a/src/WSRequestHandler_Scenes.cpp +++ b/src/WSRequestHandler_Scenes.cpp @@ -154,7 +154,7 @@ RpcResponse WSRequestHandler::ReorderSceneItems(const RpcRequest& request) { * * @param {String} `sceneName` Name of the scene to switch to. * @param {String} `transitionName` Name of the transition to use. - * @param {int (Optional)} `transitionDuration` Duration in milliseconds of the transition if transition is not fixed. Defaults to the current transition duration specified in the UI if this value is not given. + * @param {int (Optional)} `transitionDuration` Duration in milliseconds of the transition if transition is not fixed. Defaults to the current duration specified in the UI if there is no current override and this value is not given. * * @api requests * @name SetSceneTransitionOverride @@ -182,16 +182,18 @@ RpcResponse WSRequestHandler::SetSceneTransitionOverride(const RpcRequest& reque return request.failed("requested transition does not exist"); } - int transitionOverrideDuration = ( - request.hasField("transitionDuration") - ? obs_data_get_int(request.parameters(), "transitionDuration") - : obs_frontend_get_transition_duration() - ); - OBSDataAutoRelease sourceData = obs_source_get_private_settings(source); obs_data_set_string(sourceData, "transition", transitionName.toUtf8().constData()); - obs_data_set_int(sourceData, "transition_duration", transitionOverrideDuration); + if (request.hasField("transitionDuration")) { + int transitionOverrideDuration = obs_data_get_int(request.parameters(), "transitionDuration"); + obs_data_set_int(sourceData, "transition_duration", transitionOverrideDuration); + } else if(!obs_data_has_user_value(sourceData, "transition_duration")) { + obs_data_set_int(sourceData, "transition_duration", + obs_frontend_get_transition_duration() + ); + } + return request.success(); } @@ -260,7 +262,7 @@ RpcResponse WSRequestHandler::GetSceneTransitionOverride(const RpcRequest& reque OBSDataAutoRelease sourceData = obs_source_get_private_settings(source); const char* transitionOverrideName = obs_data_get_string(sourceData, "transition"); - bool hasDurationOverride = obs_data_has_autoselect_value(sourceData, "transition_duration"); + bool hasDurationOverride = obs_data_has_user_value(sourceData, "transition_duration"); int transitionOverrideDuration = obs_data_get_int(sourceData, "transition_duration"); OBSDataAutoRelease fields = obs_data_create(); From 5d12dfa3682358e82a3ac39d78fdfa6501162c4e Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Tue, 26 May 2020 21:49:10 +0000 Subject: [PATCH 070/178] docs(ci): Update protocol.md - c428201 [skip ci] --- docs/generated/comments.json | 153 +++++++++++++++++++++++++++++++++++ docs/generated/protocol.md | 69 ++++++++++++++++ 2 files changed, 222 insertions(+) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 104a2167..fea62b1f 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -5467,6 +5467,159 @@ "lead": "", "type": "class", "examples": [] + }, + { + "subheads": [], + "description": "Set a scene to use a specific transition override.", + "param": [ + "{String} `sceneName` Name of the scene to switch to.", + "{String} `transitionName` Name of the transition to use.", + "{int (Optional)} `transitionDuration` Duration in milliseconds of the transition if transition is not fixed. Defaults to the current duration specified in the UI if there is no current override and this value is not given." + ], + "api": "requests", + "name": "SetSceneTransitionOverride", + "category": "scenes", + "since": "4.9.0", + "params": [ + { + "type": "String", + "name": "sceneName", + "description": "Name of the scene to switch to." + }, + { + "type": "String", + "name": "transitionName", + "description": "Name of the transition to use." + }, + { + "type": "int (Optional)", + "name": "transitionDuration", + "description": "Duration in milliseconds of the transition if transition is not fixed. Defaults to the current duration specified in the UI if there is no current override and this value is not given." + } + ], + "names": [ + { + "name": "", + "description": "SetSceneTransitionOverride" + } + ], + "categories": [ + { + "name": "", + "description": "scenes" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "SetSceneTransitionOverride" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Remove any transition override on a scene.", + "param": "{String} `sceneName` Name of the scene to switch to.", + "api": "requests", + "name": "RemoveSceneTransitionOverride", + "category": "scenes", + "since": "4.9.0", + "params": [ + { + "type": "String", + "name": "sceneName", + "description": "Name of the scene to switch to." + } + ], + "names": [ + { + "name": "", + "description": "RemoveSceneTransitionOverride" + } + ], + "categories": [ + { + "name": "", + "description": "scenes" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "RemoveSceneTransitionOverride" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get the current scene transition override.", + "param": "{String} `sceneName` Name of the scene to switch to.", + "return": [ + "{String} `transitionName` Name of the current overriding transition. Empty string if no override is set.", + "{int} `transitionDuration` Transition duration. `-1` if no override is set." + ], + "api": "requests", + "name": "GetSceneTransitionOverride", + "category": "scenes", + "since": "4.9.0", + "returns": [ + { + "type": "String", + "name": "transitionName", + "description": "Name of the current overriding transition. Empty string if no override is set." + }, + { + "type": "int", + "name": "transitionDuration", + "description": "Transition duration. `-1` if no override is set." + } + ], + "params": [ + { + "type": "String", + "name": "sceneName", + "description": "Name of the scene to switch to." + } + ], + "names": [ + { + "name": "", + "description": "GetSceneTransitionOverride" + } + ], + "categories": [ + { + "name": "", + "description": "scenes" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "GetSceneTransitionOverride" + }, + "lead": "", + "type": "class", + "examples": [] } ], "sources": [ diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index deefbb4c..f7b999a2 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -164,6 +164,9 @@ auth_response = base64_encode(auth_response_hash) + [GetCurrentScene](#getcurrentscene) + [GetSceneList](#getscenelist) + [ReorderSceneItems](#reordersceneitems) + + [SetSceneTransitionOverride](#setscenetransitionoverride) + + [RemoveSceneTransitionOverride](#removescenetransitionoverride) + + [GetSceneTransitionOverride](#getscenetransitionoverride) * [Sources](#sources-1) + [GetSourcesList](#getsourceslist) + [GetSourceTypesList](#getsourcetypeslist) @@ -2207,6 +2210,72 @@ Changes the order of scene items in the requested scene. _No additional response items._ +--- + +### SetSceneTransitionOverride + + +- Added in v4.9.0 + +Set a scene to use a specific transition override. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneName` | _String_ | Name of the scene to switch to. | +| `transitionName` | _String_ | Name of the transition to use. | +| `transitionDuration` | _int (Optional)_ | Duration in milliseconds of the transition if transition is not fixed. Defaults to the current duration specified in the UI if there is no current override and this value is not given. | + + +**Response Items:** + +_No additional response items._ + +--- + +### RemoveSceneTransitionOverride + + +- Added in v4.9.0 + +Remove any transition override on a scene. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneName` | _String_ | Name of the scene to switch to. | + + +**Response Items:** + +_No additional response items._ + +--- + +### GetSceneTransitionOverride + + +- Added in v4.9.0 + +Get the current scene transition override. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneName` | _String_ | Name of the scene to switch to. | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `transitionName` | _String_ | Name of the current overriding transition. Empty string if no override is set. | +| `transitionDuration` | _int_ | Transition duration. `-1` if no override is set. | + + --- ## Sources From f1371034f7aae779f9cd649c902f335381858573 Mon Sep 17 00:00:00 2001 From: Alex Tsernoh Date: Wed, 27 May 2020 00:13:43 +0300 Subject: [PATCH 071/178] Request: Add CreateScene --- src/WSRequestHandler.cpp | 1 + src/WSRequestHandler.h | 1 + src/WSRequestHandler_Scenes.cpp | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 27597abb..77411461 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -46,6 +46,7 @@ const QHash WSRequestHandler::messageMap { { "SetCurrentScene", &WSRequestHandler::SetCurrentScene }, { "GetCurrentScene", &WSRequestHandler::GetCurrentScene }, { "GetSceneList", &WSRequestHandler::GetSceneList }, + { "CreateScene", &WSRequestHandler::CreateScene }, { "SetSceneTransitionOverride", &WSRequestHandler::SetSceneTransitionOverride }, { "RemoveSceneTransitionOverride", &WSRequestHandler::RemoveSceneTransitionOverride }, { "GetSceneTransitionOverride", &WSRequestHandler::GetSceneTransitionOverride }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index 4c536c3c..2a33c8f4 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -64,6 +64,7 @@ class WSRequestHandler { RpcResponse SetCurrentScene(const RpcRequest&); RpcResponse GetCurrentScene(const RpcRequest&); RpcResponse GetSceneList(const RpcRequest&); + RpcResponse CreateScene(const RpcRequest&); RpcResponse SetSceneTransitionOverride(const RpcRequest&); RpcResponse RemoveSceneTransitionOverride(const RpcRequest&); RpcResponse GetSceneTransitionOverride(const RpcRequest&); diff --git a/src/WSRequestHandler_Scenes.cpp b/src/WSRequestHandler_Scenes.cpp index 3760e5ba..97918147 100644 --- a/src/WSRequestHandler_Scenes.cpp +++ b/src/WSRequestHandler_Scenes.cpp @@ -79,6 +79,31 @@ RpcResponse WSRequestHandler::GetSceneList(const RpcRequest& request) { return request.success(data); } +/** + * Create a new scene scene. + * + * @param {String} `scene-name` Name of the scene to create. + * + * @api requests + * @name CreateScene + * @category scenes + * @since 4.8.0 + */ +RpcResponse WSRequestHandler::CreateScene(const RpcRequest& request) { + if (!request.hasField("sceneName")) { + return request.failed("missing request parameters"); + } + + const char* sceneName = obs_data_get_string(request.parameters(), "sceneName"); + OBSSourceAutoRelease source = obs_get_source_by_name(sceneName); + + if (source) { + return request.failed("scene with this name already exists"); + } + obs_scene_create(sceneName); + return request.success(); +} + /** * Changes the order of scene items in the requested scene. * From eb7787fb7dc70f4845cfa354c97e01a0d59edb9d Mon Sep 17 00:00:00 2001 From: Alex Tsernoh Date: Wed, 27 May 2020 11:18:39 +0300 Subject: [PATCH 072/178] Docs: Fix param name --- src/WSRequestHandler_Scenes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WSRequestHandler_Scenes.cpp b/src/WSRequestHandler_Scenes.cpp index 97918147..a6d9d293 100644 --- a/src/WSRequestHandler_Scenes.cpp +++ b/src/WSRequestHandler_Scenes.cpp @@ -82,7 +82,7 @@ RpcResponse WSRequestHandler::GetSceneList(const RpcRequest& request) { /** * Create a new scene scene. * - * @param {String} `scene-name` Name of the scene to create. + * @param {String} `sceneName` Name of the scene to create. * * @api requests * @name CreateScene From 37e412e710e75cee2b4f95988a5f77b4ad3b3c77 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 28 May 2020 16:16:31 -0700 Subject: [PATCH 073/178] Docs: Add discord shield to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8fc8c1a7..cf30b9fe 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ WebSockets API for OBS Studio. Follow the main author on Twitter for news & updates : [@LePalakis](https://twitter.com/LePalakis) +[![Discord](https://img.shields.io/discord/715691013825364120.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/WBaSQ3A) + [![Build Status](https://dev.azure.com/Palakis/obs-websocket/_apis/build/status/Palakis.obs-websocket?branchName=4.x-current)](https://dev.azure.com/Palakis/obs-websocket/_build/latest?definitionId=2&branchName=4.x-current) ## Downloads From 3462e7f50eb4afd0cf103b3b4ed93035d6f68968 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 28 May 2020 16:22:11 -0700 Subject: [PATCH 074/178] Docs: Add new logo and update header --- .github/images/obsws_logo.png | Bin 0 -> 58525 bytes README.md | 11 ++++++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 .github/images/obsws_logo.png diff --git a/.github/images/obsws_logo.png b/.github/images/obsws_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..2bcee839d3c8ab3f200672588e3a5557e7e08089 GIT binary patch literal 58525 zcmX_o1yq#V_x2132uPPS4$=}LNFzwMbf+L75+a==NFyBr(hNw~(5*;{lysMLcYlZb z|M|I=Yq{>4_q^xbXUDUj{hS-}N?8U6ivkM*f#Ar=N~%F1sKwx~^nG;jUq~6P(jX8z zh@7OjhTGSz84NcP%?tFs(-{2ZBf{2Cvz}rFf5g_5LgCEJ-%L!$Dr`F0T@0~<*EoW4 zj_or8a-Hz=V`Opg>BLZ=>vZ?j_-|J!nKwz6Z1=G_3N%% zoElwLh9fFGtL3t)=$Zv1<01UzNomV1G5V{48@H=J)(59=ptbkua9YtIme8+Ihu=5X zx|c28EkaoH58*^7zPA%MUn_5)5P&~*;hl$bGD?A3S*?U98N~3#lRRO#JOl=ngfPDj z8Xj`dVTaKDx*0Kkq!H8$;V|46unf|{tjvQ_p+}+2)4?Sm$|(F6w|qWCk6|zv_X7#G z=!R}>2RWf&`Ljj>F=vS8_FQkCAGO~4hVr=hbCOmS$O-B=>OB0qpT%Wwg-;ed1;gM% z64uFJLNvGN^l-$eA-p9I1=!z3mc-bbPpC(zZ@o&nXF>^Yg2Ze`Po__dNrFE&KL_N^ z)3$hXG`C(&;)|(6;-Q~D{P}aAX-icHvor;IWfe5>*faUPN0}==_{`{1@CpGHEV_}J zAJ)$cF;)K+L6hz_WI!I<)2t>p+iz2 zMOB3lKky_32M4dQKGX~GVj~t~hp-mzh}&JJCGvxzNLRx9J+jX6u8%@0iz~ zA_-SgiDe5g=q738Y|ZT@B;qJLq3_Biw$vaEThY3}WLX*Q;H@IMiIc6k`P5s{e<&v+ zmzgS7l!f6^C$d}0B|!|}M<(9~%j6|*~+k!BU8-M-Yw_yJU4>7 z_eFvC8K!n}d~tdP7d=7F^_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A%!pR17Y=|{c8TRpAfg|kKHR)mysMUz!FBAaQ)w-$5r>1Ar3O;;+8_W!KO@h>P%T>W)> z%vq4@n>lN+3;W)cN0b5|#IQ6Rs&EFng%q`LK;;xC^wr&xr7{x_( zOxg6qBQ*`eu2%6f6kQDeHI{NTR#_@W9S+3&l;K(sy2|KU=Y!R{I>I|hU7tJpit1)` zj4F2M+7R;LT}zQ&Dc8(?O!!;sYnzU7=98J5k*yuYej__sw#scaf!lOp9VqRKo07W2 zN>77y#?KnucS2_Pn1f4K#ff*mDbc1{9ZpqUsQ+wQnn*KeI%SUsDoyo2BGm8ENOl&d zo1>OPIxk=}m6DIK{rVgxZu6N04JE^y9UW3SMl_*{LR9SuX|DDA@NcU2CCCd2xer?< zQB+59WKfN)r0xWJBXSKsJ$k%!0wHM!o9|xezOrS3t{vf>!|t8qgqNJi&IYW(QHjBi z(T4!@<~=cDRivA$6JBS}NJ0}-gZD!ioz%p?YX6%7A0qsxN209F$PE7|=9vs|vo+Pp zu{a!oBn~y920woIa{(yQnjpm{Z#EnuS$n7|=D`t$lP(cfFZJJf-LBca|1TfH+cewM#NOe`-Ndo)^0f#r z?+dj1TE0zx`D&w{Ifm^Pe4EJM(Q`z@34V2Z*XXx7;k_egUcQ3Iu1Oa8{Yr>DcC0C#u<#=86jMCC^#W5j_wYkbw0=b1C{CZp8x;= literal 0 HcmV?d00001 diff --git a/README.md b/README.md index cf30b9fe..846c351f 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@ -obs-websocket -============== +# obs-websocket + +

+ +

WebSockets API for OBS Studio. -Follow the main author on Twitter for news & updates : [@LePalakis](https://twitter.com/LePalakis) - [![Discord](https://img.shields.io/discord/715691013825364120.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/WBaSQ3A) - [![Build Status](https://dev.azure.com/Palakis/obs-websocket/_apis/build/status/Palakis.obs-websocket?branchName=4.x-current)](https://dev.azure.com/Palakis/obs-websocket/_build/latest?definitionId=2&branchName=4.x-current) +[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social&label=Follow%20%40LePalakis)](https://twitter.com/LePalakis) ## Downloads From 865c0c79db1c7678fc5fbca07d4cd6b3e50d2f4b Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 28 May 2020 16:45:05 -0700 Subject: [PATCH 075/178] Docs: Rework some more of the readme --- README.md | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 846c351f..df86da85 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Here's a list of available language APIs for obs-websocket : - Golang: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf - HTTP API: [obs-websocket-http](https://github.com/IRLToolkit/obs-websocket-http) by tt2468 -I'd like to know what you're building with or for obs-websocket. If you do something in this fashion, feel free to drop me an email at `stephane /dot/ lepin /at/ gmail /dot/ com` ! +I'd like to know what you're building with or for obs-websocket. If you do something in this fashion, feel free to drop a message in `#project-showoff` in the [discord server!](https://discord.gg/WBaSQ3A) ## Compiling obs-websocket @@ -59,36 +59,13 @@ Please join the localization project on [Crowdin](https://crowdin.com/project/ob ## Special thanks -In (almost) order of appearance: - -- [Brendan H.](https://github.com/haganbmj): Code contributions and gooder English in the Protocol specification -- [Mikhail Swift](https://github.com/mikhailswift): Code contributions -- [Tobias Frahmer](https://github.com/Frahmer): Initial German localization -- [Genture](https://github.com/Genteure): Initial Simplified Chinese and Traditional Chinese localizations -- [Larissa Gabilan](https://github.com/laris151): Initial Portuguese localization -- [Andy Asquelt](https://github.com/asquelt): Initial Polish localization -- [Marcel Haazen](https://github.com/nekocentral): Initial Dutch localization -- [Peter Antonvich](https://github.com/pantonvich): Code contributions -- [yinzara](https://github.com/yinzara): Code contributions -- [Chris Angelico](https://github.com/Rosuav): Code contributions -- [Guillaume "Elektordi" Genty](https://github.com/Elektordi): Code contributions -- [Marwin M](https://github.com/dragonbane0): Code contributions -- [Logan S.](https://github.com/lsdaniel): Code contributions -- [RainbowEK](https://github.com/RainbowEK): Code contributions -- [RytoEX](https://github.com/RytoEX): CI script and code contributions -- [Theodore Stoddard](https://github.com/TStod): Code contributions -- [Philip Loche](https://github.com/PicoCentauri): Code contributions -- [Patrick Heyer](https://github.com/PatTheMav): Code contributions and CI fixes -- [Alex Van Camp](https://github.com/Lange): Code contributions -- [Freddie Meyer](https://github.com/DungFu): Code contributions -- [Casey Muller](https://github.com/caseymrm): CI fixes -- [Chris Angelico](https://github.com/Rosuav): Documentation fixes +Thank you so much to all of the contibutors [(here)](https://github.com/Palakis/obs-websocket/graphs/contributors) for your amazing help. And also: special thanks to supporters of the project! ## Supporters -They have contributed financially to the project and made possible the addition of several features into obs-websocket. Many thanks to them! +These supporters have contributed financially to the project and made possible the addition of several features into obs-websocket. Many thanks to them! --- From d2865b9f4fc216316e4e92f8a0cb7382cd533f9b Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 28 May 2020 21:45:52 -0700 Subject: [PATCH 076/178] Requests: Add AddSceneItem New request `AddSceneItem` which allows you to add a source to a scene. Returns an itemId which can be used to manipulate the item further if necessary. --- src/WSRequestHandler.cpp | 1 + src/WSRequestHandler.h | 1 + src/WSRequestHandler_SceneItems.cpp | 73 +++++++++++++++++++++++++++-- 3 files changed, 71 insertions(+), 4 deletions(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 77411461..cb3eabe0 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -60,6 +60,7 @@ const QHash WSRequestHandler::messageMap { { "SetSceneItemProperties", &WSRequestHandler::SetSceneItemProperties }, { "ResetSceneItem", &WSRequestHandler::ResetSceneItem }, { "DeleteSceneItem", &WSRequestHandler::DeleteSceneItem }, + { "AddSceneItem", &WSRequestHandler::AddSceneItem }, { "DuplicateSceneItem", &WSRequestHandler::DuplicateSceneItem }, { "ReorderSceneItems", &WSRequestHandler::ReorderSceneItems }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index 2a33c8f4..a334a1a9 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -78,6 +78,7 @@ class WSRequestHandler { RpcResponse ResetSceneItem(const RpcRequest&); RpcResponse DuplicateSceneItem(const RpcRequest&); RpcResponse DeleteSceneItem(const RpcRequest&); + RpcResponse AddSceneItem(const RpcRequest&); RpcResponse ReorderSceneItems(const RpcRequest&); RpcResponse GetStreamingStatus(const RpcRequest&); diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index c1fd8522..abff904f 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -2,6 +2,18 @@ #include "WSRequestHandler.h" +struct AddSourceData { + obs_source_t *source; + obs_sceneitem_t *sceneItem; + bool setVisible; +}; + +void AddSourceHelper(void *_data, obs_scene_t *scene) { + auto *data = reinterpret_cast(_data); + data->sceneItem = obs_scene_add(scene, data->source); + obs_sceneitem_set_visible(data->sceneItem, data->setVisible); +} + /** * Gets the scene specific properties of the specified source item. * Coordinates are relative to the item's parent (the scene or group it belongs to). @@ -37,7 +49,7 @@ * @return {int} `alignment` The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis. * @return {String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group) * @return {Array (optional)} `groupChildren` List of children (if this item is a group) -* +* * @api requests * @name GetSceneItemProperties * @category scene items @@ -164,7 +176,7 @@ RpcResponse WSRequestHandler::SetSceneItemProperties(const RpcRequest& request) vec2 newScale = oldScale; OBSDataAutoRelease reqScale = obs_data_get_obj(params, "scale"); - + if (obs_data_has_user_value(reqScale, "x")) { newScale.x = obs_data_get_double(reqScale, "x"); } @@ -252,7 +264,7 @@ RpcResponse WSRequestHandler::SetSceneItemProperties(const RpcRequest& request) } obs_sceneitem_set_bounds(sceneItem, &newBounds); - + if (obs_data_has_user_value(reqBounds, "alignment")) { const uint32_t bounds_alignment = obs_data_get_int(reqBounds, "alignment"); if (Utils::IsValidAlignment(bounds_alignment)) { @@ -455,7 +467,7 @@ RpcResponse WSRequestHandler::SetSceneItemTransform(const RpcRequest& request) { obs_sceneitem_set_scale(sceneItem, &scale); obs_sceneitem_set_rot(sceneItem, rotation); - + obs_sceneitem_defer_update_end(sceneItem); return request.success(); @@ -544,6 +556,59 @@ RpcResponse WSRequestHandler::DeleteSceneItem(const RpcRequest& request) { return request.success(); } +/** + * Creates a scene item in a scene. In other words, this is how you add a source into a scene. + * + * @param {String} `sceneName` Name of the scene to create the scene item in + * @param {String} `sourceName` Name of the source to be added + * @param {boolean} `setVisible` Whether to make the sceneitem visible on creation or not. Default `true` + * + * @return {int} `itemId` Numerical ID of the created scene item + * + * @api requests + * @name AddSceneItem + * @category scene items + * @since unreleased + */ +RpcResponse WSRequestHandler::AddSceneItem(const RpcRequest& request) { + if (!request.hasField("sceneName") || !request.hasField("sourceName")) { + return request.failed("missing request parameters"); + } + + const char* sceneName = obs_data_get_string(request.parameters(), "sceneName"); + OBSSourceAutoRelease sceneSource = obs_get_source_by_name(sceneName); + OBSScene scene = obs_scene_from_source(sceneSource); + if (!scene) { + return request.failed("requested scene is invalid or doesnt exist"); + } + + const char* sourceName = obs_data_get_string(request.parameters(), "sourceName"); + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName); + if (!source) { + return request.failed("requested source does not exist"); + } + + if (source == sceneSource) { + return request.failed("you cannot add a scene as a sceneitem to itself"); + } + + AddSourceData data; + data.source = source; + data.setVisible = true; + if (request.hasField("setVisible")) { + data.setVisible = obs_data_get_bool(request.parameters(), "setVisible"); + } + + obs_enter_graphics(); + obs_scene_atomic_update(scene, AddSourceHelper, &data); + obs_leave_graphics(); + + OBSDataAutoRelease responseData = obs_data_create(); + obs_data_set_int(responseData, "itemID", obs_sceneitem_get_id(data.sceneItem)); + + return request.success(responseData); +} + /** * Duplicates a scene item. * From cf99c688432c6b178b06a724dd9a52f3d3649761 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 28 May 2020 22:45:08 -0700 Subject: [PATCH 077/178] Requests: Fix useDecibel response when volume is -infinity When the volume in OBS is -infinity, `GetVolume` returns a decibel value of either 0, or in some cases no `volume` property at all. This makes `GetVolume` return a decibel value of -100.0 if the real volume is -infinity. --- src/WSRequestHandler_Sources.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 3a224205..b3ba2a55 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -192,6 +192,10 @@ RpcResponse WSRequestHandler::GetVolume(const RpcRequest& request) if (useDecibel) { volume = obs_mul_to_db(volume); } + + if (volume == -INFINITY) { + volume = -100.0; + } OBSDataAutoRelease response = obs_data_create(); obs_data_set_string(response, "name", obs_source_get_name(source)); From 1474499886d95b7e2badc913eaac32fa43dae90f Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 28 May 2020 23:58:11 -0700 Subject: [PATCH 078/178] Requests: Add GetSceneItemList Adds a new `GetSceneItemList` request to get all scene items in a specified scene. --- src/WSRequestHandler.cpp | 1 + src/WSRequestHandler.h | 1 + src/WSRequestHandler_SceneItems.cpp | 67 +++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index cb3eabe0..be8efdb3 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -52,6 +52,7 @@ const QHash WSRequestHandler::messageMap { { "GetSceneTransitionOverride", &WSRequestHandler::GetSceneTransitionOverride }, { "SetSourceRender", &WSRequestHandler::SetSceneItemRender }, // Retrocompat + { "GetSceneItemList", &WSRequestHandler::GetSceneItemList }, { "SetSceneItemRender", &WSRequestHandler::SetSceneItemRender }, { "SetSceneItemPosition", &WSRequestHandler::SetSceneItemPosition }, { "SetSceneItemTransform", &WSRequestHandler::SetSceneItemTransform }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index a334a1a9..b15a89ec 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -69,6 +69,7 @@ class WSRequestHandler { RpcResponse RemoveSceneTransitionOverride(const RpcRequest&); RpcResponse GetSceneTransitionOverride(const RpcRequest&); + RpcResponse GetSceneItemList(const RpcRequest&); RpcResponse SetSceneItemRender(const RpcRequest&); RpcResponse SetSceneItemPosition(const RpcRequest&); RpcResponse SetSceneItemTransform(const RpcRequest&); diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index abff904f..4b446676 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -14,6 +14,73 @@ void AddSourceHelper(void *_data, obs_scene_t *scene) { obs_sceneitem_set_visible(data->sceneItem, data->setVisible); } +/** +* Get a list of all scene items in a scene. +* +* @param {String} `sceneName` Name of the scene to get the list of scene items from. +* +* @return {Array} `sceneItems` Array of scene items +* @return {int} `sceneItems.*.itemId` Unique item id of the source item +* @return {String} `sceneItems.*.sourceId` ID if the scene item's source. For example `vlc_source` or `image_source` +* @return {String} `sceneItems.*.sourceName` Name of the scene item's source +* @return {String} `sceneItems.*.sourceType` Type of the scene item's source. Either `input` or `scene` +* +* @api requests +* @name GetSceneItemList +* @category scene items +* @since unreleased +*/ +RpcResponse WSRequestHandler::GetSceneItemList(const RpcRequest& request) { + if (!request.hasField("sceneName")) { + return request.failed("missing request parameters"); + } + + const char* sceneName = obs_data_get_string(request.parameters(), "sceneName"); + OBSSourceAutoRelease sceneSource = obs_get_source_by_name(sceneName); + OBSScene scene = obs_scene_from_source(sceneSource); + if (!scene) { + return request.failed("requested scene is invalid or doesnt exist"); + } + + OBSDataArrayAutoRelease sceneItemArray = obs_data_array_create(); + + auto sceneItemEnumProc = [](obs_scene_t *, obs_sceneitem_t* item, void* privateData) -> bool { + obs_data_array_t* sceneItemArray = (obs_data_array_t*)privateData; + + OBSDataAutoRelease sceneItemData = obs_data_create(); + obs_data_set_int(sceneItemData, "itemId", obs_sceneitem_get_id(item)); + OBSSource source = obs_sceneitem_get_source(item); + obs_data_set_string(sceneItemData, "sourceId", obs_source_get_id(source)); + obs_data_set_string(sceneItemData, "sourceName", obs_source_get_name(source)); + + QString typeString = ""; + enum obs_source_type sourceType = obs_source_get_type(source); + switch (sourceType) { + case OBS_SOURCE_TYPE_INPUT: + typeString = "input"; + break; + + case OBS_SOURCE_TYPE_SCENE: + typeString = "scene"; + break; + + default: + typeString = "unknown"; + break; + } + obs_data_set_string(sceneItemData, "sourceType", typeString.toUtf8()); + + obs_data_array_push_back(sceneItemArray, sceneItemData); + return true; + }; + obs_scene_enum_items(scene, sceneItemEnumProc, sceneItemArray); + + OBSDataAutoRelease response = obs_data_create(); + obs_data_set_array(response, "sceneItems", sceneItemArray); + + return request.success(response); +} + /** * Gets the scene specific properties of the specified source item. * Coordinates are relative to the item's parent (the scene or group it belongs to). From 612bd9960c245cd0ee3e3ec5b4d672c98f2afff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 4 Jun 2020 10:14:58 +0200 Subject: [PATCH 079/178] readme: add TLS tunneling section --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/README.md b/README.md index 1c210f96..9fd2bb4a 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,50 @@ A web client and frontend made by [t2t2](https://github.com/t2t2/obs-tablet-remo It is **highly recommended** to protect obs-websocket with a password against unauthorized control. To do this, open the "Websocket server settings" dialog under OBS' "Tools" menu. In the settings dialogs, you can enable or disable authentication and set a password for it. +### Connecting over a TLS/secure connection (or remotely) + +**Before doing this, secure the WebSockets server first by enabling authentication with a strong password!** + +If you want to expose the WebSockets server of obs-websocket over a secure TLS connection (or to connect remotely), the easiest approach is to use a localhost tunneling service like [ngrok](https://ngrok.com/) or [pagekite](https://pagekite.net/). + +**Please bear in mind that doing this will expose your OBS instance to the open Internet and the security risks it implies. You've been warned!** + +#### ngrok + +[Install the ngrok CLI tool](https://ngrok.com/download), then start ngrok bound to port 4444 like this: + +```bash +ngrok http 4444 +``` + +The ngrok command will output something like this: + +``` +ngrok by @inconshreveable + +Tunnel Status online +Version 2.0/2.0 +Web Interface http://127.0.0.1:4040 +Forwarding http://TUNNEL_ID.ngrok.io -> localhost:4444 +Forwarding https://TUNNEL_ID.ngrok.io -> localhost:4444 +``` + +Where `TUNNEL_ID` is, as the name implies, the unique name of your ngrok tunnel. You'll get a new one every time you start ngrok. + +Then, use `wss://TUNNEL_ID.ngrok.io` to connect to obs-websocket over TLS. + +See the [ngrok documentation](https://ngrok.com/docs) for more tunneling options and settings. + +#### PageKite + +[Install the PageKite CLI tool](http://pagekite.net/downloads), then start PageKite bound to port 4444 like this (replace NAME with one of your choosing): + +```bash +$ python pagekite.py 4444 NAME.pagekite.me +``` + +Then, use `wss://NAME.pagekite.me` to connect to obs-websocket over TLS. + ### Possible use cases - Remote control OBS from a phone or tablet on the same local network From 1c58727ca973bb20e1d74c1556bf5314821a342c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20B=C3=A4rtschi?= Date: Thu, 4 Jun 2020 15:28:47 +0200 Subject: [PATCH 080/178] Change position datatype from int to double (as it is in OBS) --- src/WSRequestHandler_SceneItems.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index c1fd8522..8b91d4df 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -79,8 +79,8 @@ RpcResponse WSRequestHandler::GetSceneItemProperties(const RpcRequest& request) * @param {String | Object} `item` Scene Item name (if this field is a string) or specification (if it is an object). * @param {String (optional)} `item.name` Scene Item name (if the `item` field is an object) * @param {int (optional)} `item.id` Scene Item ID (if the `item` field is an object) -* @param {int (optional)} `position.x` The new x position of the source. -* @param {int (optional)} `position.y` The new y position of the source. +* @param {double (optional)} `position.x` The new x position of the source. +* @param {double (optional)} `position.y` The new y position of the source. * @param {int (optional)} `position.alignment` The new alignment of the source. * @param {double (optional)} `rotation` The new clockwise rotation of the item in degrees. * @param {double (optional)} `scale.x` The new x scale of the item. @@ -134,10 +134,10 @@ RpcResponse WSRequestHandler::SetSceneItemProperties(const RpcRequest& request) vec2 newPosition = oldPosition; if (obs_data_has_user_value(reqPosition, "x")) { - newPosition.x = obs_data_get_int(reqPosition, "x"); + newPosition.x = obs_data_get_double(reqPosition, "x"); } if (obs_data_has_user_value(reqPosition, "y")) { - newPosition.y = obs_data_get_int(reqPosition, "y"); + newPosition.y = obs_data_get_double(reqPosition, "y"); } if (obs_data_has_user_value(reqPosition, "alignment")) { From 948f6ccd956335253b177ee8a8dd2a9dda2e52e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20B=C3=A4rtschi?= Date: Thu, 4 Jun 2020 15:42:27 +0200 Subject: [PATCH 081/178] Also change all other occurrences and documentation where int was used for transform position --- src/Utils.cpp | 4 ++-- src/WSRequestHandler_SceneItems.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index dd5ad14a..ab301606 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -684,8 +684,8 @@ bool Utils::SetFilenameFormatting(const char* filenameFormatting) { /** * @typedef {Object} `SceneItemTransform` - * @property {int} `position.x` The x position of the scene item from the left. - * @property {int} `position.y` The y position of the scene item from the top. + * @property {double} `position.x` The x position of the scene item from the left. + * @property {double} `position.y` The y position of the scene item from the top. * @property {int} `position.alignment` The point on the scene item that the item is manipulated from. * @property {double} `rotation` The clockwise rotation of the scene item in degrees around the point of alignment. * @property {double} `scale.x` The x-scale factor of the scene item. diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index 8b91d4df..8c552431 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -13,8 +13,8 @@ * * @return {String} `name` Scene Item name. * @return {int} `itemId` Scene Item ID. -* @return {int} `position.x` The x position of the source from the left. -* @return {int} `position.y` The y position of the source from the top. +* @return {double} `position.x` The x position of the source from the left. +* @return {double} `position.y` The y position of the source from the top. * @return {int} `position.alignment` The point on the source that the item is manipulated from. * @return {double} `rotation` The clockwise rotation of the item in degrees around the point of alignment. * @return {double} `scale.x` The x-scale factor of the source. From 14d43ac05b946a3830955aada3daa3f5f73e9dd8 Mon Sep 17 00:00:00 2001 From: Curt Grimes Date: Mon, 29 Jun 2020 20:24:11 -0500 Subject: [PATCH 082/178] [Bug Fix] Reenable building with captions on MacOS OBS on MacOS supports closed caption encoding. The Windows-only dependencies [here](https://github.com/obsproject/obs-studio/blob/master/UI/frontend-plugins/frontend-tools/CMakeLists.txt#L73) are only related to audio capture, not closed caption encoding. --- CI/install-build-obs-macos.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/CI/install-build-obs-macos.sh b/CI/install-build-obs-macos.sh index 4af63b49..0dc610aa 100755 --- a/CI/install-build-obs-macos.sh +++ b/CI/install-build-obs-macos.sh @@ -34,6 +34,7 @@ git checkout $OBSLatestTag mkdir build && cd build echo "[obs-websocket] Building obs-studio.." cmake .. \ + -DBUILD_CAPTIONS=true \ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \ -DDISABLE_PLUGINS=true \ -DENABLE_SCRIPTING=0 \ From 822a1751a230893c0cbdbc0c8d5926fc7ca7a252 Mon Sep 17 00:00:00 2001 From: Matt Gajownik Date: Wed, 1 Jul 2020 17:21:52 +1000 Subject: [PATCH 083/178] requests: Add support for audio_active --- src/WSRequestHandler.cpp | 1 + src/WSRequestHandler.h | 1 + src/WSRequestHandler_Sources.cpp | 34 ++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 77411461..3ee2cbd8 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -95,6 +95,7 @@ const QHash WSRequestHandler::messageMap { { "ToggleMute", &WSRequestHandler::ToggleMute }, { "SetMute", &WSRequestHandler::SetMute }, { "GetMute", &WSRequestHandler::GetMute }, + { "GetAudioActive", &WSRequestHandler::GetAudioActive }, { "SetSourceName", &WSRequestHandler::SetSourceName }, { "SetSyncOffset", &WSRequestHandler::SetSyncOffset }, { "GetSyncOffset", &WSRequestHandler::GetSyncOffset }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index 2a33c8f4..7cdde364 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -112,6 +112,7 @@ class WSRequestHandler { RpcResponse ToggleMute(const RpcRequest&); RpcResponse SetMute(const RpcRequest&); RpcResponse GetMute(const RpcRequest&); + RpcResponse GetAudioActive(const RpcRequest&); RpcResponse SetSourceName(const RpcRequest&); RpcResponse SetSyncOffset(const RpcRequest&); RpcResponse GetSyncOffset(const RpcRequest&); diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 3a224205..6b1b2cec 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -341,6 +341,40 @@ RpcResponse WSRequestHandler::ToggleMute(const RpcRequest& request) return request.success(); } +/** +* Get the audio's active status of a specified source. +* +* @param {String} `sourceName` Source name. +* +* @return {boolean} `audioActive` Audio active status of the source. +* +* @api requests +* @name GetAudioActive +* @category sources +* @since 4.9.0 +*/ +RpcResponse WSRequestHandler::GetAudioActive(const RpcRequest& request) +{ + if (!request.hasField("sourceName")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + if (sourceName.isEmpty()) { + return request.failed("invalid request parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (!source) { + return request.failed("specified source doesn't exist"); + } + + OBSDataAutoRelease response = obs_data_create(); + obs_data_set_bool(response, "audioActive", obs_source_audio_active(source)); + + return request.success(response); +} + /** * Sets (aka rename) the name of a source. Also works with scenes since scenes are technically sources in OBS. * From fdcba2734d12a45bf690c00938f6ddc9a8eb53ab Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 28 Jun 2020 17:02:37 -0700 Subject: [PATCH 084/178] Events, Docs: Refactor media events and improve docs Move duplicated functionality to a helper function and added some docs clarifying the behavior of the events, and fixed a few typos in the request handlers. --- src/WSEvents.cpp | 96 ++++++++++++--------------- src/WSRequestHandler_MediaControl.cpp | 18 ++--- 2 files changed, 51 insertions(+), 63 deletions(-) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 92e1e1d2..0e20d989 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -425,6 +425,16 @@ QString WSEvents::getRecordingTimecode() { return Utils::nsToTimestamp(getRecordingTime()); } +OBSDataAutoRelease getMediaSourceData(calldata_t* data) { + OBSDataAutoRelease fields = obs_data_create(); + OBSSource source = calldata_get_pointer(data, "source"); + + obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); + obs_data_set_string(fields, "sourceTypeId", obs_source_get_id(source)); + + return fields; +} + /** * Indicates a scene change. * @@ -1359,7 +1369,10 @@ void WSEvents::OnSourceFilterOrderChanged(void* param, calldata_t* data) { /** * A media source has started playing. * + * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + * * @return {String} `sourceName` Source name + * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaPlaying @@ -1369,20 +1382,18 @@ void WSEvents::OnSourceFilterOrderChanged(void* param, calldata_t* data) { void WSEvents::OnMediaPlaying(void* param, calldata_t* data) { auto self = reinterpret_cast(param); - OBSSource source = calldata_get_pointer(data, "source"); - if (!source) { - return; - } + OBSDataAutoRelease fields = getMediaSourceData(data); - OBSDataAutoRelease fields = obs_data_create(); - obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); self->broadcastUpdate("MediaPlaying", fields); } /** * A media source has been paused. * + * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + * * @return {String} `sourceName` Source name + * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaPaused @@ -1392,20 +1403,18 @@ void WSEvents::OnMediaPlaying(void* param, calldata_t* data) { void WSEvents::OnMediaPaused(void* param, calldata_t* data) { auto self = reinterpret_cast(param); - OBSSource source = calldata_get_pointer(data, "source"); - if (!source) { - return; - } + OBSDataAutoRelease fields = getMediaSourceData(data); - OBSDataAutoRelease fields = obs_data_create(); - obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); self->broadcastUpdate("MediaPaused", fields); } /** * A media source has been restarted. * + * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + * * @return {String} `sourceName` Source name + * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaRestarted @@ -1415,20 +1424,18 @@ void WSEvents::OnMediaPaused(void* param, calldata_t* data) { void WSEvents::OnMediaRestarted(void* param, calldata_t* data) { auto self = reinterpret_cast(param); - OBSSource source = calldata_get_pointer(data, "source"); - if (!source) { - return; - } + OBSDataAutoRelease fields = getMediaSourceData(data); - OBSDataAutoRelease fields = obs_data_create(); - obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); self->broadcastUpdate("MediaRestarted", fields); } /** * A media source has been stopped. * + * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + * * @return {String} `sourceName` Source name + * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaStopped @@ -1438,20 +1445,18 @@ void WSEvents::OnMediaRestarted(void* param, calldata_t* data) { void WSEvents::OnMediaStopped(void* param, calldata_t* data) { auto self = reinterpret_cast(param); - OBSSource source = calldata_get_pointer(data, "source"); - if (!source) { - return; - } + OBSDataAutoRelease fields = getMediaSourceData(data); - OBSDataAutoRelease fields = obs_data_create(); - obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); self->broadcastUpdate("MediaStopped", fields); } /** * A media source has gone to the next item in the playlist. * + * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + * * @return {String} `sourceName` Source name + * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaNext @@ -1461,20 +1466,18 @@ void WSEvents::OnMediaStopped(void* param, calldata_t* data) { void WSEvents::OnMediaNext(void* param, calldata_t* data) { auto self = reinterpret_cast(param); - OBSSource source = calldata_get_pointer(data, "source"); - if (!source) { - return; - } + OBSDataAutoRelease fields = getMediaSourceData(data); - OBSDataAutoRelease fields = obs_data_create(); - obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); self->broadcastUpdate("MediaNext", fields); } /** * A media source has gone to the previous item in the playlist. * + * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + * * @return {String} `sourceName` Source name + * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaPrevious @@ -1484,23 +1487,18 @@ void WSEvents::OnMediaNext(void* param, calldata_t* data) { void WSEvents::OnMediaPrevious(void* param, calldata_t* data) { auto self = reinterpret_cast(param); - OBSSource source = calldata_get_pointer(data, "source"); - if (!source) { - return; - } + OBSDataAutoRelease fields = getMediaSourceData(data); - OBSDataAutoRelease fields = obs_data_create(); - obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); self->broadcastUpdate("MediaPrevious", fields); } /** - * A media source has been started. (Does not mean that it is playing. See [`MediaPlaying`](#mediaplaying)) - * - * Note: For VLC, this means that the source and therefore playlist has started. - * For the normal Media Source, this just means that the source has been started. + * A media source has been started. + * + * Note: These events are emitted by the OBS sources themselves. For example when the media file starts playing. The behavior depends on the type of media source being used. * * @return {String} `sourceName` Source name + * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaStarted @@ -1510,23 +1508,18 @@ void WSEvents::OnMediaPrevious(void* param, calldata_t* data) { void WSEvents::OnMediaStarted(void* param, calldata_t* data) { auto self = reinterpret_cast(param); - OBSSource source = calldata_get_pointer(data, "source"); - if (!source) { - return; - } + OBSDataAutoRelease fields = getMediaSourceData(data); - OBSDataAutoRelease fields = obs_data_create(); - obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); self->broadcastUpdate("MediaStarted", fields); } /** * A media source has ended. * - * Note: For VLC, this means that the source and therefore playlist has ended. - * For the normal Media Source, this just means that the source has been stopped/ended. + * Note: These events are emitted by the OBS sources themselves. For example when the media file ends. The behavior depends on the type of media source being used. * * @return {String} `sourceName` Source name + * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaEnded @@ -1536,13 +1529,8 @@ void WSEvents::OnMediaStarted(void* param, calldata_t* data) { void WSEvents::OnMediaEnded(void* param, calldata_t* data) { auto self = reinterpret_cast(param); - OBSSource source = calldata_get_pointer(data, "source"); - if (!source) { - return; - } + OBSDataAutoRelease fields = getMediaSourceData(data); - OBSDataAutoRelease fields = obs_data_create(); - obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); self->broadcastUpdate("MediaEnded", fields); } diff --git a/src/WSRequestHandler_MediaControl.cpp b/src/WSRequestHandler_MediaControl.cpp index ea754c6a..ba61c17f 100644 --- a/src/WSRequestHandler_MediaControl.cpp +++ b/src/WSRequestHandler_MediaControl.cpp @@ -218,7 +218,7 @@ RpcResponse WSRequestHandler::GetMediaDuration(const RpcRequest& request) { } OBSDataAutoRelease response = obs_data_create(); - obs_data_set_int(response, "timeStamp", obs_source_media_get_duration(source)); + obs_data_set_int(response, "mediaDuration", obs_source_media_get_duration(source)); return request.success(response); } @@ -227,7 +227,7 @@ RpcResponse WSRequestHandler::GetMediaDuration(const RpcRequest& request) { * * @param {String} `sourceName` Source name. * -* @return {int} `timeStamp` The time in milliseconds since the start of the media. +* @return {int} `timestamp` The time in milliseconds since the start of the media. * * @api requests * @name GetMediaTime @@ -250,7 +250,7 @@ RpcResponse WSRequestHandler::GetMediaTime(const RpcRequest& request) { } OBSDataAutoRelease response = obs_data_create(); - obs_data_set_int(response, "timeStamp", obs_source_media_get_time(source)); + obs_data_set_int(response, "timestamp", obs_source_media_get_time(source)); return request.success(response); } @@ -258,7 +258,7 @@ RpcResponse WSRequestHandler::GetMediaTime(const RpcRequest& request) { * Set the timestamp of a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) * * @param {String} `sourceName` Source name. -* @param {int} `timeStamp` Milliseconds to set the timestamp to. +* @param {int} `timestamp` Milliseconds to set the timestamp to. * * @api requests * @name SetMediaTime @@ -266,12 +266,12 @@ RpcResponse WSRequestHandler::GetMediaTime(const RpcRequest& request) { * @since 4.9.0 */ RpcResponse WSRequestHandler::SetMediaTime(const RpcRequest& request) { - if (!request.hasField("sourceName") || !request.hasField("timeStamp")) { + if (!request.hasField("sourceName") || !request.hasField("timestamp")) { return request.failed("missing request parameters"); } QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); - int64_t timeStamp = (int64_t)obs_data_get_int(request.parameters(), "timeStamp"); + int64_t timestamp = (int64_t)obs_data_get_int(request.parameters(), "timestamp"); if (sourceName.isEmpty()) { return request.failed("invalid request parameters"); } @@ -281,7 +281,7 @@ RpcResponse WSRequestHandler::SetMediaTime(const RpcRequest& request) { return request.failed("specified source doesn't exist"); } - obs_source_media_set_time(source, timeStamp); + obs_source_media_set_time(source, timestamp); return request.success(); } @@ -374,7 +374,7 @@ RpcResponse WSRequestHandler::GetMediaSourcesList(const RpcRequest& request) auto sourceEnumProc = [](void* privateData, obs_source_t* source) -> bool { obs_data_array_t* sourcesArray = (obs_data_array_t*)privateData; - + QString sourceTypeId = obs_source_get_id(source); if (isMediaSource(sourceTypeId)) { OBSDataAutoRelease sourceData = obs_data_create(); @@ -393,4 +393,4 @@ RpcResponse WSRequestHandler::GetMediaSourcesList(const RpcRequest& request) OBSDataAutoRelease response = obs_data_create(); obs_data_set_array(response, "mediaSources", sourcesArray); return request.success(response); -} \ No newline at end of file +} From 4ead1c3de5b959c6e54e2cfbedc8843c87968e88 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 1 Jul 2020 04:47:28 -0700 Subject: [PATCH 085/178] Requests: Add Replay Buffer and Recording Statuses Adds `GetReplayBufferStatus` and `GetRecordingStatus`. v5.0 Will remove the recording status functionality from `GetStreamingStatus` --- src/WSRequestHandler.cpp | 2 ++ src/WSRequestHandler.h | 2 ++ src/WSRequestHandler_Recording.cpp | 29 +++++++++++++++++++++++++++ src/WSRequestHandler_ReplayBuffer.cpp | 20 ++++++++++++++++++ 4 files changed, 53 insertions(+) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 77411461..83cd4041 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -70,11 +70,13 @@ const QHash WSRequestHandler::messageMap { { "StartStreaming", &WSRequestHandler::StartStreaming }, { "StopStreaming", &WSRequestHandler::StopStreaming }, + { "GetRecordingStatus", &WSRequestHandler::GetRecordingStatus }, { "StartRecording", &WSRequestHandler::StartRecording }, { "StopRecording", &WSRequestHandler::StopRecording }, { "PauseRecording", &WSRequestHandler::PauseRecording }, { "ResumeRecording", &WSRequestHandler::ResumeRecording }, + { "GetReplayBufferStatus", &WSRequestHandler::GetReplayBufferStatus }, { "StartStopReplayBuffer", &WSRequestHandler::StartStopReplayBuffer }, { "StartReplayBuffer", &WSRequestHandler::StartReplayBuffer }, { "StopReplayBuffer", &WSRequestHandler::StopReplayBuffer }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index 2a33c8f4..d87bc803 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -87,11 +87,13 @@ class WSRequestHandler { RpcResponse StartStreaming(const RpcRequest&); RpcResponse StopStreaming(const RpcRequest&); + RpcResponse GetRecordingStatus(const RpcRequest&); RpcResponse StartRecording(const RpcRequest&); RpcResponse StopRecording(const RpcRequest&); RpcResponse PauseRecording(const RpcRequest&); RpcResponse ResumeRecording(const RpcRequest&); + RpcResponse GetReplayBufferStatus(const RpcRequest&); RpcResponse StartStopReplayBuffer(const RpcRequest&); RpcResponse StartReplayBuffer(const RpcRequest&); RpcResponse StopReplayBuffer(const RpcRequest&); diff --git a/src/WSRequestHandler_Recording.cpp b/src/WSRequestHandler_Recording.cpp index df2ed4a0..d58f60c7 100644 --- a/src/WSRequestHandler_Recording.cpp +++ b/src/WSRequestHandler_Recording.cpp @@ -1,8 +1,10 @@ +#include "obs-websocket.h" #include "WSRequestHandler.h" #include #include #include "Utils.h" +#include "WSEvents.h" RpcResponse ifCanPause(const RpcRequest& request, std::function callback) { @@ -13,6 +15,33 @@ RpcResponse ifCanPause(const RpcRequest& request, std::function c return callback(); } + /** + * Get current recording status. + * + * @return {boolean} `isRecording` Current recording status. + * @return {boolean} `isRecordingPaused` Whether the recording is paused or not. + * @return {String (optional)} `recordTimecode` Time elapsed since recording started (only present if currently recording). + * + * @api requests + * @name GetRecordingStatus + * @category recording + * @since unreleased + */ +RpcResponse WSRequestHandler::GetRecordingStatus(const RpcRequest& request) { + auto events = GetEventsSystem(); + + OBSDataAutoRelease data = obs_data_create(); + obs_data_set_bool(data, "isRecording", obs_frontend_recording_active()); + obs_data_set_bool(data, "isRecordingPaused", obs_frontend_recording_paused()); + + if (obs_frontend_recording_active()) { + QString recordingTimecode = events->getRecordingTimecode(); + obs_data_set_string(data, "recordTimecode", recordingTimecode.toUtf8().constData()); + } + + return request.success(data); +} + /** * Toggle recording on or off. * diff --git a/src/WSRequestHandler_ReplayBuffer.cpp b/src/WSRequestHandler_ReplayBuffer.cpp index 510b8f05..be860584 100644 --- a/src/WSRequestHandler_ReplayBuffer.cpp +++ b/src/WSRequestHandler_ReplayBuffer.cpp @@ -1,7 +1,27 @@ +#include "obs-websocket.h" +#include "WSEvents.h" #include "Utils.h" #include "WSRequestHandler.h" + + /** + * Get the status of the OBS replay buffer. + * + * @return {boolean} `isReplayBufferActive` Current recording status. + * + * @api requests + * @name GetReplayBufferStatus + * @category replay buffer + * @since unreleased + */ +RpcResponse WSRequestHandler::GetReplayBufferStatus(const RpcRequest& request) { + OBSDataAutoRelease data = obs_data_create(); + obs_data_set_bool(data, "isReplayBufferActive", obs_frontend_replay_buffer_active()); + + return request.success(data); +} + /** * Toggle the Replay Buffer on/off. * From bd18aee43c32161881e669c679794c8642c20299 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 28 May 2020 17:00:03 -0700 Subject: [PATCH 086/178] Docs: Update issue template to be **better** --- .github/ISSUE_TEMPLATE.md | 14 +++++++++----- CONTRIBUTING.md | 9 +++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 8c118039..215d0d54 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,16 +1,20 @@ ##### Issue type -Bug report? Feature request? Other? + + + + ##### Description -*Replace this with a description of the bug encountered or feature requested.* + ##### Steps to reproduce and other useful info -*If it's a bug, please describe the steps to reproduce it and PLEASE include an OBS log file. Otherwise, remove this section.* + ##### Technical information - **Operating System** : - **OBS Studio version** : +- **obs-websocket version** : ##### Development Environment -*If you're trying to compile obs-websocket, please describe your compiler type and version (e.g: GCC 4.7, VC2013, ...), and the CMake settings used. -Remove this section if it doesn't apply to your case.* + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1931c0c6..8cd655c1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,13 +12,13 @@ Localization happens on [Crowdin](https://crowdin.com/project/obs-websocket) ### Code Formatting Guidelines -- Function and variable names: snake_case for C names, MixedCaps for C++ names +- Function and variable names: snake_case for C names, camelCase for C++ method names - Request and Event names should use MixedCaps names - Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) -- Tabs are 8 columns wide +- Code is indented with Tabs. Assume they are 8 columns wide - 80 columns max code width. (Docs can be larger) @@ -43,6 +43,11 @@ if (!success) { return req->SendOKResponse(); ``` +- Some example common response/request property names are: + - `sceneName` - The name of a scene + - `sourceName` - The name of a source + - `fromScene` - From a scene - scene name + ### Commit Guidelines - Commits follow the 50/72 standard: From d03e94ada84fb2db461abf629ce10f43d02cdd7b Mon Sep 17 00:00:00 2001 From: Matt Gajownik Date: Wed, 1 Jul 2020 17:22:09 +1000 Subject: [PATCH 087/178] events: Add support for audio_active, fix docs version --- src/WSEvents.cpp | 50 ++++++++++++++++++++++++++++++++ src/WSEvents.h | 2 ++ src/WSRequestHandler_Sources.cpp | 2 +- 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 50bea131..726ab883 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -271,6 +271,8 @@ void WSEvents::connectSourceSignals(obs_source_t* source) { signal_handler_connect(sh, "volume", OnSourceVolumeChange, this); signal_handler_connect(sh, "audio_sync", OnSourceAudioSyncOffsetChanged, this); signal_handler_connect(sh, "audio_mixers", OnSourceAudioMixersChanged, this); + signal_handler_connect(sh, "audio_activate", OnSourceAudioActivated, this); + signal_handler_connect(sh, "audio_deactivate", OnSourceAudioDeactivated, this); signal_handler_connect(sh, "filter_add", OnSourceFilterAdded, this); signal_handler_connect(sh, "filter_remove", OnSourceFilterRemoved, this); @@ -303,6 +305,8 @@ void WSEvents::disconnectSourceSignals(obs_source_t* source) { signal_handler_disconnect(sh, "volume", OnSourceVolumeChange, this); signal_handler_disconnect(sh, "audio_sync", OnSourceAudioSyncOffsetChanged, this); signal_handler_disconnect(sh, "audio_mixers", OnSourceAudioMixersChanged, this); + signal_handler_disconnect(sh, "audio_activate", OnSourceAudioActivated, this); + signal_handler_disconnect(sh, "audio_deactivate", OnSourceAudioDeactivated, this); signal_handler_disconnect(sh, "filter_add", OnSourceFilterAdded, this); signal_handler_disconnect(sh, "filter_remove", OnSourceFilterRemoved, this); @@ -1098,6 +1102,52 @@ void WSEvents::OnSourceMuteStateChange(void* param, calldata_t* data) { self->broadcastUpdate("SourceMuteStateChanged", fields); } +/** + * A source has removed audio. + * + * @return {String} `sourceName` Source name + * + * @api events + * @name SourceAudioDeactivated + * @category sources + * @since unreleased + */ +void WSEvents::OnSourceAudioDeactivated(void* param, calldata_t* data) { + auto self = reinterpret_cast(param); + + OBSSource source = calldata_get_pointer(data, "source"); + if (!source) { + return; + } + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); + self->broadcastUpdate("SourceAudioDeactivated", fields); +} + +/** + * A source has added audio. + * + * @return {String} `sourceName` Source name + * + * @api events + * @name SourceAudioActivated + * @category sources + * @since unreleased + */ +void WSEvents::OnSourceAudioActivated(void* param, calldata_t* data) { + auto self = reinterpret_cast(param); + + OBSSource source = calldata_get_pointer(data, "source"); + if (!source) { + return; + } + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); + self->broadcastUpdate("SourceAudioActivated", fields); +} + /** * The audio sync offset of a source has changed. * diff --git a/src/WSEvents.h b/src/WSEvents.h index 06ce7f2c..a7c3d24b 100644 --- a/src/WSEvents.h +++ b/src/WSEvents.h @@ -126,6 +126,8 @@ private: static void OnSourceMuteStateChange(void* param, calldata_t* data); static void OnSourceAudioSyncOffsetChanged(void* param, calldata_t* data); static void OnSourceAudioMixersChanged(void* param, calldata_t* data); + static void OnSourceAudioActivated(void* param, calldata_t* data); + static void OnSourceAudioDeactivated(void* param, calldata_t* data); static void OnSourceRename(void* param, calldata_t* data); diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 6b1b2cec..30ba61a9 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -351,7 +351,7 @@ RpcResponse WSRequestHandler::ToggleMute(const RpcRequest& request) * @api requests * @name GetAudioActive * @category sources -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::GetAudioActive(const RpcRequest& request) { From 4f83b7373204167131737f86fa752a40524a57eb Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 3 Jul 2020 06:14:41 -0700 Subject: [PATCH 088/178] Docs: Move ssl tunnelling guide to its own page [skip ci] Having the SSL tunneling instructions on the README caused clutter and was unnecessary. --- README.md | 50 ++++++----------------------------------------- SSL-TUNNELLING.md | 45 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 44 deletions(-) create mode 100644 SSL-TUNNELLING.md diff --git a/README.md b/README.md index 76af15d7..074c30de 100644 --- a/README.md +++ b/README.md @@ -20,50 +20,6 @@ A web client and frontend made by [t2t2](https://github.com/t2t2/obs-tablet-remo It is **highly recommended** to protect obs-websocket with a password against unauthorized control. To do this, open the "Websocket server settings" dialog under OBS' "Tools" menu. In the settings dialogs, you can enable or disable authentication and set a password for it. -### Connecting over a TLS/secure connection (or remotely) - -**Before doing this, secure the WebSockets server first by enabling authentication with a strong password!** - -If you want to expose the WebSockets server of obs-websocket over a secure TLS connection (or to connect remotely), the easiest approach is to use a localhost tunneling service like [ngrok](https://ngrok.com/) or [pagekite](https://pagekite.net/). - -**Please bear in mind that doing this will expose your OBS instance to the open Internet and the security risks it implies. You've been warned!** - -#### ngrok - -[Install the ngrok CLI tool](https://ngrok.com/download), then start ngrok bound to port 4444 like this: - -```bash -ngrok http 4444 -``` - -The ngrok command will output something like this: - -``` -ngrok by @inconshreveable - -Tunnel Status online -Version 2.0/2.0 -Web Interface http://127.0.0.1:4040 -Forwarding http://TUNNEL_ID.ngrok.io -> localhost:4444 -Forwarding https://TUNNEL_ID.ngrok.io -> localhost:4444 -``` - -Where `TUNNEL_ID` is, as the name implies, the unique name of your ngrok tunnel. You'll get a new one every time you start ngrok. - -Then, use `wss://TUNNEL_ID.ngrok.io` to connect to obs-websocket over TLS. - -See the [ngrok documentation](https://ngrok.com/docs) for more tunneling options and settings. - -#### PageKite - -[Install the PageKite CLI tool](http://pagekite.net/downloads), then start PageKite bound to port 4444 like this (replace NAME with one of your choosing): - -```bash -$ python pagekite.py 4444 NAME.pagekite.me -``` - -Then, use `wss://NAME.pagekite.me` to connect to obs-websocket over TLS. - ### Possible use cases - Remote control OBS from a phone or tablet on the same local network @@ -87,6 +43,12 @@ Here's a list of available language APIs for obs-websocket : I'd like to know what you're building with or for obs-websocket. If you do something in this fashion, feel free to drop a message in `#project-showoff` in the [discord server!](https://discord.gg/WBaSQ3A) +### Securing obs-websocket (via TLS/SSL) + +If you are intending to use obs-websocket outside of a LAN environment, it is highly recommended to secure the connection using a tunneling service. + +See the SSL [tunnelling guide](SSL-TUNNELLING.md) for easy instructions on how to encrypt your websocket connection. + ## Compiling obs-websocket See the [build instructions](BUILDING.md). diff --git a/SSL-TUNNELLING.md b/SSL-TUNNELLING.md new file mode 100644 index 00000000..b841e711 --- /dev/null +++ b/SSL-TUNNELLING.md @@ -0,0 +1,45 @@ +# Connecting over a TLS/secure connection (or remotely) + +If you want to expose the WebSocket server of obs-websocket over a secure TLS connection (or to connect remotely), the easiest approach is to use a localhost tunneling service like [ngrok](https://ngrok.com/) or [pagekite](https://pagekite.net/). + +**Before doing this, secure the WebSocket server first by enabling authentication with a strong password!** + +**Please bear in mind that doing this will expose your OBS instance to the open Internet and the security risks it implies. *You've been warned!*** + + +## ngrok + +[Install the ngrok CLI tool](https://ngrok.com/download) on a linux OS, then start ngrok bound to port 4444 like this: + +```bash +ngrok http 4444 +``` + +The ngrok command will output something like this: + +```text +ngrok by @inconshreveable + +Tunnel Status online +Version 2.0/2.0 +Web Interface http://127.0.0.1:4040 +Forwarding http://TUNNEL_ID.ngrok.io -> localhost:4444 +Forwarding https://TUNNEL_ID.ngrok.io -> localhost:4444 +``` + +Where `TUNNEL_ID` is, as the name implies, the unique name of your ngrok tunnel. You'll get a new one every time you start ngrok. + +Then, use `wss://TUNNEL_ID.ngrok.io` to connect to obs-websocket over TLS. + +See the [ngrok documentation](https://ngrok.com/docs) for more tunneling options and settings. + + +## PageKite + +[Install the PageKite CLI tool](http://pagekite.net/downloads), then start PageKite bound to port 4444 like this (replace NAME with one of your choosing): + +```bash +python pagekite.py 4444 NAME.pagekite.me +``` + +Then, use `wss://NAME.pagekite.me` to connect to obs-websocket over TLS. From 802cc3a48f3efe824192feddb70cdec08d031314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 3 Jul 2020 15:48:56 +0200 Subject: [PATCH 089/178] Apply suggestions from code review --- src/WSRequestHandler_MediaControl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WSRequestHandler_MediaControl.cpp b/src/WSRequestHandler_MediaControl.cpp index ba61c17f..bb01ff81 100644 --- a/src/WSRequestHandler_MediaControl.cpp +++ b/src/WSRequestHandler_MediaControl.cpp @@ -360,7 +360,7 @@ RpcResponse WSRequestHandler::GetMediaState(const RpcRequest& request) { * * @return {Array} `mediaSources` Array of sources * @return {String} `mediaSources.*.sourceName` Unique source name -* @return {String} `mediaSources.*.sourceTypeId` Non-unique source internal type (a.k.a `ffmpeg_source` or `vlc_source`) +* @return {String} `mediaSources.*.sourceKind` Unique source internal type (a.k.a `ffmpeg_source` or `vlc_source`) * @return {String} `mediaSources.*.mediaState` The current state of media for that source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error`, `unknown` * * @api requests @@ -379,7 +379,7 @@ RpcResponse WSRequestHandler::GetMediaSourcesList(const RpcRequest& request) if (isMediaSource(sourceTypeId)) { OBSDataAutoRelease sourceData = obs_data_create(); obs_data_set_string(sourceData, "sourceName", obs_source_get_name(source)); - obs_data_set_string(sourceData, "sourceTypeId", sourceTypeId.toUtf8()); + obs_data_set_string(sourceData, "sourceKind", sourceTypeId.toUtf8()); QString mediaState = getSourceMediaState(source); obs_data_set_string(sourceData, "mediaState", mediaState.toUtf8()); From 38936173d1d005a480846446f056de44708ecf4b Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 3 Jul 2020 07:03:25 -0700 Subject: [PATCH 090/178] Requests/Events: Use sourceKind instead of sourceTypeId Left in some old terms accidentally. This fixes it. --- src/WSEvents.cpp | 18 +++++++++--------- src/WSRequestHandler_MediaControl.cpp | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index c9b701b1..0f467d9c 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -434,7 +434,7 @@ OBSDataAutoRelease getMediaSourceData(calldata_t* data) { OBSSource source = calldata_get_pointer(data, "source"); obs_data_set_string(fields, "sourceName", obs_source_get_name(source)); - obs_data_set_string(fields, "sourceTypeId", obs_source_get_id(source)); + obs_data_set_string(fields, "sourceKind", obs_source_get_id(source)); return fields; } @@ -1422,7 +1422,7 @@ void WSEvents::OnSourceFilterOrderChanged(void* param, calldata_t* data) { * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. * * @return {String} `sourceName` Source name - * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) + * @return {String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaPlaying @@ -1443,7 +1443,7 @@ void WSEvents::OnMediaPlaying(void* param, calldata_t* data) { * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. * * @return {String} `sourceName` Source name - * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) + * @return {String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaPaused @@ -1464,7 +1464,7 @@ void WSEvents::OnMediaPaused(void* param, calldata_t* data) { * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. * * @return {String} `sourceName` Source name - * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) + * @return {String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaRestarted @@ -1485,7 +1485,7 @@ void WSEvents::OnMediaRestarted(void* param, calldata_t* data) { * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. * * @return {String} `sourceName` Source name - * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) + * @return {String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaStopped @@ -1506,7 +1506,7 @@ void WSEvents::OnMediaStopped(void* param, calldata_t* data) { * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. * * @return {String} `sourceName` Source name - * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) + * @return {String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaNext @@ -1527,7 +1527,7 @@ void WSEvents::OnMediaNext(void* param, calldata_t* data) { * Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. * * @return {String} `sourceName` Source name - * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) + * @return {String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaPrevious @@ -1548,7 +1548,7 @@ void WSEvents::OnMediaPrevious(void* param, calldata_t* data) { * Note: These events are emitted by the OBS sources themselves. For example when the media file starts playing. The behavior depends on the type of media source being used. * * @return {String} `sourceName` Source name - * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) + * @return {String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaStarted @@ -1569,7 +1569,7 @@ void WSEvents::OnMediaStarted(void* param, calldata_t* data) { * Note: These events are emitted by the OBS sources themselves. For example when the media file ends. The behavior depends on the type of media source being used. * * @return {String} `sourceName` Source name - * @return {String} `sourceTypeId` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) + * @return {String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) * * @api events * @name MediaEnded diff --git a/src/WSRequestHandler_MediaControl.cpp b/src/WSRequestHandler_MediaControl.cpp index bb01ff81..1b7a73bf 100644 --- a/src/WSRequestHandler_MediaControl.cpp +++ b/src/WSRequestHandler_MediaControl.cpp @@ -375,11 +375,11 @@ RpcResponse WSRequestHandler::GetMediaSourcesList(const RpcRequest& request) auto sourceEnumProc = [](void* privateData, obs_source_t* source) -> bool { obs_data_array_t* sourcesArray = (obs_data_array_t*)privateData; - QString sourceTypeId = obs_source_get_id(source); - if (isMediaSource(sourceTypeId)) { + QString sourceKind = obs_source_get_id(source); + if (isMediaSource(sourceKind)) { OBSDataAutoRelease sourceData = obs_data_create(); obs_data_set_string(sourceData, "sourceName", obs_source_get_name(source)); - obs_data_set_string(sourceData, "sourceKind", sourceTypeId.toUtf8()); + obs_data_set_string(sourceData, "sourceKind", sourceKind.toUtf8()); QString mediaState = getSourceMediaState(source); obs_data_set_string(sourceData, "mediaState", mediaState.toUtf8()); From 513bd1372be20c3a2df3e3f107ce8a36eefc475c Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 3 Jul 2020 07:12:28 -0700 Subject: [PATCH 091/178] Docs, Requests: Fix GetSceneItemList code revisions Replace the `sourceId` term with `sourceKind` to match everything else. --- src/WSRequestHandler_SceneItems.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index 01b56789..96ed3f6a 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -21,10 +21,10 @@ void AddSourceHelper(void *_data, obs_scene_t *scene) { * * @return {Array} `sceneItems` Array of scene items * @return {int} `sceneItems.*.itemId` Unique item id of the source item -* @return {String} `sceneItems.*.sourceId` ID if the scene item's source. For example `vlc_source` or `image_source` +* @return {String} `sceneItems.*.sourceKind` ID if the scene item's source. For example `vlc_source` or `image_source` * @return {String} `sceneItems.*.sourceName` Name of the scene item's source -* @return {String} `sceneItems.*.sourceType` Type of the scene item's source. Either `input` or `scene` -* +* @return {String} `sceneItems.*.sourceType` Type of the scene item's source. Either `input`, `group`, or `scene` +* * @api requests * @name GetSceneItemList * @category scene items @@ -50,7 +50,7 @@ RpcResponse WSRequestHandler::GetSceneItemList(const RpcRequest& request) { OBSDataAutoRelease sceneItemData = obs_data_create(); obs_data_set_int(sceneItemData, "itemId", obs_sceneitem_get_id(item)); OBSSource source = obs_sceneitem_get_source(item); - obs_data_set_string(sceneItemData, "sourceId", obs_source_get_id(source)); + obs_data_set_string(sceneItemData, "sourceKind", obs_source_get_id(source)); obs_data_set_string(sceneItemData, "sourceName", obs_source_get_name(source)); QString typeString = ""; @@ -654,7 +654,7 @@ RpcResponse WSRequestHandler::AddSceneItem(const RpcRequest& request) { if (!source) { return request.failed("requested source does not exist"); } - + if (source == sceneSource) { return request.failed("you cannot add a scene as a sceneitem to itself"); } @@ -671,7 +671,7 @@ RpcResponse WSRequestHandler::AddSceneItem(const RpcRequest& request) { obs_leave_graphics(); OBSDataAutoRelease responseData = obs_data_create(); - obs_data_set_int(responseData, "itemID", obs_sceneitem_get_id(data.sceneItem)); + obs_data_set_int(responseData, "itemId", obs_sceneitem_get_id(data.sceneItem)); return request.success(responseData); } From bfa6cd0e19530e4d866448c6249ceda4c66a338b Mon Sep 17 00:00:00 2001 From: Juliane Holzt Date: Thu, 9 Jul 2020 00:43:54 +0200 Subject: [PATCH 092/178] TakeSourceScreenshot: default to current scene --- src/WSRequestHandler_Sources.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 6287783f..85471581 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -1623,7 +1623,7 @@ RpcResponse WSRequestHandler::SetAudioMonitorType(const RpcRequest& request) * Clients can specify `width` and `height` parameters to receive scaled pictures. Aspect ratio is * preserved if only one of these two parameters is specified. * -* @param {String} `sourceName` Source name. Note that, since scenes are also sources, you can also provide a scene name. +* @param {String} `sourceName` Source name. Note that, since scenes are also sources, you can also provide a scene name. If an empty string is provided, the currently active scene is used. * @param {String (optional)} `embedPictureFormat` Format of the Data URI encoded picture. Can be "png", "jpg", "jpeg" or "bmp" (or any other value supported by Qt's Image module) * @param {String (optional)} `saveToFilePath` Full file path (file extension included) where the captured image is to be saved. Can be in a format different from `pictureFormat`. Can be a relative path. * @param {String (optional)} `fileFormat` Format to save the image file as (one of the values provided in the `supported-image-export-formats` response field of `GetVersion`). If not specified, tries to guess based on file extension. @@ -1650,7 +1650,14 @@ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) { } const char* sourceName = obs_data_get_string(request.parameters(), "sourceName"); - OBSSourceAutoRelease source = obs_get_source_by_name(sourceName); + + OBSSourceAutoRelease source; + if (strlen(sourceName) == 0) { + source = obs_frontend_get_current_scene(); + } else { + source = obs_get_source_by_name(sourceName); + } + if (!source) { return request.failed("specified source doesn't exist");; } From 31a505f4a455d42dca1f96af009689de78b56cb6 Mon Sep 17 00:00:00 2001 From: Juliane Holzt Date: Thu, 9 Jul 2020 00:50:29 +0200 Subject: [PATCH 093/178] Do it when sourceName is omitted --- src/WSRequestHandler_Sources.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 85471581..d8cfebee 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -1623,7 +1623,7 @@ RpcResponse WSRequestHandler::SetAudioMonitorType(const RpcRequest& request) * Clients can specify `width` and `height` parameters to receive scaled pictures. Aspect ratio is * preserved if only one of these two parameters is specified. * -* @param {String} `sourceName` Source name. Note that, since scenes are also sources, you can also provide a scene name. If an empty string is provided, the currently active scene is used. +* @param {String (optional)} `sourceName` Source name. Note that, since scenes are also sources, you can also provide a scene name. If not provided, the currently active scene is used. * @param {String (optional)} `embedPictureFormat` Format of the Data URI encoded picture. Can be "png", "jpg", "jpeg" or "bmp" (or any other value supported by Qt's Image module) * @param {String (optional)} `saveToFilePath` Full file path (file extension included) where the captured image is to be saved. Can be in a format different from `pictureFormat`. Can be a relative path. * @param {String (optional)} `fileFormat` Format to save the image file as (one of the values provided in the `supported-image-export-formats` response field of `GetVersion`). If not specified, tries to guess based on file extension. @@ -1641,25 +1641,19 @@ RpcResponse WSRequestHandler::SetAudioMonitorType(const RpcRequest& request) * @since 4.6.0 */ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) { - if (!request.hasField("sourceName")) { - return request.failed("missing request parameters"); - } - if (!request.hasField("embedPictureFormat") && !request.hasField("saveToFilePath")) { return request.failed("At least 'embedPictureFormat' or 'saveToFilePath' must be specified"); } - const char* sourceName = obs_data_get_string(request.parameters(), "sourceName"); - OBSSourceAutoRelease source; - if (strlen(sourceName) == 0) { + if (!request.hasField("sourceName")) { source = obs_frontend_get_current_scene(); } else { + const char* sourceName = obs_data_get_string(request.parameters(), "sourceName"); source = obs_get_source_by_name(sourceName); - } - - if (!source) { - return request.failed("specified source doesn't exist");; + if (!source) { + return request.failed("specified source doesn't exist");; + } } const uint32_t sourceWidth = obs_source_get_base_width(source); From 9cdb32d56ae93520fdfb66c4ce75209d270b19cb Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 8 Jul 2020 03:19:15 -0700 Subject: [PATCH 094/178] Docs: Various docs improvements I noticed that some parts of the docs were inconsistent/lacking. Decided to go through all of them and update them. --- docs/partials/introduction.md | 4 +++- docs/partials/requestsHeader.md | 2 +- src/WSEvents.cpp | 19 ++++++++++-------- src/WSRequestHandler_General.cpp | 11 ++++++----- src/WSRequestHandler_Outputs.cpp | 8 ++++++-- src/WSRequestHandler_Profiles.cpp | 5 +++-- src/WSRequestHandler_Recording.cpp | 2 +- src/WSRequestHandler_ReplayBuffer.cpp | 2 +- src/WSRequestHandler_SceneCollections.cpp | 3 ++- src/WSRequestHandler_SceneItems.cpp | 1 - src/WSRequestHandler_Scenes.cpp | 24 +++++++++++------------ src/WSRequestHandler_Sources.cpp | 10 +++++----- src/WSRequestHandler_Streaming.cpp | 3 +-- src/WSRequestHandler_StudioMode.cpp | 2 +- 14 files changed, 53 insertions(+), 43 deletions(-) diff --git a/docs/partials/introduction.md b/docs/partials/introduction.md index c63a52cd..496363e7 100644 --- a/docs/partials/introduction.md +++ b/docs/partials/introduction.md @@ -2,7 +2,7 @@ # General Introduction Messages are exchanged between the client and the server as JSON objects. -This protocol is based on the original OBS Remote protocol created by Bill Hamilton, with new commands specific to OBS Studio. +This protocol is based on the original OBS Remote protocol created by Bill Hamilton, with new commands specific to OBS Studio. As of v5.0.0, backwards compatability with the protocol will not be kept. # Authentication `obs-websocket` uses SHA256 to transmit credentials. @@ -32,3 +32,5 @@ auth_response_string = secret + challenge auth_response_hash = binary_sha256(auth_response_string) auth_response = base64_encode(auth_response_hash) ``` + +You can also refer to any of the client libraries listed on the [README](README.md) for examples of how to authenticate. diff --git a/docs/partials/requestsHeader.md b/docs/partials/requestsHeader.md index 457ad61b..b73efc0c 100644 --- a/docs/partials/requestsHeader.md +++ b/docs/partials/requestsHeader.md @@ -6,6 +6,6 @@ Requests are sent by the client and require at least the following two fields: Once a request is sent, the server will return a JSON response with at least the following fields: - `message-id` _String_: The client defined identifier specified in the request. - `status` _String_: Response status, will be one of the following: `ok`, `error` -- `error` _String_: An error message accompanying an `error` status. +- `error` _String (Optional)_: An error message accompanying an `error` status. Additional information may be required/returned depending on the request type. See below for more information. diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 0f467d9c..bb8e354c 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -465,6 +465,8 @@ void WSEvents::OnSceneChange() { * The scene list has been modified. * Scenes have been added, removed, or renamed. * + * Note: This event is not fired when the scenes are reordered. + * * @api events * @name ScenesChanged * @category scenes @@ -756,7 +758,7 @@ void WSEvents::OnExit() { } /** - * Emit every 2 seconds. + * Emitted every 2 seconds when stream is active. * * @return {boolean} `streaming` Current streaming state. * @return {boolean} `recording` Current recording state. @@ -863,6 +865,7 @@ void WSEvents::StreamStatus() { * @api events * @name Heartbeat * @category general + * @since v0.3 */ void WSEvents::Heartbeat() { @@ -1585,7 +1588,7 @@ void WSEvents::OnMediaEnded(void* param, calldata_t* data) { } /** - * Scene items have been reordered. + * Scene items within a scene have been reordered. * * @return {String} `scene-name` Name of the scene where items have been reordered. * @return {Array} `scene-items` Ordered list of scene items @@ -1628,7 +1631,7 @@ void WSEvents::OnSceneReordered(void* param, calldata_t* data) { } /** - * An item has been added to the current scene. + * A scene item has been added to a scene. * * @return {String} `scene-name` Name of the scene. * @return {String} `item-name` Name of the item added to the scene. @@ -1661,7 +1664,7 @@ void WSEvents::OnSceneItemAdd(void* param, calldata_t* data) { } /** - * An item has been removed from the current scene. + * A scene item has been removed from a scene. * * @return {String} `scene-name` Name of the scene. * @return {String} `item-name` Name of the item removed from the scene. @@ -1694,7 +1697,7 @@ void WSEvents::OnSceneItemDelete(void* param, calldata_t* data) { } /** - * An item's visibility has been toggled. + * A scene item's visibility has been toggled. * * @return {String} `scene-name` Name of the scene. * @return {String} `item-name` Name of the item in the scene. @@ -1732,7 +1735,7 @@ void WSEvents::OnSceneItemVisibilityChanged(void* param, calldata_t* data) { } /** - * An item's locked status has been toggled. + * A scene item's locked status has been toggled. * * @return {String} `scene-name` Name of the scene. * @return {String} `item-name` Name of the item in the scene. @@ -1770,7 +1773,7 @@ void WSEvents::OnSceneItemLockChanged(void* param, calldata_t* data) { } /** - * An item's transform has been changed. + * A scene item's transform has been changed. * * @return {String} `scene-name` Name of the scene. * @return {String} `item-name` Name of the item in the scene. @@ -1921,7 +1924,7 @@ void WSEvents::OnStudioModeSwitched(bool checked) { } /** - * A custom broadcast message was received + * A custom broadcast message, sent by the server, requested by one of the websocket clients. * * @return {String} `realm` Identifier provided by the sender * @return {Object} `data` User-defined data diff --git a/src/WSRequestHandler_General.cpp b/src/WSRequestHandler_General.cpp index 416ac013..ea1c6a63 100644 --- a/src/WSRequestHandler_General.cpp +++ b/src/WSRequestHandler_General.cpp @@ -171,6 +171,7 @@ RpcResponse WSRequestHandler::Authenticate(const RpcRequest& request) { * @name SetHeartbeat * @category general * @since 4.3.0 + * @deprecated Since 4.9.0. Please poll the appropriate data using requests. Will be removed in v5.0.0. */ RpcResponse WSRequestHandler::SetHeartbeat(const RpcRequest& request) { if (!request.hasField("enable")) { @@ -231,7 +232,7 @@ RpcResponse WSRequestHandler::GetFilenameFormatting(const RpcRequest& request) { /** * Get OBS stats (almost the same info as provided in OBS' stats window) * - * @return {OBSStats} `stats` OBS stats + * @return {OBSStats} `stats` [OBS stats](#obsstats) * * @api requests * @name GetStats @@ -319,12 +320,12 @@ RpcResponse WSRequestHandler::GetVideoInfo(const RpcRequest& request) { /** * Open a projector window or create a projector on a monitor. Requires OBS v24.0.4 or newer. - * - * @param {String (Optional)} `type` Type of projector: Preview (default), Source, Scene, StudioProgram, or Multiview (case insensitive). + * + * @param {String (Optional)} `type` Type of projector: `Preview` (default), `Source`, `Scene`, `StudioProgram`, or `Multiview` (case insensitive). * @param {int (Optional)} `monitor` Monitor to open the projector on. If -1 or omitted, opens a window. - * @param {String (Optional)} `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. + * @param {String (Optional)} `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. * @param {String (Optional)} `name` Name of the source or scene to be displayed (ignored for other projector types). - * + * * @api requests * @name OpenProjector * @category general diff --git a/src/WSRequestHandler_Outputs.cpp b/src/WSRequestHandler_Outputs.cpp index dad0bf19..ab8b0cc1 100644 --- a/src/WSRequestHandler_Outputs.cpp +++ b/src/WSRequestHandler_Outputs.cpp @@ -71,7 +71,7 @@ RpcResponse findOutputOrFail(const RpcRequest& request, std::function} `profiles` List of available profiles. + * @return {String} `profiles.*.profile-name` Filter name * * @api requests * @name ListProfiles diff --git a/src/WSRequestHandler_Recording.cpp b/src/WSRequestHandler_Recording.cpp index d58f60c7..24aba87a 100644 --- a/src/WSRequestHandler_Recording.cpp +++ b/src/WSRequestHandler_Recording.cpp @@ -43,7 +43,7 @@ RpcResponse WSRequestHandler::GetRecordingStatus(const RpcRequest& request) { } /** - * Toggle recording on or off. + * Toggle recording on or off (depending on the current recording state). * * @api requests * @name StartStopRecording diff --git a/src/WSRequestHandler_ReplayBuffer.cpp b/src/WSRequestHandler_ReplayBuffer.cpp index be860584..d4c83a27 100644 --- a/src/WSRequestHandler_ReplayBuffer.cpp +++ b/src/WSRequestHandler_ReplayBuffer.cpp @@ -23,7 +23,7 @@ RpcResponse WSRequestHandler::GetReplayBufferStatus(const RpcRequest& request) { } /** -* Toggle the Replay Buffer on/off. +* Toggle the Replay Buffer on/off (depending on the current state of the replay buffer). * * @api requests * @name StartStopReplayBuffer diff --git a/src/WSRequestHandler_SceneCollections.cpp b/src/WSRequestHandler_SceneCollections.cpp index 1f87996b..0359144e 100644 --- a/src/WSRequestHandler_SceneCollections.cpp +++ b/src/WSRequestHandler_SceneCollections.cpp @@ -22,7 +22,7 @@ RpcResponse WSRequestHandler::SetCurrentSceneCollection(const RpcRequest& reques return request.failed("invalid request parameters"); } - // TODO : Check if specified profile exists and if changing is allowed + // TODO : Check if specified collection exists and if changing is allowed obs_frontend_set_current_scene_collection(sceneCollection.toUtf8()); return request.success(); } @@ -51,6 +51,7 @@ RpcResponse WSRequestHandler::GetCurrentSceneCollection(const RpcRequest& reques * List available scene collections * * @return {Array} `scene-collections` Scene collections list + * @return {String} `scene-collections.*.sc-name` Scene collection name * * @api requests * @name ListSceneCollections diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index 96ed3f6a..10ca8212 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -408,7 +408,6 @@ RpcResponse WSRequestHandler::ResetSceneItem(const RpcRequest& request) { * @name SetSceneItemRender * @category scene items * @since 0.3 -* @deprecated Since 4.3.0. Prefer the use of SetSceneItemProperties. */ RpcResponse WSRequestHandler::SetSceneItemRender(const RpcRequest& request) { if (!request.hasField("source") || diff --git a/src/WSRequestHandler_Scenes.cpp b/src/WSRequestHandler_Scenes.cpp index a6d9d293..18783119 100644 --- a/src/WSRequestHandler_Scenes.cpp +++ b/src/WSRequestHandler_Scenes.cpp @@ -36,7 +36,7 @@ RpcResponse WSRequestHandler::SetCurrentScene(const RpcRequest& request) { /** * Get the current scene's name and source items. - * + * * @return {String} `name` Name of the currently active scene. * @return {Array} `sources` Ordered list of the current scene's source items. * @@ -58,7 +58,7 @@ RpcResponse WSRequestHandler::GetCurrentScene(const RpcRequest& request) { /** * Get a list of scenes in the currently active profile. - * + * * @return {String} `current-scene` Name of the currently active scene. * @return {Array} `scenes` Ordered list of the current profile's scenes (See [GetCurrentScene](#getcurrentscene) for more information). * @@ -109,8 +109,8 @@ RpcResponse WSRequestHandler::CreateScene(const RpcRequest& request) { * * @param {String (optional)} `scene` Name of the scene to reorder (defaults to current). * @param {Array} `items` Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene -* @param {int (optional)} `items[].id` Id of a specific scene item. Unique on a scene by scene basis. -* @param {String (optional)} `items[].name` Name of a scene item. Sufficiently unique if no scene items share sources within the scene. +* @param {int (optional)} `items.*.id` Id of a specific scene item. Unique on a scene by scene basis. +* @param {String (optional)} `items.*.name` Name of a scene item. Sufficiently unique if no scene items share sources within the scene. * * @api requests * @name ReorderSceneItems @@ -184,7 +184,7 @@ RpcResponse WSRequestHandler::ReorderSceneItems(const RpcRequest& request) { * @api requests * @name SetSceneTransitionOverride * @category scenes - * @since 4.9.0 + * @since unreleased */ RpcResponse WSRequestHandler::SetSceneTransitionOverride(const RpcRequest& request) { if (!request.hasField("sceneName") || !request.hasField("transitionName")) { @@ -196,12 +196,12 @@ RpcResponse WSRequestHandler::SetSceneTransitionOverride(const RpcRequest& reque if (!source) { return request.failed("requested scene does not exist"); } - + enum obs_source_type sourceType = obs_source_get_type(source); if (sourceType != OBS_SOURCE_TYPE_SCENE) { return request.failed("requested scene is invalid"); } - + QString transitionName = obs_data_get_string(request.parameters(), "transitionName"); if (!Utils::GetTransitionFromName(transitionName)) { return request.failed("requested transition does not exist"); @@ -218,7 +218,7 @@ RpcResponse WSRequestHandler::SetSceneTransitionOverride(const RpcRequest& reque obs_frontend_get_transition_duration() ); } - + return request.success(); } @@ -230,7 +230,7 @@ RpcResponse WSRequestHandler::SetSceneTransitionOverride(const RpcRequest& reque * @api requests * @name RemoveSceneTransitionOverride * @category scenes - * @since 4.9.0 + * @since unreleased */ RpcResponse WSRequestHandler::RemoveSceneTransitionOverride(const RpcRequest& request) { if (!request.hasField("sceneName")) { @@ -242,7 +242,7 @@ RpcResponse WSRequestHandler::RemoveSceneTransitionOverride(const RpcRequest& re if (!source) { return request.failed("requested scene does not exist"); } - + enum obs_source_type sourceType = obs_source_get_type(source); if (sourceType != OBS_SOURCE_TYPE_SCENE) { return request.failed("requested scene is invalid"); @@ -266,7 +266,7 @@ RpcResponse WSRequestHandler::RemoveSceneTransitionOverride(const RpcRequest& re * @api requests * @name GetSceneTransitionOverride * @category scenes - * @since 4.9.0 + * @since unreleased */ RpcResponse WSRequestHandler::GetSceneTransitionOverride(const RpcRequest& request) { if (!request.hasField("sceneName")) { @@ -278,7 +278,7 @@ RpcResponse WSRequestHandler::GetSceneTransitionOverride(const RpcRequest& reque if (!source) { return request.failed("requested scene does not exist"); } - + enum obs_source_type sourceType = obs_source_get_type(source); if (sourceType != OBS_SOURCE_TYPE_SCENE) { return request.failed("requested scene is invalid"); diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 6287783f..f7d8605e 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -23,7 +23,7 @@ bool isTextFreeType2Source(const QString& sourceKind) * * @return {Array} `sources` Array of sources * @return {String} `sources.*.name` Unique source name -* @return {String} `sources.*.typeId` Non-unique source internal type (a.k.a type id) +* @return {String} `sources.*.typeId` Non-unique source internal type (a.k.a kind) * @return {String} `sources.*.type` Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" * * @api requests @@ -382,7 +382,7 @@ RpcResponse WSRequestHandler::GetAudioActive(const RpcRequest& request) /** * Sets (aka rename) the name of a source. Also works with scenes since scenes are technically sources in OBS. * -* Note: If the new name already exists as a source, OBS will automatically modify the name to not interfere. +* Note: If the new name already exists as a source, obs-websocket will return an error. * * @param {String} `sourceName` Source name. * @param {String} `newName` New source name. @@ -415,7 +415,7 @@ RpcResponse WSRequestHandler::SetSourceName(const RpcRequest& request) return request.success(); } else { - return request.failed("a source with that newSourceName already exists"); + return request.failed("a source with that name already exists"); } } @@ -1013,7 +1013,7 @@ RpcResponse WSRequestHandler::SetTextFreetype2Properties(const RpcRequest& reque * @name GetBrowserSourceProperties * @category sources * @since 4.1.0 - * @deprecated Since 4.8.0. Prefer the use of GetSourceSettings. + * @deprecated Since 4.8.0. Prefer the use of GetSourceSettings. Will be removed in v5.0.0 */ RpcResponse WSRequestHandler::GetBrowserSourceProperties(const RpcRequest& request) { @@ -1055,7 +1055,7 @@ RpcResponse WSRequestHandler::GetBrowserSourceProperties(const RpcRequest& reque * @api requests * @name SetBrowserSourceProperties * @category sources - * @deprecated Since 4.8.0. Prefer the use of SetSourceSettings. + * @deprecated Since 4.8.0. Prefer the use of SetSourceSettings. Will be removed in v5.0.0 * @since 4.1.0 */ RpcResponse WSRequestHandler::SetBrowserSourceProperties(const RpcRequest& request) diff --git a/src/WSRequestHandler_Streaming.cpp b/src/WSRequestHandler_Streaming.cpp index c8f5732e..aa0782c9 100644 --- a/src/WSRequestHandler_Streaming.cpp +++ b/src/WSRequestHandler_Streaming.cpp @@ -43,7 +43,7 @@ RpcResponse WSRequestHandler::GetStreamingStatus(const RpcRequest& request) { } /** - * Toggle streaming on or off. + * Toggle streaming on or off (depending on the current stream state). * * @api requests * @name StartStopStreaming @@ -292,7 +292,6 @@ RpcResponse WSRequestHandler::SaveStreamSettings(const RpcRequest& request) { /** * Send the provided text as embedded CEA-608 caption data. - * As of OBS Studio 23.1, captions are not yet available on Linux. * * @param {String} `text` Captions text * diff --git a/src/WSRequestHandler_StudioMode.cpp b/src/WSRequestHandler_StudioMode.cpp index badae29d..6781f0ad 100644 --- a/src/WSRequestHandler_StudioMode.cpp +++ b/src/WSRequestHandler_StudioMode.cpp @@ -166,7 +166,7 @@ RpcResponse WSRequestHandler::DisableStudioMode(const RpcRequest& request) { } /** - * Toggles Studio Mode. + * Toggles Studio Mode (depending on the current state of studio mode). * * @api requests * @name ToggleStudioMode From 80de8ada5765465d302f6a5bc6ecc8df4946552e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 9 Jul 2020 12:39:40 +0200 Subject: [PATCH 095/178] ci: fix Azure Pipelines not running on 4.x-current --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7fce0542..bccfedb9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ variables: trigger: branches: include: - - master + - '4.x-current' tags: include: - '*' From 04c60fd1acb6ca468b35d06dd0def048977f28e5 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Thu, 9 Jul 2020 10:40:21 +0000 Subject: [PATCH 096/178] docs(ci): Update protocol.md - 80de8ad [skip ci] --- docs/generated/comments.json | 5217 +++++++++++++++++++++------------- docs/generated/protocol.md | 2261 +++++++++------ 2 files changed, 4695 insertions(+), 2783 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index fea62b1f..5bfee9f2 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -121,8 +121,8 @@ "subheads": [], "typedef": "{Object} `SceneItemTransform`", "property": [ - "{int} `position.x` The x position of the scene item from the left.", - "{int} `position.y` The y position of the scene item from the top.", + "{double} `position.x` The x position of the scene item from the left.", + "{double} `position.y` The y position of the scene item from the top.", "{int} `position.alignment` The point on the scene item that the item is manipulated from.", "{double} `rotation` The clockwise rotation of the scene item in degrees around the point of alignment.", "{double} `scale.x` The x-scale factor of the scene item.", @@ -146,12 +146,12 @@ ], "properties": [ { - "type": "int", + "type": "double", "name": "position.x", "description": "The x position of the scene item from the left." }, { - "type": "int", + "type": "double", "name": "position.y", "description": "The y position of the scene item from the top." }, @@ -2077,6 +2077,88 @@ "type": "class", "examples": [] }, + { + "subheads": [], + "description": "A source has removed audio.", + "return": "{String} `sourceName` Source name", + "api": "events", + "name": "SourceAudioDeactivated", + "category": "sources", + "since": "unreleased", + "returns": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name" + } + ], + "names": [ + { + "name": "", + "description": "SourceAudioDeactivated" + } + ], + "categories": [ + { + "name": "", + "description": "sources" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "SourceAudioDeactivated" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "A source has added audio.", + "return": "{String} `sourceName` Source name", + "api": "events", + "name": "SourceAudioActivated", + "category": "sources", + "since": "unreleased", + "returns": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name" + } + ], + "names": [ + { + "name": "", + "description": "SourceAudioActivated" + } + ], + "categories": [ + { + "name": "", + "description": "sources" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "SourceAudioActivated" + }, + "lead": "", + "type": "class", + "examples": [] + }, { "subheads": [], "description": "The audio sync offset of a source has changed.", @@ -2481,6 +2563,400 @@ "examples": [] } ], + "media": [ + { + "subheads": [], + "description": "\n\nNote: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally.", + "return": [ + "{String} `sourceName` Source name", + "{String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + ], + "api": "events", + "name": "MediaPlaying", + "category": "media", + "since": "4.9.0", + "returns": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name" + }, + { + "type": "String", + "name": "sourceKind", + "description": "The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + } + ], + "names": [ + { + "name": "", + "description": "MediaPlaying" + } + ], + "categories": [ + { + "name": "", + "description": "media" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "MediaPlaying" + }, + "lead": "A media source has started playing.", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "\n\nNote: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally.", + "return": [ + "{String} `sourceName` Source name", + "{String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + ], + "api": "events", + "name": "MediaPaused", + "category": "media", + "since": "4.9.0", + "returns": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name" + }, + { + "type": "String", + "name": "sourceKind", + "description": "The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + } + ], + "names": [ + { + "name": "", + "description": "MediaPaused" + } + ], + "categories": [ + { + "name": "", + "description": "media" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "MediaPaused" + }, + "lead": "A media source has been paused.", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "\n\nNote: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally.", + "return": [ + "{String} `sourceName` Source name", + "{String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + ], + "api": "events", + "name": "MediaRestarted", + "category": "media", + "since": "4.9.0", + "returns": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name" + }, + { + "type": "String", + "name": "sourceKind", + "description": "The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + } + ], + "names": [ + { + "name": "", + "description": "MediaRestarted" + } + ], + "categories": [ + { + "name": "", + "description": "media" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "MediaRestarted" + }, + "lead": "A media source has been restarted.", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "\n\nNote: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally.", + "return": [ + "{String} `sourceName` Source name", + "{String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + ], + "api": "events", + "name": "MediaStopped", + "category": "media", + "since": "4.9.0", + "returns": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name" + }, + { + "type": "String", + "name": "sourceKind", + "description": "The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + } + ], + "names": [ + { + "name": "", + "description": "MediaStopped" + } + ], + "categories": [ + { + "name": "", + "description": "media" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "MediaStopped" + }, + "lead": "A media source has been stopped.", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "\n\nNote: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally.", + "return": [ + "{String} `sourceName` Source name", + "{String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + ], + "api": "events", + "name": "MediaNext", + "category": "media", + "since": "4.9.0", + "returns": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name" + }, + { + "type": "String", + "name": "sourceKind", + "description": "The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + } + ], + "names": [ + { + "name": "", + "description": "MediaNext" + } + ], + "categories": [ + { + "name": "", + "description": "media" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "MediaNext" + }, + "lead": "A media source has gone to the next item in the playlist.", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "\n\nNote: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally.", + "return": [ + "{String} `sourceName` Source name", + "{String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + ], + "api": "events", + "name": "MediaPrevious", + "category": "media", + "since": "4.9.0", + "returns": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name" + }, + { + "type": "String", + "name": "sourceKind", + "description": "The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + } + ], + "names": [ + { + "name": "", + "description": "MediaPrevious" + } + ], + "categories": [ + { + "name": "", + "description": "media" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "MediaPrevious" + }, + "lead": "A media source has gone to the previous item in the playlist.", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "\n\nNote: These events are emitted by the OBS sources themselves. For example when the media file starts playing. The behavior depends on the type of media source being used.", + "return": [ + "{String} `sourceName` Source name", + "{String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + ], + "api": "events", + "name": "MediaStarted", + "category": "media", + "since": "4.9.0", + "returns": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name" + }, + { + "type": "String", + "name": "sourceKind", + "description": "The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + } + ], + "names": [ + { + "name": "", + "description": "MediaStarted" + } + ], + "categories": [ + { + "name": "", + "description": "media" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "MediaStarted" + }, + "lead": "A media source has been started.", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "\n\nNote: These events are emitted by the OBS sources themselves. For example when the media file ends. The behavior depends on the type of media source being used.", + "return": [ + "{String} `sourceName` Source name", + "{String} `sourceKind` The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + ], + "api": "events", + "name": "MediaEnded", + "category": "media", + "since": "4.9.0", + "returns": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name" + }, + { + "type": "String", + "name": "sourceKind", + "description": "The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`)" + } + ], + "names": [ + { + "name": "", + "description": "MediaEnded" + } + ], + "categories": [ + { + "name": "", + "description": "media" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "MediaEnded" + }, + "lead": "A media source has ended.", + "type": "class", + "examples": [] + } + ], "scene items": [ { "subheads": [], @@ -3571,1942 +4047,40 @@ "examples": [] } ], - "outputs": [ + "media control": [ { "subheads": [], - "description": "List existing outputs", - "return": "{Array} `outputs` Outputs list", - "api": "requests", - "name": "ListOutputs", - "category": "outputs", - "since": "4.7.0", - "returns": [ - { - "type": "Array", - "name": "outputs", - "description": "Outputs list" - } - ], - "names": [ - { - "name": "", - "description": "ListOutputs" - } - ], - "categories": [ - { - "name": "", - "description": "outputs" - } - ], - "sinces": [ - { - "name": "", - "description": "4.7.0" - } - ], - "heading": { - "level": 2, - "text": "ListOutputs" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Get information about a single output", - "param": "{String} `outputName` Output name", - "return": "{Output} `outputInfo` Output info", - "api": "requests", - "name": "GetOutputInfo", - "category": "outputs", - "since": "4.7.0", - "returns": [ - { - "type": "Output", - "name": "outputInfo", - "description": "Output info" - } - ], - "params": [ - { - "type": "String", - "name": "outputName", - "description": "Output name" - } - ], - "names": [ - { - "name": "", - "description": "GetOutputInfo" - } - ], - "categories": [ - { - "name": "", - "description": "outputs" - } - ], - "sinces": [ - { - "name": "", - "description": "4.7.0" - } - ], - "heading": { - "level": 2, - "text": "GetOutputInfo" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Start an output", - "param": "{String} `outputName` Output name", - "api": "requests", - "name": "StartOutput", - "category": "outputs", - "since": "4.7.0", - "params": [ - { - "type": "String", - "name": "outputName", - "description": "Output name" - } - ], - "names": [ - { - "name": "", - "description": "StartOutput" - } - ], - "categories": [ - { - "name": "", - "description": "outputs" - } - ], - "sinces": [ - { - "name": "", - "description": "4.7.0" - } - ], - "heading": { - "level": 2, - "text": "StartOutput" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Stop an output", + "description": "Pause or play a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)", "param": [ - "{String} `outputName` Output name", - "{boolean (optional)} `force` Force stop (default: false)" + "{String} `sourceName` Source name.", + "{boolean} `playPause` Whether to pause or play the source. `false` for play, `true` for pause." ], "api": "requests", - "name": "StopOutput", - "category": "outputs", - "since": "4.7.0", + "name": "PlayPauseMedia", + "category": "media control", + "since": "4.9.0", "params": [ { "type": "String", - "name": "outputName", - "description": "Output name" - }, - { - "type": "boolean (optional)", - "name": "force", - "description": "Force stop (default: false)" - } - ], - "names": [ - { - "name": "", - "description": "StopOutput" - } - ], - "categories": [ - { - "name": "", - "description": "outputs" - } - ], - "sinces": [ - { - "name": "", - "description": "4.7.0" - } - ], - "heading": { - "level": 2, - "text": "StopOutput" - }, - "lead": "", - "type": "class", - "examples": [] - } - ], - "profiles": [ - { - "subheads": [], - "description": "Set the currently active profile.", - "param": "{String} `profile-name` Name of the desired profile.", - "api": "requests", - "name": "SetCurrentProfile", - "category": "profiles", - "since": "4.0.0", - "params": [ - { - "type": "String", - "name": "profile-name", - "description": "Name of the desired profile." - } - ], - "names": [ - { - "name": "", - "description": "SetCurrentProfile" - } - ], - "categories": [ - { - "name": "", - "description": "profiles" - } - ], - "sinces": [ - { - "name": "", - "description": "4.0.0" - } - ], - "heading": { - "level": 2, - "text": "SetCurrentProfile" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Get the name of the current profile.", - "return": "{String} `profile-name` Name of the currently active profile.", - "api": "requests", - "name": "GetCurrentProfile", - "category": "profiles", - "since": "4.0.0", - "returns": [ - { - "type": "String", - "name": "profile-name", - "description": "Name of the currently active profile." - } - ], - "names": [ - { - "name": "", - "description": "GetCurrentProfile" - } - ], - "categories": [ - { - "name": "", - "description": "profiles" - } - ], - "sinces": [ - { - "name": "", - "description": "4.0.0" - } - ], - "heading": { - "level": 2, - "text": "GetCurrentProfile" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Get a list of available profiles.", - "return": "{Array} `profiles` List of available profiles.", - "api": "requests", - "name": "ListProfiles", - "category": "profiles", - "since": "4.0.0", - "returns": [ - { - "type": "Array", - "name": "profiles", - "description": "List of available profiles." - } - ], - "names": [ - { - "name": "", - "description": "ListProfiles" - } - ], - "categories": [ - { - "name": "", - "description": "profiles" - } - ], - "sinces": [ - { - "name": "", - "description": "4.0.0" - } - ], - "heading": { - "level": 2, - "text": "ListProfiles" - }, - "lead": "", - "type": "class", - "examples": [] - } - ], - "recording": [ - { - "subheads": [], - "description": "Toggle recording on or off.", - "api": "requests", - "name": "StartStopRecording", - "category": "recording", - "since": "0.3", - "names": [ - { - "name": "", - "description": "StartStopRecording" - } - ], - "categories": [ - { - "name": "", - "description": "recording" - } - ], - "sinces": [ - { - "name": "", - "description": "0.3" - } - ], - "heading": { - "level": 2, - "text": "StartStopRecording" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Start recording.\nWill return an `error` if recording is already active.", - "api": "requests", - "name": "StartRecording", - "category": "recording", - "since": "4.1.0", - "names": [ - { - "name": "", - "description": "StartRecording" - } - ], - "categories": [ - { - "name": "", - "description": "recording" - } - ], - "sinces": [ - { - "name": "", - "description": "4.1.0" - } - ], - "heading": { - "level": 2, - "text": "StartRecording" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Stop recording.\nWill return an `error` if recording is not active.", - "api": "requests", - "name": "StopRecording", - "category": "recording", - "since": "4.1.0", - "names": [ - { - "name": "", - "description": "StopRecording" - } - ], - "categories": [ - { - "name": "", - "description": "recording" - } - ], - "sinces": [ - { - "name": "", - "description": "4.1.0" - } - ], - "heading": { - "level": 2, - "text": "StopRecording" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Pause the current recording.\nReturns an error if recording is not active or already paused.", - "api": "requests", - "name": "PauseRecording", - "category": "recording", - "since": "4.7.0", - "names": [ - { - "name": "", - "description": "PauseRecording" - } - ], - "categories": [ - { - "name": "", - "description": "recording" - } - ], - "sinces": [ - { - "name": "", - "description": "4.7.0" - } - ], - "heading": { - "level": 2, - "text": "PauseRecording" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Resume/unpause the current recording (if paused).\nReturns an error if recording is not active or not paused.", - "api": "requests", - "name": "ResumeRecording", - "category": "recording", - "since": "4.7.0", - "names": [ - { - "name": "", - "description": "ResumeRecording" - } - ], - "categories": [ - { - "name": "", - "description": "recording" - } - ], - "sinces": [ - { - "name": "", - "description": "4.7.0" - } - ], - "heading": { - "level": 2, - "text": "ResumeRecording" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "\n\nPlease note: if `SetRecordingFolder` is called while a recording is\nin progress, the change won't be applied immediately and will be\neffective on the next recording.", - "param": "{String} `rec-folder` Path of the recording folder.", - "api": "requests", - "name": "SetRecordingFolder", - "category": "recording", - "since": "4.1.0", - "params": [ - { - "type": "String", - "name": "rec-folder", - "description": "Path of the recording folder." - } - ], - "names": [ - { - "name": "", - "description": "SetRecordingFolder" - } - ], - "categories": [ - { - "name": "", - "description": "recording" - } - ], - "sinces": [ - { - "name": "", - "description": "4.1.0" - } - ], - "heading": { - "level": 2, - "text": "SetRecordingFolder" - }, - "lead": "In the current profile, sets the recording folder of the Simple and Advanced output modes to the specified value.", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Get the path of the current recording folder.", - "return": "{String} `rec-folder` Path of the recording folder.", - "api": "requests", - "name": "GetRecordingFolder", - "category": "recording", - "since": "4.1.0", - "returns": [ - { - "type": "String", - "name": "rec-folder", - "description": "Path of the recording folder." - } - ], - "names": [ - { - "name": "", - "description": "GetRecordingFolder" - } - ], - "categories": [ - { - "name": "", - "description": "recording" - } - ], - "sinces": [ - { - "name": "", - "description": "4.1.0" - } - ], - "heading": { - "level": 2, - "text": "GetRecordingFolder" - }, - "lead": "", - "type": "class", - "examples": [] - } - ], - "replay buffer": [ - { - "subheads": [], - "description": "Toggle the Replay Buffer on/off.", - "api": "requests", - "name": "StartStopReplayBuffer", - "category": "replay buffer", - "since": "4.2.0", - "names": [ - { - "name": "", - "description": "StartStopReplayBuffer" - } - ], - "categories": [ - { - "name": "", - "description": "replay buffer" - } - ], - "sinces": [ - { - "name": "", - "description": "4.2.0" - } - ], - "heading": { - "level": 2, - "text": "StartStopReplayBuffer" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Start recording into the Replay Buffer.\nWill return an `error` if the Replay Buffer is already active or if the\n\"Save Replay Buffer\" hotkey is not set in OBS' settings.\nSetting this hotkey is mandatory, even when triggering saves only\nthrough obs-websocket.", - "api": "requests", - "name": "StartReplayBuffer", - "category": "replay buffer", - "since": "4.2.0", - "names": [ - { - "name": "", - "description": "StartReplayBuffer" - } - ], - "categories": [ - { - "name": "", - "description": "replay buffer" - } - ], - "sinces": [ - { - "name": "", - "description": "4.2.0" - } - ], - "heading": { - "level": 2, - "text": "StartReplayBuffer" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Stop recording into the Replay Buffer.\nWill return an `error` if the Replay Buffer is not active.", - "api": "requests", - "name": "StopReplayBuffer", - "category": "replay buffer", - "since": "4.2.0", - "names": [ - { - "name": "", - "description": "StopReplayBuffer" - } - ], - "categories": [ - { - "name": "", - "description": "replay buffer" - } - ], - "sinces": [ - { - "name": "", - "description": "4.2.0" - } - ], - "heading": { - "level": 2, - "text": "StopReplayBuffer" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Flush and save the contents of the Replay Buffer to disk. This is\nbasically the same as triggering the \"Save Replay Buffer\" hotkey.\nWill return an `error` if the Replay Buffer is not active.", - "api": "requests", - "name": "SaveReplayBuffer", - "category": "replay buffer", - "since": "4.2.0", - "names": [ - { - "name": "", - "description": "SaveReplayBuffer" - } - ], - "categories": [ - { - "name": "", - "description": "replay buffer" - } - ], - "sinces": [ - { - "name": "", - "description": "4.2.0" - } - ], - "heading": { - "level": 2, - "text": "SaveReplayBuffer" - }, - "lead": "", - "type": "class", - "examples": [] - } - ], - "scene collections": [ - { - "subheads": [], - "description": "Change the active scene collection.", - "param": "{String} `sc-name` Name of the desired scene collection.", - "api": "requests", - "name": "SetCurrentSceneCollection", - "category": "scene collections", - "since": "4.0.0", - "params": [ - { - "type": "String", - "name": "sc-name", - "description": "Name of the desired scene collection." - } - ], - "names": [ - { - "name": "", - "description": "SetCurrentSceneCollection" - } - ], - "categories": [ - { - "name": "", - "description": "scene collections" - } - ], - "sinces": [ - { - "name": "", - "description": "4.0.0" - } - ], - "heading": { - "level": 2, - "text": "SetCurrentSceneCollection" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Get the name of the current scene collection.", - "return": "{String} `sc-name` Name of the currently active scene collection.", - "api": "requests", - "name": "GetCurrentSceneCollection", - "category": "scene collections", - "since": "4.0.0", - "returns": [ - { - "type": "String", - "name": "sc-name", - "description": "Name of the currently active scene collection." - } - ], - "names": [ - { - "name": "", - "description": "GetCurrentSceneCollection" - } - ], - "categories": [ - { - "name": "", - "description": "scene collections" - } - ], - "sinces": [ - { - "name": "", - "description": "4.0.0" - } - ], - "heading": { - "level": 2, - "text": "GetCurrentSceneCollection" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "List available scene collections", - "return": "{Array} `scene-collections` Scene collections list", - "api": "requests", - "name": "ListSceneCollections", - "category": "scene collections", - "since": "4.0.0", - "returns": [ - { - "type": "Array", - "name": "scene-collections", - "description": "Scene collections list" - } - ], - "names": [ - { - "name": "", - "description": "ListSceneCollections" - } - ], - "categories": [ - { - "name": "", - "description": "scene collections" - } - ], - "sinces": [ - { - "name": "", - "description": "4.0.0" - } - ], - "heading": { - "level": 2, - "text": "ListSceneCollections" - }, - "lead": "", - "type": "class", - "examples": [] - } - ], - "scene items": [ - { - "subheads": [], - "description": "Gets the scene specific properties of the specified source item.\nCoordinates are relative to the item's parent (the scene or group it belongs to).", - "param": [ - "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the current scene.", - "{String | Object} `item` Scene Item name (if this field is a string) or specification (if it is an object).", - "{String (optional)} `item.name` Scene Item name (if the `item` field is an object)", - "{int (optional)} `item.id` Scene Item ID (if the `item` field is an object)" - ], - "return": [ - "{String} `name` Scene Item name.", - "{int} `itemId` Scene Item ID.", - "{int} `position.x` The x position of the source from the left.", - "{int} `position.y` The y position of the source from the top.", - "{int} `position.alignment` The point on the source that the item is manipulated from.", - "{double} `rotation` The clockwise rotation of the item in degrees around the point of alignment.", - "{double} `scale.x` The x-scale factor of the source.", - "{double} `scale.y` The y-scale factor of the source.", - "{int} `crop.top` The number of pixels cropped off the top of the source before scaling.", - "{int} `crop.right` The number of pixels cropped off the right of the source before scaling.", - "{int} `crop.bottom` The number of pixels cropped off the bottom of the source before scaling.", - "{int} `crop.left` The number of pixels cropped off the left of the source before scaling.", - "{bool} `visible` If the source is visible.", - "{bool} `muted` If the source is muted.", - "{bool} `locked` If the source's transform is locked.", - "{String} `bounds.type` Type of bounding box. Can be \"OBS_BOUNDS_STRETCH\", \"OBS_BOUNDS_SCALE_INNER\", \"OBS_BOUNDS_SCALE_OUTER\", \"OBS_BOUNDS_SCALE_TO_WIDTH\", \"OBS_BOUNDS_SCALE_TO_HEIGHT\", \"OBS_BOUNDS_MAX_ONLY\" or \"OBS_BOUNDS_NONE\".", - "{int} `bounds.alignment` Alignment of the bounding box.", - "{double} `bounds.x` Width of the bounding box.", - "{double} `bounds.y` Height of the bounding box.", - "{int} `sourceWidth` Base width (without scaling) of the source", - "{int} `sourceHeight` Base source (without scaling) of the source", - "{double} `width` Scene item width (base source width multiplied by the horizontal scaling factor)", - "{double} `height` Scene item height (base source height multiplied by the vertical scaling factor)", - "{int} `alignment` The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis.", - "{String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group)", - "{Array (optional)} `groupChildren` List of children (if this item is a group)" - ], - "api": "requests", - "name": "GetSceneItemProperties", - "category": "scene items", - "since": "4.3.0", - "returns": [ - { - "type": "String", - "name": "name", - "description": "Scene Item name." - }, - { - "type": "int", - "name": "itemId", - "description": "Scene Item ID." - }, - { - "type": "int", - "name": "position.x", - "description": "The x position of the source from the left." - }, - { - "type": "int", - "name": "position.y", - "description": "The y position of the source from the top." - }, - { - "type": "int", - "name": "position.alignment", - "description": "The point on the source that the item is manipulated from." - }, - { - "type": "double", - "name": "rotation", - "description": "The clockwise rotation of the item in degrees around the point of alignment." - }, - { - "type": "double", - "name": "scale.x", - "description": "The x-scale factor of the source." - }, - { - "type": "double", - "name": "scale.y", - "description": "The y-scale factor of the source." - }, - { - "type": "int", - "name": "crop.top", - "description": "The number of pixels cropped off the top of the source before scaling." - }, - { - "type": "int", - "name": "crop.right", - "description": "The number of pixels cropped off the right of the source before scaling." - }, - { - "type": "int", - "name": "crop.bottom", - "description": "The number of pixels cropped off the bottom of the source before scaling." - }, - { - "type": "int", - "name": "crop.left", - "description": "The number of pixels cropped off the left of the source before scaling." - }, - { - "type": "bool", - "name": "visible", - "description": "If the source is visible." - }, - { - "type": "bool", - "name": "muted", - "description": "If the source is muted." - }, - { - "type": "bool", - "name": "locked", - "description": "If the source's transform is locked." - }, - { - "type": "String", - "name": "bounds.type", - "description": "Type of bounding box. Can be \"OBS_BOUNDS_STRETCH\", \"OBS_BOUNDS_SCALE_INNER\", \"OBS_BOUNDS_SCALE_OUTER\", \"OBS_BOUNDS_SCALE_TO_WIDTH\", \"OBS_BOUNDS_SCALE_TO_HEIGHT\", \"OBS_BOUNDS_MAX_ONLY\" or \"OBS_BOUNDS_NONE\"." - }, - { - "type": "int", - "name": "bounds.alignment", - "description": "Alignment of the bounding box." - }, - { - "type": "double", - "name": "bounds.x", - "description": "Width of the bounding box." - }, - { - "type": "double", - "name": "bounds.y", - "description": "Height of the bounding box." - }, - { - "type": "int", - "name": "sourceWidth", - "description": "Base width (without scaling) of the source" - }, - { - "type": "int", - "name": "sourceHeight", - "description": "Base source (without scaling) of the source" - }, - { - "type": "double", - "name": "width", - "description": "Scene item width (base source width multiplied by the horizontal scaling factor)" - }, - { - "type": "double", - "name": "height", - "description": "Scene item height (base source height multiplied by the vertical scaling factor)" - }, - { - "type": "int", - "name": "alignment", - "description": "The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis." - }, - { - "type": "String (optional)", - "name": "parentGroupName", - "description": "Name of the item's parent (if this item belongs to a group)" - }, - { - "type": "Array (optional)", - "name": "groupChildren", - "description": "List of children (if this item is a group)" - } - ], - "params": [ - { - "type": "String (optional)", - "name": "scene-name", - "description": "Name of the scene the scene item belongs to. Defaults to the current scene." - }, - { - "type": "String | Object", - "name": "item", - "description": "Scene Item name (if this field is a string) or specification (if it is an object)." - }, - { - "type": "String (optional)", - "name": "item.name", - "description": "Scene Item name (if the `item` field is an object)" - }, - { - "type": "int (optional)", - "name": "item.id", - "description": "Scene Item ID (if the `item` field is an object)" - } - ], - "names": [ - { - "name": "", - "description": "GetSceneItemProperties" - } - ], - "categories": [ - { - "name": "", - "description": "scene items" - } - ], - "sinces": [ - { - "name": "", - "description": "4.3.0" - } - ], - "heading": { - "level": 2, - "text": "GetSceneItemProperties" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Sets the scene specific properties of a source. Unspecified properties will remain unchanged.\nCoordinates are relative to the item's parent (the scene or group it belongs to).", - "param": [ - "{String (optional)} `scene-name` Name of the scene the source item belongs to. Defaults to the current scene.", - "{String | Object} `item` Scene Item name (if this field is a string) or specification (if it is an object).", - "{String (optional)} `item.name` Scene Item name (if the `item` field is an object)", - "{int (optional)} `item.id` Scene Item ID (if the `item` field is an object)", - "{int (optional)} `position.x` The new x position of the source.", - "{int (optional)} `position.y` The new y position of the source.", - "{int (optional)} `position.alignment` The new alignment of the source.", - "{double (optional)} `rotation` The new clockwise rotation of the item in degrees.", - "{double (optional)} `scale.x` The new x scale of the item.", - "{double (optional)} `scale.y` The new y scale of the item.", - "{int (optional)} `crop.top` The new amount of pixels cropped off the top of the source before scaling.", - "{int (optional)} `crop.bottom` The new amount of pixels cropped off the bottom of the source before scaling.", - "{int (optional)} `crop.left` The new amount of pixels cropped off the left of the source before scaling.", - "{int (optional)} `crop.right` The new amount of pixels cropped off the right of the source before scaling.", - "{bool (optional)} `visible` The new visibility of the source. 'true' shows source, 'false' hides source.", - "{bool (optional)} `locked` The new locked status of the source. 'true' keeps it in its current position, 'false' allows movement.", - "{String (optional)} `bounds.type` The new bounds type of the source. Can be \"OBS_BOUNDS_STRETCH\", \"OBS_BOUNDS_SCALE_INNER\", \"OBS_BOUNDS_SCALE_OUTER\", \"OBS_BOUNDS_SCALE_TO_WIDTH\", \"OBS_BOUNDS_SCALE_TO_HEIGHT\", \"OBS_BOUNDS_MAX_ONLY\" or \"OBS_BOUNDS_NONE\".", - "{int (optional)} `bounds.alignment` The new alignment of the bounding box. (0-2, 4-6, 8-10)", - "{double (optional)} `bounds.x` The new width of the bounding box.", - "{double (optional)} `bounds.y` The new height of the bounding box." - ], - "api": "requests", - "name": "SetSceneItemProperties", - "category": "scene items", - "since": "4.3.0", - "params": [ - { - "type": "String (optional)", - "name": "scene-name", - "description": "Name of the scene the source item belongs to. Defaults to the current scene." - }, - { - "type": "String | Object", - "name": "item", - "description": "Scene Item name (if this field is a string) or specification (if it is an object)." - }, - { - "type": "String (optional)", - "name": "item.name", - "description": "Scene Item name (if the `item` field is an object)" - }, - { - "type": "int (optional)", - "name": "item.id", - "description": "Scene Item ID (if the `item` field is an object)" - }, - { - "type": "int (optional)", - "name": "position.x", - "description": "The new x position of the source." - }, - { - "type": "int (optional)", - "name": "position.y", - "description": "The new y position of the source." - }, - { - "type": "int (optional)", - "name": "position.alignment", - "description": "The new alignment of the source." - }, - { - "type": "double (optional)", - "name": "rotation", - "description": "The new clockwise rotation of the item in degrees." - }, - { - "type": "double (optional)", - "name": "scale.x", - "description": "The new x scale of the item." - }, - { - "type": "double (optional)", - "name": "scale.y", - "description": "The new y scale of the item." - }, - { - "type": "int (optional)", - "name": "crop.top", - "description": "The new amount of pixels cropped off the top of the source before scaling." - }, - { - "type": "int (optional)", - "name": "crop.bottom", - "description": "The new amount of pixels cropped off the bottom of the source before scaling." - }, - { - "type": "int (optional)", - "name": "crop.left", - "description": "The new amount of pixels cropped off the left of the source before scaling." - }, - { - "type": "int (optional)", - "name": "crop.right", - "description": "The new amount of pixels cropped off the right of the source before scaling." - }, - { - "type": "bool (optional)", - "name": "visible", - "description": "The new visibility of the source. 'true' shows source, 'false' hides source." - }, - { - "type": "bool (optional)", - "name": "locked", - "description": "The new locked status of the source. 'true' keeps it in its current position, 'false' allows movement." - }, - { - "type": "String (optional)", - "name": "bounds.type", - "description": "The new bounds type of the source. Can be \"OBS_BOUNDS_STRETCH\", \"OBS_BOUNDS_SCALE_INNER\", \"OBS_BOUNDS_SCALE_OUTER\", \"OBS_BOUNDS_SCALE_TO_WIDTH\", \"OBS_BOUNDS_SCALE_TO_HEIGHT\", \"OBS_BOUNDS_MAX_ONLY\" or \"OBS_BOUNDS_NONE\"." - }, - { - "type": "int (optional)", - "name": "bounds.alignment", - "description": "The new alignment of the bounding box. (0-2, 4-6, 8-10)" - }, - { - "type": "double (optional)", - "name": "bounds.x", - "description": "The new width of the bounding box." - }, - { - "type": "double (optional)", - "name": "bounds.y", - "description": "The new height of the bounding box." - } - ], - "names": [ - { - "name": "", - "description": "SetSceneItemProperties" - } - ], - "categories": [ - { - "name": "", - "description": "scene items" - } - ], - "sinces": [ - { - "name": "", - "description": "4.3.0" - } - ], - "heading": { - "level": 2, - "text": "SetSceneItemProperties" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Reset a scene item.", - "param": [ - "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the current scene.", - "{String | Object} `item` Scene Item name (if this field is a string) or specification (if it is an object).", - "{String (optional)} `item.name` Scene Item name (if the `item` field is an object)", - "{int (optional)} `item.id` Scene Item ID (if the `item` field is an object)" - ], - "api": "requests", - "name": "ResetSceneItem", - "category": "scene items", - "since": "4.2.0", - "params": [ - { - "type": "String (optional)", - "name": "scene-name", - "description": "Name of the scene the scene item belongs to. Defaults to the current scene." - }, - { - "type": "String | Object", - "name": "item", - "description": "Scene Item name (if this field is a string) or specification (if it is an object)." - }, - { - "type": "String (optional)", - "name": "item.name", - "description": "Scene Item name (if the `item` field is an object)" - }, - { - "type": "int (optional)", - "name": "item.id", - "description": "Scene Item ID (if the `item` field is an object)" - } - ], - "names": [ - { - "name": "", - "description": "ResetSceneItem" - } - ], - "categories": [ - { - "name": "", - "description": "scene items" - } - ], - "sinces": [ - { - "name": "", - "description": "4.2.0" - } - ], - "heading": { - "level": 2, - "text": "ResetSceneItem" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Show or hide a specified source item in a specified scene.", - "param": [ - "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the currently active scene.", - "{String} `source` Scene Item name.", - "{boolean} `render` true = shown ; false = hidden" - ], - "api": "requests", - "name": "SetSceneItemRender", - "category": "scene items", - "since": "0.3", - "deprecated": "Since 4.3.0. Prefer the use of SetSceneItemProperties.", - "params": [ - { - "type": "String (optional)", - "name": "scene-name", - "description": "Name of the scene the scene item belongs to. Defaults to the currently active scene." - }, - { - "type": "String", - "name": "source", - "description": "Scene Item name." + "name": "sourceName", + "description": "Source name." }, { "type": "boolean", - "name": "render", - "description": "true = shown ; false = hidden" + "name": "playPause", + "description": "Whether to pause or play the source. `false` for play, `true` for pause." } ], "names": [ { "name": "", - "description": "SetSceneItemRender" + "description": "PlayPauseMedia" } ], "categories": [ { "name": "", - "description": "scene items" - } - ], - "sinces": [ - { - "name": "", - "description": "0.3" - } - ], - "deprecateds": [ - { - "name": "", - "description": "Since 4.3.0. Prefer the use of SetSceneItemProperties." - } - ], - "heading": { - "level": 2, - "text": "SetSceneItemRender" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Sets the coordinates of a specified source item.", - "param": [ - "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the current scene.", - "{String} `item` Scene Item name.", - "{double} `x` X coordinate.", - "{double} `y` Y coordinate." - ], - "api": "requests", - "name": "SetSceneItemPosition", - "category": "scene items", - "since": "4.0.0", - "deprecated": "Since 4.3.0. Prefer the use of SetSceneItemProperties.", - "params": [ - { - "type": "String (optional)", - "name": "scene-name", - "description": "Name of the scene the scene item belongs to. Defaults to the current scene." - }, - { - "type": "String", - "name": "item", - "description": "Scene Item name." - }, - { - "type": "double", - "name": "x", - "description": "X coordinate." - }, - { - "type": "double", - "name": "y", - "description": "Y coordinate." - } - ], - "names": [ - { - "name": "", - "description": "SetSceneItemPosition" - } - ], - "categories": [ - { - "name": "", - "description": "scene items" - } - ], - "sinces": [ - { - "name": "", - "description": "4.0.0" - } - ], - "deprecateds": [ - { - "name": "", - "description": "Since 4.3.0. Prefer the use of SetSceneItemProperties." - } - ], - "heading": { - "level": 2, - "text": "SetSceneItemPosition" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Set the transform of the specified source item.", - "param": [ - "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the current scene.", - "{String} `item` Scene Item name.", - "{double} `x-scale` Width scale factor.", - "{double} `y-scale` Height scale factor.", - "{double} `rotation` Source item rotation (in degrees)." - ], - "api": "requests", - "name": "SetSceneItemTransform", - "category": "scene items", - "since": "4.0.0", - "deprecated": "Since 4.3.0. Prefer the use of SetSceneItemProperties.", - "params": [ - { - "type": "String (optional)", - "name": "scene-name", - "description": "Name of the scene the scene item belongs to. Defaults to the current scene." - }, - { - "type": "String", - "name": "item", - "description": "Scene Item name." - }, - { - "type": "double", - "name": "x-scale", - "description": "Width scale factor." - }, - { - "type": "double", - "name": "y-scale", - "description": "Height scale factor." - }, - { - "type": "double", - "name": "rotation", - "description": "Source item rotation (in degrees)." - } - ], - "names": [ - { - "name": "", - "description": "SetSceneItemTransform" - } - ], - "categories": [ - { - "name": "", - "description": "scene items" - } - ], - "sinces": [ - { - "name": "", - "description": "4.0.0" - } - ], - "deprecateds": [ - { - "name": "", - "description": "Since 4.3.0. Prefer the use of SetSceneItemProperties." - } - ], - "heading": { - "level": 2, - "text": "SetSceneItemTransform" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Sets the crop coordinates of the specified source item.", - "param": [ - "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the current scene.", - "{String} `item` Scene Item name.", - "{int} `top` Pixel position of the top of the source item.", - "{int} `bottom` Pixel position of the bottom of the source item.", - "{int} `left` Pixel position of the left of the source item.", - "{int} `right` Pixel position of the right of the source item." - ], - "api": "requests", - "name": "SetSceneItemCrop", - "category": "scene items", - "since": "4.1.0", - "deprecated": "Since 4.3.0. Prefer the use of SetSceneItemProperties.", - "params": [ - { - "type": "String (optional)", - "name": "scene-name", - "description": "Name of the scene the scene item belongs to. Defaults to the current scene." - }, - { - "type": "String", - "name": "item", - "description": "Scene Item name." - }, - { - "type": "int", - "name": "top", - "description": "Pixel position of the top of the source item." - }, - { - "type": "int", - "name": "bottom", - "description": "Pixel position of the bottom of the source item." - }, - { - "type": "int", - "name": "left", - "description": "Pixel position of the left of the source item." - }, - { - "type": "int", - "name": "right", - "description": "Pixel position of the right of the source item." - } - ], - "names": [ - { - "name": "", - "description": "SetSceneItemCrop" - } - ], - "categories": [ - { - "name": "", - "description": "scene items" - } - ], - "sinces": [ - { - "name": "", - "description": "4.1.0" - } - ], - "deprecateds": [ - { - "name": "", - "description": "Since 4.3.0. Prefer the use of SetSceneItemProperties." - } - ], - "heading": { - "level": 2, - "text": "SetSceneItemCrop" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Deletes a scene item.", - "param": [ - "{String (optional)} `scene` Name of the scene the scene item belongs to. Defaults to the current scene.", - "{Object} `item` Scene item to delete (required)", - "{String} `item.name` Scene Item name (prefer `id`, including both is acceptable).", - "{int} `item.id` Scene Item ID." - ], - "api": "requests", - "name": "DeleteSceneItem", - "category": "scene items", - "since": "4.5.0", - "params": [ - { - "type": "String (optional)", - "name": "scene", - "description": "Name of the scene the scene item belongs to. Defaults to the current scene." - }, - { - "type": "Object", - "name": "item", - "description": "Scene item to delete (required)" - }, - { - "type": "String", - "name": "item.name", - "description": "Scene Item name (prefer `id`, including both is acceptable)." - }, - { - "type": "int", - "name": "item.id", - "description": "Scene Item ID." - } - ], - "names": [ - { - "name": "", - "description": "DeleteSceneItem" - } - ], - "categories": [ - { - "name": "", - "description": "scene items" - } - ], - "sinces": [ - { - "name": "", - "description": "4.5.0" - } - ], - "heading": { - "level": 2, - "text": "DeleteSceneItem" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Duplicates a scene item.", - "param": [ - "{String (optional)} `fromScene` Name of the scene to copy the item from. Defaults to the current scene.", - "{String (optional)} `toScene` Name of the scene to create the item in. Defaults to the current scene.", - "{Object} `item` Scene Item to duplicate from the source scene (required)", - "{String} `item.name` Scene Item name (prefer `id`, including both is acceptable).", - "{int} `item.id` Scene Item ID." - ], - "return": [ - "{String} `scene` Name of the scene where the new item was created", - "{Object} `item` New item info", - "{int} `item.id` New item ID", - "{String} `item.name` New item name" - ], - "api": "requests", - "name": "DuplicateSceneItem", - "category": "scene items", - "since": "4.5.0", - "returns": [ - { - "type": "String", - "name": "scene", - "description": "Name of the scene where the new item was created" - }, - { - "type": "Object", - "name": "item", - "description": "New item info" - }, - { - "type": "int", - "name": "item.id", - "description": "New item ID" - }, - { - "type": "String", - "name": "item.name", - "description": "New item name" - } - ], - "params": [ - { - "type": "String (optional)", - "name": "fromScene", - "description": "Name of the scene to copy the item from. Defaults to the current scene." - }, - { - "type": "String (optional)", - "name": "toScene", - "description": "Name of the scene to create the item in. Defaults to the current scene." - }, - { - "type": "Object", - "name": "item", - "description": "Scene Item to duplicate from the source scene (required)" - }, - { - "type": "String", - "name": "item.name", - "description": "Scene Item name (prefer `id`, including both is acceptable)." - }, - { - "type": "int", - "name": "item.id", - "description": "Scene Item ID." - } - ], - "names": [ - { - "name": "", - "description": "DuplicateSceneItem" - } - ], - "categories": [ - { - "name": "", - "description": "scene items" - } - ], - "sinces": [ - { - "name": "", - "description": "4.5.0" - } - ], - "heading": { - "level": 2, - "text": "DuplicateSceneItem" - }, - "lead": "", - "type": "class", - "examples": [] - } - ], - "scenes": [ - { - "subheads": [], - "description": "Switch to the specified scene.", - "param": "{String} `scene-name` Name of the scene to switch to.", - "api": "requests", - "name": "SetCurrentScene", - "category": "scenes", - "since": "0.3", - "params": [ - { - "type": "String", - "name": "scene-name", - "description": "Name of the scene to switch to." - } - ], - "names": [ - { - "name": "", - "description": "SetCurrentScene" - } - ], - "categories": [ - { - "name": "", - "description": "scenes" - } - ], - "sinces": [ - { - "name": "", - "description": "0.3" - } - ], - "heading": { - "level": 2, - "text": "SetCurrentScene" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Get the current scene's name and source items.", - "return": [ - "{String} `name` Name of the currently active scene.", - "{Array} `sources` Ordered list of the current scene's source items." - ], - "api": "requests", - "name": "GetCurrentScene", - "category": "scenes", - "since": "0.3", - "returns": [ - { - "type": "String", - "name": "name", - "description": "Name of the currently active scene." - }, - { - "type": "Array", - "name": "sources", - "description": "Ordered list of the current scene's source items." - } - ], - "names": [ - { - "name": "", - "description": "GetCurrentScene" - } - ], - "categories": [ - { - "name": "", - "description": "scenes" - } - ], - "sinces": [ - { - "name": "", - "description": "0.3" - } - ], - "heading": { - "level": 2, - "text": "GetCurrentScene" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Get a list of scenes in the currently active profile.", - "return": [ - "{String} `current-scene` Name of the currently active scene.", - "{Array} `scenes` Ordered list of the current profile's scenes (See [GetCurrentScene](#getcurrentscene) for more information)." - ], - "api": "requests", - "name": "GetSceneList", - "category": "scenes", - "since": "0.3", - "returns": [ - { - "type": "String", - "name": "current-scene", - "description": "Name of the currently active scene." - }, - { - "type": "Array", - "name": "scenes", - "description": "Ordered list of the current profile's scenes (See [GetCurrentScene](#getcurrentscene) for more information)." - } - ], - "names": [ - { - "name": "", - "description": "GetSceneList" - } - ], - "categories": [ - { - "name": "", - "description": "scenes" - } - ], - "sinces": [ - { - "name": "", - "description": "0.3" - } - ], - "heading": { - "level": 2, - "text": "GetSceneList" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Changes the order of scene items in the requested scene.", - "param": [ - "{String (optional)} `scene` Name of the scene to reorder (defaults to current).", - "{Array} `items` Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene", - "{int (optional)} `items[].id` Id of a specific scene item. Unique on a scene by scene basis.", - "{String (optional)} `items[].name` Name of a scene item. Sufficiently unique if no scene items share sources within the scene." - ], - "api": "requests", - "name": "ReorderSceneItems", - "category": "scenes", - "since": "4.5.0", - "params": [ - { - "type": "String (optional)", - "name": "scene", - "description": "Name of the scene to reorder (defaults to current)." - }, - { - "type": "Array", - "name": "items", - "description": "Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene" - }, - { - "type": "int (optional)", - "name": "items[].id", - "description": "Id of a specific scene item. Unique on a scene by scene basis." - }, - { - "type": "String (optional)", - "name": "items[].name", - "description": "Name of a scene item. Sufficiently unique if no scene items share sources within the scene." - } - ], - "names": [ - { - "name": "", - "description": "ReorderSceneItems" - } - ], - "categories": [ - { - "name": "", - "description": "scenes" - } - ], - "sinces": [ - { - "name": "", - "description": "4.5.0" - } - ], - "heading": { - "level": 2, - "text": "ReorderSceneItems" - }, - "lead": "", - "type": "class", - "examples": [] - }, - { - "subheads": [], - "description": "Set a scene to use a specific transition override.", - "param": [ - "{String} `sceneName` Name of the scene to switch to.", - "{String} `transitionName` Name of the transition to use.", - "{int (Optional)} `transitionDuration` Duration in milliseconds of the transition if transition is not fixed. Defaults to the current duration specified in the UI if there is no current override and this value is not given." - ], - "api": "requests", - "name": "SetSceneTransitionOverride", - "category": "scenes", - "since": "4.9.0", - "params": [ - { - "type": "String", - "name": "sceneName", - "description": "Name of the scene to switch to." - }, - { - "type": "String", - "name": "transitionName", - "description": "Name of the transition to use." - }, - { - "type": "int (Optional)", - "name": "transitionDuration", - "description": "Duration in milliseconds of the transition if transition is not fixed. Defaults to the current duration specified in the UI if there is no current override and this value is not given." - } - ], - "names": [ - { - "name": "", - "description": "SetSceneTransitionOverride" - } - ], - "categories": [ - { - "name": "", - "description": "scenes" + "description": "media control" } ], "sinces": [ @@ -5517,7 +4091,7 @@ ], "heading": { "level": 2, - "text": "SetSceneTransitionOverride" + "text": "PlayPauseMedia" }, "lead": "", "type": "class", @@ -5525,29 +4099,29 @@ }, { "subheads": [], - "description": "Remove any transition override on a scene.", - "param": "{String} `sceneName` Name of the scene to switch to.", + "description": "Restart a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)", + "param": "{String} `sourceName` Source name.", "api": "requests", - "name": "RemoveSceneTransitionOverride", - "category": "scenes", + "name": "RestartMedia", + "category": "media control", "since": "4.9.0", "params": [ { "type": "String", - "name": "sceneName", - "description": "Name of the scene to switch to." + "name": "sourceName", + "description": "Source name." } ], "names": [ { "name": "", - "description": "RemoveSceneTransitionOverride" + "description": "RestartMedia" } ], "categories": [ { "name": "", - "description": "scenes" + "description": "media control" } ], "sinces": [ @@ -5558,7 +4132,7 @@ ], "heading": { "level": 2, - "text": "RemoveSceneTransitionOverride" + "text": "RestartMedia" }, "lead": "", "type": "class", @@ -5566,45 +4140,356 @@ }, { "subheads": [], - "description": "Get the current scene transition override.", - "param": "{String} `sceneName` Name of the scene to switch to.", - "return": [ - "{String} `transitionName` Name of the current overriding transition. Empty string if no override is set.", - "{int} `transitionDuration` Transition duration. `-1` if no override is set." + "description": "Stop a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)", + "param": "{String} `sourceName` Source name.", + "api": "requests", + "name": "StopMedia", + "category": "media control", + "since": "4.9.0", + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + } + ], + "names": [ + { + "name": "", + "description": "StopMedia" + } + ], + "categories": [ + { + "name": "", + "description": "media control" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "StopMedia" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Skip to the next media item in the playlist. Supports only vlc media source (as of OBS v25.0.8)", + "param": "{String} `sourceName` Source name.", + "api": "requests", + "name": "NextMedia", + "category": "media control", + "since": "4.9.0", + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + } + ], + "names": [ + { + "name": "", + "description": "NextMedia" + } + ], + "categories": [ + { + "name": "", + "description": "media control" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "NextMedia" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Go to the previous media item in the playlist. Supports only vlc media source (as of OBS v25.0.8)", + "param": "{String} `sourceName` Source name.", + "api": "requests", + "name": "PreviousMedia", + "category": "media control", + "since": "4.9.0", + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + } + ], + "names": [ + { + "name": "", + "description": "PreviousMedia" + } + ], + "categories": [ + { + "name": "", + "description": "media control" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "PreviousMedia" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get the length of media in milliseconds. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)\nNote: For some reason, for the first 5 or so seconds that the media is playing, the total duration can be off by upwards of 50ms.", + "param": "{String} `sourceName` Source name.", + "return": "{int} `mediaDuration` The total length of media in milliseconds..", + "api": "requests", + "name": "GetMediaDuration", + "category": "media control", + "since": "4.9.0", + "returns": [ + { + "type": "int", + "name": "mediaDuration", + "description": "The total length of media in milliseconds.." + } + ], + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + } + ], + "names": [ + { + "name": "", + "description": "GetMediaDuration" + } + ], + "categories": [ + { + "name": "", + "description": "media control" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "GetMediaDuration" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get the current timestamp of media in milliseconds. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)", + "param": "{String} `sourceName` Source name.", + "return": "{int} `timestamp` The time in milliseconds since the start of the media.", + "api": "requests", + "name": "GetMediaTime", + "category": "media control", + "since": "4.9.0", + "returns": [ + { + "type": "int", + "name": "timestamp", + "description": "The time in milliseconds since the start of the media." + } + ], + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + } + ], + "names": [ + { + "name": "", + "description": "GetMediaTime" + } + ], + "categories": [ + { + "name": "", + "description": "media control" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "GetMediaTime" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Set the timestamp of a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)", + "param": [ + "{String} `sourceName` Source name.", + "{int} `timestamp` Milliseconds to set the timestamp to." ], "api": "requests", - "name": "GetSceneTransitionOverride", - "category": "scenes", + "name": "SetMediaTime", + "category": "media control", + "since": "4.9.0", + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + }, + { + "type": "int", + "name": "timestamp", + "description": "Milliseconds to set the timestamp to." + } + ], + "names": [ + { + "name": "", + "description": "SetMediaTime" + } + ], + "categories": [ + { + "name": "", + "description": "media control" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "SetMediaTime" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Scrub media using a supplied offset. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)\nNote: Due to processing/network delays, this request is not perfect. The processing rate of this request has also not been tested.", + "param": [ + "{String} `sourceName` Source name.", + "{int} `timeOffset` Millisecond offset (positive or negative) to offset the current media position." + ], + "api": "requests", + "name": "ScrubMedia", + "category": "media control", + "since": "4.9.0", + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + }, + { + "type": "int", + "name": "timeOffset", + "description": "Millisecond offset (positive or negative) to offset the current media position." + } + ], + "names": [ + { + "name": "", + "description": "ScrubMedia" + } + ], + "categories": [ + { + "name": "", + "description": "media control" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "ScrubMedia" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get the current playing state of a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)", + "param": "{String} `sourceName` Source name.", + "return": "{String} `mediaState` The media state of the provided source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error`, `unknown`", + "api": "requests", + "name": "GetMediaState", + "category": "media control", "since": "4.9.0", "returns": [ { "type": "String", - "name": "transitionName", - "description": "Name of the current overriding transition. Empty string if no override is set." - }, - { - "type": "int", - "name": "transitionDuration", - "description": "Transition duration. `-1` if no override is set." + "name": "mediaState", + "description": "The media state of the provided source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error`, `unknown`" } ], "params": [ { "type": "String", - "name": "sceneName", - "description": "Name of the scene to switch to." + "name": "sourceName", + "description": "Source name." } ], "names": [ { "name": "", - "description": "GetSceneTransitionOverride" + "description": "GetMediaState" } ], "categories": [ { "name": "", - "description": "scenes" + "description": "media control" } ], "sinces": [ @@ -5615,7 +4500,7 @@ ], "heading": { "level": 2, - "text": "GetSceneTransitionOverride" + "text": "GetMediaState" }, "lead": "", "type": "class", @@ -5623,6 +4508,67 @@ } ], "sources": [ + { + "subheads": [], + "description": "List the media state of all media sources (vlc and media source)", + "return": [ + "{Array} `mediaSources` Array of sources", + "{String} `mediaSources.*.sourceName` Unique source name", + "{String} `mediaSources.*.sourceKind` Unique source internal type (a.k.a `ffmpeg_source` or `vlc_source`)", + "{String} `mediaSources.*.mediaState` The current state of media for that source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error`, `unknown`" + ], + "api": "requests", + "name": "GetMediaSourcesList", + "category": "sources", + "since": "4.9.0", + "returns": [ + { + "type": "Array", + "name": "mediaSources", + "description": "Array of sources" + }, + { + "type": "String", + "name": "mediaSources.*.sourceName", + "description": "Unique source name" + }, + { + "type": "String", + "name": "mediaSources.*.sourceKind", + "description": "Unique source internal type (a.k.a `ffmpeg_source` or `vlc_source`)" + }, + { + "type": "String", + "name": "mediaSources.*.mediaState", + "description": "The current state of media for that source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error`, `unknown`" + } + ], + "names": [ + { + "name": "", + "description": "GetMediaSourcesList" + } + ], + "categories": [ + { + "name": "", + "description": "sources" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "GetMediaSourcesList" + }, + "lead": "", + "type": "class", + "examples": [] + }, { "subheads": [], "description": "List all sources available in the running OBS instance", @@ -6072,6 +5018,55 @@ "type": "class", "examples": [] }, + { + "subheads": [], + "description": "Get the audio's active status of a specified source.", + "param": "{String} `sourceName` Source name.", + "return": "{boolean} `audioActive` Audio active status of the source.", + "api": "requests", + "name": "GetAudioActive", + "category": "sources", + "since": "unreleased", + "returns": [ + { + "type": "boolean", + "name": "audioActive", + "description": "Audio active status of the source." + } + ], + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + } + ], + "names": [ + { + "name": "", + "description": "GetAudioActive" + } + ], + "categories": [ + { + "name": "", + "description": "sources" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "GetAudioActive" + }, + "lead": "", + "type": "class", + "examples": [] + }, { "subheads": [], "description": "\n\nNote: If the new name already exists as a source, OBS will automatically modify the name to not interfere.", @@ -8032,6 +7027,2332 @@ "examples": [] } ], + "outputs": [ + { + "subheads": [], + "description": "List existing outputs", + "return": "{Array} `outputs` Outputs list", + "api": "requests", + "name": "ListOutputs", + "category": "outputs", + "since": "4.7.0", + "returns": [ + { + "type": "Array", + "name": "outputs", + "description": "Outputs list" + } + ], + "names": [ + { + "name": "", + "description": "ListOutputs" + } + ], + "categories": [ + { + "name": "", + "description": "outputs" + } + ], + "sinces": [ + { + "name": "", + "description": "4.7.0" + } + ], + "heading": { + "level": 2, + "text": "ListOutputs" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get information about a single output", + "param": "{String} `outputName` Output name", + "return": "{Output} `outputInfo` Output info", + "api": "requests", + "name": "GetOutputInfo", + "category": "outputs", + "since": "4.7.0", + "returns": [ + { + "type": "Output", + "name": "outputInfo", + "description": "Output info" + } + ], + "params": [ + { + "type": "String", + "name": "outputName", + "description": "Output name" + } + ], + "names": [ + { + "name": "", + "description": "GetOutputInfo" + } + ], + "categories": [ + { + "name": "", + "description": "outputs" + } + ], + "sinces": [ + { + "name": "", + "description": "4.7.0" + } + ], + "heading": { + "level": 2, + "text": "GetOutputInfo" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Start an output", + "param": "{String} `outputName` Output name", + "api": "requests", + "name": "StartOutput", + "category": "outputs", + "since": "4.7.0", + "params": [ + { + "type": "String", + "name": "outputName", + "description": "Output name" + } + ], + "names": [ + { + "name": "", + "description": "StartOutput" + } + ], + "categories": [ + { + "name": "", + "description": "outputs" + } + ], + "sinces": [ + { + "name": "", + "description": "4.7.0" + } + ], + "heading": { + "level": 2, + "text": "StartOutput" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Stop an output", + "param": [ + "{String} `outputName` Output name", + "{boolean (optional)} `force` Force stop (default: false)" + ], + "api": "requests", + "name": "StopOutput", + "category": "outputs", + "since": "4.7.0", + "params": [ + { + "type": "String", + "name": "outputName", + "description": "Output name" + }, + { + "type": "boolean (optional)", + "name": "force", + "description": "Force stop (default: false)" + } + ], + "names": [ + { + "name": "", + "description": "StopOutput" + } + ], + "categories": [ + { + "name": "", + "description": "outputs" + } + ], + "sinces": [ + { + "name": "", + "description": "4.7.0" + } + ], + "heading": { + "level": 2, + "text": "StopOutput" + }, + "lead": "", + "type": "class", + "examples": [] + } + ], + "profiles": [ + { + "subheads": [], + "description": "Set the currently active profile.", + "param": "{String} `profile-name` Name of the desired profile.", + "api": "requests", + "name": "SetCurrentProfile", + "category": "profiles", + "since": "4.0.0", + "params": [ + { + "type": "String", + "name": "profile-name", + "description": "Name of the desired profile." + } + ], + "names": [ + { + "name": "", + "description": "SetCurrentProfile" + } + ], + "categories": [ + { + "name": "", + "description": "profiles" + } + ], + "sinces": [ + { + "name": "", + "description": "4.0.0" + } + ], + "heading": { + "level": 2, + "text": "SetCurrentProfile" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get the name of the current profile.", + "return": "{String} `profile-name` Name of the currently active profile.", + "api": "requests", + "name": "GetCurrentProfile", + "category": "profiles", + "since": "4.0.0", + "returns": [ + { + "type": "String", + "name": "profile-name", + "description": "Name of the currently active profile." + } + ], + "names": [ + { + "name": "", + "description": "GetCurrentProfile" + } + ], + "categories": [ + { + "name": "", + "description": "profiles" + } + ], + "sinces": [ + { + "name": "", + "description": "4.0.0" + } + ], + "heading": { + "level": 2, + "text": "GetCurrentProfile" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get a list of available profiles.", + "return": "{Array} `profiles` List of available profiles.", + "api": "requests", + "name": "ListProfiles", + "category": "profiles", + "since": "4.0.0", + "returns": [ + { + "type": "Array", + "name": "profiles", + "description": "List of available profiles." + } + ], + "names": [ + { + "name": "", + "description": "ListProfiles" + } + ], + "categories": [ + { + "name": "", + "description": "profiles" + } + ], + "sinces": [ + { + "name": "", + "description": "4.0.0" + } + ], + "heading": { + "level": 2, + "text": "ListProfiles" + }, + "lead": "", + "type": "class", + "examples": [] + } + ], + "recording": [ + { + "subheads": [], + "description": "Get current recording status.", + "return": [ + "{boolean} `isRecording` Current recording status.", + "{boolean} `isRecordingPaused` Whether the recording is paused or not.", + "{String (optional)} `recordTimecode` Time elapsed since recording started (only present if currently recording)." + ], + "api": "requests", + "name": "GetRecordingStatus", + "category": "recording", + "since": "unreleased", + "returns": [ + { + "type": "boolean", + "name": "isRecording", + "description": "Current recording status." + }, + { + "type": "boolean", + "name": "isRecordingPaused", + "description": "Whether the recording is paused or not." + }, + { + "type": "String (optional)", + "name": "recordTimecode", + "description": "Time elapsed since recording started (only present if currently recording)." + } + ], + "names": [ + { + "name": "", + "description": "GetRecordingStatus" + } + ], + "categories": [ + { + "name": "", + "description": "recording" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "GetRecordingStatus" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Toggle recording on or off.", + "api": "requests", + "name": "StartStopRecording", + "category": "recording", + "since": "0.3", + "names": [ + { + "name": "", + "description": "StartStopRecording" + } + ], + "categories": [ + { + "name": "", + "description": "recording" + } + ], + "sinces": [ + { + "name": "", + "description": "0.3" + } + ], + "heading": { + "level": 2, + "text": "StartStopRecording" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Start recording.\nWill return an `error` if recording is already active.", + "api": "requests", + "name": "StartRecording", + "category": "recording", + "since": "4.1.0", + "names": [ + { + "name": "", + "description": "StartRecording" + } + ], + "categories": [ + { + "name": "", + "description": "recording" + } + ], + "sinces": [ + { + "name": "", + "description": "4.1.0" + } + ], + "heading": { + "level": 2, + "text": "StartRecording" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Stop recording.\nWill return an `error` if recording is not active.", + "api": "requests", + "name": "StopRecording", + "category": "recording", + "since": "4.1.0", + "names": [ + { + "name": "", + "description": "StopRecording" + } + ], + "categories": [ + { + "name": "", + "description": "recording" + } + ], + "sinces": [ + { + "name": "", + "description": "4.1.0" + } + ], + "heading": { + "level": 2, + "text": "StopRecording" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Pause the current recording.\nReturns an error if recording is not active or already paused.", + "api": "requests", + "name": "PauseRecording", + "category": "recording", + "since": "4.7.0", + "names": [ + { + "name": "", + "description": "PauseRecording" + } + ], + "categories": [ + { + "name": "", + "description": "recording" + } + ], + "sinces": [ + { + "name": "", + "description": "4.7.0" + } + ], + "heading": { + "level": 2, + "text": "PauseRecording" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Resume/unpause the current recording (if paused).\nReturns an error if recording is not active or not paused.", + "api": "requests", + "name": "ResumeRecording", + "category": "recording", + "since": "4.7.0", + "names": [ + { + "name": "", + "description": "ResumeRecording" + } + ], + "categories": [ + { + "name": "", + "description": "recording" + } + ], + "sinces": [ + { + "name": "", + "description": "4.7.0" + } + ], + "heading": { + "level": 2, + "text": "ResumeRecording" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "\n\nPlease note: if `SetRecordingFolder` is called while a recording is\nin progress, the change won't be applied immediately and will be\neffective on the next recording.", + "param": "{String} `rec-folder` Path of the recording folder.", + "api": "requests", + "name": "SetRecordingFolder", + "category": "recording", + "since": "4.1.0", + "params": [ + { + "type": "String", + "name": "rec-folder", + "description": "Path of the recording folder." + } + ], + "names": [ + { + "name": "", + "description": "SetRecordingFolder" + } + ], + "categories": [ + { + "name": "", + "description": "recording" + } + ], + "sinces": [ + { + "name": "", + "description": "4.1.0" + } + ], + "heading": { + "level": 2, + "text": "SetRecordingFolder" + }, + "lead": "In the current profile, sets the recording folder of the Simple and Advanced output modes to the specified value.", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get the path of the current recording folder.", + "return": "{String} `rec-folder` Path of the recording folder.", + "api": "requests", + "name": "GetRecordingFolder", + "category": "recording", + "since": "4.1.0", + "returns": [ + { + "type": "String", + "name": "rec-folder", + "description": "Path of the recording folder." + } + ], + "names": [ + { + "name": "", + "description": "GetRecordingFolder" + } + ], + "categories": [ + { + "name": "", + "description": "recording" + } + ], + "sinces": [ + { + "name": "", + "description": "4.1.0" + } + ], + "heading": { + "level": 2, + "text": "GetRecordingFolder" + }, + "lead": "", + "type": "class", + "examples": [] + } + ], + "replay buffer": [ + { + "subheads": [], + "description": "Get the status of the OBS replay buffer.", + "return": "{boolean} `isReplayBufferActive` Current recording status.", + "api": "requests", + "name": "GetReplayBufferStatus", + "category": "replay buffer", + "since": "unreleased", + "returns": [ + { + "type": "boolean", + "name": "isReplayBufferActive", + "description": "Current recording status." + } + ], + "names": [ + { + "name": "", + "description": "GetReplayBufferStatus" + } + ], + "categories": [ + { + "name": "", + "description": "replay buffer" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "GetReplayBufferStatus" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Toggle the Replay Buffer on/off.", + "api": "requests", + "name": "StartStopReplayBuffer", + "category": "replay buffer", + "since": "4.2.0", + "names": [ + { + "name": "", + "description": "StartStopReplayBuffer" + } + ], + "categories": [ + { + "name": "", + "description": "replay buffer" + } + ], + "sinces": [ + { + "name": "", + "description": "4.2.0" + } + ], + "heading": { + "level": 2, + "text": "StartStopReplayBuffer" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Start recording into the Replay Buffer.\nWill return an `error` if the Replay Buffer is already active or if the\n\"Save Replay Buffer\" hotkey is not set in OBS' settings.\nSetting this hotkey is mandatory, even when triggering saves only\nthrough obs-websocket.", + "api": "requests", + "name": "StartReplayBuffer", + "category": "replay buffer", + "since": "4.2.0", + "names": [ + { + "name": "", + "description": "StartReplayBuffer" + } + ], + "categories": [ + { + "name": "", + "description": "replay buffer" + } + ], + "sinces": [ + { + "name": "", + "description": "4.2.0" + } + ], + "heading": { + "level": 2, + "text": "StartReplayBuffer" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Stop recording into the Replay Buffer.\nWill return an `error` if the Replay Buffer is not active.", + "api": "requests", + "name": "StopReplayBuffer", + "category": "replay buffer", + "since": "4.2.0", + "names": [ + { + "name": "", + "description": "StopReplayBuffer" + } + ], + "categories": [ + { + "name": "", + "description": "replay buffer" + } + ], + "sinces": [ + { + "name": "", + "description": "4.2.0" + } + ], + "heading": { + "level": 2, + "text": "StopReplayBuffer" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Flush and save the contents of the Replay Buffer to disk. This is\nbasically the same as triggering the \"Save Replay Buffer\" hotkey.\nWill return an `error` if the Replay Buffer is not active.", + "api": "requests", + "name": "SaveReplayBuffer", + "category": "replay buffer", + "since": "4.2.0", + "names": [ + { + "name": "", + "description": "SaveReplayBuffer" + } + ], + "categories": [ + { + "name": "", + "description": "replay buffer" + } + ], + "sinces": [ + { + "name": "", + "description": "4.2.0" + } + ], + "heading": { + "level": 2, + "text": "SaveReplayBuffer" + }, + "lead": "", + "type": "class", + "examples": [] + } + ], + "scene collections": [ + { + "subheads": [], + "description": "Change the active scene collection.", + "param": "{String} `sc-name` Name of the desired scene collection.", + "api": "requests", + "name": "SetCurrentSceneCollection", + "category": "scene collections", + "since": "4.0.0", + "params": [ + { + "type": "String", + "name": "sc-name", + "description": "Name of the desired scene collection." + } + ], + "names": [ + { + "name": "", + "description": "SetCurrentSceneCollection" + } + ], + "categories": [ + { + "name": "", + "description": "scene collections" + } + ], + "sinces": [ + { + "name": "", + "description": "4.0.0" + } + ], + "heading": { + "level": 2, + "text": "SetCurrentSceneCollection" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get the name of the current scene collection.", + "return": "{String} `sc-name` Name of the currently active scene collection.", + "api": "requests", + "name": "GetCurrentSceneCollection", + "category": "scene collections", + "since": "4.0.0", + "returns": [ + { + "type": "String", + "name": "sc-name", + "description": "Name of the currently active scene collection." + } + ], + "names": [ + { + "name": "", + "description": "GetCurrentSceneCollection" + } + ], + "categories": [ + { + "name": "", + "description": "scene collections" + } + ], + "sinces": [ + { + "name": "", + "description": "4.0.0" + } + ], + "heading": { + "level": 2, + "text": "GetCurrentSceneCollection" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "List available scene collections", + "return": "{Array} `scene-collections` Scene collections list", + "api": "requests", + "name": "ListSceneCollections", + "category": "scene collections", + "since": "4.0.0", + "returns": [ + { + "type": "Array", + "name": "scene-collections", + "description": "Scene collections list" + } + ], + "names": [ + { + "name": "", + "description": "ListSceneCollections" + } + ], + "categories": [ + { + "name": "", + "description": "scene collections" + } + ], + "sinces": [ + { + "name": "", + "description": "4.0.0" + } + ], + "heading": { + "level": 2, + "text": "ListSceneCollections" + }, + "lead": "", + "type": "class", + "examples": [] + } + ], + "scene items": [ + { + "subheads": [], + "description": "Get a list of all scene items in a scene.", + "param": "{String} `sceneName` Name of the scene to get the list of scene items from.", + "return": [ + "{Array} `sceneItems` Array of scene items", + "{int} `sceneItems.*.itemId` Unique item id of the source item", + "{String} `sceneItems.*.sourceKind` ID if the scene item's source. For example `vlc_source` or `image_source`", + "{String} `sceneItems.*.sourceName` Name of the scene item's source", + "{String} `sceneItems.*.sourceType` Type of the scene item's source. Either `input`, `group`, or `scene`" + ], + "api": "requests", + "name": "GetSceneItemList", + "category": "scene items", + "since": "unreleased", + "returns": [ + { + "type": "Array", + "name": "sceneItems", + "description": "Array of scene items" + }, + { + "type": "int", + "name": "sceneItems.*.itemId", + "description": "Unique item id of the source item" + }, + { + "type": "String", + "name": "sceneItems.*.sourceKind", + "description": "ID if the scene item's source. For example `vlc_source` or `image_source`" + }, + { + "type": "String", + "name": "sceneItems.*.sourceName", + "description": "Name of the scene item's source" + }, + { + "type": "String", + "name": "sceneItems.*.sourceType", + "description": "Type of the scene item's source. Either `input`, `group`, or `scene`" + } + ], + "params": [ + { + "type": "String", + "name": "sceneName", + "description": "Name of the scene to get the list of scene items from." + } + ], + "names": [ + { + "name": "", + "description": "GetSceneItemList" + } + ], + "categories": [ + { + "name": "", + "description": "scene items" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "GetSceneItemList" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Gets the scene specific properties of the specified source item.\nCoordinates are relative to the item's parent (the scene or group it belongs to).", + "param": [ + "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the current scene.", + "{String | Object} `item` Scene Item name (if this field is a string) or specification (if it is an object).", + "{String (optional)} `item.name` Scene Item name (if the `item` field is an object)", + "{int (optional)} `item.id` Scene Item ID (if the `item` field is an object)" + ], + "return": [ + "{String} `name` Scene Item name.", + "{int} `itemId` Scene Item ID.", + "{double} `position.x` The x position of the source from the left.", + "{double} `position.y` The y position of the source from the top.", + "{int} `position.alignment` The point on the source that the item is manipulated from.", + "{double} `rotation` The clockwise rotation of the item in degrees around the point of alignment.", + "{double} `scale.x` The x-scale factor of the source.", + "{double} `scale.y` The y-scale factor of the source.", + "{int} `crop.top` The number of pixels cropped off the top of the source before scaling.", + "{int} `crop.right` The number of pixels cropped off the right of the source before scaling.", + "{int} `crop.bottom` The number of pixels cropped off the bottom of the source before scaling.", + "{int} `crop.left` The number of pixels cropped off the left of the source before scaling.", + "{bool} `visible` If the source is visible.", + "{bool} `muted` If the source is muted.", + "{bool} `locked` If the source's transform is locked.", + "{String} `bounds.type` Type of bounding box. Can be \"OBS_BOUNDS_STRETCH\", \"OBS_BOUNDS_SCALE_INNER\", \"OBS_BOUNDS_SCALE_OUTER\", \"OBS_BOUNDS_SCALE_TO_WIDTH\", \"OBS_BOUNDS_SCALE_TO_HEIGHT\", \"OBS_BOUNDS_MAX_ONLY\" or \"OBS_BOUNDS_NONE\".", + "{int} `bounds.alignment` Alignment of the bounding box.", + "{double} `bounds.x` Width of the bounding box.", + "{double} `bounds.y` Height of the bounding box.", + "{int} `sourceWidth` Base width (without scaling) of the source", + "{int} `sourceHeight` Base source (without scaling) of the source", + "{double} `width` Scene item width (base source width multiplied by the horizontal scaling factor)", + "{double} `height` Scene item height (base source height multiplied by the vertical scaling factor)", + "{int} `alignment` The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis.", + "{String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group)", + "{Array (optional)} `groupChildren` List of children (if this item is a group)" + ], + "api": "requests", + "name": "GetSceneItemProperties", + "category": "scene items", + "since": "4.3.0", + "returns": [ + { + "type": "String", + "name": "name", + "description": "Scene Item name." + }, + { + "type": "int", + "name": "itemId", + "description": "Scene Item ID." + }, + { + "type": "double", + "name": "position.x", + "description": "The x position of the source from the left." + }, + { + "type": "double", + "name": "position.y", + "description": "The y position of the source from the top." + }, + { + "type": "int", + "name": "position.alignment", + "description": "The point on the source that the item is manipulated from." + }, + { + "type": "double", + "name": "rotation", + "description": "The clockwise rotation of the item in degrees around the point of alignment." + }, + { + "type": "double", + "name": "scale.x", + "description": "The x-scale factor of the source." + }, + { + "type": "double", + "name": "scale.y", + "description": "The y-scale factor of the source." + }, + { + "type": "int", + "name": "crop.top", + "description": "The number of pixels cropped off the top of the source before scaling." + }, + { + "type": "int", + "name": "crop.right", + "description": "The number of pixels cropped off the right of the source before scaling." + }, + { + "type": "int", + "name": "crop.bottom", + "description": "The number of pixels cropped off the bottom of the source before scaling." + }, + { + "type": "int", + "name": "crop.left", + "description": "The number of pixels cropped off the left of the source before scaling." + }, + { + "type": "bool", + "name": "visible", + "description": "If the source is visible." + }, + { + "type": "bool", + "name": "muted", + "description": "If the source is muted." + }, + { + "type": "bool", + "name": "locked", + "description": "If the source's transform is locked." + }, + { + "type": "String", + "name": "bounds.type", + "description": "Type of bounding box. Can be \"OBS_BOUNDS_STRETCH\", \"OBS_BOUNDS_SCALE_INNER\", \"OBS_BOUNDS_SCALE_OUTER\", \"OBS_BOUNDS_SCALE_TO_WIDTH\", \"OBS_BOUNDS_SCALE_TO_HEIGHT\", \"OBS_BOUNDS_MAX_ONLY\" or \"OBS_BOUNDS_NONE\"." + }, + { + "type": "int", + "name": "bounds.alignment", + "description": "Alignment of the bounding box." + }, + { + "type": "double", + "name": "bounds.x", + "description": "Width of the bounding box." + }, + { + "type": "double", + "name": "bounds.y", + "description": "Height of the bounding box." + }, + { + "type": "int", + "name": "sourceWidth", + "description": "Base width (without scaling) of the source" + }, + { + "type": "int", + "name": "sourceHeight", + "description": "Base source (without scaling) of the source" + }, + { + "type": "double", + "name": "width", + "description": "Scene item width (base source width multiplied by the horizontal scaling factor)" + }, + { + "type": "double", + "name": "height", + "description": "Scene item height (base source height multiplied by the vertical scaling factor)" + }, + { + "type": "int", + "name": "alignment", + "description": "The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis." + }, + { + "type": "String (optional)", + "name": "parentGroupName", + "description": "Name of the item's parent (if this item belongs to a group)" + }, + { + "type": "Array (optional)", + "name": "groupChildren", + "description": "List of children (if this item is a group)" + } + ], + "params": [ + { + "type": "String (optional)", + "name": "scene-name", + "description": "Name of the scene the scene item belongs to. Defaults to the current scene." + }, + { + "type": "String | Object", + "name": "item", + "description": "Scene Item name (if this field is a string) or specification (if it is an object)." + }, + { + "type": "String (optional)", + "name": "item.name", + "description": "Scene Item name (if the `item` field is an object)" + }, + { + "type": "int (optional)", + "name": "item.id", + "description": "Scene Item ID (if the `item` field is an object)" + } + ], + "names": [ + { + "name": "", + "description": "GetSceneItemProperties" + } + ], + "categories": [ + { + "name": "", + "description": "scene items" + } + ], + "sinces": [ + { + "name": "", + "description": "4.3.0" + } + ], + "heading": { + "level": 2, + "text": "GetSceneItemProperties" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Sets the scene specific properties of a source. Unspecified properties will remain unchanged.\nCoordinates are relative to the item's parent (the scene or group it belongs to).", + "param": [ + "{String (optional)} `scene-name` Name of the scene the source item belongs to. Defaults to the current scene.", + "{String | Object} `item` Scene Item name (if this field is a string) or specification (if it is an object).", + "{String (optional)} `item.name` Scene Item name (if the `item` field is an object)", + "{int (optional)} `item.id` Scene Item ID (if the `item` field is an object)", + "{double (optional)} `position.x` The new x position of the source.", + "{double (optional)} `position.y` The new y position of the source.", + "{int (optional)} `position.alignment` The new alignment of the source.", + "{double (optional)} `rotation` The new clockwise rotation of the item in degrees.", + "{double (optional)} `scale.x` The new x scale of the item.", + "{double (optional)} `scale.y` The new y scale of the item.", + "{int (optional)} `crop.top` The new amount of pixels cropped off the top of the source before scaling.", + "{int (optional)} `crop.bottom` The new amount of pixels cropped off the bottom of the source before scaling.", + "{int (optional)} `crop.left` The new amount of pixels cropped off the left of the source before scaling.", + "{int (optional)} `crop.right` The new amount of pixels cropped off the right of the source before scaling.", + "{bool (optional)} `visible` The new visibility of the source. 'true' shows source, 'false' hides source.", + "{bool (optional)} `locked` The new locked status of the source. 'true' keeps it in its current position, 'false' allows movement.", + "{String (optional)} `bounds.type` The new bounds type of the source. Can be \"OBS_BOUNDS_STRETCH\", \"OBS_BOUNDS_SCALE_INNER\", \"OBS_BOUNDS_SCALE_OUTER\", \"OBS_BOUNDS_SCALE_TO_WIDTH\", \"OBS_BOUNDS_SCALE_TO_HEIGHT\", \"OBS_BOUNDS_MAX_ONLY\" or \"OBS_BOUNDS_NONE\".", + "{int (optional)} `bounds.alignment` The new alignment of the bounding box. (0-2, 4-6, 8-10)", + "{double (optional)} `bounds.x` The new width of the bounding box.", + "{double (optional)} `bounds.y` The new height of the bounding box." + ], + "api": "requests", + "name": "SetSceneItemProperties", + "category": "scene items", + "since": "4.3.0", + "params": [ + { + "type": "String (optional)", + "name": "scene-name", + "description": "Name of the scene the source item belongs to. Defaults to the current scene." + }, + { + "type": "String | Object", + "name": "item", + "description": "Scene Item name (if this field is a string) or specification (if it is an object)." + }, + { + "type": "String (optional)", + "name": "item.name", + "description": "Scene Item name (if the `item` field is an object)" + }, + { + "type": "int (optional)", + "name": "item.id", + "description": "Scene Item ID (if the `item` field is an object)" + }, + { + "type": "double (optional)", + "name": "position.x", + "description": "The new x position of the source." + }, + { + "type": "double (optional)", + "name": "position.y", + "description": "The new y position of the source." + }, + { + "type": "int (optional)", + "name": "position.alignment", + "description": "The new alignment of the source." + }, + { + "type": "double (optional)", + "name": "rotation", + "description": "The new clockwise rotation of the item in degrees." + }, + { + "type": "double (optional)", + "name": "scale.x", + "description": "The new x scale of the item." + }, + { + "type": "double (optional)", + "name": "scale.y", + "description": "The new y scale of the item." + }, + { + "type": "int (optional)", + "name": "crop.top", + "description": "The new amount of pixels cropped off the top of the source before scaling." + }, + { + "type": "int (optional)", + "name": "crop.bottom", + "description": "The new amount of pixels cropped off the bottom of the source before scaling." + }, + { + "type": "int (optional)", + "name": "crop.left", + "description": "The new amount of pixels cropped off the left of the source before scaling." + }, + { + "type": "int (optional)", + "name": "crop.right", + "description": "The new amount of pixels cropped off the right of the source before scaling." + }, + { + "type": "bool (optional)", + "name": "visible", + "description": "The new visibility of the source. 'true' shows source, 'false' hides source." + }, + { + "type": "bool (optional)", + "name": "locked", + "description": "The new locked status of the source. 'true' keeps it in its current position, 'false' allows movement." + }, + { + "type": "String (optional)", + "name": "bounds.type", + "description": "The new bounds type of the source. Can be \"OBS_BOUNDS_STRETCH\", \"OBS_BOUNDS_SCALE_INNER\", \"OBS_BOUNDS_SCALE_OUTER\", \"OBS_BOUNDS_SCALE_TO_WIDTH\", \"OBS_BOUNDS_SCALE_TO_HEIGHT\", \"OBS_BOUNDS_MAX_ONLY\" or \"OBS_BOUNDS_NONE\"." + }, + { + "type": "int (optional)", + "name": "bounds.alignment", + "description": "The new alignment of the bounding box. (0-2, 4-6, 8-10)" + }, + { + "type": "double (optional)", + "name": "bounds.x", + "description": "The new width of the bounding box." + }, + { + "type": "double (optional)", + "name": "bounds.y", + "description": "The new height of the bounding box." + } + ], + "names": [ + { + "name": "", + "description": "SetSceneItemProperties" + } + ], + "categories": [ + { + "name": "", + "description": "scene items" + } + ], + "sinces": [ + { + "name": "", + "description": "4.3.0" + } + ], + "heading": { + "level": 2, + "text": "SetSceneItemProperties" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Reset a scene item.", + "param": [ + "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the current scene.", + "{String | Object} `item` Scene Item name (if this field is a string) or specification (if it is an object).", + "{String (optional)} `item.name` Scene Item name (if the `item` field is an object)", + "{int (optional)} `item.id` Scene Item ID (if the `item` field is an object)" + ], + "api": "requests", + "name": "ResetSceneItem", + "category": "scene items", + "since": "4.2.0", + "params": [ + { + "type": "String (optional)", + "name": "scene-name", + "description": "Name of the scene the scene item belongs to. Defaults to the current scene." + }, + { + "type": "String | Object", + "name": "item", + "description": "Scene Item name (if this field is a string) or specification (if it is an object)." + }, + { + "type": "String (optional)", + "name": "item.name", + "description": "Scene Item name (if the `item` field is an object)" + }, + { + "type": "int (optional)", + "name": "item.id", + "description": "Scene Item ID (if the `item` field is an object)" + } + ], + "names": [ + { + "name": "", + "description": "ResetSceneItem" + } + ], + "categories": [ + { + "name": "", + "description": "scene items" + } + ], + "sinces": [ + { + "name": "", + "description": "4.2.0" + } + ], + "heading": { + "level": 2, + "text": "ResetSceneItem" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Show or hide a specified source item in a specified scene.", + "param": [ + "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the currently active scene.", + "{String} `source` Scene Item name.", + "{boolean} `render` true = shown ; false = hidden" + ], + "api": "requests", + "name": "SetSceneItemRender", + "category": "scene items", + "since": "0.3", + "deprecated": "Since 4.3.0. Prefer the use of SetSceneItemProperties.", + "params": [ + { + "type": "String (optional)", + "name": "scene-name", + "description": "Name of the scene the scene item belongs to. Defaults to the currently active scene." + }, + { + "type": "String", + "name": "source", + "description": "Scene Item name." + }, + { + "type": "boolean", + "name": "render", + "description": "true = shown ; false = hidden" + } + ], + "names": [ + { + "name": "", + "description": "SetSceneItemRender" + } + ], + "categories": [ + { + "name": "", + "description": "scene items" + } + ], + "sinces": [ + { + "name": "", + "description": "0.3" + } + ], + "deprecateds": [ + { + "name": "", + "description": "Since 4.3.0. Prefer the use of SetSceneItemProperties." + } + ], + "heading": { + "level": 2, + "text": "SetSceneItemRender" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Sets the coordinates of a specified source item.", + "param": [ + "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the current scene.", + "{String} `item` Scene Item name.", + "{double} `x` X coordinate.", + "{double} `y` Y coordinate." + ], + "api": "requests", + "name": "SetSceneItemPosition", + "category": "scene items", + "since": "4.0.0", + "deprecated": "Since 4.3.0. Prefer the use of SetSceneItemProperties.", + "params": [ + { + "type": "String (optional)", + "name": "scene-name", + "description": "Name of the scene the scene item belongs to. Defaults to the current scene." + }, + { + "type": "String", + "name": "item", + "description": "Scene Item name." + }, + { + "type": "double", + "name": "x", + "description": "X coordinate." + }, + { + "type": "double", + "name": "y", + "description": "Y coordinate." + } + ], + "names": [ + { + "name": "", + "description": "SetSceneItemPosition" + } + ], + "categories": [ + { + "name": "", + "description": "scene items" + } + ], + "sinces": [ + { + "name": "", + "description": "4.0.0" + } + ], + "deprecateds": [ + { + "name": "", + "description": "Since 4.3.0. Prefer the use of SetSceneItemProperties." + } + ], + "heading": { + "level": 2, + "text": "SetSceneItemPosition" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Set the transform of the specified source item.", + "param": [ + "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the current scene.", + "{String} `item` Scene Item name.", + "{double} `x-scale` Width scale factor.", + "{double} `y-scale` Height scale factor.", + "{double} `rotation` Source item rotation (in degrees)." + ], + "api": "requests", + "name": "SetSceneItemTransform", + "category": "scene items", + "since": "4.0.0", + "deprecated": "Since 4.3.0. Prefer the use of SetSceneItemProperties.", + "params": [ + { + "type": "String (optional)", + "name": "scene-name", + "description": "Name of the scene the scene item belongs to. Defaults to the current scene." + }, + { + "type": "String", + "name": "item", + "description": "Scene Item name." + }, + { + "type": "double", + "name": "x-scale", + "description": "Width scale factor." + }, + { + "type": "double", + "name": "y-scale", + "description": "Height scale factor." + }, + { + "type": "double", + "name": "rotation", + "description": "Source item rotation (in degrees)." + } + ], + "names": [ + { + "name": "", + "description": "SetSceneItemTransform" + } + ], + "categories": [ + { + "name": "", + "description": "scene items" + } + ], + "sinces": [ + { + "name": "", + "description": "4.0.0" + } + ], + "deprecateds": [ + { + "name": "", + "description": "Since 4.3.0. Prefer the use of SetSceneItemProperties." + } + ], + "heading": { + "level": 2, + "text": "SetSceneItemTransform" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Sets the crop coordinates of the specified source item.", + "param": [ + "{String (optional)} `scene-name` Name of the scene the scene item belongs to. Defaults to the current scene.", + "{String} `item` Scene Item name.", + "{int} `top` Pixel position of the top of the source item.", + "{int} `bottom` Pixel position of the bottom of the source item.", + "{int} `left` Pixel position of the left of the source item.", + "{int} `right` Pixel position of the right of the source item." + ], + "api": "requests", + "name": "SetSceneItemCrop", + "category": "scene items", + "since": "4.1.0", + "deprecated": "Since 4.3.0. Prefer the use of SetSceneItemProperties.", + "params": [ + { + "type": "String (optional)", + "name": "scene-name", + "description": "Name of the scene the scene item belongs to. Defaults to the current scene." + }, + { + "type": "String", + "name": "item", + "description": "Scene Item name." + }, + { + "type": "int", + "name": "top", + "description": "Pixel position of the top of the source item." + }, + { + "type": "int", + "name": "bottom", + "description": "Pixel position of the bottom of the source item." + }, + { + "type": "int", + "name": "left", + "description": "Pixel position of the left of the source item." + }, + { + "type": "int", + "name": "right", + "description": "Pixel position of the right of the source item." + } + ], + "names": [ + { + "name": "", + "description": "SetSceneItemCrop" + } + ], + "categories": [ + { + "name": "", + "description": "scene items" + } + ], + "sinces": [ + { + "name": "", + "description": "4.1.0" + } + ], + "deprecateds": [ + { + "name": "", + "description": "Since 4.3.0. Prefer the use of SetSceneItemProperties." + } + ], + "heading": { + "level": 2, + "text": "SetSceneItemCrop" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Deletes a scene item.", + "param": [ + "{String (optional)} `scene` Name of the scene the scene item belongs to. Defaults to the current scene.", + "{Object} `item` Scene item to delete (required)", + "{String} `item.name` Scene Item name (prefer `id`, including both is acceptable).", + "{int} `item.id` Scene Item ID." + ], + "api": "requests", + "name": "DeleteSceneItem", + "category": "scene items", + "since": "4.5.0", + "params": [ + { + "type": "String (optional)", + "name": "scene", + "description": "Name of the scene the scene item belongs to. Defaults to the current scene." + }, + { + "type": "Object", + "name": "item", + "description": "Scene item to delete (required)" + }, + { + "type": "String", + "name": "item.name", + "description": "Scene Item name (prefer `id`, including both is acceptable)." + }, + { + "type": "int", + "name": "item.id", + "description": "Scene Item ID." + } + ], + "names": [ + { + "name": "", + "description": "DeleteSceneItem" + } + ], + "categories": [ + { + "name": "", + "description": "scene items" + } + ], + "sinces": [ + { + "name": "", + "description": "4.5.0" + } + ], + "heading": { + "level": 2, + "text": "DeleteSceneItem" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Creates a scene item in a scene. In other words, this is how you add a source into a scene.", + "param": [ + "{String} `sceneName` Name of the scene to create the scene item in", + "{String} `sourceName` Name of the source to be added", + "{boolean} `setVisible` Whether to make the sceneitem visible on creation or not. Default `true`" + ], + "return": "{int} `itemId` Numerical ID of the created scene item", + "api": "requests", + "name": "AddSceneItem", + "category": "scene items", + "since": "unreleased", + "returns": [ + { + "type": "int", + "name": "itemId", + "description": "Numerical ID of the created scene item" + } + ], + "params": [ + { + "type": "String", + "name": "sceneName", + "description": "Name of the scene to create the scene item in" + }, + { + "type": "String", + "name": "sourceName", + "description": "Name of the source to be added" + }, + { + "type": "boolean", + "name": "setVisible", + "description": "Whether to make the sceneitem visible on creation or not. Default `true`" + } + ], + "names": [ + { + "name": "", + "description": "AddSceneItem" + } + ], + "categories": [ + { + "name": "", + "description": "scene items" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "AddSceneItem" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Duplicates a scene item.", + "param": [ + "{String (optional)} `fromScene` Name of the scene to copy the item from. Defaults to the current scene.", + "{String (optional)} `toScene` Name of the scene to create the item in. Defaults to the current scene.", + "{Object} `item` Scene Item to duplicate from the source scene (required)", + "{String} `item.name` Scene Item name (prefer `id`, including both is acceptable).", + "{int} `item.id` Scene Item ID." + ], + "return": [ + "{String} `scene` Name of the scene where the new item was created", + "{Object} `item` New item info", + "{int} `item.id` New item ID", + "{String} `item.name` New item name" + ], + "api": "requests", + "name": "DuplicateSceneItem", + "category": "scene items", + "since": "4.5.0", + "returns": [ + { + "type": "String", + "name": "scene", + "description": "Name of the scene where the new item was created" + }, + { + "type": "Object", + "name": "item", + "description": "New item info" + }, + { + "type": "int", + "name": "item.id", + "description": "New item ID" + }, + { + "type": "String", + "name": "item.name", + "description": "New item name" + } + ], + "params": [ + { + "type": "String (optional)", + "name": "fromScene", + "description": "Name of the scene to copy the item from. Defaults to the current scene." + }, + { + "type": "String (optional)", + "name": "toScene", + "description": "Name of the scene to create the item in. Defaults to the current scene." + }, + { + "type": "Object", + "name": "item", + "description": "Scene Item to duplicate from the source scene (required)" + }, + { + "type": "String", + "name": "item.name", + "description": "Scene Item name (prefer `id`, including both is acceptable)." + }, + { + "type": "int", + "name": "item.id", + "description": "Scene Item ID." + } + ], + "names": [ + { + "name": "", + "description": "DuplicateSceneItem" + } + ], + "categories": [ + { + "name": "", + "description": "scene items" + } + ], + "sinces": [ + { + "name": "", + "description": "4.5.0" + } + ], + "heading": { + "level": 2, + "text": "DuplicateSceneItem" + }, + "lead": "", + "type": "class", + "examples": [] + } + ], + "scenes": [ + { + "subheads": [], + "description": "Switch to the specified scene.", + "param": "{String} `scene-name` Name of the scene to switch to.", + "api": "requests", + "name": "SetCurrentScene", + "category": "scenes", + "since": "0.3", + "params": [ + { + "type": "String", + "name": "scene-name", + "description": "Name of the scene to switch to." + } + ], + "names": [ + { + "name": "", + "description": "SetCurrentScene" + } + ], + "categories": [ + { + "name": "", + "description": "scenes" + } + ], + "sinces": [ + { + "name": "", + "description": "0.3" + } + ], + "heading": { + "level": 2, + "text": "SetCurrentScene" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get the current scene's name and source items.", + "return": [ + "{String} `name` Name of the currently active scene.", + "{Array} `sources` Ordered list of the current scene's source items." + ], + "api": "requests", + "name": "GetCurrentScene", + "category": "scenes", + "since": "0.3", + "returns": [ + { + "type": "String", + "name": "name", + "description": "Name of the currently active scene." + }, + { + "type": "Array", + "name": "sources", + "description": "Ordered list of the current scene's source items." + } + ], + "names": [ + { + "name": "", + "description": "GetCurrentScene" + } + ], + "categories": [ + { + "name": "", + "description": "scenes" + } + ], + "sinces": [ + { + "name": "", + "description": "0.3" + } + ], + "heading": { + "level": 2, + "text": "GetCurrentScene" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get a list of scenes in the currently active profile.", + "return": [ + "{String} `current-scene` Name of the currently active scene.", + "{Array} `scenes` Ordered list of the current profile's scenes (See [GetCurrentScene](#getcurrentscene) for more information)." + ], + "api": "requests", + "name": "GetSceneList", + "category": "scenes", + "since": "0.3", + "returns": [ + { + "type": "String", + "name": "current-scene", + "description": "Name of the currently active scene." + }, + { + "type": "Array", + "name": "scenes", + "description": "Ordered list of the current profile's scenes (See [GetCurrentScene](#getcurrentscene) for more information)." + } + ], + "names": [ + { + "name": "", + "description": "GetSceneList" + } + ], + "categories": [ + { + "name": "", + "description": "scenes" + } + ], + "sinces": [ + { + "name": "", + "description": "0.3" + } + ], + "heading": { + "level": 2, + "text": "GetSceneList" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Create a new scene scene.", + "param": "{String} `sceneName` Name of the scene to create.", + "api": "requests", + "name": "CreateScene", + "category": "scenes", + "since": "4.8.0", + "params": [ + { + "type": "String", + "name": "sceneName", + "description": "Name of the scene to create." + } + ], + "names": [ + { + "name": "", + "description": "CreateScene" + } + ], + "categories": [ + { + "name": "", + "description": "scenes" + } + ], + "sinces": [ + { + "name": "", + "description": "4.8.0" + } + ], + "heading": { + "level": 2, + "text": "CreateScene" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Changes the order of scene items in the requested scene.", + "param": [ + "{String (optional)} `scene` Name of the scene to reorder (defaults to current).", + "{Array} `items` Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene", + "{int (optional)} `items[].id` Id of a specific scene item. Unique on a scene by scene basis.", + "{String (optional)} `items[].name` Name of a scene item. Sufficiently unique if no scene items share sources within the scene." + ], + "api": "requests", + "name": "ReorderSceneItems", + "category": "scenes", + "since": "4.5.0", + "params": [ + { + "type": "String (optional)", + "name": "scene", + "description": "Name of the scene to reorder (defaults to current)." + }, + { + "type": "Array", + "name": "items", + "description": "Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene" + }, + { + "type": "int (optional)", + "name": "items[].id", + "description": "Id of a specific scene item. Unique on a scene by scene basis." + }, + { + "type": "String (optional)", + "name": "items[].name", + "description": "Name of a scene item. Sufficiently unique if no scene items share sources within the scene." + } + ], + "names": [ + { + "name": "", + "description": "ReorderSceneItems" + } + ], + "categories": [ + { + "name": "", + "description": "scenes" + } + ], + "sinces": [ + { + "name": "", + "description": "4.5.0" + } + ], + "heading": { + "level": 2, + "text": "ReorderSceneItems" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Set a scene to use a specific transition override.", + "param": [ + "{String} `sceneName` Name of the scene to switch to.", + "{String} `transitionName` Name of the transition to use.", + "{int (Optional)} `transitionDuration` Duration in milliseconds of the transition if transition is not fixed. Defaults to the current duration specified in the UI if there is no current override and this value is not given." + ], + "api": "requests", + "name": "SetSceneTransitionOverride", + "category": "scenes", + "since": "4.9.0", + "params": [ + { + "type": "String", + "name": "sceneName", + "description": "Name of the scene to switch to." + }, + { + "type": "String", + "name": "transitionName", + "description": "Name of the transition to use." + }, + { + "type": "int (Optional)", + "name": "transitionDuration", + "description": "Duration in milliseconds of the transition if transition is not fixed. Defaults to the current duration specified in the UI if there is no current override and this value is not given." + } + ], + "names": [ + { + "name": "", + "description": "SetSceneTransitionOverride" + } + ], + "categories": [ + { + "name": "", + "description": "scenes" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "SetSceneTransitionOverride" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Remove any transition override on a scene.", + "param": "{String} `sceneName` Name of the scene to switch to.", + "api": "requests", + "name": "RemoveSceneTransitionOverride", + "category": "scenes", + "since": "4.9.0", + "params": [ + { + "type": "String", + "name": "sceneName", + "description": "Name of the scene to switch to." + } + ], + "names": [ + { + "name": "", + "description": "RemoveSceneTransitionOverride" + } + ], + "categories": [ + { + "name": "", + "description": "scenes" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "RemoveSceneTransitionOverride" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Get the current scene transition override.", + "param": "{String} `sceneName` Name of the scene to switch to.", + "return": [ + "{String} `transitionName` Name of the current overriding transition. Empty string if no override is set.", + "{int} `transitionDuration` Transition duration. `-1` if no override is set." + ], + "api": "requests", + "name": "GetSceneTransitionOverride", + "category": "scenes", + "since": "4.9.0", + "returns": [ + { + "type": "String", + "name": "transitionName", + "description": "Name of the current overriding transition. Empty string if no override is set." + }, + { + "type": "int", + "name": "transitionDuration", + "description": "Transition duration. `-1` if no override is set." + } + ], + "params": [ + { + "type": "String", + "name": "sceneName", + "description": "Name of the scene to switch to." + } + ], + "names": [ + { + "name": "", + "description": "GetSceneTransitionOverride" + } + ], + "categories": [ + { + "name": "", + "description": "scenes" + } + ], + "sinces": [ + { + "name": "", + "description": "4.9.0" + } + ], + "heading": { + "level": 2, + "text": "GetSceneTransitionOverride" + }, + "lead": "", + "type": "class", + "examples": [] + } + ], "streaming": [ { "subheads": [], diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index f7b999a2..b2c5a84e 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -92,6 +92,8 @@ auth_response = base64_encode(auth_response_hash) + [SourceDestroyed](#sourcedestroyed) + [SourceVolumeChanged](#sourcevolumechanged) + [SourceMuteStateChanged](#sourcemutestatechanged) + + [SourceAudioDeactivated](#sourceaudiodeactivated) + + [SourceAudioActivated](#sourceaudioactivated) + [SourceAudioSyncOffsetChanged](#sourceaudiosyncoffsetchanged) + [SourceAudioMixersChanged](#sourceaudiomixerschanged) + [SourceRenamed](#sourcerenamed) @@ -99,6 +101,15 @@ auth_response = base64_encode(auth_response_hash) + [SourceFilterRemoved](#sourcefilterremoved) + [SourceFilterVisibilityChanged](#sourcefiltervisibilitychanged) + [SourceFiltersReordered](#sourcefiltersreordered) + * [Media](#media) + + [MediaPlaying](#mediaplaying) + + [MediaPaused](#mediapaused) + + [MediaRestarted](#mediarestarted) + + [MediaStopped](#mediastopped) + + [MediaNext](#medianext) + + [MediaPrevious](#mediaprevious) + + [MediaStarted](#mediastarted) + + [MediaEnded](#mediaended) * [Scene Items](#scene-items) + [SourceOrderChanged](#sourceorderchanged) + [SceneItemAdded](#sceneitemadded) @@ -123,51 +134,19 @@ auth_response = base64_encode(auth_response_hash) + [BroadcastCustomMessage](#broadcastcustommessage-1) + [GetVideoInfo](#getvideoinfo) + [OpenProjector](#openprojector) - * [Outputs](#outputs) - + [ListOutputs](#listoutputs) - + [GetOutputInfo](#getoutputinfo) - + [StartOutput](#startoutput) - + [StopOutput](#stopoutput) - * [Profiles](#profiles-1) - + [SetCurrentProfile](#setcurrentprofile) - + [GetCurrentProfile](#getcurrentprofile) - + [ListProfiles](#listprofiles) - * [Recording](#recording-1) - + [StartStopRecording](#startstoprecording) - + [StartRecording](#startrecording) - + [StopRecording](#stoprecording) - + [PauseRecording](#pauserecording) - + [ResumeRecording](#resumerecording) - + [SetRecordingFolder](#setrecordingfolder) - + [GetRecordingFolder](#getrecordingfolder) - * [Replay Buffer](#replay-buffer-1) - + [StartStopReplayBuffer](#startstopreplaybuffer) - + [StartReplayBuffer](#startreplaybuffer) - + [StopReplayBuffer](#stopreplaybuffer) - + [SaveReplayBuffer](#savereplaybuffer) - * [Scene Collections](#scene-collections) - + [SetCurrentSceneCollection](#setcurrentscenecollection) - + [GetCurrentSceneCollection](#getcurrentscenecollection) - + [ListSceneCollections](#listscenecollections) - * [Scene Items](#scene-items-1) - + [GetSceneItemProperties](#getsceneitemproperties) - + [SetSceneItemProperties](#setsceneitemproperties) - + [ResetSceneItem](#resetsceneitem) - + [SetSceneItemRender](#setsceneitemrender) - + [SetSceneItemPosition](#setsceneitemposition) - + [SetSceneItemTransform](#setsceneitemtransform) - + [SetSceneItemCrop](#setsceneitemcrop) - + [DeleteSceneItem](#deletesceneitem) - + [DuplicateSceneItem](#duplicatesceneitem) - * [Scenes](#scenes-1) - + [SetCurrentScene](#setcurrentscene) - + [GetCurrentScene](#getcurrentscene) - + [GetSceneList](#getscenelist) - + [ReorderSceneItems](#reordersceneitems) - + [SetSceneTransitionOverride](#setscenetransitionoverride) - + [RemoveSceneTransitionOverride](#removescenetransitionoverride) - + [GetSceneTransitionOverride](#getscenetransitionoverride) + * [Media Control](#media-control) + + [PlayPauseMedia](#playpausemedia) + + [RestartMedia](#restartmedia) + + [StopMedia](#stopmedia) + + [NextMedia](#nextmedia) + + [PreviousMedia](#previousmedia) + + [GetMediaDuration](#getmediaduration) + + [GetMediaTime](#getmediatime) + + [SetMediaTime](#setmediatime) + + [ScrubMedia](#scrubmedia) + + [GetMediaState](#getmediastate) * [Sources](#sources-1) + + [GetMediaSourcesList](#getmediasourceslist) + [GetSourcesList](#getsourceslist) + [GetSourceTypesList](#getsourcetypeslist) + [GetVolume](#getvolume) @@ -175,6 +154,7 @@ auth_response = base64_encode(auth_response_hash) + [GetMute](#getmute) + [SetMute](#setmute) + [ToggleMute](#togglemute) + + [GetAudioActive](#getaudioactive) + [SetSourceName](#setsourcename) + [SetSyncOffset](#setsyncoffset) + [GetSyncOffset](#getsyncoffset) @@ -198,6 +178,55 @@ auth_response = base64_encode(auth_response_hash) + [GetAudioMonitorType](#getaudiomonitortype) + [SetAudioMonitorType](#setaudiomonitortype) + [TakeSourceScreenshot](#takesourcescreenshot) + * [Outputs](#outputs) + + [ListOutputs](#listoutputs) + + [GetOutputInfo](#getoutputinfo) + + [StartOutput](#startoutput) + + [StopOutput](#stopoutput) + * [Profiles](#profiles-1) + + [SetCurrentProfile](#setcurrentprofile) + + [GetCurrentProfile](#getcurrentprofile) + + [ListProfiles](#listprofiles) + * [Recording](#recording-1) + + [GetRecordingStatus](#getrecordingstatus) + + [StartStopRecording](#startstoprecording) + + [StartRecording](#startrecording) + + [StopRecording](#stoprecording) + + [PauseRecording](#pauserecording) + + [ResumeRecording](#resumerecording) + + [SetRecordingFolder](#setrecordingfolder) + + [GetRecordingFolder](#getrecordingfolder) + * [Replay Buffer](#replay-buffer-1) + + [GetReplayBufferStatus](#getreplaybufferstatus) + + [StartStopReplayBuffer](#startstopreplaybuffer) + + [StartReplayBuffer](#startreplaybuffer) + + [StopReplayBuffer](#stopreplaybuffer) + + [SaveReplayBuffer](#savereplaybuffer) + * [Scene Collections](#scene-collections) + + [SetCurrentSceneCollection](#setcurrentscenecollection) + + [GetCurrentSceneCollection](#getcurrentscenecollection) + + [ListSceneCollections](#listscenecollections) + * [Scene Items](#scene-items-1) + + [GetSceneItemList](#getsceneitemlist) + + [GetSceneItemProperties](#getsceneitemproperties) + + [SetSceneItemProperties](#setsceneitemproperties) + + [ResetSceneItem](#resetsceneitem) + + [SetSceneItemRender](#setsceneitemrender) + + [SetSceneItemPosition](#setsceneitemposition) + + [SetSceneItemTransform](#setsceneitemtransform) + + [SetSceneItemCrop](#setsceneitemcrop) + + [DeleteSceneItem](#deletesceneitem) + + [AddSceneItem](#addsceneitem) + + [DuplicateSceneItem](#duplicatesceneitem) + * [Scenes](#scenes-1) + + [SetCurrentScene](#setcurrentscene) + + [GetCurrentScene](#getcurrentscene) + + [GetSceneList](#getscenelist) + + [CreateScene](#createscene) + + [ReorderSceneItems](#reordersceneitems) + + [SetSceneTransitionOverride](#setscenetransitionoverride) + + [RemoveSceneTransitionOverride](#removescenetransitionoverride) + + [GetSceneTransitionOverride](#getscenetransitionoverride) * [Streaming](#streaming-1) + [GetStreamingStatus](#getstreamingstatus) + [StartStopStreaming](#startstopstreaming) @@ -251,8 +280,8 @@ These are complex types, such as `Source` and `Scene`, which are used as argumen ## SceneItemTransform | Name | Type | Description | | ---- | :---: | ------------| -| `position.x` | _int_ | The x position of the scene item from the left. | -| `position.y` | _int_ | The y position of the scene item from the top. | +| `position.x` | _double_ | The x position of the scene item from the left. | +| `position.y` | _double_ | The y position of the scene item from the top. | | `position.alignment` | _int_ | The point on the scene item that the item is manipulated from. | | `rotation` | _double_ | The clockwise rotation of the scene item in degrees around the point of alignment. | | `scale.x` | _double_ | The x-scale factor of the scene item. | @@ -882,6 +911,38 @@ A source has been muted or unmuted. | `muted` | _boolean_ | Mute status of the source | +--- + +### SourceAudioDeactivated + + +- Unreleased + +A source has removed audio. + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name | + + +--- + +### SourceAudioActivated + + +- Unreleased + +A source has added audio. + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name | + + --- ### SourceAudioSyncOffsetChanged @@ -1011,6 +1072,160 @@ Filters in a source have been reordered. | `filters.*.type` | _String_ | Filter type | +--- + +## Media + +### MediaPlaying + + +- Added in v4.9.0 + + + +Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name | +| `sourceKind` | _String_ | The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) | + + +--- + +### MediaPaused + + +- Added in v4.9.0 + + + +Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name | +| `sourceKind` | _String_ | The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) | + + +--- + +### MediaRestarted + + +- Added in v4.9.0 + + + +Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name | +| `sourceKind` | _String_ | The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) | + + +--- + +### MediaStopped + + +- Added in v4.9.0 + + + +Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name | +| `sourceKind` | _String_ | The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) | + + +--- + +### MediaNext + + +- Added in v4.9.0 + + + +Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name | +| `sourceKind` | _String_ | The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) | + + +--- + +### MediaPrevious + + +- Added in v4.9.0 + + + +Note: This event is only emitted when something actively controls the media/VLC source. In other words, the source will never emit this on its own naturally. + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name | +| `sourceKind` | _String_ | The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) | + + +--- + +### MediaStarted + + +- Added in v4.9.0 + + + +Note: These events are emitted by the OBS sources themselves. For example when the media file starts playing. The behavior depends on the type of media source being used. + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name | +| `sourceKind` | _String_ | The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) | + + +--- + +### MediaEnded + + +- Added in v4.9.0 + + + +Note: These events are emitted by the OBS sources themselves. For example when the media file ends. The behavior depends on the type of media source being used. + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name | +| `sourceKind` | _String_ | The ID type of the source (Eg. `vlc_source` or `ffmpeg_source`) | + + --- ## Scene Items @@ -1435,797 +1650,21 @@ _No additional response items._ --- -## Outputs +## Media Control -### ListOutputs - - -- Added in v4.7.0 - -List existing outputs - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `outputs` | _Array<Output>_ | Outputs list | - - ---- - -### GetOutputInfo - - -- Added in v4.7.0 - -Get information about a single output - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `outputName` | _String_ | Output name | - - -**Response Items:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `outputInfo` | _Output_ | Output info | - - ---- - -### StartOutput - - -- Added in v4.7.0 - -Start an output - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `outputName` | _String_ | Output name | - - -**Response Items:** - -_No additional response items._ - ---- - -### StopOutput - - -- Added in v4.7.0 - -Stop an output - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `outputName` | _String_ | Output name | -| `force` | _boolean (optional)_ | Force stop (default: false) | - - -**Response Items:** - -_No additional response items._ - ---- - -## Profiles - -### SetCurrentProfile - - -- Added in v4.0.0 - -Set the currently active profile. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `profile-name` | _String_ | Name of the desired profile. | - - -**Response Items:** - -_No additional response items._ - ---- - -### GetCurrentProfile - - -- Added in v4.0.0 - -Get the name of the current profile. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `profile-name` | _String_ | Name of the currently active profile. | - - ---- - -### ListProfiles - - -- Added in v4.0.0 - -Get a list of available profiles. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `profiles` | _Array<Object>_ | List of available profiles. | - - ---- - -## Recording - -### StartStopRecording - - -- Added in v0.3 - -Toggle recording on or off. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -_No additional response items._ - ---- - -### StartRecording - - -- Added in v4.1.0 - -Start recording. -Will return an `error` if recording is already active. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -_No additional response items._ - ---- - -### StopRecording - - -- Added in v4.1.0 - -Stop recording. -Will return an `error` if recording is not active. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -_No additional response items._ - ---- - -### PauseRecording - - -- Added in v4.7.0 - -Pause the current recording. -Returns an error if recording is not active or already paused. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -_No additional response items._ - ---- - -### ResumeRecording - - -- Added in v4.7.0 - -Resume/unpause the current recording (if paused). -Returns an error if recording is not active or not paused. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -_No additional response items._ - ---- - -### SetRecordingFolder - - -- Added in v4.1.0 - - - -Please note: if `SetRecordingFolder` is called while a recording is -in progress, the change won't be applied immediately and will be -effective on the next recording. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `rec-folder` | _String_ | Path of the recording folder. | - - -**Response Items:** - -_No additional response items._ - ---- - -### GetRecordingFolder - - -- Added in v4.1.0 - -Get the path of the current recording folder. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `rec-folder` | _String_ | Path of the recording folder. | - - ---- - -## Replay Buffer - -### StartStopReplayBuffer - - -- Added in v4.2.0 - -Toggle the Replay Buffer on/off. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -_No additional response items._ - ---- - -### StartReplayBuffer - - -- Added in v4.2.0 - -Start recording into the Replay Buffer. -Will return an `error` if the Replay Buffer is already active or if the -"Save Replay Buffer" hotkey is not set in OBS' settings. -Setting this hotkey is mandatory, even when triggering saves only -through obs-websocket. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -_No additional response items._ - ---- - -### StopReplayBuffer - - -- Added in v4.2.0 - -Stop recording into the Replay Buffer. -Will return an `error` if the Replay Buffer is not active. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -_No additional response items._ - ---- - -### SaveReplayBuffer - - -- Added in v4.2.0 - -Flush and save the contents of the Replay Buffer to disk. This is -basically the same as triggering the "Save Replay Buffer" hotkey. -Will return an `error` if the Replay Buffer is not active. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -_No additional response items._ - ---- - -## Scene Collections - -### SetCurrentSceneCollection - - -- Added in v4.0.0 - -Change the active scene collection. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `sc-name` | _String_ | Name of the desired scene collection. | - - -**Response Items:** - -_No additional response items._ - ---- - -### GetCurrentSceneCollection - - -- Added in v4.0.0 - -Get the name of the current scene collection. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `sc-name` | _String_ | Name of the currently active scene collection. | - - ---- - -### ListSceneCollections - - -- Added in v4.0.0 - -List available scene collections - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene-collections` | _Array<String>_ | Scene collections list | - - ---- - -## Scene Items - -### GetSceneItemProperties - - -- Added in v4.3.0 - -Gets the scene specific properties of the specified source item. -Coordinates are relative to the item's parent (the scene or group it belongs to). - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | -| `item` | _String \| Object_ | Scene Item name (if this field is a string) or specification (if it is an object). | -| `item.name` | _String (optional)_ | Scene Item name (if the `item` field is an object) | -| `item.id` | _int (optional)_ | Scene Item ID (if the `item` field is an object) | - - -**Response Items:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `name` | _String_ | Scene Item name. | -| `itemId` | _int_ | Scene Item ID. | -| `position.x` | _int_ | The x position of the source from the left. | -| `position.y` | _int_ | The y position of the source from the top. | -| `position.alignment` | _int_ | The point on the source that the item is manipulated from. | -| `rotation` | _double_ | The clockwise rotation of the item in degrees around the point of alignment. | -| `scale.x` | _double_ | The x-scale factor of the source. | -| `scale.y` | _double_ | The y-scale factor of the source. | -| `crop.top` | _int_ | The number of pixels cropped off the top of the source before scaling. | -| `crop.right` | _int_ | The number of pixels cropped off the right of the source before scaling. | -| `crop.bottom` | _int_ | The number of pixels cropped off the bottom of the source before scaling. | -| `crop.left` | _int_ | The number of pixels cropped off the left of the source before scaling. | -| `visible` | _bool_ | If the source is visible. | -| `muted` | _bool_ | If the source is muted. | -| `locked` | _bool_ | If the source's transform is locked. | -| `bounds.type` | _String_ | Type of bounding box. Can be "OBS_BOUNDS_STRETCH", "OBS_BOUNDS_SCALE_INNER", "OBS_BOUNDS_SCALE_OUTER", "OBS_BOUNDS_SCALE_TO_WIDTH", "OBS_BOUNDS_SCALE_TO_HEIGHT", "OBS_BOUNDS_MAX_ONLY" or "OBS_BOUNDS_NONE". | -| `bounds.alignment` | _int_ | Alignment of the bounding box. | -| `bounds.x` | _double_ | Width of the bounding box. | -| `bounds.y` | _double_ | Height of the bounding box. | -| `sourceWidth` | _int_ | Base width (without scaling) of the source | -| `sourceHeight` | _int_ | Base source (without scaling) of the source | -| `width` | _double_ | Scene item width (base source width multiplied by the horizontal scaling factor) | -| `height` | _double_ | Scene item height (base source height multiplied by the vertical scaling factor) | -| `alignment` | _int_ | The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis. | -| `parentGroupName` | _String (optional)_ | Name of the item's parent (if this item belongs to a group) | -| `groupChildren` | _Array<SceneItemTransform> (optional)_ | List of children (if this item is a group) | - - ---- - -### SetSceneItemProperties - - -- Added in v4.3.0 - -Sets the scene specific properties of a source. Unspecified properties will remain unchanged. -Coordinates are relative to the item's parent (the scene or group it belongs to). - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene-name` | _String (optional)_ | Name of the scene the source item belongs to. Defaults to the current scene. | -| `item` | _String \| Object_ | Scene Item name (if this field is a string) or specification (if it is an object). | -| `item.name` | _String (optional)_ | Scene Item name (if the `item` field is an object) | -| `item.id` | _int (optional)_ | Scene Item ID (if the `item` field is an object) | -| `position.x` | _int (optional)_ | The new x position of the source. | -| `position.y` | _int (optional)_ | The new y position of the source. | -| `position.alignment` | _int (optional)_ | The new alignment of the source. | -| `rotation` | _double (optional)_ | The new clockwise rotation of the item in degrees. | -| `scale.x` | _double (optional)_ | The new x scale of the item. | -| `scale.y` | _double (optional)_ | The new y scale of the item. | -| `crop.top` | _int (optional)_ | The new amount of pixels cropped off the top of the source before scaling. | -| `crop.bottom` | _int (optional)_ | The new amount of pixels cropped off the bottom of the source before scaling. | -| `crop.left` | _int (optional)_ | The new amount of pixels cropped off the left of the source before scaling. | -| `crop.right` | _int (optional)_ | The new amount of pixels cropped off the right of the source before scaling. | -| `visible` | _bool (optional)_ | The new visibility of the source. 'true' shows source, 'false' hides source. | -| `locked` | _bool (optional)_ | The new locked status of the source. 'true' keeps it in its current position, 'false' allows movement. | -| `bounds.type` | _String (optional)_ | The new bounds type of the source. Can be "OBS_BOUNDS_STRETCH", "OBS_BOUNDS_SCALE_INNER", "OBS_BOUNDS_SCALE_OUTER", "OBS_BOUNDS_SCALE_TO_WIDTH", "OBS_BOUNDS_SCALE_TO_HEIGHT", "OBS_BOUNDS_MAX_ONLY" or "OBS_BOUNDS_NONE". | -| `bounds.alignment` | _int (optional)_ | The new alignment of the bounding box. (0-2, 4-6, 8-10) | -| `bounds.x` | _double (optional)_ | The new width of the bounding box. | -| `bounds.y` | _double (optional)_ | The new height of the bounding box. | - - -**Response Items:** - -_No additional response items._ - ---- - -### ResetSceneItem - - -- Added in v4.2.0 - -Reset a scene item. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | -| `item` | _String \| Object_ | Scene Item name (if this field is a string) or specification (if it is an object). | -| `item.name` | _String (optional)_ | Scene Item name (if the `item` field is an object) | -| `item.id` | _int (optional)_ | Scene Item ID (if the `item` field is an object) | - - -**Response Items:** - -_No additional response items._ - ---- - -### SetSceneItemRender - -- **⚠️ Deprecated. Since 4.3.0. Prefer the use of SetSceneItemProperties. ⚠️** - -- Added in v0.3 - -Show or hide a specified source item in a specified scene. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the currently active scene. | -| `source` | _String_ | Scene Item name. | -| `render` | _boolean_ | true = shown ; false = hidden | - - -**Response Items:** - -_No additional response items._ - ---- - -### SetSceneItemPosition - -- **⚠️ Deprecated. Since 4.3.0. Prefer the use of SetSceneItemProperties. ⚠️** - -- Added in v4.0.0 - -Sets the coordinates of a specified source item. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | -| `item` | _String_ | Scene Item name. | -| `x` | _double_ | X coordinate. | -| `y` | _double_ | Y coordinate. | - - -**Response Items:** - -_No additional response items._ - ---- - -### SetSceneItemTransform - -- **⚠️ Deprecated. Since 4.3.0. Prefer the use of SetSceneItemProperties. ⚠️** - -- Added in v4.0.0 - -Set the transform of the specified source item. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | -| `item` | _String_ | Scene Item name. | -| `x-scale` | _double_ | Width scale factor. | -| `y-scale` | _double_ | Height scale factor. | -| `rotation` | _double_ | Source item rotation (in degrees). | - - -**Response Items:** - -_No additional response items._ - ---- - -### SetSceneItemCrop - -- **⚠️ Deprecated. Since 4.3.0. Prefer the use of SetSceneItemProperties. ⚠️** - -- Added in v4.1.0 - -Sets the crop coordinates of the specified source item. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | -| `item` | _String_ | Scene Item name. | -| `top` | _int_ | Pixel position of the top of the source item. | -| `bottom` | _int_ | Pixel position of the bottom of the source item. | -| `left` | _int_ | Pixel position of the left of the source item. | -| `right` | _int_ | Pixel position of the right of the source item. | - - -**Response Items:** - -_No additional response items._ - ---- - -### DeleteSceneItem - - -- Added in v4.5.0 - -Deletes a scene item. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | -| `item` | _Object_ | Scene item to delete (required) | -| `item.name` | _String_ | Scene Item name (prefer `id`, including both is acceptable). | -| `item.id` | _int_ | Scene Item ID. | - - -**Response Items:** - -_No additional response items._ - ---- - -### DuplicateSceneItem - - -- Added in v4.5.0 - -Duplicates a scene item. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `fromScene` | _String (optional)_ | Name of the scene to copy the item from. Defaults to the current scene. | -| `toScene` | _String (optional)_ | Name of the scene to create the item in. Defaults to the current scene. | -| `item` | _Object_ | Scene Item to duplicate from the source scene (required) | -| `item.name` | _String_ | Scene Item name (prefer `id`, including both is acceptable). | -| `item.id` | _int_ | Scene Item ID. | - - -**Response Items:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene` | _String_ | Name of the scene where the new item was created | -| `item` | _Object_ | New item info | -| `item.id` | _int_ | New item ID | -| `item.name` | _String_ | New item name | - - ---- - -## Scenes - -### SetCurrentScene - - -- Added in v0.3 - -Switch to the specified scene. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene-name` | _String_ | Name of the scene to switch to. | - - -**Response Items:** - -_No additional response items._ - ---- - -### GetCurrentScene - - -- Added in v0.3 - -Get the current scene's name and source items. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `name` | _String_ | Name of the currently active scene. | -| `sources` | _Array<SceneItem>_ | Ordered list of the current scene's source items. | - - ---- - -### GetSceneList - - -- Added in v0.3 - -Get a list of scenes in the currently active profile. - -**Request Fields:** - -_No specified parameters._ - -**Response Items:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `current-scene` | _String_ | Name of the currently active scene. | -| `scenes` | _Array<Scene>_ | Ordered list of the current profile's scenes (See [GetCurrentScene](#getcurrentscene) for more information). | - - ---- - -### ReorderSceneItems - - -- Added in v4.5.0 - -Changes the order of scene items in the requested scene. - -**Request Fields:** - -| Name | Type | Description | -| ---- | :---: | ------------| -| `scene` | _String (optional)_ | Name of the scene to reorder (defaults to current). | -| `items` | _Array<Scene>_ | Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene | -| `items[].id` | _int (optional)_ | Id of a specific scene item. Unique on a scene by scene basis. | -| `items[].name` | _String (optional)_ | Name of a scene item. Sufficiently unique if no scene items share sources within the scene. | - - -**Response Items:** - -_No additional response items._ - ---- - -### SetSceneTransitionOverride +### PlayPauseMedia - Added in v4.9.0 -Set a scene to use a specific transition override. +Pause or play a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) **Request Fields:** | Name | Type | Description | | ---- | :---: | ------------| -| `sceneName` | _String_ | Name of the scene to switch to. | -| `transitionName` | _String_ | Name of the transition to use. | -| `transitionDuration` | _int (Optional)_ | Duration in milliseconds of the transition if transition is not fixed. Defaults to the current duration specified in the UI if there is no current override and this value is not given. | +| `sourceName` | _String_ | Source name. | +| `playPause` | _boolean_ | Whether to pause or play the source. `false` for play, `true` for pause. | **Response Items:** @@ -2234,18 +1673,18 @@ _No additional response items._ --- -### RemoveSceneTransitionOverride +### RestartMedia - Added in v4.9.0 -Remove any transition override on a scene. +Restart a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) **Request Fields:** | Name | Type | Description | | ---- | :---: | ------------| -| `sceneName` | _String_ | Name of the scene to switch to. | +| `sourceName` | _String_ | Source name. | **Response Items:** @@ -2254,32 +1693,204 @@ _No additional response items._ --- -### GetSceneTransitionOverride +### StopMedia - Added in v4.9.0 -Get the current scene transition override. +Stop a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) **Request Fields:** | Name | Type | Description | | ---- | :---: | ------------| -| `sceneName` | _String_ | Name of the scene to switch to. | +| `sourceName` | _String_ | Source name. | + + +**Response Items:** + +_No additional response items._ + +--- + +### NextMedia + + +- Added in v4.9.0 + +Skip to the next media item in the playlist. Supports only vlc media source (as of OBS v25.0.8) + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | + + +**Response Items:** + +_No additional response items._ + +--- + +### PreviousMedia + + +- Added in v4.9.0 + +Go to the previous media item in the playlist. Supports only vlc media source (as of OBS v25.0.8) + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | + + +**Response Items:** + +_No additional response items._ + +--- + +### GetMediaDuration + + +- Added in v4.9.0 + +Get the length of media in milliseconds. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) +Note: For some reason, for the first 5 or so seconds that the media is playing, the total duration can be off by upwards of 50ms. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | **Response Items:** | Name | Type | Description | | ---- | :---: | ------------| -| `transitionName` | _String_ | Name of the current overriding transition. Empty string if no override is set. | -| `transitionDuration` | _int_ | Transition duration. `-1` if no override is set. | +| `mediaDuration` | _int_ | The total length of media in milliseconds.. | + + +--- + +### GetMediaTime + + +- Added in v4.9.0 + +Get the current timestamp of media in milliseconds. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `timestamp` | _int_ | The time in milliseconds since the start of the media. | + + +--- + +### SetMediaTime + + +- Added in v4.9.0 + +Set the timestamp of a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | +| `timestamp` | _int_ | Milliseconds to set the timestamp to. | + + +**Response Items:** + +_No additional response items._ + +--- + +### ScrubMedia + + +- Added in v4.9.0 + +Scrub media using a supplied offset. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) +Note: Due to processing/network delays, this request is not perfect. The processing rate of this request has also not been tested. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | +| `timeOffset` | _int_ | Millisecond offset (positive or negative) to offset the current media position. | + + +**Response Items:** + +_No additional response items._ + +--- + +### GetMediaState + + +- Added in v4.9.0 + +Get the current playing state of a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `mediaState` | _String_ | The media state of the provided source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error`, `unknown` | --- ## Sources +### GetMediaSourcesList + + +- Added in v4.9.0 + +List the media state of all media sources (vlc and media source) + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `mediaSources` | _Array<Object>_ | Array of sources | +| `mediaSources.*.sourceName` | _String_ | Unique source name | +| `mediaSources.*.sourceKind` | _String_ | Unique source internal type (a.k.a `ffmpeg_source` or `vlc_source`) | +| `mediaSources.*.mediaState` | _String_ | The current state of media for that source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error`, `unknown` | + + +--- + ### GetSourcesList @@ -2446,6 +2057,29 @@ Inverts the mute status of a specified source. _No additional response items._ +--- + +### GetAudioActive + + +- Unreleased + +Get the audio's active status of a specified source. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `audioActive` | _boolean_ | Audio active status of the source. | + + --- ### SetSourceName @@ -3090,6 +2724,963 @@ preserved if only one of these two parameters is specified. | `imageFile` | _String_ | Absolute path to the saved image file (if `saveToFilePath` was specified in the request) | +--- + +## Outputs + +### ListOutputs + + +- Added in v4.7.0 + +List existing outputs + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `outputs` | _Array<Output>_ | Outputs list | + + +--- + +### GetOutputInfo + + +- Added in v4.7.0 + +Get information about a single output + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `outputName` | _String_ | Output name | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `outputInfo` | _Output_ | Output info | + + +--- + +### StartOutput + + +- Added in v4.7.0 + +Start an output + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `outputName` | _String_ | Output name | + + +**Response Items:** + +_No additional response items._ + +--- + +### StopOutput + + +- Added in v4.7.0 + +Stop an output + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `outputName` | _String_ | Output name | +| `force` | _boolean (optional)_ | Force stop (default: false) | + + +**Response Items:** + +_No additional response items._ + +--- + +## Profiles + +### SetCurrentProfile + + +- Added in v4.0.0 + +Set the currently active profile. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `profile-name` | _String_ | Name of the desired profile. | + + +**Response Items:** + +_No additional response items._ + +--- + +### GetCurrentProfile + + +- Added in v4.0.0 + +Get the name of the current profile. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `profile-name` | _String_ | Name of the currently active profile. | + + +--- + +### ListProfiles + + +- Added in v4.0.0 + +Get a list of available profiles. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `profiles` | _Array<Object>_ | List of available profiles. | + + +--- + +## Recording + +### GetRecordingStatus + + +- Unreleased + +Get current recording status. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `isRecording` | _boolean_ | Current recording status. | +| `isRecordingPaused` | _boolean_ | Whether the recording is paused or not. | +| `recordTimecode` | _String (optional)_ | Time elapsed since recording started (only present if currently recording). | + + +--- + +### StartStopRecording + + +- Added in v0.3 + +Toggle recording on or off. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +_No additional response items._ + +--- + +### StartRecording + + +- Added in v4.1.0 + +Start recording. +Will return an `error` if recording is already active. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +_No additional response items._ + +--- + +### StopRecording + + +- Added in v4.1.0 + +Stop recording. +Will return an `error` if recording is not active. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +_No additional response items._ + +--- + +### PauseRecording + + +- Added in v4.7.0 + +Pause the current recording. +Returns an error if recording is not active or already paused. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +_No additional response items._ + +--- + +### ResumeRecording + + +- Added in v4.7.0 + +Resume/unpause the current recording (if paused). +Returns an error if recording is not active or not paused. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +_No additional response items._ + +--- + +### SetRecordingFolder + + +- Added in v4.1.0 + + + +Please note: if `SetRecordingFolder` is called while a recording is +in progress, the change won't be applied immediately and will be +effective on the next recording. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `rec-folder` | _String_ | Path of the recording folder. | + + +**Response Items:** + +_No additional response items._ + +--- + +### GetRecordingFolder + + +- Added in v4.1.0 + +Get the path of the current recording folder. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `rec-folder` | _String_ | Path of the recording folder. | + + +--- + +## Replay Buffer + +### GetReplayBufferStatus + + +- Unreleased + +Get the status of the OBS replay buffer. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `isReplayBufferActive` | _boolean_ | Current recording status. | + + +--- + +### StartStopReplayBuffer + + +- Added in v4.2.0 + +Toggle the Replay Buffer on/off. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +_No additional response items._ + +--- + +### StartReplayBuffer + + +- Added in v4.2.0 + +Start recording into the Replay Buffer. +Will return an `error` if the Replay Buffer is already active or if the +"Save Replay Buffer" hotkey is not set in OBS' settings. +Setting this hotkey is mandatory, even when triggering saves only +through obs-websocket. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +_No additional response items._ + +--- + +### StopReplayBuffer + + +- Added in v4.2.0 + +Stop recording into the Replay Buffer. +Will return an `error` if the Replay Buffer is not active. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +_No additional response items._ + +--- + +### SaveReplayBuffer + + +- Added in v4.2.0 + +Flush and save the contents of the Replay Buffer to disk. This is +basically the same as triggering the "Save Replay Buffer" hotkey. +Will return an `error` if the Replay Buffer is not active. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +_No additional response items._ + +--- + +## Scene Collections + +### SetCurrentSceneCollection + + +- Added in v4.0.0 + +Change the active scene collection. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sc-name` | _String_ | Name of the desired scene collection. | + + +**Response Items:** + +_No additional response items._ + +--- + +### GetCurrentSceneCollection + + +- Added in v4.0.0 + +Get the name of the current scene collection. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sc-name` | _String_ | Name of the currently active scene collection. | + + +--- + +### ListSceneCollections + + +- Added in v4.0.0 + +List available scene collections + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene-collections` | _Array<String>_ | Scene collections list | + + +--- + +## Scene Items + +### GetSceneItemList + + +- Unreleased + +Get a list of all scene items in a scene. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneName` | _String_ | Name of the scene to get the list of scene items from. | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneItems` | _Array<Object>_ | Array of scene items | +| `sceneItems.*.itemId` | _int_ | Unique item id of the source item | +| `sceneItems.*.sourceKind` | _String_ | ID if the scene item's source. For example `vlc_source` or `image_source` | +| `sceneItems.*.sourceName` | _String_ | Name of the scene item's source | +| `sceneItems.*.sourceType` | _String_ | Type of the scene item's source. Either `input`, `group`, or `scene` | + + +--- + +### GetSceneItemProperties + + +- Added in v4.3.0 + +Gets the scene specific properties of the specified source item. +Coordinates are relative to the item's parent (the scene or group it belongs to). + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | +| `item` | _String \| Object_ | Scene Item name (if this field is a string) or specification (if it is an object). | +| `item.name` | _String (optional)_ | Scene Item name (if the `item` field is an object) | +| `item.id` | _int (optional)_ | Scene Item ID (if the `item` field is an object) | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `name` | _String_ | Scene Item name. | +| `itemId` | _int_ | Scene Item ID. | +| `position.x` | _double_ | The x position of the source from the left. | +| `position.y` | _double_ | The y position of the source from the top. | +| `position.alignment` | _int_ | The point on the source that the item is manipulated from. | +| `rotation` | _double_ | The clockwise rotation of the item in degrees around the point of alignment. | +| `scale.x` | _double_ | The x-scale factor of the source. | +| `scale.y` | _double_ | The y-scale factor of the source. | +| `crop.top` | _int_ | The number of pixels cropped off the top of the source before scaling. | +| `crop.right` | _int_ | The number of pixels cropped off the right of the source before scaling. | +| `crop.bottom` | _int_ | The number of pixels cropped off the bottom of the source before scaling. | +| `crop.left` | _int_ | The number of pixels cropped off the left of the source before scaling. | +| `visible` | _bool_ | If the source is visible. | +| `muted` | _bool_ | If the source is muted. | +| `locked` | _bool_ | If the source's transform is locked. | +| `bounds.type` | _String_ | Type of bounding box. Can be "OBS_BOUNDS_STRETCH", "OBS_BOUNDS_SCALE_INNER", "OBS_BOUNDS_SCALE_OUTER", "OBS_BOUNDS_SCALE_TO_WIDTH", "OBS_BOUNDS_SCALE_TO_HEIGHT", "OBS_BOUNDS_MAX_ONLY" or "OBS_BOUNDS_NONE". | +| `bounds.alignment` | _int_ | Alignment of the bounding box. | +| `bounds.x` | _double_ | Width of the bounding box. | +| `bounds.y` | _double_ | Height of the bounding box. | +| `sourceWidth` | _int_ | Base width (without scaling) of the source | +| `sourceHeight` | _int_ | Base source (without scaling) of the source | +| `width` | _double_ | Scene item width (base source width multiplied by the horizontal scaling factor) | +| `height` | _double_ | Scene item height (base source height multiplied by the vertical scaling factor) | +| `alignment` | _int_ | The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis. | +| `parentGroupName` | _String (optional)_ | Name of the item's parent (if this item belongs to a group) | +| `groupChildren` | _Array<SceneItemTransform> (optional)_ | List of children (if this item is a group) | + + +--- + +### SetSceneItemProperties + + +- Added in v4.3.0 + +Sets the scene specific properties of a source. Unspecified properties will remain unchanged. +Coordinates are relative to the item's parent (the scene or group it belongs to). + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene-name` | _String (optional)_ | Name of the scene the source item belongs to. Defaults to the current scene. | +| `item` | _String \| Object_ | Scene Item name (if this field is a string) or specification (if it is an object). | +| `item.name` | _String (optional)_ | Scene Item name (if the `item` field is an object) | +| `item.id` | _int (optional)_ | Scene Item ID (if the `item` field is an object) | +| `position.x` | _double (optional)_ | The new x position of the source. | +| `position.y` | _double (optional)_ | The new y position of the source. | +| `position.alignment` | _int (optional)_ | The new alignment of the source. | +| `rotation` | _double (optional)_ | The new clockwise rotation of the item in degrees. | +| `scale.x` | _double (optional)_ | The new x scale of the item. | +| `scale.y` | _double (optional)_ | The new y scale of the item. | +| `crop.top` | _int (optional)_ | The new amount of pixels cropped off the top of the source before scaling. | +| `crop.bottom` | _int (optional)_ | The new amount of pixels cropped off the bottom of the source before scaling. | +| `crop.left` | _int (optional)_ | The new amount of pixels cropped off the left of the source before scaling. | +| `crop.right` | _int (optional)_ | The new amount of pixels cropped off the right of the source before scaling. | +| `visible` | _bool (optional)_ | The new visibility of the source. 'true' shows source, 'false' hides source. | +| `locked` | _bool (optional)_ | The new locked status of the source. 'true' keeps it in its current position, 'false' allows movement. | +| `bounds.type` | _String (optional)_ | The new bounds type of the source. Can be "OBS_BOUNDS_STRETCH", "OBS_BOUNDS_SCALE_INNER", "OBS_BOUNDS_SCALE_OUTER", "OBS_BOUNDS_SCALE_TO_WIDTH", "OBS_BOUNDS_SCALE_TO_HEIGHT", "OBS_BOUNDS_MAX_ONLY" or "OBS_BOUNDS_NONE". | +| `bounds.alignment` | _int (optional)_ | The new alignment of the bounding box. (0-2, 4-6, 8-10) | +| `bounds.x` | _double (optional)_ | The new width of the bounding box. | +| `bounds.y` | _double (optional)_ | The new height of the bounding box. | + + +**Response Items:** + +_No additional response items._ + +--- + +### ResetSceneItem + + +- Added in v4.2.0 + +Reset a scene item. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | +| `item` | _String \| Object_ | Scene Item name (if this field is a string) or specification (if it is an object). | +| `item.name` | _String (optional)_ | Scene Item name (if the `item` field is an object) | +| `item.id` | _int (optional)_ | Scene Item ID (if the `item` field is an object) | + + +**Response Items:** + +_No additional response items._ + +--- + +### SetSceneItemRender + +- **⚠️ Deprecated. Since 4.3.0. Prefer the use of SetSceneItemProperties. ⚠️** + +- Added in v0.3 + +Show or hide a specified source item in a specified scene. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the currently active scene. | +| `source` | _String_ | Scene Item name. | +| `render` | _boolean_ | true = shown ; false = hidden | + + +**Response Items:** + +_No additional response items._ + +--- + +### SetSceneItemPosition + +- **⚠️ Deprecated. Since 4.3.0. Prefer the use of SetSceneItemProperties. ⚠️** + +- Added in v4.0.0 + +Sets the coordinates of a specified source item. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | +| `item` | _String_ | Scene Item name. | +| `x` | _double_ | X coordinate. | +| `y` | _double_ | Y coordinate. | + + +**Response Items:** + +_No additional response items._ + +--- + +### SetSceneItemTransform + +- **⚠️ Deprecated. Since 4.3.0. Prefer the use of SetSceneItemProperties. ⚠️** + +- Added in v4.0.0 + +Set the transform of the specified source item. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | +| `item` | _String_ | Scene Item name. | +| `x-scale` | _double_ | Width scale factor. | +| `y-scale` | _double_ | Height scale factor. | +| `rotation` | _double_ | Source item rotation (in degrees). | + + +**Response Items:** + +_No additional response items._ + +--- + +### SetSceneItemCrop + +- **⚠️ Deprecated. Since 4.3.0. Prefer the use of SetSceneItemProperties. ⚠️** + +- Added in v4.1.0 + +Sets the crop coordinates of the specified source item. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene-name` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | +| `item` | _String_ | Scene Item name. | +| `top` | _int_ | Pixel position of the top of the source item. | +| `bottom` | _int_ | Pixel position of the bottom of the source item. | +| `left` | _int_ | Pixel position of the left of the source item. | +| `right` | _int_ | Pixel position of the right of the source item. | + + +**Response Items:** + +_No additional response items._ + +--- + +### DeleteSceneItem + + +- Added in v4.5.0 + +Deletes a scene item. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene` | _String (optional)_ | Name of the scene the scene item belongs to. Defaults to the current scene. | +| `item` | _Object_ | Scene item to delete (required) | +| `item.name` | _String_ | Scene Item name (prefer `id`, including both is acceptable). | +| `item.id` | _int_ | Scene Item ID. | + + +**Response Items:** + +_No additional response items._ + +--- + +### AddSceneItem + + +- Unreleased + +Creates a scene item in a scene. In other words, this is how you add a source into a scene. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneName` | _String_ | Name of the scene to create the scene item in | +| `sourceName` | _String_ | Name of the source to be added | +| `setVisible` | _boolean_ | Whether to make the sceneitem visible on creation or not. Default `true` | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `itemId` | _int_ | Numerical ID of the created scene item | + + +--- + +### DuplicateSceneItem + + +- Added in v4.5.0 + +Duplicates a scene item. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `fromScene` | _String (optional)_ | Name of the scene to copy the item from. Defaults to the current scene. | +| `toScene` | _String (optional)_ | Name of the scene to create the item in. Defaults to the current scene. | +| `item` | _Object_ | Scene Item to duplicate from the source scene (required) | +| `item.name` | _String_ | Scene Item name (prefer `id`, including both is acceptable). | +| `item.id` | _int_ | Scene Item ID. | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene` | _String_ | Name of the scene where the new item was created | +| `item` | _Object_ | New item info | +| `item.id` | _int_ | New item ID | +| `item.name` | _String_ | New item name | + + +--- + +## Scenes + +### SetCurrentScene + + +- Added in v0.3 + +Switch to the specified scene. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene-name` | _String_ | Name of the scene to switch to. | + + +**Response Items:** + +_No additional response items._ + +--- + +### GetCurrentScene + + +- Added in v0.3 + +Get the current scene's name and source items. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `name` | _String_ | Name of the currently active scene. | +| `sources` | _Array<SceneItem>_ | Ordered list of the current scene's source items. | + + +--- + +### GetSceneList + + +- Added in v0.3 + +Get a list of scenes in the currently active profile. + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `current-scene` | _String_ | Name of the currently active scene. | +| `scenes` | _Array<Scene>_ | Ordered list of the current profile's scenes (See [GetCurrentScene](#getcurrentscene) for more information). | + + +--- + +### CreateScene + + +- Added in v4.8.0 + +Create a new scene scene. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneName` | _String_ | Name of the scene to create. | + + +**Response Items:** + +_No additional response items._ + +--- + +### ReorderSceneItems + + +- Added in v4.5.0 + +Changes the order of scene items in the requested scene. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `scene` | _String (optional)_ | Name of the scene to reorder (defaults to current). | +| `items` | _Array<Scene>_ | Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene | +| `items[].id` | _int (optional)_ | Id of a specific scene item. Unique on a scene by scene basis. | +| `items[].name` | _String (optional)_ | Name of a scene item. Sufficiently unique if no scene items share sources within the scene. | + + +**Response Items:** + +_No additional response items._ + +--- + +### SetSceneTransitionOverride + + +- Added in v4.9.0 + +Set a scene to use a specific transition override. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneName` | _String_ | Name of the scene to switch to. | +| `transitionName` | _String_ | Name of the transition to use. | +| `transitionDuration` | _int (Optional)_ | Duration in milliseconds of the transition if transition is not fixed. Defaults to the current duration specified in the UI if there is no current override and this value is not given. | + + +**Response Items:** + +_No additional response items._ + +--- + +### RemoveSceneTransitionOverride + + +- Added in v4.9.0 + +Remove any transition override on a scene. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneName` | _String_ | Name of the scene to switch to. | + + +**Response Items:** + +_No additional response items._ + +--- + +### GetSceneTransitionOverride + + +- Added in v4.9.0 + +Get the current scene transition override. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneName` | _String_ | Name of the scene to switch to. | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `transitionName` | _String_ | Name of the current overriding transition. Empty string if no override is set. | +| `transitionDuration` | _int_ | Transition duration. `-1` if no override is set. | + + --- ## Streaming From eb00294bbb8bad3f61ba0d9ba2c68af0f566bee3 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 9 Jul 2020 18:37:06 -0700 Subject: [PATCH 097/178] Settings: Add option to lock binding to IPv4 WebsocketPP defaults to binding to an IPv6 interface. Since IPv6 is broken on so many networks, this adds an option to force WebsocketPP to use the default IPv4 interface to bind to. --- data/locale/en-US.ini | 1 + src/Config.cpp | 18 ++- src/Config.h | 1 + src/WSServer.cpp | 15 +- src/WSServer.h | 3 +- src/forms/settings-dialog.cpp | 4 +- src/forms/settings-dialog.ui | 291 +++++++++++++++++----------------- src/obs-websocket.cpp | 2 +- 8 files changed, 184 insertions(+), 151 deletions(-) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index 607ab2f2..69fbed16 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -3,6 +3,7 @@ OBSWebsocket.Settings.ServerEnable="Enable WebSockets server" OBSWebsocket.Settings.ServerPort="Server Port" OBSWebsocket.Settings.AuthRequired="Enable authentication" OBSWebsocket.Settings.Password="Password" +OBSWebsocket.Settings.LockToIPv4="Lock server to only using IPv4" OBSWebsocket.Settings.DebugEnable="Enable debug logging" OBSWebsocket.Settings.AlertsEnable="Enable System Tray Alerts" OBSWebsocket.NotifyConnect.Title="New WebSocket connection" diff --git a/src/Config.cpp b/src/Config.cpp index 4ed30608..1a17065f 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -25,6 +25,7 @@ with this program. If not, see #define SECTION_NAME "WebsocketAPI" #define PARAM_ENABLE "ServerEnabled" #define PARAM_PORT "ServerPort" +#define PARAM_LOCKTOIPV4 "LockToIPv4" #define PARAM_DEBUG "DebugEnabled" #define PARAM_ALERT "AlertsEnabled" #define PARAM_AUTHREQUIRED "AuthRequired" @@ -41,6 +42,7 @@ with this program. If not, see Config::Config() : ServerEnabled(true), ServerPort(4444), + LockToIPv4(false), DebugEnabled(false), AlertsEnabled(true), AuthRequired(false), @@ -67,6 +69,7 @@ void Config::Load() ServerEnabled = config_get_bool(obsConfig, SECTION_NAME, PARAM_ENABLE); ServerPort = config_get_uint(obsConfig, SECTION_NAME, PARAM_PORT); + LockToIPv4 = config_get_bool(obsConfig, SECTION_NAME, PARAM_LOCKTOIPV4); DebugEnabled = config_get_bool(obsConfig, SECTION_NAME, PARAM_DEBUG); AlertsEnabled = config_get_bool(obsConfig, SECTION_NAME, PARAM_ALERT); @@ -82,6 +85,7 @@ void Config::Save() config_set_bool(obsConfig, SECTION_NAME, PARAM_ENABLE, ServerEnabled); config_set_uint(obsConfig, SECTION_NAME, PARAM_PORT, ServerPort); + config_set_bool(obsConfig, SECTION_NAME, PARAM_LOCKTOIPV4, LockToIPv4); config_set_bool(obsConfig, SECTION_NAME, PARAM_DEBUG, DebugEnabled); config_set_bool(obsConfig, SECTION_NAME, PARAM_ALERT, AlertsEnabled); @@ -104,6 +108,8 @@ void Config::SetDefaults() SECTION_NAME, PARAM_ENABLE, ServerEnabled); config_set_default_uint(obsConfig, SECTION_NAME, PARAM_PORT, ServerPort); + config_set_default_bool(obsConfig, + SECTION_NAME, PARAM_LOCKTOIPV4, LockToIPv4); config_set_default_bool(obsConfig, SECTION_NAME, PARAM_DEBUG, DebugEnabled); @@ -205,16 +211,17 @@ void Config::OnFrontendEvent(enum obs_frontend_event event, void* param) bool previousEnabled = config->ServerEnabled; uint64_t previousPort = config->ServerPort; + bool previousLock = config->LockToIPv4; config->SetDefaults(); config->Load(); - if (config->ServerEnabled != previousEnabled || config->ServerPort != previousPort) { + if (config->ServerEnabled != previousEnabled || config->ServerPort != previousPort || config->LockToIPv4 != previousLock) { auto server = GetServer(); server->stop(); if (config->ServerEnabled) { - server->start(config->ServerPort); + server->start(config->ServerPort, config->LockToIPv4); if (previousEnabled != config->ServerEnabled) { Utils::SysTrayNotify(startMessage, QSystemTrayIcon::MessageIcon::Information); @@ -246,6 +253,13 @@ void Config::MigrateFromGlobalSettings() config_remove_value(source, SECTION_NAME, PARAM_PORT); } + + if(config_has_user_value(source, SECTION_NAME, PARAM_LOCKTOIPV4)) { + bool value = config_get_bool(source, SECTION_NAME, PARAM_LOCKTOIPV4); + config_set_bool(destination, SECTION_NAME, PARAM_LOCKTOIPV4, value); + + config_remove_value(source, SECTION_NAME, PARAM_LOCKTOIPV4); + } if(config_has_user_value(source, SECTION_NAME, PARAM_DEBUG)) { bool value = config_get_bool(source, SECTION_NAME, PARAM_DEBUG); diff --git a/src/Config.h b/src/Config.h index 0845f874..f21e396a 100644 --- a/src/Config.h +++ b/src/Config.h @@ -42,6 +42,7 @@ class Config { bool ServerEnabled; uint64_t ServerPort; + bool LockToIPv4; bool DebugEnabled; bool AlertsEnabled; diff --git a/src/WSServer.cpp b/src/WSServer.cpp index 33f1bcbb..add0e1e1 100644 --- a/src/WSServer.cpp +++ b/src/WSServer.cpp @@ -60,10 +60,10 @@ WSServer::~WSServer() stop(); } -void WSServer::start(quint16 port) +void WSServer::start(quint16 port, bool lockToIPv4) { - if (_server.is_listening() && port == _serverPort) { - blog(LOG_INFO, "WSServer::start: server already on this port. no restart needed"); + if (_server.is_listening() && (port == _serverPort && _lockToIPv4 == lockToIPv4)) { + blog(LOG_INFO, "WSServer::start: server already on this port and protocol mode. no restart needed"); return; } @@ -74,9 +74,16 @@ void WSServer::start(quint16 port) _server.reset(); _serverPort = port; + _lockToIPv4 = lockToIPv4; websocketpp::lib::error_code errorCode; - _server.listen(_serverPort, errorCode); + if (lockToIPv4) { + blog(LOG_INFO, "WSServer::start: Locked to IPv4 bindings"); + _server.listen(websocketpp::lib::asio::ip::tcp::v4(), _serverPort, errorCode); + } else { + blog(LOG_INFO, "WSServer::start: Not locked to IPv4 bindings"); + _server.listen(_serverPort, errorCode); + } if (errorCode) { std::string errorCodeMessage = errorCode.message(); diff --git a/src/WSServer.h b/src/WSServer.h index 723f51af..1ca0734b 100644 --- a/src/WSServer.h +++ b/src/WSServer.h @@ -44,7 +44,7 @@ Q_OBJECT public: explicit WSServer(); virtual ~WSServer(); - void start(quint16 port); + void start(quint16 port, bool lockToIPv4); void stop(); void broadcast(const RpcEvent& event); QThreadPool* threadPool() { @@ -62,6 +62,7 @@ private: server _server; quint16 _serverPort; + bool _lockToIPv4; std::set> _connections; std::map> _connectionProperties; QMutex _clMutex; diff --git a/src/forms/settings-dialog.cpp b/src/forms/settings-dialog.cpp index 6aa2d4f1..ca686dfe 100644 --- a/src/forms/settings-dialog.cpp +++ b/src/forms/settings-dialog.cpp @@ -45,6 +45,7 @@ void SettingsDialog::showEvent(QShowEvent* event) { ui->serverEnabled->setChecked(conf->ServerEnabled); ui->serverPort->setValue(conf->ServerPort); + ui->lockToIPv4->setChecked(conf->LockToIPv4); ui->debugEnabled->setChecked(conf->DebugEnabled); ui->alertsEnabled->setChecked(conf->AlertsEnabled); @@ -72,6 +73,7 @@ void SettingsDialog::FormAccepted() { conf->ServerEnabled = ui->serverEnabled->isChecked(); conf->ServerPort = ui->serverPort->value(); + conf->LockToIPv4 = ui->lockToIPv4->isChecked(); conf->DebugEnabled = ui->debugEnabled->isChecked(); conf->AlertsEnabled = ui->alertsEnabled->isChecked(); @@ -95,7 +97,7 @@ void SettingsDialog::FormAccepted() { auto server = GetServer(); if (conf->ServerEnabled) { - server->start(conf->ServerPort); + server->start(conf->ServerPort, conf->LockToIPv4); } else { server->stop(); } diff --git a/src/forms/settings-dialog.ui b/src/forms/settings-dialog.ui index 6964a153..237fb932 100644 --- a/src/forms/settings-dialog.ui +++ b/src/forms/settings-dialog.ui @@ -2,150 +2,157 @@ SettingsDialog - - - 0 - 0 - 407 - 195 - - - - - 0 - 0 - - - - OBSWebsocket.Settings.DialogTitle - - - false - - - - QLayout::SetDefaultConstraint - - - - - - - OBSWebsocket.Settings.AuthRequired - - - - - - - OBSWebsocket.Settings.Password - - - - - - - QLineEdit::Password - - - - - - - OBSWebsocket.Settings.ServerEnable - - - true - - - - - - - OBSWebsocket.Settings.ServerPort - - - - - - - 1024 - - - 65535 - - - 4444 - - - - - - - OBSWebsocket.Settings.AlertsEnable - - - true - - - - - - - OBSWebsocket.Settings.DebugEnable - - - false - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - + + + 0 + 0 + 407 + 216 + + + + + 0 + 0 + + + + OBSWebsocket.Settings.DialogTitle + + + false + + + + QLayout::SetDefaultConstraint + + + + + + + OBSWebsocket.Settings.AuthRequired + + + + + + + OBSWebsocket.Settings.Password + + + + + + + QLineEdit::Password + + + + + + + OBSWebsocket.Settings.ServerEnable + + + true + + + + + + + OBSWebsocket.Settings.ServerPort + + + + + + + 1024 + + + 65535 + + + 4444 + + + + + + + OBSWebsocket.Settings.AlertsEnable + + + true + + + + + + + OBSWebsocket.Settings.DebugEnable + + + false + + + + + + + OBSWebsocket.Settings.LockToIPv4 + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + - - buttonBox - accepted() - SettingsDialog - accept() - - - 248 - 294 - - - 157 - 314 - - - - - buttonBox - rejected() - SettingsDialog - reject() - - - 316 - 300 - - - 286 - 314 - - - + + buttonBox + accepted() + SettingsDialog + accept() + + + 248 + 294 + + + 157 + 314 + + + + + buttonBox + rejected() + SettingsDialog + reject() + + + 316 + 300 + + + 286 + 314 + + + diff --git a/src/obs-websocket.cpp b/src/obs-websocket.cpp index 9f19ab9e..b198ebb7 100644 --- a/src/obs-websocket.cpp +++ b/src/obs-websocket.cpp @@ -81,7 +81,7 @@ bool obs_module_load(void) { auto eventCallback = [](enum obs_frontend_event event, void *param) { if (event == OBS_FRONTEND_EVENT_FINISHED_LOADING) { if (_config->ServerEnabled) { - _server->start(_config->ServerPort); + _server->start(_config->ServerPort, _config->LockToIPv4); } obs_frontend_remove_event_callback((obs_frontend_event_cb)param, nullptr); } From 9c4bd7a48705871bc37c7873cb9bfa9d8f877930 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 11 Jul 2020 05:00:10 -0700 Subject: [PATCH 098/178] Requests: Scene collection and profile name checking For `SetCurrentProfile` and `SetCurrentSceneCollection`, check if it exists before attempting to switch to it, and return an error if it does not exist. --- src/Utils.cpp | 20 ++++++++++++++++++++ src/Utils.h | 1 + src/WSRequestHandler_Profiles.cpp | 8 +++++++- src/WSRequestHandler_SceneCollections.cpp | 8 +++++++- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index ab301606..4ac3577d 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -51,6 +51,26 @@ obs_bounds_type getBoundsTypeFromName(QString name) { return boundTypeNames.key(name); } +bool Utils::StringInStringList(char** strings, const char* string) { + size_t index = 0; + char* value = nullptr; + + while (1) { + value = strings[index]; + + if (value == nullptr) { + return false; + } + + if (strcmp(value, string) == 0) { + return true; + } + + index++; + } + return false; +} + obs_data_array_t* Utils::StringListToArray(char** strings, const char* key) { obs_data_array_t* list = obs_data_array_create(); diff --git a/src/Utils.h b/src/Utils.h index dbe2481f..69b86fc5 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -35,6 +35,7 @@ typedef void(*PauseRecordingFunction)(bool); typedef bool(*RecordingPausedFunction)(); namespace Utils { + bool StringInStringList(char** strings, const char* string); obs_data_array_t* StringListToArray(char** strings, const char* key); obs_data_array_t* GetSceneItems(obs_source_t* source); obs_data_t* GetSceneItemData(obs_sceneitem_t* item); diff --git a/src/WSRequestHandler_Profiles.cpp b/src/WSRequestHandler_Profiles.cpp index 78e3ce2d..12728021 100644 --- a/src/WSRequestHandler_Profiles.cpp +++ b/src/WSRequestHandler_Profiles.cpp @@ -22,7 +22,13 @@ RpcResponse WSRequestHandler::SetCurrentProfile(const RpcRequest& request) { return request.failed("invalid request parameters"); } - // TODO : check if profile exists + char** profiles = obs_frontend_get_profiles(); + bool profileExists = Utils::StringInStringList(profiles, profileName.toUtf8()); + bfree(profiles); + if (!profileExists) { + return request.failed("profile does not exist"); + } + obs_frontend_set_current_profile(profileName.toUtf8()); return request.success(); } diff --git a/src/WSRequestHandler_SceneCollections.cpp b/src/WSRequestHandler_SceneCollections.cpp index 1f87996b..50d6417c 100644 --- a/src/WSRequestHandler_SceneCollections.cpp +++ b/src/WSRequestHandler_SceneCollections.cpp @@ -22,7 +22,13 @@ RpcResponse WSRequestHandler::SetCurrentSceneCollection(const RpcRequest& reques return request.failed("invalid request parameters"); } - // TODO : Check if specified profile exists and if changing is allowed + char** collections = obs_frontend_get_profiles(); + bool collectionExists = Utils::StringInStringList(collections, sceneCollection.toUtf8()); + bfree(collections); + if (!collectionExists) { + return request.failed("collection does not exist"); + } + obs_frontend_set_current_scene_collection(sceneCollection.toUtf8()); return request.success(); } From aa8fa008119818b81e9973390ddfb1a3a0db7fa5 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 9 Jul 2020 03:50:50 -0700 Subject: [PATCH 099/178] Docs: More updates Changes the media stuff's `@since 4.9.0` to `@since unreleased` to reduce potential confusion on the docs. As a part of the final 4.9.0 commits, I will be changing it back to 4.9.0. We also fix the contributing document since it was all messed up. --- CONTRIBUTING.md | 52 +++++++++++++-------------- src/WSEvents.cpp | 16 ++++----- src/WSRequestHandler_MediaControl.cpp | 22 ++++++------ 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8cd655c1..f94782b9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,22 +12,22 @@ Localization happens on [Crowdin](https://crowdin.com/project/obs-websocket) ### Code Formatting Guidelines -- Function and variable names: snake_case for C names, camelCase for C++ method names +* Function and variable names: snake_case for C names, camelCase for C++ method names -- Request and Event names should use MixedCaps names +* Request and Event names should use MixedCaps names -- Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) +* Request and Event json properties should use camelCase. For more detailed info on property naming, see [Google's JSON Style Guide](https://google.github.io/styleguide/jsoncstyleguide.xml) -- Code is indented with Tabs. Assume they are 8 columns wide +* Code is indented with Tabs. Assume they are 8 columns wide -- 80 columns max code width. (Docs can be larger) +* 80 columns max code width. (Docs can be larger) -- New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples). - These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). +* New and updated requests/events must always come with accompanying documentation comments (see existing protocol elements for examples). +These are required to automatically generate the [protocol specification document](docs/generated/protocol.md). ### Code Best-Practices -- Favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: +* Favor return-early code and avoid wrapping huge portions of code in conditionals. As an example, this: ```cpp if (success) { return req->SendOKResponse(); @@ -43,23 +43,23 @@ if (!success) { return req->SendOKResponse(); ``` -- Some example common response/request property names are: - - `sceneName` - The name of a scene - - `sourceName` - The name of a source - - `fromScene` - From a scene - scene name +* Some example common response/request property names are: + * `sceneName` - The name of a scene + * `sourceName` - The name of a source + * `fromScene` - From a scene - scene name ### Commit Guidelines -- Commits follow the 50/72 standard: - - 50 characters max for the commit title (excluding scope name) - - One empty line after the title - - Description wrapped to 72 columns max width per line. +* Commits follow the 50/72 standard: + * 50 characters max for the commit title (excluding scope name) + * One empty line after the title + * Description wrapped to 72 columns max width per line. -- Commit titles: - - Use present tense - - Prefix the title with a "scope" name - - e.g: "CI: fix wrong behaviour when packaging for OS X" - - Typical scopes: CI, General, Requests, Events, Server +* Commit titles: + * Use present tense + * Prefix the title with a "scope" name + * e.g: "CI: fix wrong behaviour when packaging for OS X" + * Typical scopes: CI, General, Requests, Events, Server **Example commit:** @@ -73,10 +73,10 @@ transitions. ### Pull Requests -- Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). - - Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) +* Pull Requests must never be based off your fork's main branch (in this case, `4.x-current`). + * Start your work in a newly named branch based on the upstream main one (e.g.: `feature/cool-new-feature`, `bugfix/fix-palakis-mistakes`, ...) -- Only open a pull request if you are ready to show off your work. +* Only open a pull request if you are ready to show off your work. -- If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers), - create it as a Draft Pull Request** (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). +* If your work is not done yet, but for any reason you need to PR it (like collecting discussions, testing with CI, getting testers), + create it as a Draft Pull Request (open the little arrow menu next to the "Create pull request" button, then select "Create draft pull request"). \ No newline at end of file diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index bb8e354c..0818fada 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -1430,7 +1430,7 @@ void WSEvents::OnSourceFilterOrderChanged(void* param, calldata_t* data) { * @api events * @name MediaPlaying * @category media - * @since 4.9.0 + * @since unreleased */ void WSEvents::OnMediaPlaying(void* param, calldata_t* data) { auto self = reinterpret_cast(param); @@ -1451,7 +1451,7 @@ void WSEvents::OnMediaPlaying(void* param, calldata_t* data) { * @api events * @name MediaPaused * @category media - * @since 4.9.0 + * @since unreleased */ void WSEvents::OnMediaPaused(void* param, calldata_t* data) { auto self = reinterpret_cast(param); @@ -1472,7 +1472,7 @@ void WSEvents::OnMediaPaused(void* param, calldata_t* data) { * @api events * @name MediaRestarted * @category media - * @since 4.9.0 + * @since unreleased */ void WSEvents::OnMediaRestarted(void* param, calldata_t* data) { auto self = reinterpret_cast(param); @@ -1493,7 +1493,7 @@ void WSEvents::OnMediaRestarted(void* param, calldata_t* data) { * @api events * @name MediaStopped * @category media - * @since 4.9.0 + * @since unreleased */ void WSEvents::OnMediaStopped(void* param, calldata_t* data) { auto self = reinterpret_cast(param); @@ -1514,7 +1514,7 @@ void WSEvents::OnMediaStopped(void* param, calldata_t* data) { * @api events * @name MediaNext * @category media - * @since 4.9.0 + * @since unreleased */ void WSEvents::OnMediaNext(void* param, calldata_t* data) { auto self = reinterpret_cast(param); @@ -1535,7 +1535,7 @@ void WSEvents::OnMediaNext(void* param, calldata_t* data) { * @api events * @name MediaPrevious * @category media - * @since 4.9.0 + * @since unreleased */ void WSEvents::OnMediaPrevious(void* param, calldata_t* data) { auto self = reinterpret_cast(param); @@ -1556,7 +1556,7 @@ void WSEvents::OnMediaPrevious(void* param, calldata_t* data) { * @api events * @name MediaStarted * @category media - * @since 4.9.0 + * @since unreleased */ void WSEvents::OnMediaStarted(void* param, calldata_t* data) { auto self = reinterpret_cast(param); @@ -1577,7 +1577,7 @@ void WSEvents::OnMediaStarted(void* param, calldata_t* data) { * @api events * @name MediaEnded * @category media - * @since 4.9.0 + * @since unreleased */ void WSEvents::OnMediaEnded(void* param, calldata_t* data) { auto self = reinterpret_cast(param); diff --git a/src/WSRequestHandler_MediaControl.cpp b/src/WSRequestHandler_MediaControl.cpp index 1b7a73bf..225c40c5 100644 --- a/src/WSRequestHandler_MediaControl.cpp +++ b/src/WSRequestHandler_MediaControl.cpp @@ -51,7 +51,7 @@ QString getSourceMediaState(obs_source_t *source) * @api requests * @name PlayPauseMedia * @category media control -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::PlayPauseMedia(const RpcRequest& request) { if ((!request.hasField("sourceName")) || (!request.hasField("playPause"))) { @@ -81,7 +81,7 @@ RpcResponse WSRequestHandler::PlayPauseMedia(const RpcRequest& request) { * @api requests * @name RestartMedia * @category media control -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::RestartMedia(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -110,7 +110,7 @@ RpcResponse WSRequestHandler::RestartMedia(const RpcRequest& request) { * @api requests * @name StopMedia * @category media control -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::StopMedia(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -139,7 +139,7 @@ RpcResponse WSRequestHandler::StopMedia(const RpcRequest& request) { * @api requests * @name NextMedia * @category media control -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::NextMedia(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -168,7 +168,7 @@ RpcResponse WSRequestHandler::NextMedia(const RpcRequest& request) { * @api requests * @name PreviousMedia * @category media control -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::PreviousMedia(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -200,7 +200,7 @@ RpcResponse WSRequestHandler::PreviousMedia(const RpcRequest& request) { * @api requests * @name GetMediaDuration * @category media control -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::GetMediaDuration(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -232,7 +232,7 @@ RpcResponse WSRequestHandler::GetMediaDuration(const RpcRequest& request) { * @api requests * @name GetMediaTime * @category media control -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::GetMediaTime(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -263,7 +263,7 @@ RpcResponse WSRequestHandler::GetMediaTime(const RpcRequest& request) { * @api requests * @name SetMediaTime * @category media control -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::SetMediaTime(const RpcRequest& request) { if (!request.hasField("sourceName") || !request.hasField("timestamp")) { @@ -295,7 +295,7 @@ RpcResponse WSRequestHandler::SetMediaTime(const RpcRequest& request) { * @api requests * @name ScrubMedia * @category media control -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::ScrubMedia(const RpcRequest& request) { if (!request.hasField("sourceName") || !request.hasField("timeOffset")) { @@ -332,7 +332,7 @@ RpcResponse WSRequestHandler::ScrubMedia(const RpcRequest& request) { * @api requests * @name GetMediaState * @category media control -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::GetMediaState(const RpcRequest& request) { if (!request.hasField("sourceName")) { @@ -366,7 +366,7 @@ RpcResponse WSRequestHandler::GetMediaState(const RpcRequest& request) { * @api requests * @name GetMediaSourcesList * @category sources -* @since 4.9.0 +* @since unreleased */ RpcResponse WSRequestHandler::GetMediaSourcesList(const RpcRequest& request) { From ac9c6b4a1f70b09e202f6e407b5227d59c43bd2f Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 12 Jul 2020 02:22:26 -0700 Subject: [PATCH 100/178] Docs: Fix GDIPlus requests documentation `bk-color` and `bk-opacity` are actually `bk_color` and `bk_opacity` respectively. Issue reported in #561 --- src/WSRequestHandler_Sources.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index f7d8605e..036b41c1 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -596,8 +596,8 @@ RpcResponse WSRequestHandler::SetSourceSettings(const RpcRequest& request) * * @return {String} `source` Source name. * @return {String} `align` Text Alignment ("left", "center", "right"). - * @return {int} `bk-color` Background color. - * @return {int} `bk-opacity` Background opacity (0-100). + * @return {int} `bk_color` Background color. + * @return {int} `bk_opacity` Background opacity (0-100). * @return {boolean} `chatlog` Chat log. * @return {int} `chatlog_lines` Chat log lines. * @return {int} `color` Text color. @@ -656,8 +656,8 @@ RpcResponse WSRequestHandler::GetTextGDIPlusProperties(const RpcRequest& request * * @param {String} `source` Name of the source. * @param {String (optional)} `align` Text Alignment ("left", "center", "right"). - * @param {int (optional)} `bk-color` Background color. - * @param {int (optional)} `bk-opacity` Background opacity (0-100). + * @param {int (optional)} `bk_color` Background color. + * @param {int (optional)} `bk_opacity` Background opacity (0-100). * @param {boolean (optional)} `chatlog` Chat log. * @param {int (optional)} `chatlog_lines` Chat log lines. * @param {int (optional)} `color` Text color. From c368696ddce80ac3b459db55b853e18d92d5fe48 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Wed, 15 Jul 2020 13:00:59 +0000 Subject: [PATCH 101/178] docs(ci): Update protocol.md - 94269c0 [skip ci] --- docs/generated/comments.json | 217 +++++++++++++++++++---------------- docs/generated/protocol.md | 120 ++++++++++--------- 2 files changed, 184 insertions(+), 153 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 5bfee9f2..5447e5f5 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -561,7 +561,7 @@ }, { "subheads": [], - "description": "The scene list has been modified.\nScenes have been added, removed, or renamed.", + "description": "\n\nNote: This event is not fired when the scenes are reordered.", "api": "events", "name": "ScenesChanged", "category": "scenes", @@ -588,7 +588,7 @@ "level": 2, "text": "ScenesChanged" }, - "lead": "", + "lead": "The scene list has been modified. Scenes have been added, removed, or renamed.", "type": "class", "examples": [] }, @@ -1190,7 +1190,7 @@ }, { "subheads": [], - "description": "Emit every 2 seconds.", + "description": "Emitted every 2 seconds when stream is active.", "return": [ "{boolean} `streaming` Current streaming state.", "{boolean} `recording` Current recording state.", @@ -1730,6 +1730,7 @@ "api": "events", "name": "Heartbeat", "category": "general", + "since": "v0.3", "returns": [ { "type": "boolean", @@ -1804,6 +1805,12 @@ "description": "general" } ], + "sinces": [ + { + "name": "", + "description": "v0.3" + } + ], "heading": { "level": 2, "text": "Heartbeat" @@ -1814,7 +1821,7 @@ }, { "subheads": [], - "description": "A custom broadcast message was received", + "description": "A custom broadcast message, sent by the server, requested by one of the websocket clients.", "return": [ "{String} `realm` Identifier provided by the sender", "{Object} `data` User-defined data" @@ -2574,7 +2581,7 @@ "api": "events", "name": "MediaPlaying", "category": "media", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "String", @@ -2602,7 +2609,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -2623,7 +2630,7 @@ "api": "events", "name": "MediaPaused", "category": "media", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "String", @@ -2651,7 +2658,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -2672,7 +2679,7 @@ "api": "events", "name": "MediaRestarted", "category": "media", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "String", @@ -2700,7 +2707,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -2721,7 +2728,7 @@ "api": "events", "name": "MediaStopped", "category": "media", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "String", @@ -2749,7 +2756,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -2770,7 +2777,7 @@ "api": "events", "name": "MediaNext", "category": "media", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "String", @@ -2798,7 +2805,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -2819,7 +2826,7 @@ "api": "events", "name": "MediaPrevious", "category": "media", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "String", @@ -2847,7 +2854,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -2868,7 +2875,7 @@ "api": "events", "name": "MediaStarted", "category": "media", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "String", @@ -2896,7 +2903,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -2917,7 +2924,7 @@ "api": "events", "name": "MediaEnded", "category": "media", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "String", @@ -2945,7 +2952,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -2960,7 +2967,7 @@ "scene items": [ { "subheads": [], - "description": "Scene items have been reordered.", + "description": "Scene items within a scene have been reordered.", "return": [ "{String} `scene-name` Name of the scene where items have been reordered.", "{Array} `scene-items` Ordered list of scene items", @@ -3021,7 +3028,7 @@ }, { "subheads": [], - "description": "An item has been added to the current scene.", + "description": "A scene item has been added to a scene.", "return": [ "{String} `scene-name` Name of the scene.", "{String} `item-name` Name of the item added to the scene.", @@ -3076,7 +3083,7 @@ }, { "subheads": [], - "description": "An item has been removed from the current scene.", + "description": "A scene item has been removed from a scene.", "return": [ "{String} `scene-name` Name of the scene.", "{String} `item-name` Name of the item removed from the scene.", @@ -3131,7 +3138,7 @@ }, { "subheads": [], - "description": "An item's visibility has been toggled.", + "description": "A scene item's visibility has been toggled.", "return": [ "{String} `scene-name` Name of the scene.", "{String} `item-name` Name of the item in the scene.", @@ -3192,7 +3199,7 @@ }, { "subheads": [], - "description": "An item's locked status has been toggled.", + "description": "A scene item's locked status has been toggled.", "return": [ "{String} `scene-name` Name of the scene.", "{String} `item-name` Name of the item in the scene.", @@ -3253,7 +3260,7 @@ }, { "subheads": [], - "description": "An item's transform has been changed.", + "description": "A scene item's transform has been changed.", "return": [ "{String} `scene-name` Name of the scene.", "{String} `item-name` Name of the item in the scene.", @@ -3689,6 +3696,7 @@ "name": "SetHeartbeat", "category": "general", "since": "4.3.0", + "deprecated": "Since 4.9.0. Please poll the appropriate data using requests. Will be removed in v5.0.0.", "params": [ { "type": "boolean", @@ -3714,6 +3722,12 @@ "description": "4.3.0" } ], + "deprecateds": [ + { + "name": "", + "description": "Since 4.9.0. Please poll the appropriate data using requests. Will be removed in v5.0.0." + } + ], "heading": { "level": 2, "text": "SetHeartbeat" @@ -3807,7 +3821,7 @@ { "subheads": [], "description": "Get OBS stats (almost the same info as provided in OBS' stats window)", - "return": "{OBSStats} `stats` OBS stats", + "return": "{OBSStats} `stats` [OBS stats](#obsstats)", "api": "requests", "name": "GetStats", "category": "general", @@ -3816,7 +3830,7 @@ { "type": "OBSStats", "name": "stats", - "description": "OBS stats" + "description": "[OBS stats](#obsstats)" } ], "names": [ @@ -3989,9 +4003,9 @@ "subheads": [], "description": "Open a projector window or create a projector on a monitor. Requires OBS v24.0.4 or newer.", "param": [ - "{String (Optional)} `type` Type of projector: Preview (default), Source, Scene, StudioProgram, or Multiview (case insensitive).", + "{String (Optional)} `type` Type of projector: `Preview` (default), `Source`, `Scene`, `StudioProgram`, or `Multiview` (case insensitive).", "{int (Optional)} `monitor` Monitor to open the projector on. If -1 or omitted, opens a window.", - "{String (Optional)} `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.", + "{String (Optional)} `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.", "{String (Optional)} `name` Name of the source or scene to be displayed (ignored for other projector types)." ], "api": "requests", @@ -4002,7 +4016,7 @@ { "type": "String (Optional)", "name": "type", - "description": "Type of projector: Preview (default), Source, Scene, StudioProgram, or Multiview (case insensitive)." + "description": "Type of projector: `Preview` (default), `Source`, `Scene`, `StudioProgram`, or `Multiview` (case insensitive)." }, { "type": "int (Optional)", @@ -4012,7 +4026,7 @@ { "type": "String (Optional)", "name": "geometry", - "description": "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." + "description": "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." }, { "type": "String (Optional)", @@ -4058,7 +4072,7 @@ "api": "requests", "name": "PlayPauseMedia", "category": "media control", - "since": "4.9.0", + "since": "unreleased", "params": [ { "type": "String", @@ -4086,7 +4100,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -4104,7 +4118,7 @@ "api": "requests", "name": "RestartMedia", "category": "media control", - "since": "4.9.0", + "since": "unreleased", "params": [ { "type": "String", @@ -4127,7 +4141,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -4145,7 +4159,7 @@ "api": "requests", "name": "StopMedia", "category": "media control", - "since": "4.9.0", + "since": "unreleased", "params": [ { "type": "String", @@ -4168,7 +4182,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -4186,7 +4200,7 @@ "api": "requests", "name": "NextMedia", "category": "media control", - "since": "4.9.0", + "since": "unreleased", "params": [ { "type": "String", @@ -4209,7 +4223,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -4227,7 +4241,7 @@ "api": "requests", "name": "PreviousMedia", "category": "media control", - "since": "4.9.0", + "since": "unreleased", "params": [ { "type": "String", @@ -4250,7 +4264,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -4269,7 +4283,7 @@ "api": "requests", "name": "GetMediaDuration", "category": "media control", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "int", @@ -4299,7 +4313,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -4318,7 +4332,7 @@ "api": "requests", "name": "GetMediaTime", "category": "media control", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "int", @@ -4348,7 +4362,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -4369,7 +4383,7 @@ "api": "requests", "name": "SetMediaTime", "category": "media control", - "since": "4.9.0", + "since": "unreleased", "params": [ { "type": "String", @@ -4397,7 +4411,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -4418,7 +4432,7 @@ "api": "requests", "name": "ScrubMedia", "category": "media control", - "since": "4.9.0", + "since": "unreleased", "params": [ { "type": "String", @@ -4446,7 +4460,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -4465,7 +4479,7 @@ "api": "requests", "name": "GetMediaState", "category": "media control", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "String", @@ -4495,7 +4509,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -4520,7 +4534,7 @@ "api": "requests", "name": "GetMediaSourcesList", "category": "sources", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "Array", @@ -4558,7 +4572,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -4575,7 +4589,7 @@ "return": [ "{Array} `sources` Array of sources", "{String} `sources.*.name` Unique source name", - "{String} `sources.*.typeId` Non-unique source internal type (a.k.a type id)", + "{String} `sources.*.typeId` Non-unique source internal type (a.k.a kind)", "{String} `sources.*.type` Source type. Value is one of the following: \"input\", \"filter\", \"transition\", \"scene\" or \"unknown\"" ], "api": "requests", @@ -4596,7 +4610,7 @@ { "type": "String", "name": "sources.*.typeId", - "description": "Non-unique source internal type (a.k.a type id)" + "description": "Non-unique source internal type (a.k.a kind)" }, { "type": "String", @@ -5069,7 +5083,7 @@ }, { "subheads": [], - "description": "\n\nNote: If the new name already exists as a source, OBS will automatically modify the name to not interfere.", + "description": "\n\nNote: If the new name already exists as a source, obs-websocket will return an error.", "param": [ "{String} `sourceName` Source name.", "{String} `newName` New source name." @@ -5377,8 +5391,8 @@ "return": [ "{String} `source` Source name.", "{String} `align` Text Alignment (\"left\", \"center\", \"right\").", - "{int} `bk-color` Background color.", - "{int} `bk-opacity` Background opacity (0-100).", + "{int} `bk_color` Background color.", + "{int} `bk_opacity` Background opacity (0-100).", "{boolean} `chatlog` Chat log.", "{int} `chatlog_lines` Chat log lines.", "{int} `color` Text color.", @@ -5421,12 +5435,12 @@ }, { "type": "int", - "name": "bk-color", + "name": "bk_color", "description": "Background color." }, { "type": "int", - "name": "bk-opacity", + "name": "bk_opacity", "description": "Background opacity (0-100)." }, { @@ -5589,8 +5603,8 @@ "param": [ "{String} `source` Name of the source.", "{String (optional)} `align` Text Alignment (\"left\", \"center\", \"right\").", - "{int (optional)} `bk-color` Background color.", - "{int (optional)} `bk-opacity` Background opacity (0-100).", + "{int (optional)} `bk_color` Background color.", + "{int (optional)} `bk_opacity` Background opacity (0-100).", "{boolean (optional)} `chatlog` Chat log.", "{int (optional)} `chatlog_lines` Chat log lines.", "{int (optional)} `color` Text color.", @@ -5634,12 +5648,12 @@ }, { "type": "int (optional)", - "name": "bk-color", + "name": "bk_color", "description": "Background color." }, { "type": "int (optional)", - "name": "bk-opacity", + "name": "bk_opacity", "description": "Background opacity (0-100)." }, { @@ -6087,7 +6101,7 @@ "name": "GetBrowserSourceProperties", "category": "sources", "since": "4.1.0", - "deprecated": "Since 4.8.0. Prefer the use of GetSourceSettings.", + "deprecated": "Since 4.8.0. Prefer the use of GetSourceSettings. Will be removed in v5.0.0", "returns": [ { "type": "String", @@ -6163,7 +6177,7 @@ "deprecateds": [ { "name": "", - "description": "Since 4.8.0. Prefer the use of GetSourceSettings." + "description": "Since 4.8.0. Prefer the use of GetSourceSettings. Will be removed in v5.0.0" } ], "heading": { @@ -6192,7 +6206,7 @@ "api": "requests", "name": "SetBrowserSourceProperties", "category": "sources", - "deprecated": "Since 4.8.0. Prefer the use of SetSourceSettings.", + "deprecated": "Since 4.8.0. Prefer the use of SetSourceSettings. Will be removed in v5.0.0", "since": "4.1.0", "params": [ { @@ -6261,7 +6275,7 @@ "deprecateds": [ { "name": "", - "description": "Since 4.8.0. Prefer the use of SetSourceSettings." + "description": "Since 4.8.0. Prefer the use of SetSourceSettings. Will be removed in v5.0.0" } ], "sinces": [ @@ -7120,7 +7134,7 @@ }, { "subheads": [], - "description": "Start an output", + "description": "\n\nNote: Controlling outputs is an experimental feature of obs-websocket. Some plugins which add outputs to OBS may not function properly when they are controlled in this way.", "param": "{String} `outputName` Output name", "api": "requests", "name": "StartOutput", @@ -7155,13 +7169,13 @@ "level": 2, "text": "StartOutput" }, - "lead": "", + "lead": "Start an output", "type": "class", "examples": [] }, { "subheads": [], - "description": "Stop an output", + "description": "\n\nNote: Controlling outputs is an experimental feature of obs-websocket. Some plugins which add outputs to OBS may not function properly when they are controlled in this way.", "param": [ "{String} `outputName` Output name", "{boolean (optional)} `force` Force stop (default: false)" @@ -7204,7 +7218,7 @@ "level": 2, "text": "StopOutput" }, - "lead": "", + "lead": "Stop an output", "type": "class", "examples": [] } @@ -7295,7 +7309,10 @@ { "subheads": [], "description": "Get a list of available profiles.", - "return": "{Array} `profiles` List of available profiles.", + "return": [ + "{Array} `profiles` List of available profiles.", + "{String} `profiles.*.profile-name` Filter name" + ], "api": "requests", "name": "ListProfiles", "category": "profiles", @@ -7305,6 +7322,11 @@ "type": "Array", "name": "profiles", "description": "List of available profiles." + }, + { + "type": "String", + "name": "profiles.*.profile-name", + "description": "Filter name" } ], "names": [ @@ -7392,7 +7414,7 @@ }, { "subheads": [], - "description": "Toggle recording on or off.", + "description": "Toggle recording on or off (depending on the current recording state).", "api": "requests", "name": "StartStopRecording", "category": "recording", @@ -7682,7 +7704,7 @@ }, { "subheads": [], - "description": "Toggle the Replay Buffer on/off.", + "description": "Toggle the Replay Buffer on/off (depending on the current state of the replay buffer).", "api": "requests", "name": "StartStopReplayBuffer", "category": "replay buffer", @@ -7899,7 +7921,10 @@ { "subheads": [], "description": "List available scene collections", - "return": "{Array} `scene-collections` Scene collections list", + "return": [ + "{Array} `scene-collections` Scene collections list", + "{String} `scene-collections.*.sc-name` Scene collection name" + ], "api": "requests", "name": "ListSceneCollections", "category": "scene collections", @@ -7909,6 +7934,11 @@ "type": "Array", "name": "scene-collections", "description": "Scene collections list" + }, + { + "type": "String", + "name": "scene-collections.*.sc-name", + "description": "Scene collection name" } ], "names": [ @@ -8465,7 +8495,6 @@ "name": "SetSceneItemRender", "category": "scene items", "since": "0.3", - "deprecated": "Since 4.3.0. Prefer the use of SetSceneItemProperties.", "params": [ { "type": "String (optional)", @@ -8501,12 +8530,6 @@ "description": "0.3" } ], - "deprecateds": [ - { - "name": "", - "description": "Since 4.3.0. Prefer the use of SetSceneItemProperties." - } - ], "heading": { "level": 2, "text": "SetSceneItemRender" @@ -9144,8 +9167,8 @@ "param": [ "{String (optional)} `scene` Name of the scene to reorder (defaults to current).", "{Array} `items` Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene", - "{int (optional)} `items[].id` Id of a specific scene item. Unique on a scene by scene basis.", - "{String (optional)} `items[].name` Name of a scene item. Sufficiently unique if no scene items share sources within the scene." + "{int (optional)} `items.*.id` Id of a specific scene item. Unique on a scene by scene basis.", + "{String (optional)} `items.*.name` Name of a scene item. Sufficiently unique if no scene items share sources within the scene." ], "api": "requests", "name": "ReorderSceneItems", @@ -9164,12 +9187,12 @@ }, { "type": "int (optional)", - "name": "items[].id", + "name": "items.*.id", "description": "Id of a specific scene item. Unique on a scene by scene basis." }, { "type": "String (optional)", - "name": "items[].name", + "name": "items.*.name", "description": "Name of a scene item. Sufficiently unique if no scene items share sources within the scene." } ], @@ -9210,7 +9233,7 @@ "api": "requests", "name": "SetSceneTransitionOverride", "category": "scenes", - "since": "4.9.0", + "since": "unreleased", "params": [ { "type": "String", @@ -9243,7 +9266,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -9261,7 +9284,7 @@ "api": "requests", "name": "RemoveSceneTransitionOverride", "category": "scenes", - "since": "4.9.0", + "since": "unreleased", "params": [ { "type": "String", @@ -9284,7 +9307,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -9306,7 +9329,7 @@ "api": "requests", "name": "GetSceneTransitionOverride", "category": "scenes", - "since": "4.9.0", + "since": "unreleased", "returns": [ { "type": "String", @@ -9341,7 +9364,7 @@ "sinces": [ { "name": "", - "description": "4.9.0" + "description": "unreleased" } ], "heading": { @@ -9423,7 +9446,7 @@ }, { "subheads": [], - "description": "Toggle streaming on or off.", + "description": "Toggle streaming on or off (depending on the current stream state).", "api": "requests", "name": "StartStopStreaming", "category": "streaming", @@ -9777,7 +9800,7 @@ }, { "subheads": [], - "description": "Send the provided text as embedded CEA-608 caption data.\nAs of OBS Studio 23.1, captions are not yet available on Linux.", + "description": "Send the provided text as embedded CEA-608 caption data.", "param": "{String} `text` Captions text", "api": "requests", "name": "SendCaptions", @@ -10072,7 +10095,7 @@ }, { "subheads": [], - "description": "Toggles Studio Mode.", + "description": "Toggles Studio Mode (depending on the current state of studio mode).", "api": "requests", "name": "ToggleStudioMode", "category": "studio mode", diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index b2c5a84e..a5d3a57f 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -4,7 +4,7 @@ # General Introduction Messages are exchanged between the client and the server as JSON objects. -This protocol is based on the original OBS Remote protocol created by Bill Hamilton, with new commands specific to OBS Studio. +This protocol is based on the original OBS Remote protocol created by Bill Hamilton, with new commands specific to OBS Studio. As of v5.0.0, backwards compatability with the protocol will not be kept. # Authentication `obs-websocket` uses SHA256 to transmit credentials. @@ -35,6 +35,8 @@ auth_response_hash = binary_sha256(auth_response_string) auth_response = base64_encode(auth_response_hash) ``` +You can also refer to any of the client libraries listed on the [README](README.md) for examples of how to authenticate. + @@ -380,8 +382,9 @@ Indicates a scene change. - Added in v0.3 -The scene list has been modified. -Scenes have been added, removed, or renamed. + + +Note: This event is not fired when the scenes are reordered. **Response Items:** @@ -616,7 +619,7 @@ _No additional response items._ - Added in v0.3 -Emit every 2 seconds. +Emitted every 2 seconds when stream is active. **Response Items:** @@ -799,7 +802,7 @@ _No additional response items._ ### Heartbeat -- Added in v +- Added in vv0.3 Emitted every 2 seconds after enabling it by calling SetHeartbeat. @@ -828,7 +831,7 @@ Emitted every 2 seconds after enabling it by calling SetHeartbeat. - Added in v4.7.0 -A custom broadcast message was received +A custom broadcast message, sent by the server, requested by one of the websocket clients. **Response Items:** @@ -1079,7 +1082,7 @@ Filters in a source have been reordered. ### MediaPlaying -- Added in v4.9.0 +- Unreleased @@ -1098,7 +1101,7 @@ Note: This event is only emitted when something actively controls the media/VLC ### MediaPaused -- Added in v4.9.0 +- Unreleased @@ -1117,7 +1120,7 @@ Note: This event is only emitted when something actively controls the media/VLC ### MediaRestarted -- Added in v4.9.0 +- Unreleased @@ -1136,7 +1139,7 @@ Note: This event is only emitted when something actively controls the media/VLC ### MediaStopped -- Added in v4.9.0 +- Unreleased @@ -1155,7 +1158,7 @@ Note: This event is only emitted when something actively controls the media/VLC ### MediaNext -- Added in v4.9.0 +- Unreleased @@ -1174,7 +1177,7 @@ Note: This event is only emitted when something actively controls the media/VLC ### MediaPrevious -- Added in v4.9.0 +- Unreleased @@ -1193,7 +1196,7 @@ Note: This event is only emitted when something actively controls the media/VLC ### MediaStarted -- Added in v4.9.0 +- Unreleased @@ -1212,7 +1215,7 @@ Note: These events are emitted by the OBS sources themselves. For example when t ### MediaEnded -- Added in v4.9.0 +- Unreleased @@ -1235,7 +1238,7 @@ Note: These events are emitted by the OBS sources themselves. For example when t - Added in v4.0.0 -Scene items have been reordered. +Scene items within a scene have been reordered. **Response Items:** @@ -1254,7 +1257,7 @@ Scene items have been reordered. - Added in v4.0.0 -An item has been added to the current scene. +A scene item has been added to a scene. **Response Items:** @@ -1272,7 +1275,7 @@ An item has been added to the current scene. - Added in v4.0.0 -An item has been removed from the current scene. +A scene item has been removed from a scene. **Response Items:** @@ -1290,7 +1293,7 @@ An item has been removed from the current scene. - Added in v4.0.0 -An item's visibility has been toggled. +A scene item's visibility has been toggled. **Response Items:** @@ -1309,7 +1312,7 @@ An item's visibility has been toggled. - Added in v4.8.0 -An item's locked status has been toggled. +A scene item's locked status has been toggled. **Response Items:** @@ -1328,7 +1331,7 @@ An item's locked status has been toggled. - Added in v4.6.0 -An item's transform has been changed. +A scene item's transform has been changed. **Response Items:** @@ -1424,7 +1427,7 @@ Requests are sent by the client and require at least the following two fields: Once a request is sent, the server will return a JSON response with at least the following fields: - `message-id` _String_: The client defined identifier specified in the request. - `status` _String_: Response status, will be one of the following: `ok`, `error` -- `error` _String_: An error message accompanying an `error` status. +- `error` _String (Optional)_: An error message accompanying an `error` status. Additional information may be required/returned depending on the request type. See below for more information. @@ -1500,6 +1503,7 @@ _No additional response items._ ### SetHeartbeat +- **⚠️ Deprecated. Since 4.9.0. Please poll the appropriate data using requests. Will be removed in v5.0.0. ⚠️** - Added in v4.3.0 @@ -1573,7 +1577,7 @@ _No specified parameters._ | Name | Type | Description | | ---- | :---: | ------------| -| `stats` | _OBSStats_ | OBS stats | +| `stats` | _OBSStats_ | [OBS stats](#obsstats) | --- @@ -1638,9 +1642,9 @@ Open a projector window or create a projector on a monitor. Requires OBS v24.0.4 | Name | Type | Description | | ---- | :---: | ------------| -| `type` | _String (Optional)_ | Type of projector: Preview (default), Source, Scene, StudioProgram, or Multiview (case insensitive). | +| `type` | _String (Optional)_ | Type of projector: `Preview` (default), `Source`, `Scene`, `StudioProgram`, or `Multiview` (case insensitive). | | `monitor` | _int (Optional)_ | Monitor to open the projector on. If -1 or omitted, opens a window. | -| `geometry` | _String (Optional)_ | 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. | +| `geometry` | _String (Optional)_ | 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` | _String (Optional)_ | Name of the source or scene to be displayed (ignored for other projector types). | @@ -1655,7 +1659,7 @@ _No additional response items._ ### PlayPauseMedia -- Added in v4.9.0 +- Unreleased Pause or play a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) @@ -1676,7 +1680,7 @@ _No additional response items._ ### RestartMedia -- Added in v4.9.0 +- Unreleased Restart a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) @@ -1696,7 +1700,7 @@ _No additional response items._ ### StopMedia -- Added in v4.9.0 +- Unreleased Stop a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) @@ -1716,7 +1720,7 @@ _No additional response items._ ### NextMedia -- Added in v4.9.0 +- Unreleased Skip to the next media item in the playlist. Supports only vlc media source (as of OBS v25.0.8) @@ -1736,7 +1740,7 @@ _No additional response items._ ### PreviousMedia -- Added in v4.9.0 +- Unreleased Go to the previous media item in the playlist. Supports only vlc media source (as of OBS v25.0.8) @@ -1756,7 +1760,7 @@ _No additional response items._ ### GetMediaDuration -- Added in v4.9.0 +- Unreleased Get the length of media in milliseconds. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) Note: For some reason, for the first 5 or so seconds that the media is playing, the total duration can be off by upwards of 50ms. @@ -1780,7 +1784,7 @@ Note: For some reason, for the first 5 or so seconds that the media is playing, ### GetMediaTime -- Added in v4.9.0 +- Unreleased Get the current timestamp of media in milliseconds. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) @@ -1803,7 +1807,7 @@ Get the current timestamp of media in milliseconds. Supports ffmpeg and vlc medi ### SetMediaTime -- Added in v4.9.0 +- Unreleased Set the timestamp of a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) @@ -1824,7 +1828,7 @@ _No additional response items._ ### ScrubMedia -- Added in v4.9.0 +- Unreleased Scrub media using a supplied offset. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) Note: Due to processing/network delays, this request is not perfect. The processing rate of this request has also not been tested. @@ -1846,7 +1850,7 @@ _No additional response items._ ### GetMediaState -- Added in v4.9.0 +- Unreleased Get the current playing state of a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8) @@ -1871,7 +1875,7 @@ Get the current playing state of a media source. Supports ffmpeg and vlc media s ### GetMediaSourcesList -- Added in v4.9.0 +- Unreleased List the media state of all media sources (vlc and media source) @@ -1908,7 +1912,7 @@ _No specified parameters._ | ---- | :---: | ------------| | `sources` | _Array<Object>_ | Array of sources | | `sources.*.name` | _String_ | Unique source name | -| `sources.*.typeId` | _String_ | Non-unique source internal type (a.k.a type id) | +| `sources.*.typeId` | _String_ | Non-unique source internal type (a.k.a kind) | | `sources.*.type` | _String_ | Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" | @@ -2089,7 +2093,7 @@ Get the audio's active status of a specified source. -Note: If the new name already exists as a source, OBS will automatically modify the name to not interfere. +Note: If the new name already exists as a source, obs-websocket will return an error. **Request Fields:** @@ -2223,8 +2227,8 @@ Get the current properties of a Text GDI Plus source. | ---- | :---: | ------------| | `source` | _String_ | Source name. | | `align` | _String_ | Text Alignment ("left", "center", "right"). | -| `bk-color` | _int_ | Background color. | -| `bk-opacity` | _int_ | Background opacity (0-100). | +| `bk_color` | _int_ | Background color. | +| `bk_opacity` | _int_ | Background opacity (0-100). | | `chatlog` | _boolean_ | Chat log. | | `chatlog_lines` | _int_ | Chat log lines. | | `color` | _int_ | Text color. | @@ -2266,8 +2270,8 @@ Set the current properties of a Text GDI Plus source. | ---- | :---: | ------------| | `source` | _String_ | Name of the source. | | `align` | _String (optional)_ | Text Alignment ("left", "center", "right"). | -| `bk-color` | _int (optional)_ | Background color. | -| `bk-opacity` | _int (optional)_ | Background opacity (0-100). | +| `bk_color` | _int (optional)_ | Background color. | +| `bk_opacity` | _int (optional)_ | Background opacity (0-100). | | `chatlog` | _boolean (optional)_ | Chat log. | | `chatlog_lines` | _int (optional)_ | Chat log lines. | | `color` | _int (optional)_ | Text color. | @@ -2376,7 +2380,7 @@ _No additional response items._ ### GetBrowserSourceProperties -- **⚠️ Deprecated. Since 4.8.0. Prefer the use of GetSourceSettings. ⚠️** +- **⚠️ Deprecated. Since 4.8.0. Prefer the use of GetSourceSettings. Will be removed in v5.0.0 ⚠️** - Added in v4.1.0 @@ -2408,7 +2412,7 @@ Get current properties for a Browser Source. ### SetBrowserSourceProperties -- **⚠️ Deprecated. Since 4.8.0. Prefer the use of SetSourceSettings. ⚠️** +- **⚠️ Deprecated. Since 4.8.0. Prefer the use of SetSourceSettings. Will be removed in v5.0.0 ⚠️** - Added in v4.1.0 @@ -2776,7 +2780,9 @@ Get information about a single output - Added in v4.7.0 -Start an output + + +Note: Controlling outputs is an experimental feature of obs-websocket. Some plugins which add outputs to OBS may not function properly when they are controlled in this way. **Request Fields:** @@ -2796,7 +2802,9 @@ _No additional response items._ - Added in v4.7.0 -Stop an output + + +Note: Controlling outputs is an experimental feature of obs-websocket. Some plugins which add outputs to OBS may not function properly when they are controlled in this way. **Request Fields:** @@ -2870,6 +2878,7 @@ _No specified parameters._ | Name | Type | Description | | ---- | :---: | ------------| | `profiles` | _Array<Object>_ | List of available profiles. | +| `profiles.*.profile-name` | _String_ | Filter name | --- @@ -2903,7 +2912,7 @@ _No specified parameters._ - Added in v0.3 -Toggle recording on or off. +Toggle recording on or off (depending on the current recording state). **Request Fields:** @@ -3058,7 +3067,7 @@ _No specified parameters._ - Added in v4.2.0 -Toggle the Replay Buffer on/off. +Toggle the Replay Buffer on/off (depending on the current state of the replay buffer). **Request Fields:** @@ -3186,6 +3195,7 @@ _No specified parameters._ | Name | Type | Description | | ---- | :---: | ------------| | `scene-collections` | _Array<String>_ | Scene collections list | +| `scene-collections.*.sc-name` | _String_ | Scene collection name | --- @@ -3336,7 +3346,6 @@ _No additional response items._ ### SetSceneItemRender -- **⚠️ Deprecated. Since 4.3.0. Prefer the use of SetSceneItemProperties. ⚠️** - Added in v0.3 @@ -3607,8 +3616,8 @@ Changes the order of scene items in the requested scene. | ---- | :---: | ------------| | `scene` | _String (optional)_ | Name of the scene to reorder (defaults to current). | | `items` | _Array<Scene>_ | Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene | -| `items[].id` | _int (optional)_ | Id of a specific scene item. Unique on a scene by scene basis. | -| `items[].name` | _String (optional)_ | Name of a scene item. Sufficiently unique if no scene items share sources within the scene. | +| `items.*.id` | _int (optional)_ | Id of a specific scene item. Unique on a scene by scene basis. | +| `items.*.name` | _String (optional)_ | Name of a scene item. Sufficiently unique if no scene items share sources within the scene. | **Response Items:** @@ -3620,7 +3629,7 @@ _No additional response items._ ### SetSceneTransitionOverride -- Added in v4.9.0 +- Unreleased Set a scene to use a specific transition override. @@ -3642,7 +3651,7 @@ _No additional response items._ ### RemoveSceneTransitionOverride -- Added in v4.9.0 +- Unreleased Remove any transition override on a scene. @@ -3662,7 +3671,7 @@ _No additional response items._ ### GetSceneTransitionOverride -- Added in v4.9.0 +- Unreleased Get the current scene transition override. @@ -3714,7 +3723,7 @@ _No specified parameters._ - Added in v0.3 -Toggle streaming on or off. +Toggle streaming on or off (depending on the current stream state). **Request Fields:** @@ -3849,7 +3858,6 @@ _No additional response items._ - Added in v4.6.0 Send the provided text as embedded CEA-608 caption data. -As of OBS Studio 23.1, captions are not yet available on Linux. **Request Fields:** @@ -3991,7 +3999,7 @@ _No additional response items._ - Added in v4.1.0 -Toggles Studio Mode. +Toggles Studio Mode (depending on the current state of studio mode). **Request Fields:** From a651a1a69fd94022abb65f89756a8b64aa29e2c0 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Wed, 15 Jul 2020 13:01:23 +0000 Subject: [PATCH 102/178] docs(ci): Update protocol.md - c368696 [skip ci] --- docs/generated/comments.json | 6 +++--- docs/generated/protocol.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 5447e5f5..6635e97e 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -6943,7 +6943,7 @@ "subheads": [], "description": "\n\nAt least `embedPictureFormat` or `saveToFilePath` must be specified.\n\nClients can specify `width` and `height` parameters to receive scaled pictures. Aspect ratio is\npreserved if only one of these two parameters is specified.", "param": [ - "{String} `sourceName` Source name. Note that, since scenes are also sources, you can also provide a scene name.", + "{String (optional)} `sourceName` Source name. Note that, since scenes are also sources, you can also provide a scene name. If not provided, the currently active scene is used.", "{String (optional)} `embedPictureFormat` Format of the Data URI encoded picture. Can be \"png\", \"jpg\", \"jpeg\" or \"bmp\" (or any other value supported by Qt's Image module)", "{String (optional)} `saveToFilePath` Full file path (file extension included) where the captured image is to be saved. Can be in a format different from `pictureFormat`. Can be a relative path.", "{String (optional)} `fileFormat` Format to save the image file as (one of the values provided in the `supported-image-export-formats` response field of `GetVersion`). If not specified, tries to guess based on file extension.", @@ -6979,9 +6979,9 @@ ], "params": [ { - "type": "String", + "type": "String (optional)", "name": "sourceName", - "description": "Source name. Note that, since scenes are also sources, you can also provide a scene name." + "description": "Source name. Note that, since scenes are also sources, you can also provide a scene name. If not provided, the currently active scene is used." }, { "type": "String (optional)", diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index a5d3a57f..d2f4f324 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -2710,7 +2710,7 @@ preserved if only one of these two parameters is specified. | Name | Type | Description | | ---- | :---: | ------------| -| `sourceName` | _String_ | Source name. Note that, since scenes are also sources, you can also provide a scene name. | +| `sourceName` | _String (optional)_ | Source name. Note that, since scenes are also sources, you can also provide a scene name. If not provided, the currently active scene is used. | | `embedPictureFormat` | _String (optional)_ | Format of the Data URI encoded picture. Can be "png", "jpg", "jpeg" or "bmp" (or any other value supported by Qt's Image module) | | `saveToFilePath` | _String (optional)_ | Full file path (file extension included) where the captured image is to be saved. Can be in a format different from `pictureFormat`. Can be a relative path. | | `fileFormat` | _String (optional)_ | Format to save the image file as (one of the values provided in the `supported-image-export-formats` response field of `GetVersion`). If not specified, tries to guess based on file extension. | From 58448f363b078339e8861715f26a28dee63cf62d Mon Sep 17 00:00:00 2001 From: venepe Date: Wed, 15 Jul 2020 21:23:51 -0500 Subject: [PATCH 103/178] CMakeLists: Compile for arm targets --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9230d197..261d8c78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) add_definitions(-DASIO_STANDALONE) +if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") + set(CMAKE_CXX_FLAGS "-mfpu=neon") +endif() + if (WIN32 OR APPLE) include(external/FindLibObs.cmake) endif() From d91b3f8dd9261ed9f912e4dd33202f20494942ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 28 Jul 2020 02:23:31 +0200 Subject: [PATCH 104/178] Utils(GetTrayIcon): refactor with frontend API function --- src/Utils.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index ab301606..da0b7fe6 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -485,11 +485,8 @@ QString Utils::OBSVersionString() { } QSystemTrayIcon* Utils::GetTrayIcon() { - QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window(); - if (!main) return nullptr; - - QList trays = main->findChildren(); - return trays.isEmpty() ? nullptr : trays.first(); + void* systemTray = obs_frontend_get_system_tray(); + return reinterpret_cast(systemTray); } void Utils::SysTrayNotify(QString text, From 1dd96fa7144d80791af9694270c4d0fe61b8d7cd Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 31 Jul 2020 22:08:07 -0700 Subject: [PATCH 105/178] Docs: Add `enabled` field to `SourceFiltersReordered` Was noticed in Discord that this was missing from the docs --- src/WSEvents.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 0818fada..56d24c8a 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -1397,6 +1397,7 @@ void WSEvents::OnSourceFilterVisibilityChanged(void* param, calldata_t* data) { * @return {Array} `filters` Ordered Filters list * @return {String} `filters.*.name` Filter name * @return {String} `filters.*.type` Filter type + * @return {boolean} `filters.*.enabled` Filter visibility status * * @api events * @name SourceFiltersReordered From a51ad1383bc2dd2333a16df20dc8584a65ce3340 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 12 Aug 2020 16:54:03 -0700 Subject: [PATCH 106/178] Docs: Fix requests marked as "unreleased" --- src/WSRequestHandler_Scenes.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WSRequestHandler_Scenes.cpp b/src/WSRequestHandler_Scenes.cpp index 18783119..9c317cdf 100644 --- a/src/WSRequestHandler_Scenes.cpp +++ b/src/WSRequestHandler_Scenes.cpp @@ -184,7 +184,7 @@ RpcResponse WSRequestHandler::ReorderSceneItems(const RpcRequest& request) { * @api requests * @name SetSceneTransitionOverride * @category scenes - * @since unreleased + * @since 4.8.0 */ RpcResponse WSRequestHandler::SetSceneTransitionOverride(const RpcRequest& request) { if (!request.hasField("sceneName") || !request.hasField("transitionName")) { @@ -230,7 +230,7 @@ RpcResponse WSRequestHandler::SetSceneTransitionOverride(const RpcRequest& reque * @api requests * @name RemoveSceneTransitionOverride * @category scenes - * @since unreleased + * @since 4.8.0 */ RpcResponse WSRequestHandler::RemoveSceneTransitionOverride(const RpcRequest& request) { if (!request.hasField("sceneName")) { @@ -266,7 +266,7 @@ RpcResponse WSRequestHandler::RemoveSceneTransitionOverride(const RpcRequest& re * @api requests * @name GetSceneTransitionOverride * @category scenes - * @since unreleased + * @since 4.8.0 */ RpcResponse WSRequestHandler::GetSceneTransitionOverride(const RpcRequest& request) { if (!request.hasField("sceneName")) { From 9679de097fad250a60d506ee582f2b153c1012d5 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 21 Aug 2020 22:43:42 -0700 Subject: [PATCH 107/178] Installer: Don't show warning when obs directory is not empty More info here: https://jrsoftware.org/ishelp/index.php?topic=setup_direxistswarning --- installer/installer.iss | 1 + 1 file changed, 1 insertion(+) diff --git a/installer/installer.iss b/installer/installer.iss index 243f3a31..e94ff579 100644 --- a/installer/installer.iss +++ b/installer/installer.iss @@ -23,6 +23,7 @@ DefaultGroupName={#MyAppName} OutputBaseFilename=obs-websocket-Windows-Installer Compression=lzma SolidCompression=yes +DirExistsWarning=no [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" From 588487f8607fad3ef92cc0b27ad2c995bdcf5ff4 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Tue, 15 Sep 2020 09:36:27 +0000 Subject: [PATCH 108/178] docs(ci): Update protocol.md - f3ab210 [skip ci] --- docs/generated/comments.json | 20 +++++++++++++------- docs/generated/protocol.md | 7 ++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 6635e97e..a4fb874f 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -2515,7 +2515,8 @@ "{String} `sourceName` Source name", "{Array} `filters` Ordered Filters list", "{String} `filters.*.name` Filter name", - "{String} `filters.*.type` Filter type" + "{String} `filters.*.type` Filter type", + "{boolean} `filters.*.enabled` Filter visibility status" ], "api": "events", "name": "SourceFiltersReordered", @@ -2541,6 +2542,11 @@ "type": "String", "name": "filters.*.type", "description": "Filter type" + }, + { + "type": "boolean", + "name": "filters.*.enabled", + "description": "Filter visibility status" } ], "names": [ @@ -9233,7 +9239,7 @@ "api": "requests", "name": "SetSceneTransitionOverride", "category": "scenes", - "since": "unreleased", + "since": "4.8.0", "params": [ { "type": "String", @@ -9266,7 +9272,7 @@ "sinces": [ { "name": "", - "description": "unreleased" + "description": "4.8.0" } ], "heading": { @@ -9284,7 +9290,7 @@ "api": "requests", "name": "RemoveSceneTransitionOverride", "category": "scenes", - "since": "unreleased", + "since": "4.8.0", "params": [ { "type": "String", @@ -9307,7 +9313,7 @@ "sinces": [ { "name": "", - "description": "unreleased" + "description": "4.8.0" } ], "heading": { @@ -9329,7 +9335,7 @@ "api": "requests", "name": "GetSceneTransitionOverride", "category": "scenes", - "since": "unreleased", + "since": "4.8.0", "returns": [ { "type": "String", @@ -9364,7 +9370,7 @@ "sinces": [ { "name": "", - "description": "unreleased" + "description": "4.8.0" } ], "heading": { diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index d2f4f324..ec8d7760 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -1073,6 +1073,7 @@ Filters in a source have been reordered. | `filters` | _Array<Object>_ | Ordered Filters list | | `filters.*.name` | _String_ | Filter name | | `filters.*.type` | _String_ | Filter type | +| `filters.*.enabled` | _boolean_ | Filter visibility status | --- @@ -3629,7 +3630,7 @@ _No additional response items._ ### SetSceneTransitionOverride -- Unreleased +- Added in v4.8.0 Set a scene to use a specific transition override. @@ -3651,7 +3652,7 @@ _No additional response items._ ### RemoveSceneTransitionOverride -- Unreleased +- Added in v4.8.0 Remove any transition override on a scene. @@ -3671,7 +3672,7 @@ _No additional response items._ ### GetSceneTransitionOverride -- Unreleased +- Added in v4.8.0 Get the current scene transition override. From 6b254e0ad5b86a6695ae78e2919a6c020bb1d0ba Mon Sep 17 00:00:00 2001 From: tt2468 Date: Tue, 15 Sep 2020 02:49:01 -0700 Subject: [PATCH 109/178] Requests: Add CreateSource and clean up code --- src/Utils.cpp | 7 +++ src/Utils.h | 6 +++ src/WSRequestHandler.cpp | 1 + src/WSRequestHandler.h | 1 + src/WSRequestHandler_SceneItems.cpp | 16 +----- src/WSRequestHandler_Sources.cpp | 75 +++++++++++++++++++++++++++++ 6 files changed, 92 insertions(+), 14 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index ab301606..148a0b11 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -859,3 +859,10 @@ QString Utils::nsToTimestamp(uint64_t ns) return QString::asprintf("%02" PRIu64 ":%02" PRIu64 ":%02" PRIu64 ".%03" PRIu64, hoursPart, minutesPart, secsPart, msPart); } + +void Utils::AddSourceHelper(void *_data, obs_scene_t *scene) +{ + auto *data = reinterpret_cast(_data); + data->sceneItem = obs_scene_add(scene, data->source); + obs_sceneitem_set_visible(data->sceneItem, data->setVisible); +} diff --git a/src/Utils.h b/src/Utils.h index dbe2481f..de1d7f7a 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -85,4 +85,10 @@ namespace Utils { bool SetFilenameFormatting(const char* filenameFormatting); QString nsToTimestamp(uint64_t ns); + struct AddSourceData { + obs_source_t *source; + obs_sceneitem_t *sceneItem; + bool setVisible; + }; + void AddSourceHelper(void *_data, obs_scene_t *scene); }; diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 56c4cdaa..fd9e1be0 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -94,6 +94,7 @@ const QHash WSRequestHandler::messageMap { { "GetTransitionDuration", &WSRequestHandler::GetTransitionDuration }, { "GetTransitionPosition", &WSRequestHandler::GetTransitionPosition }, + { "CreateSource", &WSRequestHandler::CreateSource }, { "SetVolume", &WSRequestHandler::SetVolume }, { "GetVolume", &WSRequestHandler::GetVolume }, { "ToggleMute", &WSRequestHandler::ToggleMute }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index e409db50..b7404527 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -111,6 +111,7 @@ class WSRequestHandler { RpcResponse GetTransitionDuration(const RpcRequest&); RpcResponse GetTransitionPosition(const RpcRequest&); + RpcResponse CreateSource(const RpcRequest&); RpcResponse SetVolume(const RpcRequest&); RpcResponse GetVolume(const RpcRequest&); RpcResponse ToggleMute(const RpcRequest&); diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index 10ca8212..38771d22 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -2,18 +2,6 @@ #include "WSRequestHandler.h" -struct AddSourceData { - obs_source_t *source; - obs_sceneitem_t *sceneItem; - bool setVisible; -}; - -void AddSourceHelper(void *_data, obs_scene_t *scene) { - auto *data = reinterpret_cast(_data); - data->sceneItem = obs_scene_add(scene, data->source); - obs_sceneitem_set_visible(data->sceneItem, data->setVisible); -} - /** * Get a list of all scene items in a scene. * @@ -658,7 +646,7 @@ RpcResponse WSRequestHandler::AddSceneItem(const RpcRequest& request) { return request.failed("you cannot add a scene as a sceneitem to itself"); } - AddSourceData data; + Utils::AddSourceData data; data.source = source; data.setVisible = true; if (request.hasField("setVisible")) { @@ -666,7 +654,7 @@ RpcResponse WSRequestHandler::AddSceneItem(const RpcRequest& request) { } obs_enter_graphics(); - obs_scene_atomic_update(scene, AddSourceHelper, &data); + obs_scene_atomic_update(scene, Utils::AddSourceHelper, &data); obs_leave_graphics(); OBSDataAutoRelease responseData = obs_data_create(); diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index c6125e5b..28039323 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -18,6 +18,81 @@ bool isTextFreeType2Source(const QString& sourceKind) return (sourceKind == "text_ft2_source" || sourceKind == "text_ft2_source_v2"); } +/** + * Create a source and add it as a sceneitem to a scene. + * + * @param {String} `sourceName` Source name. + * @param {String} `sourceKind` Source kind, Eg. `vlc_source`. + * @param {String} `sceneName` Scene to add the new source to. + * @param {Object (optional)} `sourceSettings` Source settings data. + * @param {boolean (optional)} `setVisible` Set the created SceneItem as visible or not. + * + * @return {int} `itemId` ID of the SceneItem in the scene. + * + * @api requests + * @name CreateSource + * @category sources + * @since unreleased + */ +RpcResponse WSRequestHandler::CreateSource(const RpcRequest& request) +{ + if (!request.hasField("sourceName") || !request.hasField("sourceKind") || !request.hasField("sceneName")) { + return request.failed("missing request parameters"); + } + + QString sourceName = obs_data_get_string(request.parameters(), "sourceName"); + QString sourceKind = obs_data_get_string(request.parameters(), "sourceKind"); + if (sourceName.isEmpty() || sourceKind.isEmpty()) { + return request.failed("empty sourceKind or sourceName parameters"); + } + + OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8()); + if (source) { + return request.failed("a source with that name already exists"); + } + + const char* sceneName = obs_data_get_string(request.parameters(), "sceneName"); + OBSSourceAutoRelease sceneSource = obs_get_source_by_name(sceneName); + OBSScene scene = obs_scene_from_source(sceneSource); + if (!scene) { + return request.failed("requested scene is invalid or doesnt exist"); + } + + obs_source_t *newSource = obs_source_create(sourceKind.toUtf8(), sourceName.toUtf8(), nullptr, nullptr); + + if (!newSource) { + return request.failed("failed to create the source"); + } + obs_source_set_enabled(newSource, true); + + if (request.hasField("sourceSettings")) { // We apply the settings after source creation because otherwise we get a bunch of memory leaks. + OBSDataAutoRelease currentSettings = obs_source_get_settings(newSource); + OBSDataAutoRelease newSettings = obs_data_get_obj(request.parameters(), "sourceSettings"); + OBSDataAutoRelease sourceSettings = obs_data_create(); + obs_data_apply(sourceSettings, currentSettings); + obs_data_apply(sourceSettings, newSettings); + obs_source_update(newSource, sourceSettings); + obs_source_update_properties(newSource); + } + + Utils::AddSourceData data; + data.source = newSource; + data.setVisible = true; + if (request.hasField("setVisible")) { + data.setVisible = obs_data_get_bool(request.parameters(), "setVisible"); + } + + obs_enter_graphics(); + obs_scene_atomic_update(scene, Utils::AddSourceHelper, &data); + obs_leave_graphics(); + + OBSDataAutoRelease responseData = obs_data_create(); + obs_data_set_int(responseData, "itemId", obs_sceneitem_get_id(data.sceneItem)); + + obs_source_release(newSource); + return request.success(responseData); +} + /** * List all sources available in the running OBS instance * From 7f1c4a1c4c254679436bd5cd8cbfd0341fa86310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 15 Sep 2020 17:12:34 +0200 Subject: [PATCH 110/178] Utils: simplified string list lookup --- src/Utils.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 4ac3577d..1abb27ab 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -52,15 +52,13 @@ obs_bounds_type getBoundsTypeFromName(QString name) { } bool Utils::StringInStringList(char** strings, const char* string) { + if (!strings) { + return false; + } + size_t index = 0; - char* value = nullptr; - - while (1) { - value = strings[index]; - - if (value == nullptr) { - return false; - } + while (strings[index] != NULL) { + char* value = strings[index]; if (strcmp(value, string) == 0) { return true; @@ -68,6 +66,7 @@ bool Utils::StringInStringList(char** strings, const char* string) { index++; } + return false; } From 539e636939432fbe2bb3cace0ee6ec37fd73ac26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 15 Sep 2020 17:14:53 +0200 Subject: [PATCH 111/178] requests(SceneCollections): fix typo (profiles instead of scene collections) --- src/WSRequestHandler_SceneCollections.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WSRequestHandler_SceneCollections.cpp b/src/WSRequestHandler_SceneCollections.cpp index 1df49673..40ac5fb7 100644 --- a/src/WSRequestHandler_SceneCollections.cpp +++ b/src/WSRequestHandler_SceneCollections.cpp @@ -22,11 +22,11 @@ RpcResponse WSRequestHandler::SetCurrentSceneCollection(const RpcRequest& reques return request.failed("invalid request parameters"); } - char** collections = obs_frontend_get_profiles(); + char** collections = obs_frontend_get_scene_collections(); bool collectionExists = Utils::StringInStringList(collections, sceneCollection.toUtf8()); bfree(collections); if (!collectionExists) { - return request.failed("collection does not exist"); + return request.failed("scene collection does not exist"); } obs_frontend_set_current_scene_collection(sceneCollection.toUtf8()); From 0dd0d01e8f385e092f502f2b13c3b02f90a14b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 15 Sep 2020 18:17:45 +0200 Subject: [PATCH 112/178] requests(Profiles + SceneCollections): don't use QString where it is not needed --- src/WSRequestHandler_Profiles.cpp | 8 ++++---- src/WSRequestHandler_SceneCollections.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/WSRequestHandler_Profiles.cpp b/src/WSRequestHandler_Profiles.cpp index b3e0bd8a..17cae4a3 100644 --- a/src/WSRequestHandler_Profiles.cpp +++ b/src/WSRequestHandler_Profiles.cpp @@ -17,19 +17,19 @@ RpcResponse WSRequestHandler::SetCurrentProfile(const RpcRequest& request) { return request.failed("missing request parameters"); } - QString profileName = obs_data_get_string(request.parameters(), "profile-name"); - if (profileName.isEmpty()) { + const char* profileName = obs_data_get_string(request.parameters(), "profile-name"); + if (!profileName) { return request.failed("invalid request parameters"); } char** profiles = obs_frontend_get_profiles(); - bool profileExists = Utils::StringInStringList(profiles, profileName.toUtf8()); + bool profileExists = Utils::StringInStringList(profiles, profileName); bfree(profiles); if (!profileExists) { return request.failed("profile does not exist"); } - obs_frontend_set_current_profile(profileName.toUtf8()); + obs_frontend_set_current_profile(profileName); return request.success(); } diff --git a/src/WSRequestHandler_SceneCollections.cpp b/src/WSRequestHandler_SceneCollections.cpp index 40ac5fb7..faf6299b 100644 --- a/src/WSRequestHandler_SceneCollections.cpp +++ b/src/WSRequestHandler_SceneCollections.cpp @@ -17,19 +17,19 @@ RpcResponse WSRequestHandler::SetCurrentSceneCollection(const RpcRequest& reques return request.failed("missing request parameters"); } - QString sceneCollection = obs_data_get_string(request.parameters(), "sc-name"); - if (sceneCollection.isEmpty()) { + const char* sceneCollection = obs_data_get_string(request.parameters(), "sc-name"); + if (!sceneCollection) { return request.failed("invalid request parameters"); } char** collections = obs_frontend_get_scene_collections(); - bool collectionExists = Utils::StringInStringList(collections, sceneCollection.toUtf8()); + bool collectionExists = Utils::StringInStringList(collections, sceneCollection); bfree(collections); if (!collectionExists) { return request.failed("scene collection does not exist"); } - obs_frontend_set_current_scene_collection(sceneCollection.toUtf8()); + obs_frontend_set_current_scene_collection(sceneCollection); return request.success(); } From a148f7fd7cce52bcf778ec6a48f8dd96194ed718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Wed, 16 Sep 2020 21:45:31 +0200 Subject: [PATCH 113/178] requests(Profiles + SceneCollections): fix crash on change --- src/WSRequestHandler_Profiles.cpp | 5 ++++- src/WSRequestHandler_SceneCollections.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/WSRequestHandler_Profiles.cpp b/src/WSRequestHandler_Profiles.cpp index 17cae4a3..55d39b83 100644 --- a/src/WSRequestHandler_Profiles.cpp +++ b/src/WSRequestHandler_Profiles.cpp @@ -29,7 +29,10 @@ RpcResponse WSRequestHandler::SetCurrentProfile(const RpcRequest& request) { return request.failed("profile does not exist"); } - obs_frontend_set_current_profile(profileName); + obs_queue_task(OBS_TASK_UI, [](void* param) { + obs_frontend_set_current_profile(reinterpret_cast(param)); + }, (void*)profileName, true); + return request.success(); } diff --git a/src/WSRequestHandler_SceneCollections.cpp b/src/WSRequestHandler_SceneCollections.cpp index faf6299b..77ce5d0a 100644 --- a/src/WSRequestHandler_SceneCollections.cpp +++ b/src/WSRequestHandler_SceneCollections.cpp @@ -29,7 +29,10 @@ RpcResponse WSRequestHandler::SetCurrentSceneCollection(const RpcRequest& reques return request.failed("scene collection does not exist"); } - obs_frontend_set_current_scene_collection(sceneCollection); + obs_queue_task(OBS_TASK_UI, [](void* param) { + obs_frontend_set_current_scene_collection(reinterpret_cast(param)); + }, (void*)sceneCollection, true); + return request.success(); } From fbc6e02ff66c74e176362423536cee6d4337de1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gra=C3=A7a?= Date: Thu, 24 Sep 2020 13:16:57 +0100 Subject: [PATCH 114/178] =?UTF-8?q?docs:=20=F0=9F=93=9D=20list=20multiple?= =?UTF-8?q?=20available=20web=20clients?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 074c30de..741ca5cf 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,10 @@ Binaries for Windows, MacOS, and Linux are available in the [Releases](https://g ## Using obs-websocket -A web client and frontend made by [t2t2](https://github.com/t2t2/obs-tablet-remote) (compatible with tablets and other touch interfaces) is available here : http://t2t2.github.io/obs-tablet-remote/ +Here is a list of available web clients: (compatible with tablets and other touch interfaces) + +- [Niek/obs-web](https://github.com/Niek/obs-web) +- [t2t2/obs-tablet-remote](https://github.com/t2t2/obs-tablet-remote) It is **highly recommended** to protect obs-websocket with a password against unauthorized control. To do this, open the "Websocket server settings" dialog under OBS' "Tools" menu. In the settings dialogs, you can enable or disable authentication and set a password for it. From bac5b1551b229c016916fbfb36900fb4181fb2f1 Mon Sep 17 00:00:00 2001 From: LorenaGdL Date: Tue, 29 Sep 2020 13:38:32 +0000 Subject: [PATCH 115/178] Requests: Add ProcessHotkeyByName Adds a new request called `ProcessHotkeyByName` which calls the routine associated with a given hotkey. The hotkey is identified by the unique name set while registering it. Works with both OBS default hotkeys and hotkeys added by plugins/scripts. --- src/WSRequestHandler.cpp | 2 ++ src/WSRequestHandler.h | 2 ++ src/WSRequestHandler_General.cpp | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 56c4cdaa..2c92305a 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -43,6 +43,8 @@ const QHash WSRequestHandler::messageMap { { "BroadcastCustomMessage", &WSRequestHandler::BroadcastCustomMessage }, + { "ProcessHotkeyByName", &WSRequestHandler::ProcessHotkeyByName }, + { "SetCurrentScene", &WSRequestHandler::SetCurrentScene }, { "GetCurrentScene", &WSRequestHandler::GetCurrentScene }, { "GetSceneList", &WSRequestHandler::GetSceneList }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index e409db50..7a4e64ff 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -61,6 +61,8 @@ class WSRequestHandler { RpcResponse BroadcastCustomMessage(const RpcRequest&); + RpcResponse ProcessHotkeyByName(const RpcRequest&); + RpcResponse SetCurrentScene(const RpcRequest&); RpcResponse GetCurrentScene(const RpcRequest&); RpcResponse GetSceneList(const RpcRequest&); diff --git a/src/WSRequestHandler_General.cpp b/src/WSRequestHandler_General.cpp index ea1c6a63..54675a84 100644 --- a/src/WSRequestHandler_General.cpp +++ b/src/WSRequestHandler_General.cpp @@ -345,3 +345,24 @@ RpcResponse WSRequestHandler::OpenProjector(const RpcRequest& request) { obs_frontend_open_projector(type, monitor, geometry, name); return request.success(); } + +/** +* Executes hotkey routine, identified by hotkey unique name +* +* @param {String} `name` Unique name of the hotkey, as defined when registering the hotkey (e.g. "ReplayBuffer.Save") +* +* @api requests +* @name ProcessHotkeyByName +* @category general +* @since unreleased +*/ +RpcResponse WSRequestHandler::ProcessHotkeyByName(const RpcRequest& request) { + const char* name = obs_data_get_string(request.parameters(), "name"); + + obs_hotkey_t* hk = Utils::FindHotkeyByName(name); + if (!hk) { + return request.failed("Hotkey not found"); + } + obs_hotkey_trigger_routed_callback(obs_hotkey_get_id(hk), true); + return request.success(); +} From 9daae857de24753f1b85461f05acaab23516cee8 Mon Sep 17 00:00:00 2001 From: LorenaGdL Date: Tue, 29 Sep 2020 13:43:00 +0000 Subject: [PATCH 116/178] Requests: Add ProcessHotkeyByCombination Adds a new request called `ProcessHotkeyByCombination` which calls the routine associated with a given hotkey. The hotkey is identified by the combination of keys set by the user to trigger it. Multiple routines are called if the same combination is bound to different hotkeys. --- src/WSRequestHandler.cpp | 1 + src/WSRequestHandler.h | 1 + src/WSRequestHandler_General.cpp | 45 ++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 2c92305a..9b62546c 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -44,6 +44,7 @@ const QHash WSRequestHandler::messageMap { { "BroadcastCustomMessage", &WSRequestHandler::BroadcastCustomMessage }, { "ProcessHotkeyByName", &WSRequestHandler::ProcessHotkeyByName }, + { "ProcessHotkeyByCombination", &WSRequestHandler::ProcessHotkeyByCombination }, { "SetCurrentScene", &WSRequestHandler::SetCurrentScene }, { "GetCurrentScene", &WSRequestHandler::GetCurrentScene }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index 7a4e64ff..f8849e84 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -62,6 +62,7 @@ class WSRequestHandler { RpcResponse BroadcastCustomMessage(const RpcRequest&); RpcResponse ProcessHotkeyByName(const RpcRequest&); + RpcResponse ProcessHotkeyByCombination(const RpcRequest&); RpcResponse SetCurrentScene(const RpcRequest&); RpcResponse GetCurrentScene(const RpcRequest&); diff --git a/src/WSRequestHandler_General.cpp b/src/WSRequestHandler_General.cpp index 54675a84..0fc5d619 100644 --- a/src/WSRequestHandler_General.cpp +++ b/src/WSRequestHandler_General.cpp @@ -366,3 +366,48 @@ RpcResponse WSRequestHandler::ProcessHotkeyByName(const RpcRequest& request) { obs_hotkey_trigger_routed_callback(obs_hotkey_get_id(hk), true); return request.success(); } + +/** +* Executes hotkey routine, identified by bound combination of keys. A single key combination might trigger multiple hotkey routines depending on user settings +* +* @param {String} `key` Main key identifier (e.g. `OBS_KEY_A` for key "A"). Available identifiers [here](https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h) +* @param {Object (Optional)} `modifiers` Optional key modifiers object: `{"shift":true/false, "alt":true/false, "control":true/false, "command":true/false}`. False entries can be ommitted +* +* @api requests +* @name ProcessHotkeyByCombination +* @category general +* @since unreleased +*/ +RpcResponse WSRequestHandler::ProcessHotkeyByCombination(const RpcRequest& request) { + if (!request.hasField("key")) { + return request.failed("Missing request key parameter"); + } + + OBSDataAutoRelease data = obs_data_get_obj(request.parameters(), "modifiers"); + + obs_key_combination_t combo = {0}; + uint32_t modifiers = 0; + if (obs_data_get_bool(data, "shift")) + modifiers |= INTERACT_SHIFT_KEY; + if (obs_data_get_bool(data, "control")) + modifiers |= INTERACT_CONTROL_KEY; + if (obs_data_get_bool(data, "alt")) + modifiers |= INTERACT_ALT_KEY; + if (obs_data_get_bool(data, "command")) + modifiers |= INTERACT_COMMAND_KEY; + + combo.modifiers = modifiers; + combo.key = obs_key_from_name(obs_data_get_string(request.parameters(), "key")); + + if (!modifiers + && (combo.key == OBS_KEY_NONE || combo.key >= OBS_KEY_LAST_VALUE)) { + return request.failed("Invalid key-modifier combination"); + } + + // Inject hotkey press-release sequence + obs_hotkey_inject_event(combo, false); + obs_hotkey_inject_event(combo, true); + obs_hotkey_inject_event(combo, false); + + return request.success(); +} From 46f624e3b993f35c9a3429b84cd13f61f18707f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 29 Sep 2020 19:37:28 +0200 Subject: [PATCH 117/178] requests(GetSceneItemList): fallback to current scene if sceneName is not specified --- src/WSRequestHandler_SceneItems.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index 10ca8212..01b6a29d 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -31,12 +31,15 @@ void AddSourceHelper(void *_data, obs_scene_t *scene) { * @since unreleased */ RpcResponse WSRequestHandler::GetSceneItemList(const RpcRequest& request) { - if (!request.hasField("sceneName")) { - return request.failed("missing request parameters"); + const char* sceneName = obs_data_get_string(request.parameters(), "sceneName"); + + OBSSourceAutoRelease sceneSource; + if (sceneName) { + sceneSource = obs_get_source_by_name(sceneName); + } else { + sceneSource = obs_frontend_get_current_scene(); } - const char* sceneName = obs_data_get_string(request.parameters(), "sceneName"); - OBSSourceAutoRelease sceneSource = obs_get_source_by_name(sceneName); OBSScene scene = obs_scene_from_source(sceneSource); if (!scene) { return request.failed("requested scene is invalid or doesnt exist"); From 32960afc1b64883f1577f848c8cc138203b184c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 29 Sep 2020 19:45:07 +0200 Subject: [PATCH 118/178] requests(GetSceneItemList): update docs --- src/WSRequestHandler_SceneItems.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index 01b6a29d..d7c08899 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -17,7 +17,7 @@ void AddSourceHelper(void *_data, obs_scene_t *scene) { /** * Get a list of all scene items in a scene. * -* @param {String} `sceneName` Name of the scene to get the list of scene items from. +* @param {String (optional)} `sceneName` Name of the scene to get the list of scene items from. Defaults to the current scene if not specified. * * @return {Array} `sceneItems` Array of scene items * @return {int} `sceneItems.*.itemId` Unique item id of the source item From 4491da0350f5567193d2738717e10db2fa3282c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 29 Sep 2020 23:48:17 +0200 Subject: [PATCH 119/178] requests(GetSceneItemList): fix empty/non-present parameter detection --- src/WSRequestHandler_SceneItems.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index d7c08899..1d4393f6 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -34,7 +34,7 @@ RpcResponse WSRequestHandler::GetSceneItemList(const RpcRequest& request) { const char* sceneName = obs_data_get_string(request.parameters(), "sceneName"); OBSSourceAutoRelease sceneSource; - if (sceneName) { + if (sceneName && strcmp(sceneName, "") != 0) { sceneSource = obs_get_source_by_name(sceneName); } else { sceneSource = obs_frontend_get_current_scene(); From 4a4c97aac46f0232488c8f8766f9f13396b13101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 29 Sep 2020 23:48:35 +0200 Subject: [PATCH 120/178] request(GetSceneItemList): provide scene name in response --- src/WSRequestHandler_SceneItems.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index 1d4393f6..2d09780d 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -19,6 +19,7 @@ void AddSourceHelper(void *_data, obs_scene_t *scene) { * * @param {String (optional)} `sceneName` Name of the scene to get the list of scene items from. Defaults to the current scene if not specified. * +* @return {String} `sceneName` Name of the requested (or current) scene * @return {Array} `sceneItems` Array of scene items * @return {int} `sceneItems.*.itemId` Unique item id of the source item * @return {String} `sceneItems.*.sourceKind` ID if the scene item's source. For example `vlc_source` or `image_source` @@ -79,6 +80,7 @@ RpcResponse WSRequestHandler::GetSceneItemList(const RpcRequest& request) { obs_scene_enum_items(scene, sceneItemEnumProc, sceneItemArray); OBSDataAutoRelease response = obs_data_create(); + obs_data_set_string(response, "sceneName", obs_source_get_name(sceneSource)); obs_data_set_array(response, "sceneItems", sceneItemArray); return request.success(response); From ae4ee0332c7b11a9de1cdd7bf6b5e8772c3fd1f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Wed, 30 Sep 2020 12:19:37 +0200 Subject: [PATCH 121/178] Fix macOS CI (#597) * ci(macos): fix attempt #1 * Revert "ci(macos): fix attempt #1" This reverts commit b846490136973872ac3b724637cef303e3255083. * ci(macos): provide QTDIR when building OBS * Revert "ci(macos): provide QTDIR when building OBS" This reverts commit 74a882fcf4b9e502b1125508d796b29b69ec0e73. * ci(macos): use local qt formula * ci(macos): update qt.rb --- CI/install-dependencies-macos.sh | 7 +- CI/macos/qt.rb | 262 ++++++++++++++----------------- 2 files changed, 123 insertions(+), 146 deletions(-) diff --git a/CI/install-dependencies-macos.sh b/CI/install-dependencies-macos.sh index 0adf464b..267fa49a 100755 --- a/CI/install-dependencies-macos.sh +++ b/CI/install-dependencies-macos.sh @@ -35,13 +35,8 @@ done # qtwebsockets deps echo "[obs-websocket] Installing obs-websocket dependency 'QT 5.10.1'.." -# =!= NOTICE =!= -# When building QT5 from sources on macOS 10.13+, use local qt5 formula: -# brew install ./CI/macos/qt.rb -# Pouring from the bottle is much quicker though, so use bottle for now. -# =!= NOTICE =!= -brew install https://gist.githubusercontent.com/DDRBoxman/b3956fab6073335a4bf151db0dcbd4ad/raw/ed1342a8a86793ea8c10d8b4d712a654da121ace/qt.rb +brew install ./CI/macos/qt.rb # Pin this version of QT5 to avoid `brew upgrade` # upgrading it to incompatible version diff --git a/CI/macos/qt.rb b/CI/macos/qt.rb index 50ff4f57..4405a240 100644 --- a/CI/macos/qt.rb +++ b/CI/macos/qt.rb @@ -1,163 +1,145 @@ # Patches for Qt must be at the very least submitted to Qt's Gerrit codereview # rather than their bug-report Jira. The latter is rarely reviewed by Qt. class Qt < Formula - desc "Cross-platform application and UI framework" - homepage "https://www.qt.io/" - url "https://download.qt.io/archive/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz" - mirror "https://mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz" - sha256 "05ffba7b811b854ed558abf2be2ddbd3bb6ddd0b60ea4b5da75d277ac15e740a" - head "https://code.qt.io/qt/qt5.git", :branch => "5.10.1", :shallow => false + desc "Cross-platform application and UI framework" + homepage "https://www.qt.io/" + url "https://download.qt.io/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz" + mirror "https://www.mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz" + sha256 "05ffba7b811b854ed558abf2be2ddbd3bb6ddd0b60ea4b5da75d277ac15e740a" + head "https://code.qt.io/qt/qt5.git", :branch => "5.10", :shallow => false - bottle do - sha256 "8b4bad005596a5f8790150fe455db998ac2406f4e0f04140d6656205d844d266" => :high_sierra - sha256 "9c488554935fb573554a4e36d36d3c81e47245b7fefc4b61edef894e67ba1740" => :sierra - sha256 "c0407afba5951df6cc4c6f6c1c315972bd41c99cecb4e029919c4c15ab6f7bdc" => :el_capitan - end + bottle do + sha256 "8b4bad005596a5f8790150fe455db998ac2406f4e0f04140d6656205d844d266" => :high_sierra + sha256 "9c488554935fb573554a4e36d36d3c81e47245b7fefc4b61edef894e67ba1740" => :sierra + sha256 "c0407afba5951df6cc4c6f6c1c315972bd41c99cecb4e029919c4c15ab6f7bdc" => :el_capitan + end - keg_only "Qt 5 has CMake issues when linked" + keg_only "Qt 5 has CMake issues when linked" - option "with-docs", "Build documentation" - option "with-examples", "Build examples" + option "with-docs", "Build documentation" + option "with-examples", "Build examples" + option "without-proprietary-codecs", "Don't build with proprietary codecs (e.g. mp3)" - deprecated_option "with-mysql" => "with-mysql-client" + # OS X 10.7 Lion is still supported in Qt 5.5, but is no longer a reference + # configuration and thus untested in practice. Builds on OS X 10.7 have been + # reported to fail: . + # depends_on :macos => :mountain_lion - # OS X 10.7 Lion is still supported in Qt 5.5, but is no longer a reference - # configuration and thus untested in practice. Builds on OS X 10.7 have been - # reported to fail: . - depends_on :macos => :mountain_lion + depends_on "pkg-config" => :build + depends_on :xcode => :build + depends_on "mysql" => :optional + depends_on "postgresql" => :optional - depends_on "pkg-config" => :build - depends_on :xcode => :build - depends_on "mysql-client" => :optional - depends_on "postgresql" => :optional + # Restore `.pc` files for framework-based build of Qt 5 on OS X. This + # partially reverts merged + # between the 5.5.1 and 5.6.0 releases. (Remove this as soon as feasible!) + # + # Core formulae known to fail without this patch (as of 2016-10-15): + # * gnuplot (with `--with-qt` option) + # * mkvtoolnix (with `--with-qt` option, silent build failure) + # * poppler (with `--with-qt` option) + patch do + url "https://raw.githubusercontent.com/Homebrew/formula-patches/e8fe6567/qt5/restore-pc-files.patch" + sha256 "48ff18be2f4050de7288bddbae7f47e949512ac4bcd126c2f504be2ac701158b" + end - # Restore `.pc` files for framework-based build of Qt 5 on OS X. This - # partially reverts merged - # between the 5.5.1 and 5.6.0 releases. (Remove this as soon as feasible!) - # - # Core formulae known to fail without this patch (as of 2016-10-15): - # * gnuplot (with `--with-qt` option) - # * mkvtoolnix (with `--with-qt` option, silent build failure) - # * poppler (with `--with-qt` option) - patch do - url "https://raw.githubusercontent.com/Homebrew/formula-patches/e8fe6567/qt5/restore-pc-files.patch" - sha256 "48ff18be2f4050de7288bddbae7f47e949512ac4bcd126c2f504be2ac701158b" - end + def install + args = %W[ + -verbose + -prefix #{prefix} + -release + -opensource -confirm-license + -system-zlib + -qt-libpng + -qt-libjpeg + -qt-freetype + -qt-pcre + -nomake tests + -no-rpath + -pkg-config + -dbus-runtime + ] - # Fix compile error on macOS 10.13 around QFixed: - # https://github.com/Homebrew/homebrew-core/issues/27095 - # https://bugreports.qt.io/browse/QTBUG-67545 - patch do - url "https://raw.githubusercontent.com/z00m1n/formula-patches/0de0e229/qt/QTBUG-67545.patch" - sha256 "4a115097c7582c7dce4207f5500d13feb8c990eb8a05a43f41953985976ebe6c" - end + args << "-nomake" << "examples" if build.without? "examples" - # Fix compile error on macOS 10.13 caused by qtlocation dependency - # mapbox-gl-native using Boost 1.62.0 does not build with C++ 17: - # https://github.com/Homebrew/homebrew-core/issues/27095 - # https://bugreports.qt.io/browse/QTBUG-67810 - patch do - url "https://raw.githubusercontent.com/z00m1n/formula-patches/a1a1f0dd/qt/QTBUG-67810.patch" - sha256 "8ee0bf71df1043f08ebae3aa35036be29c4d9ebff8a27e3b0411a6bd635e9382" - end + if build.with? "mysql" + args << "-plugin-sql-mysql" + (buildpath/"brew_shim/mysql_config").write <<~EOS + #!/bin/sh + if [ x"$1" = x"--libs" ]; then + mysql_config --libs | sed "s/-lssl -lcrypto//" + else + exec mysql_config "$@" + fi + EOS + chmod 0755, "brew_shim/mysql_config" + args << "-mysql_config" << buildpath/"brew_shim/mysql_config" + end - def install - args = %W[ - -verbose - -prefix #{prefix} - -release - -opensource -confirm-license - -system-zlib - -qt-libpng - -qt-libjpeg - -qt-freetype - -qt-pcre - -nomake tests - -no-rpath - -pkg-config - -dbus-runtime - -no-assimp - ] + args << "-plugin-sql-psql" if build.with? "postgresql" + args << "-proprietary-codecs" if build.with? "proprietary-codecs" - args << "-nomake" << "examples" if build.without? "examples" + system "./configure", *args + system "make" + ENV.deparallelize + system "make", "install" - if build.with? "mysql-client" - args << "-plugin-sql-mysql" - (buildpath/"brew_shim/mysql_config").write <<~EOS - #!/bin/sh - if [ x"$1" = x"--libs" ]; then - mysql_config --libs | sed "s/-lssl -lcrypto//" - else - exec mysql_config "$@" - fi - EOS - chmod 0755, "brew_shim/mysql_config" - args << "-mysql_config" << buildpath/"brew_shim/mysql_config" - end + if build.with? "docs" + system "make", "docs" + system "make", "install_docs" + end - args << "-plugin-sql-psql" if build.with? "postgresql" + # Some config scripts will only find Qt in a "Frameworks" folder + frameworks.install_symlink Dir["#{lib}/*.framework"] - system "./configure", *args - system "make" - ENV.deparallelize - system "make", "install" + # The pkg-config files installed suggest that headers can be found in the + # `include` directory. Make this so by creating symlinks from `include` to + # the Frameworks' Headers folders. + Pathname.glob("#{lib}/*.framework/Headers") do |path| + include.install_symlink path => path.parent.basename(".framework") + end - if build.with? "docs" - system "make", "docs" - system "make", "install_docs" - end + # Move `*.app` bundles into `libexec` to expose them to `brew linkapps` and + # because we don't like having them in `bin`. + # (Note: This move breaks invocation of Assistant via the Help menu + # of both Designer and Linguist as that relies on Assistant being in `bin`.) + libexec.mkpath + Pathname.glob("#{bin}/*.app") { |app| mv app, libexec } + end - # Some config scripts will only find Qt in a "Frameworks" folder - frameworks.install_symlink Dir["#{lib}/*.framework"] + def caveats; <<~EOS + We agreed to the Qt opensource license for you. + If this is unacceptable you should uninstall. + EOS + end - # The pkg-config files installed suggest that headers can be found in the - # `include` directory. Make this so by creating symlinks from `include` to - # the Frameworks' Headers folders. - Pathname.glob("#{lib}/*.framework/Headers") do |path| - include.install_symlink path => path.parent.basename(".framework") - end + test do + (testpath/"hello.pro").write <<~EOS + QT += core + QT -= gui + TARGET = hello + CONFIG += console + CONFIG -= app_bundle + TEMPLATE = app + SOURCES += main.cpp + EOS - # Move `*.app` bundles into `libexec` to expose them to `brew linkapps` and - # because we don't like having them in `bin`. - # (Note: This move breaks invocation of Assistant via the Help menu - # of both Designer and Linguist as that relies on Assistant being in `bin`.) - libexec.mkpath - Pathname.glob("#{bin}/*.app") { |app| mv app, libexec } - end + (testpath/"main.cpp").write <<~EOS + #include + #include - def caveats; <<~EOS - We agreed to the Qt opensource license for you. - If this is unacceptable you should uninstall. - EOS - end + int main(int argc, char *argv[]) + { + QCoreApplication a(argc, argv); + qDebug() << "Hello World!"; + return 0; + } + EOS - test do - (testpath/"hello.pro").write <<~EOS - QT += core - QT -= gui - TARGET = hello - CONFIG += console - CONFIG -= app_bundle - TEMPLATE = app - SOURCES += main.cpp - EOS - - (testpath/"main.cpp").write <<~EOS - #include - #include - - int main(int argc, char *argv[]) - { - QCoreApplication a(argc, argv); - qDebug() << "Hello World!"; - return 0; - } - EOS - - system bin/"qmake", testpath/"hello.pro" - system "make" - assert_predicate testpath/"hello", :exist? - assert_predicate testpath/"main.o", :exist? - system "./hello" - end -end + system bin/"qmake", testpath/"hello.pro" + system "make" + assert_predicate testpath/"hello", :exist? + assert_predicate testpath/"main.o", :exist? + system "./hello" + end +end \ No newline at end of file From 449ad6d13c1fcf92a81466939a5186b37a540bf6 Mon Sep 17 00:00:00 2001 From: LorenaGdL Date: Wed, 30 Sep 2020 19:15:23 +0000 Subject: [PATCH 122/178] PR review changes: Modify requests names Changes requests names to "TriggerHotkeyByName" and "TriggerHotkeyBySequence" --- src/WSRequestHandler.cpp | 4 ++-- src/WSRequestHandler.h | 4 ++-- src/WSRequestHandler_General.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index 9b62546c..b4ab8137 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -43,8 +43,8 @@ const QHash WSRequestHandler::messageMap { { "BroadcastCustomMessage", &WSRequestHandler::BroadcastCustomMessage }, - { "ProcessHotkeyByName", &WSRequestHandler::ProcessHotkeyByName }, - { "ProcessHotkeyByCombination", &WSRequestHandler::ProcessHotkeyByCombination }, + { "TriggerHotkeyByName", &WSRequestHandler::TriggerHotkeyByName }, + { "TriggerHotkeyBySequence", &WSRequestHandler::TriggerHotkeyBySequence }, { "SetCurrentScene", &WSRequestHandler::SetCurrentScene }, { "GetCurrentScene", &WSRequestHandler::GetCurrentScene }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index f8849e84..c3190668 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -61,8 +61,8 @@ class WSRequestHandler { RpcResponse BroadcastCustomMessage(const RpcRequest&); - RpcResponse ProcessHotkeyByName(const RpcRequest&); - RpcResponse ProcessHotkeyByCombination(const RpcRequest&); + RpcResponse TriggerHotkeyByName(const RpcRequest&); + RpcResponse TriggerHotkeyBySequence(const RpcRequest&); RpcResponse SetCurrentScene(const RpcRequest&); RpcResponse GetCurrentScene(const RpcRequest&); diff --git a/src/WSRequestHandler_General.cpp b/src/WSRequestHandler_General.cpp index 0fc5d619..6f5cea2a 100644 --- a/src/WSRequestHandler_General.cpp +++ b/src/WSRequestHandler_General.cpp @@ -356,7 +356,7 @@ RpcResponse WSRequestHandler::OpenProjector(const RpcRequest& request) { * @category general * @since unreleased */ -RpcResponse WSRequestHandler::ProcessHotkeyByName(const RpcRequest& request) { +RpcResponse WSRequestHandler::TriggerHotkeyByName(const RpcRequest& request) { const char* name = obs_data_get_string(request.parameters(), "name"); obs_hotkey_t* hk = Utils::FindHotkeyByName(name); @@ -378,7 +378,7 @@ RpcResponse WSRequestHandler::ProcessHotkeyByName(const RpcRequest& request) { * @category general * @since unreleased */ -RpcResponse WSRequestHandler::ProcessHotkeyByCombination(const RpcRequest& request) { +RpcResponse WSRequestHandler::TriggerHotkeyBySequence(const RpcRequest& request) { if (!request.hasField("key")) { return request.failed("Missing request key parameter"); } From e7c8c1d6b60926e8ba520d524dff4ede876144c8 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 30 Sep 2020 15:02:59 -0700 Subject: [PATCH 123/178] Requests: Update hotkey docs and rename some variables --- src/WSRequestHandler_General.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/WSRequestHandler_General.cpp b/src/WSRequestHandler_General.cpp index 6f5cea2a..a5f19143 100644 --- a/src/WSRequestHandler_General.cpp +++ b/src/WSRequestHandler_General.cpp @@ -349,19 +349,19 @@ RpcResponse WSRequestHandler::OpenProjector(const RpcRequest& request) { /** * Executes hotkey routine, identified by hotkey unique name * -* @param {String} `name` Unique name of the hotkey, as defined when registering the hotkey (e.g. "ReplayBuffer.Save") +* @param {String} `hotkeyName` Unique name of the hotkey, as defined when registering the hotkey (e.g. "ReplayBuffer.Save") * * @api requests -* @name ProcessHotkeyByName +* @name TriggerHotkeyByName * @category general * @since unreleased */ RpcResponse WSRequestHandler::TriggerHotkeyByName(const RpcRequest& request) { - const char* name = obs_data_get_string(request.parameters(), "name"); + const char* name = obs_data_get_string(request.parameters(), "hotkeyName"); obs_hotkey_t* hk = Utils::FindHotkeyByName(name); if (!hk) { - return request.failed("Hotkey not found"); + return request.failed("hotkey not found"); } obs_hotkey_trigger_routed_callback(obs_hotkey_get_id(hk), true); return request.success(); @@ -370,20 +370,24 @@ RpcResponse WSRequestHandler::TriggerHotkeyByName(const RpcRequest& request) { /** * Executes hotkey routine, identified by bound combination of keys. A single key combination might trigger multiple hotkey routines depending on user settings * -* @param {String} `key` Main key identifier (e.g. `OBS_KEY_A` for key "A"). Available identifiers [here](https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h) -* @param {Object (Optional)} `modifiers` Optional key modifiers object: `{"shift":true/false, "alt":true/false, "control":true/false, "command":true/false}`. False entries can be ommitted +* @param {String} `keyId` Main key identifier (e.g. `OBS_KEY_A` for key "A"). Available identifiers [here](https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h) +* @param {Object (Optional)} `keyModifiers` Optional key modifiers object. False entries can be ommitted +* @param {boolean} `keyModifiers.shift` Trigger Shift Key +* @param {boolean} `keyModifiers.alt` Trigger Alt Key +* @param {boolean} `keyModifiers.control` Trigger Control (Ctrl) Key +* @param {boolean} `keyModifiers.command` Trigger Command Key (Mac) * * @api requests -* @name ProcessHotkeyByCombination +* @name TriggerHotkeyByCombination * @category general * @since unreleased */ RpcResponse WSRequestHandler::TriggerHotkeyBySequence(const RpcRequest& request) { - if (!request.hasField("key")) { - return request.failed("Missing request key parameter"); + if (!request.hasField("keyId")) { + return request.failed("missing request keyId parameter"); } - OBSDataAutoRelease data = obs_data_get_obj(request.parameters(), "modifiers"); + OBSDataAutoRelease data = obs_data_get_obj(request.parameters(), "keyModifiers"); obs_key_combination_t combo = {0}; uint32_t modifiers = 0; @@ -397,11 +401,11 @@ RpcResponse WSRequestHandler::TriggerHotkeyBySequence(const RpcRequest& request) modifiers |= INTERACT_COMMAND_KEY; combo.modifiers = modifiers; - combo.key = obs_key_from_name(obs_data_get_string(request.parameters(), "key")); + combo.key = obs_key_from_name(obs_data_get_string(request.parameters(), "keyId")); if (!modifiers && (combo.key == OBS_KEY_NONE || combo.key >= OBS_KEY_LAST_VALUE)) { - return request.failed("Invalid key-modifier combination"); + return request.failed("invalid key-modifier combination"); } // Inject hotkey press-release sequence From 8a90051ab5f4ce08bc00626faf49775b9e1b58b5 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Wed, 30 Sep 2020 22:22:57 +0000 Subject: [PATCH 124/178] docs(ci): Update protocol.md - 02c7a7f [skip ci] --- docs/generated/comments.json | 114 +++++++++++++++++++++++++++++++++++ docs/generated/protocol.md | 47 +++++++++++++++ 2 files changed, 161 insertions(+) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index a4fb874f..9f1bf005 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -4065,6 +4065,120 @@ "lead": "", "type": "class", "examples": [] + }, + { + "subheads": [], + "description": "Executes hotkey routine, identified by hotkey unique name", + "param": "{String} `hotkeyName` Unique name of the hotkey, as defined when registering the hotkey (e.g. \"ReplayBuffer.Save\")", + "api": "requests", + "name": "TriggerHotkeyByName", + "category": "general", + "since": "unreleased", + "params": [ + { + "type": "String", + "name": "hotkeyName", + "description": "Unique name of the hotkey, as defined when registering the hotkey (e.g. \"ReplayBuffer.Save\")" + } + ], + "names": [ + { + "name": "", + "description": "TriggerHotkeyByName" + } + ], + "categories": [ + { + "name": "", + "description": "general" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "TriggerHotkeyByName" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Executes hotkey routine, identified by bound combination of keys. A single key combination might trigger multiple hotkey routines depending on user settings", + "param": [ + "{String} `keyId` Main key identifier (e.g. `OBS_KEY_A` for key \"A\"). Available identifiers [here](https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h)", + "{Object (Optional)} `keyModifiers` Optional key modifiers object. False entries can be ommitted", + "{boolean} `keyModifiers.shift` Trigger Shift Key", + "{boolean} `keyModifiers.alt` Trigger Alt Key", + "{boolean} `keyModifiers.control` Trigger Control (Ctrl) Key", + "{boolean} `keyModifiers.command` Trigger Command Key (Mac)" + ], + "api": "requests", + "name": "TriggerHotkeyByCombination", + "category": "general", + "since": "unreleased", + "params": [ + { + "type": "String", + "name": "keyId", + "description": "Main key identifier (e.g. `OBS_KEY_A` for key \"A\"). Available identifiers [here](https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h)" + }, + { + "type": "Object (Optional)", + "name": "keyModifiers", + "description": "Optional key modifiers object. False entries can be ommitted" + }, + { + "type": "boolean", + "name": "keyModifiers.shift", + "description": "Trigger Shift Key" + }, + { + "type": "boolean", + "name": "keyModifiers.alt", + "description": "Trigger Alt Key" + }, + { + "type": "boolean", + "name": "keyModifiers.control", + "description": "Trigger Control (Ctrl) Key" + }, + { + "type": "boolean", + "name": "keyModifiers.command", + "description": "Trigger Command Key (Mac)" + } + ], + "names": [ + { + "name": "", + "description": "TriggerHotkeyByCombination" + } + ], + "categories": [ + { + "name": "", + "description": "general" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "TriggerHotkeyByCombination" + }, + "lead": "", + "type": "class", + "examples": [] } ], "media control": [ diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index ec8d7760..78bfda94 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -136,6 +136,8 @@ You can also refer to any of the client libraries listed on the [README](README. + [BroadcastCustomMessage](#broadcastcustommessage-1) + [GetVideoInfo](#getvideoinfo) + [OpenProjector](#openprojector) + + [TriggerHotkeyByName](#triggerhotkeybyname) + + [TriggerHotkeyByCombination](#triggerhotkeybycombination) * [Media Control](#media-control) + [PlayPauseMedia](#playpausemedia) + [RestartMedia](#restartmedia) @@ -1649,6 +1651,51 @@ Open a projector window or create a projector on a monitor. Requires OBS v24.0.4 | `name` | _String (Optional)_ | Name of the source or scene to be displayed (ignored for other projector types). | +**Response Items:** + +_No additional response items._ + +--- + +### TriggerHotkeyByName + + +- Unreleased + +Executes hotkey routine, identified by hotkey unique name + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `hotkeyName` | _String_ | Unique name of the hotkey, as defined when registering the hotkey (e.g. "ReplayBuffer.Save") | + + +**Response Items:** + +_No additional response items._ + +--- + +### TriggerHotkeyByCombination + + +- Unreleased + +Executes hotkey routine, identified by bound combination of keys. A single key combination might trigger multiple hotkey routines depending on user settings + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `keyId` | _String_ | Main key identifier (e.g. `OBS_KEY_A` for key "A"). Available identifiers [here](https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h) | +| `keyModifiers` | _Object (Optional)_ | Optional key modifiers object. False entries can be ommitted | +| `keyModifiers.shift` | _boolean_ | Trigger Shift Key | +| `keyModifiers.alt` | _boolean_ | Trigger Alt Key | +| `keyModifiers.control` | _boolean_ | Trigger Control (Ctrl) Key | +| `keyModifiers.command` | _boolean_ | Trigger Command Key (Mac) | + + **Response Items:** _No additional response items._ From 0be5564ce7fa124f35d5a8efaec6749655ce4549 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Wed, 30 Sep 2020 15:57:13 -0700 Subject: [PATCH 125/178] Docs: Fix typo --- src/WSRequestHandler_General.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WSRequestHandler_General.cpp b/src/WSRequestHandler_General.cpp index a5f19143..d42513bc 100644 --- a/src/WSRequestHandler_General.cpp +++ b/src/WSRequestHandler_General.cpp @@ -378,7 +378,7 @@ RpcResponse WSRequestHandler::TriggerHotkeyByName(const RpcRequest& request) { * @param {boolean} `keyModifiers.command` Trigger Command Key (Mac) * * @api requests -* @name TriggerHotkeyByCombination +* @name TriggerHotkeyBySequence * @category general * @since unreleased */ From d9f35a855dbdc4cc64ca2c08612480d5a6bbfe34 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Thu, 1 Oct 2020 07:56:26 +0000 Subject: [PATCH 126/178] docs(ci): Update protocol.md - 9678d59 [skip ci] --- docs/generated/comments.json | 6 +++--- docs/generated/protocol.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 9f1bf005..9670bee5 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -4119,7 +4119,7 @@ "{boolean} `keyModifiers.command` Trigger Command Key (Mac)" ], "api": "requests", - "name": "TriggerHotkeyByCombination", + "name": "TriggerHotkeyBySequence", "category": "general", "since": "unreleased", "params": [ @@ -4157,7 +4157,7 @@ "names": [ { "name": "", - "description": "TriggerHotkeyByCombination" + "description": "TriggerHotkeyBySequence" } ], "categories": [ @@ -4174,7 +4174,7 @@ ], "heading": { "level": 2, - "text": "TriggerHotkeyByCombination" + "text": "TriggerHotkeyBySequence" }, "lead": "", "type": "class", diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 78bfda94..76aad352 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -137,7 +137,7 @@ You can also refer to any of the client libraries listed on the [README](README. + [GetVideoInfo](#getvideoinfo) + [OpenProjector](#openprojector) + [TriggerHotkeyByName](#triggerhotkeybyname) - + [TriggerHotkeyByCombination](#triggerhotkeybycombination) + + [TriggerHotkeyBySequence](#triggerhotkeybysequence) * [Media Control](#media-control) + [PlayPauseMedia](#playpausemedia) + [RestartMedia](#restartmedia) @@ -1677,7 +1677,7 @@ _No additional response items._ --- -### TriggerHotkeyByCombination +### TriggerHotkeyBySequence - Unreleased From 7a31e88ed6dada1555fb7ce28d076404e6ae483c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Sun, 25 Oct 2020 19:25:26 +0100 Subject: [PATCH 127/178] requests: add GetTransitionSettings and SetTransitionSettings --- src/WSRequestHandler.cpp | 4 +- src/WSRequestHandler.h | 2 + src/WSRequestHandler_Transitions.cpp | 65 ++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index b4ab8137..8d8e7776 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -28,7 +28,7 @@ using namespace std::placeholders; -const QHash WSRequestHandler::messageMap { +const QHash WSRequestHandler::messageMap{ { "GetVersion", &WSRequestHandler::GetVersion }, { "GetAuthRequired", &WSRequestHandler::GetAuthRequired }, { "Authenticate", &WSRequestHandler::Authenticate }, @@ -96,6 +96,8 @@ const QHash WSRequestHandler::messageMap { { "SetTransitionDuration", &WSRequestHandler::SetTransitionDuration }, { "GetTransitionDuration", &WSRequestHandler::GetTransitionDuration }, { "GetTransitionPosition", &WSRequestHandler::GetTransitionPosition }, + { "GetTransitionSettings", &WSRequestHandler::GetTransitionSettings }, + { "SetTransitionSettings", &WSRequestHandler::SetTransitionSettings }, { "SetVolume", &WSRequestHandler::SetVolume }, { "GetVolume", &WSRequestHandler::GetVolume }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index c3190668..03281a5e 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -113,6 +113,8 @@ class WSRequestHandler { RpcResponse SetTransitionDuration(const RpcRequest&); RpcResponse GetTransitionDuration(const RpcRequest&); RpcResponse GetTransitionPosition(const RpcRequest&); + RpcResponse GetTransitionSettings(const RpcRequest&); + RpcResponse SetTransitionSettings(const RpcRequest&); RpcResponse SetVolume(const RpcRequest&); RpcResponse GetVolume(const RpcRequest&); diff --git a/src/WSRequestHandler_Transitions.cpp b/src/WSRequestHandler_Transitions.cpp index 9bcee450..9875b625 100644 --- a/src/WSRequestHandler_Transitions.cpp +++ b/src/WSRequestHandler_Transitions.cpp @@ -139,3 +139,68 @@ RpcResponse WSRequestHandler::GetTransitionPosition(const RpcRequest& request) { return request.success(response); } + +/** + * Get the current settings of a transition + * + * @param {String} `transitionName` Transition name + * + * @return {Object} `transitionSettings` Current transition settings + * + * @api requests + * @name GetTransitionSettings + * @category transitions + * @since unreleased + */ +RpcResponse WSRequestHandler::GetTransitionSettings(const RpcRequest& request) { + if (!request.hasField("transitionName")) { + return request.failed("missing request parameters"); + } + + const char* transitionName = obs_data_get_string(request.parameters(), "transitionName"); + OBSSourceAutoRelease transition = Utils::GetTransitionFromName(transitionName); + if (!transition) { + return request.failed("specified transition doesn't exist"); + } + + OBSDataAutoRelease transitionSettings = obs_source_get_settings(transition); + + OBSDataAutoRelease response = obs_data_create(); + obs_data_set_obj(response, "transitionSettings", transitionSettings); + return request.success(response); +} + +/** + * Change the current settings of a transition + * + * @param {String} `transitionName` Transition name + * @param {Object} `transitionSettings` Transition settings (they can be partial) + * + * @return {Object} `transitionSettings` Updated transition settings + * + * @api requests + * @name SetTransitionSettings + * @category transitions + * @since unreleased + */ +RpcResponse WSRequestHandler::SetTransitionSettings(const RpcRequest& request) { + if (!request.hasField("transitionName") || !request.hasField("transitionSettings")) { + return request.failed("missing request parameters"); + } + + const char* transitionName = obs_data_get_string(request.parameters(), "transitionName"); + OBSSourceAutoRelease transition = Utils::GetTransitionFromName(transitionName); + if (!transition) { + return request.failed("specified transition doesn't exist"); + } + + OBSDataAutoRelease newSettings = obs_data_get_obj(request.parameters(), "transitionSettings"); + obs_source_update(transition, newSettings); + obs_source_update_properties(transition); + + OBSDataAutoRelease updatedSettings = obs_source_get_settings(transition); + + OBSDataAutoRelease response = obs_data_create(); + obs_data_set_obj(response, "transitionSettings", updatedSettings); // TODO + return request.success(response); +} From 5d9d5e074676631a808eec9deecc910a66e4664b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Sun, 25 Oct 2020 19:25:48 +0100 Subject: [PATCH 128/178] request(SetSourceSettings): remove redundant obs_data_apply step --- src/WSRequestHandler_Sources.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index c6125e5b..ba98ecdb 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -511,6 +511,7 @@ RpcResponse WSRequestHandler::GetSourceSettings(const RpcRequest& request) const char* sourceName = obs_data_get_string(request.parameters(), "sourceName"); OBSSourceAutoRelease source = obs_get_source_by_name(sourceName); + if (!source) { return request.failed("specified source doesn't exist"); } @@ -571,21 +572,17 @@ RpcResponse WSRequestHandler::SetSourceSettings(const RpcRequest& request) } } - OBSDataAutoRelease currentSettings = obs_source_get_settings(source); OBSDataAutoRelease newSettings = obs_data_get_obj(request.parameters(), "sourceSettings"); - OBSDataAutoRelease sourceSettings = obs_data_create(); - obs_data_apply(sourceSettings, currentSettings); - obs_data_apply(sourceSettings, newSettings); - - obs_source_update(source, sourceSettings); + obs_source_update(source, newSettings); obs_source_update_properties(source); + OBSDataAutoRelease updatedSettings = obs_source_get_settings(source); + OBSDataAutoRelease response = obs_data_create(); obs_data_set_string(response, "sourceName", obs_source_get_name(source)); obs_data_set_string(response, "sourceType", obs_source_get_id(source)); - obs_data_set_obj(response, "sourceSettings", sourceSettings); - + obs_data_set_obj(response, "sourceSettings", updatedSettings); return request.success(response); } From 8ba441da7fbeecffd90f971e97128b08dfba3c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Sun, 25 Oct 2020 19:33:42 +0100 Subject: [PATCH 129/178] requests(transitions): remove TODO --- src/WSRequestHandler_Transitions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WSRequestHandler_Transitions.cpp b/src/WSRequestHandler_Transitions.cpp index 9875b625..ef03352d 100644 --- a/src/WSRequestHandler_Transitions.cpp +++ b/src/WSRequestHandler_Transitions.cpp @@ -201,6 +201,6 @@ RpcResponse WSRequestHandler::SetTransitionSettings(const RpcRequest& request) { OBSDataAutoRelease updatedSettings = obs_source_get_settings(transition); OBSDataAutoRelease response = obs_data_create(); - obs_data_set_obj(response, "transitionSettings", updatedSettings); // TODO + obs_data_set_obj(response, "transitionSettings", updatedSettings); return request.success(response); } From 11326274e06d0b3c33d4c1f75115cf5a25cd9170 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Sun, 25 Oct 2020 18:34:53 +0000 Subject: [PATCH 130/178] docs(ci): Update protocol.md - acd3940 [skip ci] --- docs/generated/comments.json | 12 +++++++++--- docs/generated/protocol.md | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 9670bee5..9754b0c1 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -8092,8 +8092,9 @@ { "subheads": [], "description": "Get a list of all scene items in a scene.", - "param": "{String} `sceneName` Name of the scene to get the list of scene items from.", + "param": "{String (optional)} `sceneName` Name of the scene to get the list of scene items from. Defaults to the current scene if not specified.", "return": [ + "{String} `sceneName` Name of the requested (or current) scene", "{Array} `sceneItems` Array of scene items", "{int} `sceneItems.*.itemId` Unique item id of the source item", "{String} `sceneItems.*.sourceKind` ID if the scene item's source. For example `vlc_source` or `image_source`", @@ -8105,6 +8106,11 @@ "category": "scene items", "since": "unreleased", "returns": [ + { + "type": "String", + "name": "sceneName", + "description": "Name of the requested (or current) scene" + }, { "type": "Array", "name": "sceneItems", @@ -8133,9 +8139,9 @@ ], "params": [ { - "type": "String", + "type": "String (optional)", "name": "sceneName", - "description": "Name of the scene to get the list of scene items from." + "description": "Name of the scene to get the list of scene items from. Defaults to the current scene if not specified." } ], "names": [ diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 76aad352..487c732e 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -3261,13 +3261,14 @@ Get a list of all scene items in a scene. | Name | Type | Description | | ---- | :---: | ------------| -| `sceneName` | _String_ | Name of the scene to get the list of scene items from. | +| `sceneName` | _String (optional)_ | Name of the scene to get the list of scene items from. Defaults to the current scene if not specified. | **Response Items:** | Name | Type | Description | | ---- | :---: | ------------| +| `sceneName` | _String_ | Name of the requested (or current) scene | | `sceneItems` | _Array<Object>_ | Array of scene items | | `sceneItems.*.itemId` | _int_ | Unique item id of the source item | | `sceneItems.*.sourceKind` | _String_ | ID if the scene item's source. For example `vlc_source` or `image_source` | From fabf68b6350b53a31a65dadfde07a16fc80dd967 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Mon, 2 Nov 2020 23:13:33 -0800 Subject: [PATCH 131/178] CI: Remove BUILD_CAPTIONS flag OBS has removed the `BUILD_CAPTIONS` flag from their repo. No reason to keep it --- .github/workflows/pr_push.yml | 8 ++++---- .github/workflows/tag_release.yml | 8 ++++---- CI/install-build-obs-macos.sh | 1 - CI/prepare-obs-windows.cmd | 6 +++--- src/WSRequestHandler.cpp | 2 -- src/WSRequestHandler.h | 2 -- src/WSRequestHandler_Streaming.cpp | 2 -- 7 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pr_push.yml b/.github/workflows/pr_push.yml index 62836706..cad2023f 100644 --- a/.github/workflows/pr_push.yml +++ b/.github/workflows/pr_push.yml @@ -82,7 +82,7 @@ jobs: run: | mkdir .\build32 cd .\build32 - cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. - name: 'Build OBS-Studio 32-bit' if: steps.build-cache-obs-32.outputs.cache-hit != 'true' working-directory: ${{ github.workspace }}/obs-studio @@ -105,7 +105,7 @@ jobs: run: | mkdir .\build64 cd .\build64 - cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. - name: 'Build OBS-Studio 64-bit' if: steps.build-cache-obs-64.outputs.cache-hit != 'true' working-directory: ${{ github.workspace }}/obs-studio @@ -242,7 +242,7 @@ jobs: run: | mkdir ./build cd ./build - cmake -DBUILD_CAPTIONS=YES -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES -DCMAKE_INSTALL_PREFIX=/usr .. + cmake -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES -DCMAKE_INSTALL_PREFIX=/usr .. - name: 'Build OBS-Studio' working-directory: ${{ github.workspace }}/obs-studio shell: bash @@ -354,7 +354,7 @@ jobs: run: | mkdir build cd build - cmake -DBUILD_CAPTIONS=YES -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DENABLE_SCRIPTING=NO -DDepsPath=/tmp/obsdeps -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/${{ env.QT_VERSION }}/lib/cmake .. + cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DENABLE_SCRIPTING=NO -DDepsPath=/tmp/obsdeps -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/${{ env.QT_VERSION }}/lib/cmake .. - name: 'Build OBS Studio libraries' working-directory: ${{ github.workspace }}/obs-studio shell: bash diff --git a/.github/workflows/tag_release.yml b/.github/workflows/tag_release.yml index 698ce49a..f499e0bb 100644 --- a/.github/workflows/tag_release.yml +++ b/.github/workflows/tag_release.yml @@ -76,7 +76,7 @@ jobs: run: | mkdir .\build32 cd .\build32 - cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. - name: 'Build OBS-Studio 32-bit' if: steps.build-cache-obs-32.outputs.cache-hit != 'true' working-directory: ${{ github.workspace }}/obs-studio @@ -99,7 +99,7 @@ jobs: run: | mkdir .\build64 cd .\build64 - cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DBUILD_CAPTIONS=YES -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. + cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES .. - name: 'Build OBS-Studio 64-bit' if: steps.build-cache-obs-64.outputs.cache-hit != 'true' working-directory: ${{ github.workspace }}/obs-studio @@ -235,7 +235,7 @@ jobs: run: | mkdir ./build cd ./build - cmake -DBUILD_CAPTIONS=YES -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES -DCMAKE_INSTALL_PREFIX=/usr .. + cmake -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES -DCMAKE_INSTALL_PREFIX=/usr .. - name: 'Build OBS-Studio' working-directory: ${{ github.workspace }}/obs-studio shell: bash @@ -346,7 +346,7 @@ jobs: run: | mkdir build cd build - cmake -DBUILD_CAPTIONS=YES -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DENABLE_SCRIPTING=NO -DDepsPath=/tmp/obsdeps -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/${{ env.QT_VERSION }}/lib/cmake .. + cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DENABLE_SCRIPTING=NO -DDepsPath=/tmp/obsdeps -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/${{ env.QT_VERSION }}/lib/cmake .. - name: 'Build OBS Studio libraries' working-directory: ${{ github.workspace }}/obs-studio shell: bash diff --git a/CI/install-build-obs-macos.sh b/CI/install-build-obs-macos.sh index 0dc610aa..4af63b49 100755 --- a/CI/install-build-obs-macos.sh +++ b/CI/install-build-obs-macos.sh @@ -34,7 +34,6 @@ git checkout $OBSLatestTag mkdir build && cd build echo "[obs-websocket] Building obs-studio.." cmake .. \ - -DBUILD_CAPTIONS=true \ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \ -DDISABLE_PLUGINS=true \ -DENABLE_SCRIPTING=0 \ diff --git a/CI/prepare-obs-windows.cmd b/CI/prepare-obs-windows.cmd index 961fbe17..43fc1c32 100644 --- a/CI/prepare-obs-windows.cmd +++ b/CI/prepare-obs-windows.cmd @@ -24,14 +24,14 @@ if not exist build64 mkdir build64 echo Running cmake for obs-studio %OBSLatestTag% 32-bit... cd build32 -cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -DDepsPath="%DepsPath32%" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. +cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -DDepsPath="%DepsPath32%" -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. echo: echo: echo Running cmake for obs-studio %OBSLatestTag% 64-bit... cd ..\build64 -cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -DDepsPath="%DepsPath64%" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. +cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -DDepsPath="%DepsPath64%" -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true .. echo: echo: -dir "%OBSPath%\libobs" \ No newline at end of file +dir "%OBSPath%\libobs" diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index b4ab8137..e4f0a907 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -135,9 +135,7 @@ const QHash WSRequestHandler::messageMap { { "SetStreamSettings", &WSRequestHandler::SetStreamSettings }, { "GetStreamSettings", &WSRequestHandler::GetStreamSettings }, { "SaveStreamSettings", &WSRequestHandler::SaveStreamSettings }, -#if BUILD_CAPTIONS { "SendCaptions", &WSRequestHandler::SendCaptions }, -#endif { "GetStudioModeStatus", &WSRequestHandler::GetStudioModeStatus }, { "GetPreviewScene", &WSRequestHandler::GetPreviewScene }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index c3190668..fcde500c 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -152,9 +152,7 @@ class WSRequestHandler { RpcResponse SetStreamSettings(const RpcRequest&); RpcResponse GetStreamSettings(const RpcRequest&); RpcResponse SaveStreamSettings(const RpcRequest&); -#if BUILD_CAPTIONS RpcResponse SendCaptions(const RpcRequest&); -#endif RpcResponse GetStudioModeStatus(const RpcRequest&); RpcResponse GetPreviewScene(const RpcRequest&); diff --git a/src/WSRequestHandler_Streaming.cpp b/src/WSRequestHandler_Streaming.cpp index aa0782c9..94f5b5c3 100644 --- a/src/WSRequestHandler_Streaming.cpp +++ b/src/WSRequestHandler_Streaming.cpp @@ -300,7 +300,6 @@ RpcResponse WSRequestHandler::SaveStreamSettings(const RpcRequest& request) { * @category streaming * @since 4.6.0 */ -#if BUILD_CAPTIONS RpcResponse WSRequestHandler::SendCaptions(const RpcRequest& request) { if (!request.hasField("text")) { return request.failed("missing request parameters"); @@ -315,5 +314,4 @@ RpcResponse WSRequestHandler::SendCaptions(const RpcRequest& request) { return request.success(); } -#endif From b9cbd0ecd155ae18920a520b7df374427a37368f Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Fri, 27 Nov 2020 11:19:36 +0000 Subject: [PATCH 132/178] docs(ci): Update protocol.md - 3d7511c [skip ci] --- docs/generated/comments.json | 106 +++++++++++++++++++++++++++++++++++ docs/generated/protocol.md | 49 ++++++++++++++++ 2 files changed, 155 insertions(+) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 9754b0c1..a703f6d3 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -10521,6 +10521,112 @@ "lead": "", "type": "class", "examples": [] + }, + { + "subheads": [], + "description": "Get the current settings of a transition", + "param": "{String} `transitionName` Transition name", + "return": "{Object} `transitionSettings` Current transition settings", + "api": "requests", + "name": "GetTransitionSettings", + "category": "transitions", + "since": "unreleased", + "returns": [ + { + "type": "Object", + "name": "transitionSettings", + "description": "Current transition settings" + } + ], + "params": [ + { + "type": "String", + "name": "transitionName", + "description": "Transition name" + } + ], + "names": [ + { + "name": "", + "description": "GetTransitionSettings" + } + ], + "categories": [ + { + "name": "", + "description": "transitions" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "GetTransitionSettings" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "Change the current settings of a transition", + "param": [ + "{String} `transitionName` Transition name", + "{Object} `transitionSettings` Transition settings (they can be partial)" + ], + "return": "{Object} `transitionSettings` Updated transition settings", + "api": "requests", + "name": "SetTransitionSettings", + "category": "transitions", + "since": "unreleased", + "returns": [ + { + "type": "Object", + "name": "transitionSettings", + "description": "Updated transition settings" + } + ], + "params": [ + { + "type": "String", + "name": "transitionName", + "description": "Transition name" + }, + { + "type": "Object", + "name": "transitionSettings", + "description": "Transition settings (they can be partial)" + } + ], + "names": [ + { + "name": "", + "description": "SetTransitionSettings" + } + ], + "categories": [ + { + "name": "", + "description": "transitions" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "SetTransitionSettings" + }, + "lead": "", + "type": "class", + "examples": [] } ] } diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 487c732e..7d3f7610 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -255,6 +255,8 @@ You can also refer to any of the client libraries listed on the [README](README. + [SetTransitionDuration](#settransitionduration) + [GetTransitionDuration](#gettransitionduration) + [GetTransitionPosition](#gettransitionposition) + + [GetTransitionSettings](#gettransitionsettings) + + [SetTransitionSettings](#settransitionsettings) @@ -4185,3 +4187,50 @@ _No specified parameters._ --- +### GetTransitionSettings + + +- Unreleased + +Get the current settings of a transition + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `transitionName` | _String_ | Transition name | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `transitionSettings` | _Object_ | Current transition settings | + + +--- + +### SetTransitionSettings + + +- Unreleased + +Change the current settings of a transition + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `transitionName` | _String_ | Transition name | +| `transitionSettings` | _Object_ | Transition settings (they can be partial) | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `transitionSettings` | _Object_ | Updated transition settings | + + +--- + From eddd4abe76dee7d7dc94444551ad660b27e012e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 12:45:57 +0100 Subject: [PATCH 133/178] ci(linux): update frontend api headers to v26 --- CI/install-dependencies-ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/install-dependencies-ubuntu.sh b/CI/install-dependencies-ubuntu.sh index d0e16f53..4ed044da 100755 --- a/CI/install-dependencies-ubuntu.sh +++ b/CI/install-dependencies-ubuntu.sh @@ -14,6 +14,6 @@ sudo apt-get install -y \ qtbase5-dev # Dirty hack -sudo wget -O /usr/include/obs/obs-frontend-api.h https://raw.githubusercontent.com/obsproject/obs-studio/25.0.0/UI/obs-frontend-api/obs-frontend-api.h +sudo wget -O /usr/include/obs/obs-frontend-api.h https://raw.githubusercontent.com/obsproject/obs-studio/26.0.0/UI/obs-frontend-api/obs-frontend-api.h sudo ldconfig From 6b03efed42ac4180c9fbe18ed0b08cc1cfaa6537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 15:33:32 +0100 Subject: [PATCH 134/178] requests(outputs): fix corrupted parameters object on MSVC when using findOutputOrFail --- src/WSRequestHandler_Outputs.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/WSRequestHandler_Outputs.cpp b/src/WSRequestHandler_Outputs.cpp index ab8b0cc1..c30f9ef5 100644 --- a/src/WSRequestHandler_Outputs.cpp +++ b/src/WSRequestHandler_Outputs.cpp @@ -59,7 +59,7 @@ obs_data_t* getOutputInfo(obs_output_t* output) return data; } -RpcResponse findOutputOrFail(const RpcRequest& request, std::function callback) +RpcResponse findOutputOrFail(const RpcRequest& request, std::function callback) { if (!request.hasField("outputName")) { return request.failed("missing request parameters"); @@ -71,7 +71,7 @@ RpcResponse findOutputOrFail(const RpcRequest& request, std::function Date: Fri, 27 Nov 2020 16:03:21 +0100 Subject: [PATCH 135/178] requests(transitions): documentation fixes --- src/WSRequestHandler_Transitions.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/WSRequestHandler_Transitions.cpp b/src/WSRequestHandler_Transitions.cpp index 78d7ee30..fbdef0cf 100644 --- a/src/WSRequestHandler_Transitions.cpp +++ b/src/WSRequestHandler_Transitions.cpp @@ -129,7 +129,7 @@ RpcResponse WSRequestHandler::GetTransitionDuration(const RpcRequest& request) { * @api requests * @name GetTransitionPosition * @category transitions - * @since 4.8.0 + * @since unreleased */ RpcResponse WSRequestHandler::GetTransitionPosition(const RpcRequest& request) { OBSSourceAutoRelease currentTransition = obs_frontend_get_current_transition(); @@ -206,12 +206,12 @@ RpcResponse WSRequestHandler::SetTransitionSettings(const RpcRequest& request) { } /** - * Release the T-Bar. YOU MUST CALL THIS IF YOU SPECIFY `release = false` IN `SetTBarPosition`. + * Release the T-Bar. *YOU MUST CALL THIS if you called `SetTBarPosition` with the `release` parameter set to `false`.* * * @api requests * @name ReleaseTBar * @category transitions - * @since 4.8.0 + * @since unreleased */ RpcResponse WSRequestHandler::ReleaseTBar(const RpcRequest& request) { if (!obs_frontend_preview_program_mode_active()) { @@ -231,12 +231,13 @@ RpcResponse WSRequestHandler::ReleaseTBar(const RpcRequest& request) { * Set the manual position of the T-Bar (in Studio Mode) to the specified value. Will return an error if OBS is not in studio mode * or if the current transition doesn't support T-Bar control. * - * @param {double} `position` T-Bar position. This value must be between 0.0 and 1.0. + * @param {double} `position` T-Bar position. This value must be between 0.0 and 1024.0. + * @param {boolean (optional)} `release` Whether or not the T-Bar gets released after setting its new position. Call `ReleaseTBar` manually if you set `release` to false. Defaults to true * * @api requests * @name SetTBarPosition * @category transitions - * @since 4.8.0 + * @since unreleased */ RpcResponse WSRequestHandler::SetTBarPosition(const RpcRequest& request) { if (!obs_frontend_preview_program_mode_active()) { From 98187e2bd7a91a942c65e01933df7b783b9bb547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 16:07:20 +0100 Subject: [PATCH 136/178] requests(transitions): documentation fixes cont. --- src/WSRequestHandler_Transitions.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/WSRequestHandler_Transitions.cpp b/src/WSRequestHandler_Transitions.cpp index fbdef0cf..0c7f3f9c 100644 --- a/src/WSRequestHandler_Transitions.cpp +++ b/src/WSRequestHandler_Transitions.cpp @@ -206,7 +206,8 @@ RpcResponse WSRequestHandler::SetTransitionSettings(const RpcRequest& request) { } /** - * Release the T-Bar. *YOU MUST CALL THIS if you called `SetTBarPosition` with the `release` parameter set to `false`.* + * Release the T-Bar (like a user releasing their mouse button after moving it). + * *YOU MUST CALL THIS if you called `SetTBarPosition` with the `release` parameter set to `false`.* * * @api requests * @name ReleaseTBar @@ -231,8 +232,8 @@ RpcResponse WSRequestHandler::ReleaseTBar(const RpcRequest& request) { * Set the manual position of the T-Bar (in Studio Mode) to the specified value. Will return an error if OBS is not in studio mode * or if the current transition doesn't support T-Bar control. * - * @param {double} `position` T-Bar position. This value must be between 0.0 and 1024.0. - * @param {boolean (optional)} `release` Whether or not the T-Bar gets released after setting its new position. Call `ReleaseTBar` manually if you set `release` to false. Defaults to true + * @param {double} `position` T-Bar position. This value must be between 0.0 and 1.0. + * @param {boolean (optional)} `release` Whether or not the T-Bar gets released automatically after setting its new position (like a user releasing their mouse button after moving the T-Bar). Call `ReleaseTBar` manually if you set `release` to false. Defaults to true. * * @api requests * @name SetTBarPosition From a53df39e46f3897c21c93db4bc7c185b5b6c63e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 16:15:03 +0100 Subject: [PATCH 137/178] requests(transitions): yet another doc fix --- src/WSRequestHandler_Transitions.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/WSRequestHandler_Transitions.cpp b/src/WSRequestHandler_Transitions.cpp index 0c7f3f9c..7fd15349 100644 --- a/src/WSRequestHandler_Transitions.cpp +++ b/src/WSRequestHandler_Transitions.cpp @@ -231,6 +231,8 @@ RpcResponse WSRequestHandler::ReleaseTBar(const RpcRequest& request) { /** * Set the manual position of the T-Bar (in Studio Mode) to the specified value. Will return an error if OBS is not in studio mode * or if the current transition doesn't support T-Bar control. + * + * If your code needs to perform multiple successive T-Bar moves (e.g. : in an animation, or in response to a user moving a T-Bar control in your User Interface), set `release` to false and call `ReleaseTBar` later once the animation/interaction is over. * * @param {double} `position` T-Bar position. This value must be between 0.0 and 1.0. * @param {boolean (optional)} `release` Whether or not the T-Bar gets released automatically after setting its new position (like a user releasing their mouse button after moving the T-Bar). Call `ReleaseTBar` manually if you set `release` to false. Defaults to true. From f7616ade1fc6dc3fed3a19b28cd960d5bcea8ea8 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Fri, 27 Nov 2020 15:41:27 +0000 Subject: [PATCH 138/178] docs(ci): Update protocol.md - f14379a [skip ci] --- docs/generated/comments.json | 86 +++++++++++++++++++++++++++++++++++- docs/generated/protocol.md | 45 ++++++++++++++++++- 2 files changed, 128 insertions(+), 3 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index a703f6d3..ba652f2f 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -10488,7 +10488,7 @@ "api": "requests", "name": "GetTransitionPosition", "category": "transitions", - "since": "4.8.0", + "since": "unreleased", "returns": [ { "type": "double", @@ -10511,7 +10511,7 @@ "sinces": [ { "name": "", - "description": "4.8.0" + "description": "unreleased" } ], "heading": { @@ -10627,6 +10627,88 @@ "lead": "", "type": "class", "examples": [] + }, + { + "subheads": [], + "description": "Release the T-Bar (like a user releasing their mouse button after moving it).\n*YOU MUST CALL THIS if you called `SetTBarPosition` with the `release` parameter set to `false`.*", + "api": "requests", + "name": "ReleaseTBar", + "category": "transitions", + "since": "unreleased", + "names": [ + { + "name": "", + "description": "ReleaseTBar" + } + ], + "categories": [ + { + "name": "", + "description": "transitions" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "ReleaseTBar" + }, + "lead": "", + "type": "class", + "examples": [] + }, + { + "subheads": [], + "description": "\n\nIf your code needs to perform multiple successive T-Bar moves (e.g. : in an animation, or in response to a user moving a T-Bar control in your User Interface), set `release` to false and call `ReleaseTBar` later once the animation/interaction is over.", + "param": [ + "{double} `position` T-Bar position. This value must be between 0.0 and 1.0.", + "{boolean (optional)} `release` Whether or not the T-Bar gets released automatically after setting its new position (like a user releasing their mouse button after moving the T-Bar). Call `ReleaseTBar` manually if you set `release` to false. Defaults to true." + ], + "api": "requests", + "name": "SetTBarPosition", + "category": "transitions", + "since": "unreleased", + "params": [ + { + "type": "double", + "name": "position", + "description": "T-Bar position. This value must be between 0.0 and 1.0." + }, + { + "type": "boolean (optional)", + "name": "release", + "description": "Whether or not the T-Bar gets released automatically after setting its new position (like a user releasing their mouse button after moving the T-Bar). Call `ReleaseTBar` manually if you set `release` to false. Defaults to true." + } + ], + "names": [ + { + "name": "", + "description": "SetTBarPosition" + } + ], + "categories": [ + { + "name": "", + "description": "transitions" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "SetTBarPosition" + }, + "lead": "Set the manual position of the T-Bar (in Studio Mode) to the specified value. Will return an error if OBS is not in studio mode or if the current transition doesn't support T-Bar control.", + "type": "class", + "examples": [] } ] } diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 7d3f7610..2bb187d1 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -257,6 +257,8 @@ You can also refer to any of the client libraries listed on the [README](README. + [GetTransitionPosition](#gettransitionposition) + [GetTransitionSettings](#gettransitionsettings) + [SetTransitionSettings](#settransitionsettings) + + [ReleaseTBar](#releasetbar) + + [SetTBarPosition](#settbarposition) @@ -4170,7 +4172,7 @@ _No specified parameters._ ### GetTransitionPosition -- Added in v4.8.0 +- Unreleased Get the position of the current transition. @@ -4234,3 +4236,44 @@ Change the current settings of a transition --- +### ReleaseTBar + + +- Unreleased + +Release the T-Bar (like a user releasing their mouse button after moving it). +*YOU MUST CALL THIS if you called `SetTBarPosition` with the `release` parameter set to `false`.* + +**Request Fields:** + +_No specified parameters._ + +**Response Items:** + +_No additional response items._ + +--- + +### SetTBarPosition + + +- Unreleased + + + +If your code needs to perform multiple successive T-Bar moves (e.g. : in an animation, or in response to a user moving a T-Bar control in your User Interface), set `release` to false and call `ReleaseTBar` later once the animation/interaction is over. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `position` | _double_ | T-Bar position. This value must be between 0.0 and 1.0. | +| `release` | _boolean (optional)_ | Whether or not the T-Bar gets released automatically after setting its new position (like a user releasing their mouse button after moving the T-Bar). Call `ReleaseTBar` manually if you set `release` to false. Defaults to true. | + + +**Response Items:** + +_No additional response items._ + +--- + From d87a7e896bbe980023b79dee8b4486cdfc91ef51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 16:46:33 +0100 Subject: [PATCH 139/178] events(SceneCollectionChanged): add new scene collection name --- src/WSEvents.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 56d24c8a..c2e9d0bc 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -479,13 +479,17 @@ void WSEvents::OnSceneListChange() { /** * Triggered when switching to another scene collection or when renaming the current scene collection. * + * @return {String} `sceneCollection` Name of the new current scene collection. + * * @api events * @name SceneCollectionChanged * @category scenes * @since 4.0.0 */ void WSEvents::OnSceneCollectionChange() { - broadcastUpdate("SceneCollectionChanged"); + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "sceneCollection", obs_frontend_get_current_scene_collection()); + broadcastUpdate("SceneCollectionChanged", fields); OnTransitionListChange(); OnTransitionChange(); From fe52cd8db15cfa95c1a67999b505480822b46b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 16:47:10 +0100 Subject: [PATCH 140/178] events(ProfileChanged): add new profile name --- src/WSEvents.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index c2e9d0bc..d04b2880 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -546,13 +546,17 @@ void WSEvents::OnTransitionListChange() { /** * Triggered when switching to another profile or when renaming the current profile. * + * @return {String} `profile` Name of the new current profile. + * * @api events * @name ProfileChanged * @category profiles * @since 4.0.0 */ void WSEvents::OnProfileChange() { - broadcastUpdate("ProfileChanged"); + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_string(fields, "profile", obs_frontend_get_current_profile()); + broadcastUpdate("ProfileChanged", fields); } /** From 0dc8e070ff07b691d8d0b0fa45d57901bae85bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 16:57:47 +0100 Subject: [PATCH 141/178] events(SceneCollectionListChanged): add scene collections list property --- src/WSEvents.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index d04b2880..705a3184 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -501,13 +501,23 @@ void WSEvents::OnSceneCollectionChange() { /** * Triggered when a scene collection is created, added, renamed, or removed. * + * @return {Array} `sceneCollections` Scene collections list. + * @return {String} `sceneCollections.*.name` Scene collection name. + * * @api events * @name SceneCollectionListChanged * @category scenes * @since 4.0.0 */ void WSEvents::OnSceneCollectionListChange() { - broadcastUpdate("SceneCollectionListChanged"); + char** sceneCollections = obs_frontend_get_scene_collections(); + OBSDataArrayAutoRelease sceneCollectionsList = + Utils::StringListToArray(sceneCollections, "name"); + bfree(sceneCollections); + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_array(fields, "sceneCollections", sceneCollectionsList); + broadcastUpdate("SceneCollectionListChanged", fields); } /** @@ -568,7 +578,9 @@ void WSEvents::OnProfileChange() { * @since 4.0.0 */ void WSEvents::OnProfileListChange() { - broadcastUpdate("ProfileListChanged"); + OBSDataAutoRelease fields = obs_data_create(); + // TODO provide new profile list + broadcastUpdate("ProfileListChanged", fields); } /** From 542761e411871e6f86e69ea42d21234f71a1b5e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 16:58:34 +0100 Subject: [PATCH 142/178] events(ProfileListChanged): add profile list property --- src/WSEvents.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 705a3184..351b30ad 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -572,14 +572,21 @@ void WSEvents::OnProfileChange() { /** * Triggered when a profile is created, added, renamed, or removed. * + * @return {Array} `profiles` Profiles list. + * @return {String} `profiles.*.name` Profile name. + * * @api events * @name ProfileListChanged * @category profiles * @since 4.0.0 */ void WSEvents::OnProfileListChange() { + char** profiles = obs_frontend_get_profiles(); + OBSDataArrayAutoRelease profilesList = Utils::StringListToArray(profiles, "name"); + bfree(profiles); + OBSDataAutoRelease fields = obs_data_create(); - // TODO provide new profile list + obs_data_set_array(fields, "profiles", profilesList); broadcastUpdate("ProfileListChanged", fields); } From 0cdea68567d11bb07506a5b966a96823013f665a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 17:07:28 +0100 Subject: [PATCH 143/178] events(ScenesChanged): provide scenes list property --- src/WSEvents.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 351b30ad..ad765e26 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -467,13 +467,19 @@ void WSEvents::OnSceneChange() { * * Note: This event is not fired when the scenes are reordered. * + * @return {Array} `scenes` Scenes list. + * * @api events * @name ScenesChanged * @category scenes * @since 0.3 */ void WSEvents::OnSceneListChange() { - broadcastUpdate("ScenesChanged"); + OBSDataArrayAutoRelease scenes = Utils::GetScenes(); + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_array(fields, "scenes", scenes); + broadcastUpdate("ScenesChanged", fields); } /** From 14409dec4f933748d4aa9177110c6fd979df8777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 17:09:07 +0100 Subject: [PATCH 144/178] events(TransitionListChanged): provide transitions list property --- src/WSEvents.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index ad765e26..af94214e 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -550,13 +550,30 @@ void WSEvents::OnTransitionChange() { * The list of available transitions has been modified. * Transitions have been added, removed, or renamed. * + * @return {Array} `transitions` Transitions list. + * * @api events * @name TransitionListChanged * @category transitions * @since 4.0.0 */ void WSEvents::OnTransitionListChange() { - broadcastUpdate("TransitionListChanged"); + obs_frontend_source_list transitionList = {}; + obs_frontend_get_transitions(&transitionList); + + OBSDataArrayAutoRelease transitions = obs_data_array_create(); + for (size_t i = 0; i < transitionList.sources.num; i++) { + OBSSource transition = transitionList.sources.array[i]; + + OBSDataAutoRelease obj = obs_data_create(); + obs_data_set_string(obj, "name", obs_source_get_name(transition)); + obs_data_array_push_back(transitions, obj); + } + obs_frontend_source_list_free(&transitionList); + + OBSDataAutoRelease fields = obs_data_create(); + obs_data_set_array(fields, "transitions", transitions); + broadcastUpdate("TransitionListChanged", fields); } /** From ae9ea8510c8439f3188e8f90f51a34e4876ecb57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 17:10:27 +0100 Subject: [PATCH 145/178] events: fix docs --- src/WSEvents.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index af94214e..ce27798d 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -507,7 +507,7 @@ void WSEvents::OnSceneCollectionChange() { /** * Triggered when a scene collection is created, added, renamed, or removed. * - * @return {Array} `sceneCollections` Scene collections list. + * @return {Array} `sceneCollections` Scene collections list. * @return {String} `sceneCollections.*.name` Scene collection name. * * @api events @@ -550,7 +550,8 @@ void WSEvents::OnTransitionChange() { * The list of available transitions has been modified. * Transitions have been added, removed, or renamed. * - * @return {Array} `transitions` Transitions list. + * @return {Array} `transitions` Transitions list. + * @return {String} `transitions.*.name` Transition name. * * @api events * @name TransitionListChanged @@ -595,7 +596,7 @@ void WSEvents::OnProfileChange() { /** * Triggered when a profile is created, added, renamed, or removed. * - * @return {Array} `profiles` Profiles list. + * @return {Array} `profiles` Profiles list. * @return {String} `profiles.*.name` Profile name. * * @api events From ef0e90701431d571e35cd3b0d37269e8c80a814c Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Fri, 27 Nov 2020 16:24:32 +0000 Subject: [PATCH 146/178] docs(ci): Update protocol.md - 9fb0f56 [skip ci] --- docs/generated/comments.json | 72 ++++++++++++++++++++++++++++++++++++ docs/generated/protocol.md | 33 ++++++++++++++--- 2 files changed, 99 insertions(+), 6 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index ba652f2f..cffcd1d5 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -562,10 +562,18 @@ { "subheads": [], "description": "\n\nNote: This event is not fired when the scenes are reordered.", + "return": "{Array} `scenes` Scenes list.", "api": "events", "name": "ScenesChanged", "category": "scenes", "since": "0.3", + "returns": [ + { + "type": "Array", + "name": "scenes", + "description": "Scenes list." + } + ], "names": [ { "name": "", @@ -595,10 +603,18 @@ { "subheads": [], "description": "Triggered when switching to another scene collection or when renaming the current scene collection.", + "return": "{String} `sceneCollection` Name of the new current scene collection.", "api": "events", "name": "SceneCollectionChanged", "category": "scenes", "since": "4.0.0", + "returns": [ + { + "type": "String", + "name": "sceneCollection", + "description": "Name of the new current scene collection." + } + ], "names": [ { "name": "", @@ -628,10 +644,26 @@ { "subheads": [], "description": "Triggered when a scene collection is created, added, renamed, or removed.", + "return": [ + "{Array} `sceneCollections` Scene collections list.", + "{String} `sceneCollections.*.name` Scene collection name." + ], "api": "events", "name": "SceneCollectionListChanged", "category": "scenes", "since": "4.0.0", + "returns": [ + { + "type": "Array", + "name": "sceneCollections", + "description": "Scene collections list." + }, + { + "type": "String", + "name": "sceneCollections.*.name", + "description": "Scene collection name." + } + ], "names": [ { "name": "", @@ -704,10 +736,26 @@ { "subheads": [], "description": "The list of available transitions has been modified.\nTransitions have been added, removed, or renamed.", + "return": [ + "{Array} `transitions` Transitions list.", + "{String} `transitions.*.name` Transition name." + ], "api": "events", "name": "TransitionListChanged", "category": "transitions", "since": "4.0.0", + "returns": [ + { + "type": "Array", + "name": "transitions", + "description": "Transitions list." + }, + { + "type": "String", + "name": "transitions.*.name", + "description": "Transition name." + } + ], "names": [ { "name": "", @@ -975,10 +1023,18 @@ { "subheads": [], "description": "Triggered when switching to another profile or when renaming the current profile.", + "return": "{String} `profile` Name of the new current profile.", "api": "events", "name": "ProfileChanged", "category": "profiles", "since": "4.0.0", + "returns": [ + { + "type": "String", + "name": "profile", + "description": "Name of the new current profile." + } + ], "names": [ { "name": "", @@ -1008,10 +1064,26 @@ { "subheads": [], "description": "Triggered when a profile is created, added, renamed, or removed.", + "return": [ + "{Array} `profiles` Profiles list.", + "{String} `profiles.*.name` Profile name." + ], "api": "events", "name": "ProfileListChanged", "category": "profiles", "since": "4.0.0", + "returns": [ + { + "type": "Array", + "name": "profiles", + "description": "Profiles list." + }, + { + "type": "String", + "name": "profiles.*.name", + "description": "Profile name." + } + ], "names": [ { "name": "", diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 2bb187d1..6ecdc51d 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -394,7 +394,10 @@ Note: This event is not fired when the scenes are reordered. **Response Items:** -_No additional response items._ +| Name | Type | Description | +| ---- | :---: | ------------| +| `scenes` | _Array<Scene>_ | Scenes list. | + --- @@ -407,7 +410,10 @@ Triggered when switching to another scene collection or when renaming the curren **Response Items:** -_No additional response items._ +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneCollection` | _String_ | Name of the new current scene collection. | + --- @@ -420,7 +426,11 @@ Triggered when a scene collection is created, added, renamed, or removed. **Response Items:** -_No additional response items._ +| Name | Type | Description | +| ---- | :---: | ------------| +| `sceneCollections` | _Array<Object>_ | Scene collections list. | +| `sceneCollections.*.name` | _String_ | Scene collection name. | + --- @@ -452,7 +462,11 @@ Transitions have been added, removed, or renamed. **Response Items:** -_No additional response items._ +| Name | Type | Description | +| ---- | :---: | ------------| +| `transitions` | _Array<Object>_ | Transitions list. | +| `transitions.*.name` | _String_ | Transition name. | + --- @@ -543,7 +557,10 @@ Triggered when switching to another profile or when renaming the current profile **Response Items:** -_No additional response items._ +| Name | Type | Description | +| ---- | :---: | ------------| +| `profile` | _String_ | Name of the new current profile. | + --- @@ -556,7 +573,11 @@ Triggered when a profile is created, added, renamed, or removed. **Response Items:** -_No additional response items._ +| Name | Type | Description | +| ---- | :---: | ------------| +| `profiles` | _Array<Object>_ | Profiles list. | +| `profiles.*.name` | _String_ | Profile name. | + --- From eaf34f3c3a3ee0fe6473a771301be38d61a795b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 19:38:01 +0100 Subject: [PATCH 147/178] requests(CreateSource): simplified settings apply obs_source_update already does that internally --- src/WSRequestHandler_Sources.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 4968d238..abd5b21c 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -66,12 +66,8 @@ RpcResponse WSRequestHandler::CreateSource(const RpcRequest& request) obs_source_set_enabled(newSource, true); if (request.hasField("sourceSettings")) { // We apply the settings after source creation because otherwise we get a bunch of memory leaks. - OBSDataAutoRelease currentSettings = obs_source_get_settings(newSource); OBSDataAutoRelease newSettings = obs_data_get_obj(request.parameters(), "sourceSettings"); - OBSDataAutoRelease sourceSettings = obs_data_create(); - obs_data_apply(sourceSettings, currentSettings); - obs_data_apply(sourceSettings, newSettings); - obs_source_update(newSource, sourceSettings); + obs_source_update(newSource, newSettings); obs_source_update_properties(newSource); } From 60ce25c689a33302cfb7828c659e6c46d8a7fbaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 19:38:55 +0100 Subject: [PATCH 148/178] requests(CreateSource): fix docs --- src/WSRequestHandler_Sources.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index abd5b21c..5214b408 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -25,7 +25,7 @@ bool isTextFreeType2Source(const QString& sourceKind) * @param {String} `sourceKind` Source kind, Eg. `vlc_source`. * @param {String} `sceneName` Scene to add the new source to. * @param {Object (optional)} `sourceSettings` Source settings data. - * @param {boolean (optional)} `setVisible` Set the created SceneItem as visible or not. + * @param {boolean (optional)} `setVisible` Set the created SceneItem as visible or not. Defaults to true * * @return {int} `itemId` ID of the SceneItem in the scene. * From 08178b93542e474f7d4028e0c6ce24aabe1e74fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 19:40:02 +0100 Subject: [PATCH 149/178] requests(CreateSource): use the OBSSourceAutoRelease container instead of manipulating refs manually --- src/WSRequestHandler_Sources.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 5214b408..3b662fdd 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -58,7 +58,7 @@ RpcResponse WSRequestHandler::CreateSource(const RpcRequest& request) return request.failed("requested scene is invalid or doesnt exist"); } - obs_source_t *newSource = obs_source_create(sourceKind.toUtf8(), sourceName.toUtf8(), nullptr, nullptr); + OBSSourceAutoRelease newSource = obs_source_create(sourceKind.toUtf8(), sourceName.toUtf8(), nullptr, nullptr); if (!newSource) { return request.failed("failed to create the source"); @@ -85,7 +85,6 @@ RpcResponse WSRequestHandler::CreateSource(const RpcRequest& request) OBSDataAutoRelease responseData = obs_data_create(); obs_data_set_int(responseData, "itemId", obs_sceneitem_get_id(data.sceneItem)); - obs_source_release(newSource); return request.success(responseData); } From 80d21ce80d029658207df9d7142c602ebb99cb1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 27 Nov 2020 23:52:55 +0100 Subject: [PATCH 150/178] WSRequestHandler: fix indent --- src/WSRequestHandler.cpp | 2 +- src/WSRequestHandler.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WSRequestHandler.cpp b/src/WSRequestHandler.cpp index bb897b44..e68f250e 100644 --- a/src/WSRequestHandler.cpp +++ b/src/WSRequestHandler.cpp @@ -99,7 +99,7 @@ const QHash WSRequestHandler::messageMap{ { "GetTransitionSettings", &WSRequestHandler::GetTransitionSettings }, { "SetTransitionSettings", &WSRequestHandler::SetTransitionSettings }, - { "CreateSource", &WSRequestHandler::CreateSource }, + { "CreateSource", &WSRequestHandler::CreateSource }, { "SetVolume", &WSRequestHandler::SetVolume }, { "GetVolume", &WSRequestHandler::GetVolume }, { "ToggleMute", &WSRequestHandler::ToggleMute }, diff --git a/src/WSRequestHandler.h b/src/WSRequestHandler.h index 047734a5..0dfbdbb5 100644 --- a/src/WSRequestHandler.h +++ b/src/WSRequestHandler.h @@ -116,7 +116,7 @@ class WSRequestHandler { RpcResponse GetTransitionSettings(const RpcRequest&); RpcResponse SetTransitionSettings(const RpcRequest&); - RpcResponse CreateSource(const RpcRequest&); + RpcResponse CreateSource(const RpcRequest&); RpcResponse SetVolume(const RpcRequest&); RpcResponse GetVolume(const RpcRequest&); RpcResponse ToggleMute(const RpcRequest&); From a1fcc35fd6f97d60804495185b201d703db4965f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Sat, 28 Nov 2020 00:19:27 +0100 Subject: [PATCH 151/178] requests(CreateSource): pass settings on source creation --- src/WSRequestHandler_Sources.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 3b662fdd..9aa5c260 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -58,19 +58,18 @@ RpcResponse WSRequestHandler::CreateSource(const RpcRequest& request) return request.failed("requested scene is invalid or doesnt exist"); } - OBSSourceAutoRelease newSource = obs_source_create(sourceKind.toUtf8(), sourceName.toUtf8(), nullptr, nullptr); + OBSDataAutoRelease sourceSettings = nullptr; + if (request.hasField("sourceSettings")) { + sourceSettings = obs_data_get_obj(request.parameters(), "sourceSettings"); + } + + OBSSourceAutoRelease newSource = obs_source_create(sourceKind.toUtf8(), sourceName.toUtf8(), sourceSettings, nullptr); if (!newSource) { return request.failed("failed to create the source"); } obs_source_set_enabled(newSource, true); - if (request.hasField("sourceSettings")) { // We apply the settings after source creation because otherwise we get a bunch of memory leaks. - OBSDataAutoRelease newSettings = obs_data_get_obj(request.parameters(), "sourceSettings"); - obs_source_update(newSource, newSettings); - obs_source_update_properties(newSource); - } - Utils::AddSourceData data; data.source = newSource; data.setVisible = true; From 569e9681e5ab5e2d2a3c11f4b7bece776f25646d Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Fri, 27 Nov 2020 23:39:48 +0000 Subject: [PATCH 152/178] docs(ci): Update protocol.md - 9edc3ea [skip ci] --- docs/generated/comments.json | 75 ++++++++++++++++++++++++++++++++++++ docs/generated/protocol.md | 28 ++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index cffcd1d5..d87fc089 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -4775,6 +4775,81 @@ "type": "class", "examples": [] }, + { + "subheads": [], + "description": "Create a source and add it as a sceneitem to a scene.", + "param": [ + "{String} `sourceName` Source name.", + "{String} `sourceKind` Source kind, Eg. `vlc_source`.", + "{String} `sceneName` Scene to add the new source to.", + "{Object (optional)} `sourceSettings` Source settings data.", + "{boolean (optional)} `setVisible` Set the created SceneItem as visible or not. Defaults to true" + ], + "return": "{int} `itemId` ID of the SceneItem in the scene.", + "api": "requests", + "name": "CreateSource", + "category": "sources", + "since": "unreleased", + "returns": [ + { + "type": "int", + "name": "itemId", + "description": "ID of the SceneItem in the scene." + } + ], + "params": [ + { + "type": "String", + "name": "sourceName", + "description": "Source name." + }, + { + "type": "String", + "name": "sourceKind", + "description": "Source kind, Eg. `vlc_source`." + }, + { + "type": "String", + "name": "sceneName", + "description": "Scene to add the new source to." + }, + { + "type": "Object (optional)", + "name": "sourceSettings", + "description": "Source settings data." + }, + { + "type": "boolean (optional)", + "name": "setVisible", + "description": "Set the created SceneItem as visible or not. Defaults to true" + } + ], + "names": [ + { + "name": "", + "description": "CreateSource" + } + ], + "categories": [ + { + "name": "", + "description": "sources" + } + ], + "sinces": [ + { + "name": "", + "description": "unreleased" + } + ], + "heading": { + "level": 2, + "text": "CreateSource" + }, + "lead": "", + "type": "class", + "examples": [] + }, { "subheads": [], "description": "List all sources available in the running OBS instance", diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 6ecdc51d..82296c31 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -151,6 +151,7 @@ You can also refer to any of the client libraries listed on the [README](README. + [GetMediaState](#getmediastate) * [Sources](#sources-1) + [GetMediaSourcesList](#getmediasourceslist) + + [CreateSource](#createsource) + [GetSourcesList](#getsourceslist) + [GetSourceTypesList](#getsourcetypeslist) + [GetVolume](#getvolume) @@ -1966,6 +1967,33 @@ _No specified parameters._ | `mediaSources.*.mediaState` | _String_ | The current state of media for that source. States: `none`, `playing`, `opening`, `buffering`, `paused`, `stopped`, `ended`, `error`, `unknown` | +--- + +### CreateSource + + +- Unreleased + +Create a source and add it as a sceneitem to a scene. + +**Request Fields:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `sourceName` | _String_ | Source name. | +| `sourceKind` | _String_ | Source kind, Eg. `vlc_source`. | +| `sceneName` | _String_ | Scene to add the new source to. | +| `sourceSettings` | _Object (optional)_ | Source settings data. | +| `setVisible` | _boolean (optional)_ | Set the created SceneItem as visible or not. Defaults to true | + + +**Response Items:** + +| Name | Type | Description | +| ---- | :---: | ------------| +| `itemId` | _int_ | ID of the SceneItem in the scene. | + + --- ### GetSourcesList From 9999b30d1aefbd7824b55601046ba0430ac51fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Sat, 28 Nov 2020 05:49:09 +0100 Subject: [PATCH 153/178] docs(scene items): fix documentation for GetSceneItemProperties Fixes #607 --- src/WSRequestHandler_SceneItems.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index b5334d89..659a8b9b 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -87,7 +87,7 @@ RpcResponse WSRequestHandler::GetSceneItemList(const RpcRequest& request) { * @return {int} `itemId` Scene Item ID. * @return {double} `position.x` The x position of the source from the left. * @return {double} `position.y` The y position of the source from the top. -* @return {int} `position.alignment` The point on the source that the item is manipulated from. +* @return {int} `position.alignment` The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis. * @return {double} `rotation` The clockwise rotation of the item in degrees around the point of alignment. * @return {double} `scale.x` The x-scale factor of the source. * @return {double} `scale.y` The y-scale factor of the source. @@ -106,7 +106,6 @@ RpcResponse WSRequestHandler::GetSceneItemList(const RpcRequest& request) { * @return {int} `sourceHeight` Base source (without scaling) of the source * @return {double} `width` Scene item width (base source width multiplied by the horizontal scaling factor) * @return {double} `height` Scene item height (base source height multiplied by the vertical scaling factor) -* @return {int} `alignment` The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis. * @return {String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group) * @return {Array (optional)} `groupChildren` List of children (if this item is a group) * From e794762f72def6df75a63481fa021c0bab58cbca Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Sat, 28 Nov 2020 04:50:08 +0000 Subject: [PATCH 154/178] docs(ci): Update protocol.md - 9999b30 [skip ci] --- docs/generated/comments.json | 10 ++-------- docs/generated/protocol.md | 3 +-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index d87fc089..a06b3cb8 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -8331,7 +8331,7 @@ "{int} `itemId` Scene Item ID.", "{double} `position.x` The x position of the source from the left.", "{double} `position.y` The y position of the source from the top.", - "{int} `position.alignment` The point on the source that the item is manipulated from.", + "{int} `position.alignment` The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis.", "{double} `rotation` The clockwise rotation of the item in degrees around the point of alignment.", "{double} `scale.x` The x-scale factor of the source.", "{double} `scale.y` The y-scale factor of the source.", @@ -8350,7 +8350,6 @@ "{int} `sourceHeight` Base source (without scaling) of the source", "{double} `width` Scene item width (base source width multiplied by the horizontal scaling factor)", "{double} `height` Scene item height (base source height multiplied by the vertical scaling factor)", - "{int} `alignment` The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis.", "{String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group)", "{Array (optional)} `groupChildren` List of children (if this item is a group)" ], @@ -8382,7 +8381,7 @@ { "type": "int", "name": "position.alignment", - "description": "The point on the source that the item is manipulated from." + "description": "The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis." }, { "type": "double", @@ -8474,11 +8473,6 @@ "name": "height", "description": "Scene item height (base source height multiplied by the vertical scaling factor)" }, - { - "type": "int", - "name": "alignment", - "description": "The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis." - }, { "type": "String (optional)", "name": "parentGroupName", diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 82296c31..2ace2cde 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -3357,7 +3357,7 @@ Coordinates are relative to the item's parent (the scene or group it belongs to) | `itemId` | _int_ | Scene Item ID. | | `position.x` | _double_ | The x position of the source from the left. | | `position.y` | _double_ | The y position of the source from the top. | -| `position.alignment` | _int_ | The point on the source that the item is manipulated from. | +| `position.alignment` | _int_ | The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis. | | `rotation` | _double_ | The clockwise rotation of the item in degrees around the point of alignment. | | `scale.x` | _double_ | The x-scale factor of the source. | | `scale.y` | _double_ | The y-scale factor of the source. | @@ -3376,7 +3376,6 @@ Coordinates are relative to the item's parent (the scene or group it belongs to) | `sourceHeight` | _int_ | Base source (without scaling) of the source | | `width` | _double_ | Scene item width (base source width multiplied by the horizontal scaling factor) | | `height` | _double_ | Scene item height (base source height multiplied by the vertical scaling factor) | -| `alignment` | _int_ | The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis. | | `parentGroupName` | _String (optional)_ | Name of the item's parent (if this item belongs to a group) | | `groupChildren` | _Array<SceneItemTransform> (optional)_ | List of children (if this item is a group) | From 96bd4141fdd4fc4e0c8d06f9c7174dc99a8f863e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Sun, 29 Nov 2020 12:22:21 +0100 Subject: [PATCH 155/178] events: add recordingFilename property to RecordingStarted, RecordingStopping and RecordingStopped --- src/Utils.cpp | 23 +++++++++++++++++++++++ src/Utils.h | 2 ++ src/WSEvents.cpp | 23 +++++++++++++++++++---- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index cd197519..5140a7ae 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -696,6 +696,29 @@ bool Utils::SetFilenameFormatting(const char* filenameFormatting) { return true; } +const char* Utils::GetCurrentRecordingFilename() +{ + OBSOutputAutoRelease recordingOutput = obs_frontend_get_recording_output(); + if (!recordingOutput) { + return nullptr; + } + + OBSDataAutoRelease settings = obs_output_get_settings(recordingOutput); + + // mimicks the behavior of BasicOutputHandler::GetRecordingFilename : + // try to fetch the path from the "url" property, then try "path" if the first one + // didn't yield any result + OBSDataItemAutoRelease item = obs_data_item_byname(settings, "url"); + if (!item) { + item = obs_data_item_byname(settings, "path"); + if (!item) { + return nullptr; + } + } + + return obs_data_item_get_string(item); +} + // Transform properties copy-pasted from WSRequestHandler_SceneItems.cpp because typedefs can't be extended yet /** diff --git a/src/Utils.h b/src/Utils.h index 0851a8ea..47a19f2d 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -85,6 +85,8 @@ namespace Utils { const char* GetFilenameFormatting(); bool SetFilenameFormatting(const char* filenameFormatting); + const char* GetCurrentRecordingFilename(); + QString nsToTimestamp(uint64_t ns); struct AddSourceData { obs_source_t *source; diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index ce27798d..80b565f7 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -678,7 +678,10 @@ void WSEvents::OnStreamStopped() { /** * A request to start recording has been issued. - * + * + * Note: `recordingFilename` is not provided in this event because this information + * is not available at the time this event is emitted. + * * @api events * @name RecordingStarting * @category recording @@ -691,37 +694,49 @@ void WSEvents::OnRecordingStarting() { /** * Recording started successfully. * + * @return {String} `recordingFilename` Absolute path to the file of the current recording. + * * @api events * @name RecordingStarted * @category recording * @since 0.3 */ void WSEvents::OnRecordingStarted() { - broadcastUpdate("RecordingStarted"); + OBSDataAutoRelease data = obs_data_create(); + obs_data_set_string(data, "recordingFilename", Utils::GetCurrentRecordingFilename()); + broadcastUpdate("RecordingStarted", data); } /** * A request to stop recording has been issued. * + * @return {String} `recordingFilename` Absolute path to the file of the current recording. + * * @api events * @name RecordingStopping * @category recording * @since 0.3 */ void WSEvents::OnRecordingStopping() { - broadcastUpdate("RecordingStopping"); + OBSDataAutoRelease data = obs_data_create(); + obs_data_set_string(data, "recordingFilename", Utils::GetCurrentRecordingFilename()); + broadcastUpdate("RecordingStopping", data); } /** * Recording stopped successfully. * + * @return {String} `recordingFilename` Absolute path to the file of the current recording. + * * @api events * @name RecordingStopped * @category recording * @since 0.3 */ void WSEvents::OnRecordingStopped() { - broadcastUpdate("RecordingStopped"); + OBSDataAutoRelease data = obs_data_create(); + obs_data_set_string(data, "recordingFilename", Utils::GetCurrentRecordingFilename()); + broadcastUpdate("RecordingStopped", data); } /** From a137ccd8ba2b396940a0066ffcb58b4fafbc35cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Sun, 29 Nov 2020 12:24:49 +0100 Subject: [PATCH 156/178] requests(GetRecordingStatus): add recordingFilename property --- src/WSRequestHandler_Recording.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/WSRequestHandler_Recording.cpp b/src/WSRequestHandler_Recording.cpp index 24aba87a..db0c529d 100644 --- a/src/WSRequestHandler_Recording.cpp +++ b/src/WSRequestHandler_Recording.cpp @@ -21,6 +21,7 @@ RpcResponse ifCanPause(const RpcRequest& request, std::function c * @return {boolean} `isRecording` Current recording status. * @return {boolean} `isRecordingPaused` Whether the recording is paused or not. * @return {String (optional)} `recordTimecode` Time elapsed since recording started (only present if currently recording). + * @return {String (optional)} `recordingFilename` Absolute path to the recording file (only present if currently recording). * * @api requests * @name GetRecordingStatus @@ -37,6 +38,7 @@ RpcResponse WSRequestHandler::GetRecordingStatus(const RpcRequest& request) { if (obs_frontend_recording_active()) { QString recordingTimecode = events->getRecordingTimecode(); obs_data_set_string(data, "recordTimecode", recordingTimecode.toUtf8().constData()); + obs_data_set_string(data, "recordingFilename", Utils::GetCurrentRecordingFilename()); } return request.success(data); From a93c4dfbbd106e3383373858191eec08a0016885 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Sun, 29 Nov 2020 11:40:39 +0000 Subject: [PATCH 157/178] docs(ci): Update protocol.md - aceb437 [skip ci] --- docs/generated/comments.json | 36 +++++++++++++++++++++++++++++++++--- docs/generated/protocol.md | 21 +++++++++++++++++---- 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index a06b3cb8..c432f672 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -1415,7 +1415,7 @@ "recording": [ { "subheads": [], - "description": "A request to start recording has been issued.", + "description": "\n\nNote: `recordingFilename` is not provided in this event because this information\nis not available at the time this event is emitted.", "api": "events", "name": "RecordingStarting", "category": "recording", @@ -1442,17 +1442,25 @@ "level": 2, "text": "RecordingStarting" }, - "lead": "", + "lead": "A request to start recording has been issued.", "type": "class", "examples": [] }, { "subheads": [], "description": "Recording started successfully.", + "return": "{String} `recordingFilename` Absolute path to the file of the current recording.", "api": "events", "name": "RecordingStarted", "category": "recording", "since": "0.3", + "returns": [ + { + "type": "String", + "name": "recordingFilename", + "description": "Absolute path to the file of the current recording." + } + ], "names": [ { "name": "", @@ -1482,10 +1490,18 @@ { "subheads": [], "description": "A request to stop recording has been issued.", + "return": "{String} `recordingFilename` Absolute path to the file of the current recording.", "api": "events", "name": "RecordingStopping", "category": "recording", "since": "0.3", + "returns": [ + { + "type": "String", + "name": "recordingFilename", + "description": "Absolute path to the file of the current recording." + } + ], "names": [ { "name": "", @@ -1515,10 +1531,18 @@ { "subheads": [], "description": "Recording stopped successfully.", + "return": "{String} `recordingFilename` Absolute path to the file of the current recording.", "api": "events", "name": "RecordingStopped", "category": "recording", "since": "0.3", + "returns": [ + { + "type": "String", + "name": "recordingFilename", + "description": "Absolute path to the file of the current recording." + } + ], "names": [ { "name": "", @@ -7630,7 +7654,8 @@ "return": [ "{boolean} `isRecording` Current recording status.", "{boolean} `isRecordingPaused` Whether the recording is paused or not.", - "{String (optional)} `recordTimecode` Time elapsed since recording started (only present if currently recording)." + "{String (optional)} `recordTimecode` Time elapsed since recording started (only present if currently recording).", + "{String (optional)} `recordingFilename` Absolute path to the recording file (only present if currently recording)." ], "api": "requests", "name": "GetRecordingStatus", @@ -7651,6 +7676,11 @@ "type": "String (optional)", "name": "recordTimecode", "description": "Time elapsed since recording started (only present if currently recording)." + }, + { + "type": "String (optional)", + "name": "recordingFilename", + "description": "Absolute path to the recording file (only present if currently recording)." } ], "names": [ diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 2ace2cde..6a1e542f 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -683,7 +683,10 @@ Emitted every 2 seconds when stream is active. - Added in v0.3 -A request to start recording has been issued. + + +Note: `recordingFilename` is not provided in this event because this information +is not available at the time this event is emitted. **Response Items:** @@ -700,7 +703,10 @@ Recording started successfully. **Response Items:** -_No additional response items._ +| Name | Type | Description | +| ---- | :---: | ------------| +| `recordingFilename` | _String_ | Absolute path to the file of the current recording. | + --- @@ -713,7 +719,10 @@ A request to stop recording has been issued. **Response Items:** -_No additional response items._ +| Name | Type | Description | +| ---- | :---: | ------------| +| `recordingFilename` | _String_ | Absolute path to the file of the current recording. | + --- @@ -726,7 +735,10 @@ Recording stopped successfully. **Response Items:** -_No additional response items._ +| Name | Type | Description | +| ---- | :---: | ------------| +| `recordingFilename` | _String_ | Absolute path to the file of the current recording. | + --- @@ -3004,6 +3016,7 @@ _No specified parameters._ | `isRecording` | _boolean_ | Current recording status. | | `isRecordingPaused` | _boolean_ | Whether the recording is paused or not. | | `recordTimecode` | _String (optional)_ | Time elapsed since recording started (only present if currently recording). | +| `recordingFilename` | _String (optional)_ | Absolute path to the recording file (only present if currently recording). | --- From c8f0d5a3e45a712d69e242e1b68ae62665ac5f92 Mon Sep 17 00:00:00 2001 From: Leandro Facchinetti Date: Wed, 16 Dec 2020 21:57:23 +0000 Subject: [PATCH 158/178] Add link to obs-cli --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 741ca5cf..d1c2ff9e 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Here's a list of available language APIs for obs-websocket : - Java 8+: [obs-websocket-java](https://github.com/Twasi/websocket-obs-java) by TwasiNET - Golang: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf - HTTP API: [obs-websocket-http](https://github.com/IRLToolkit/obs-websocket-http) by tt2468 +- CLI: [obs-cli](https://github.com/leafac/obs-cli) by leafac I'd like to know what you're building with or for obs-websocket. If you do something in this fashion, feel free to drop a message in `#project-showoff` in the [discord server!](https://discord.gg/WBaSQ3A) From 3dea5fd4f43c2b023d4038a4ea89936c9e5b6eac Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 19 Dec 2020 21:51:25 -0800 Subject: [PATCH 159/178] README: Add codefactor badge They give us an A and I think that's pretty cool so might as well display it --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d1c2ff9e..df8d28e8 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,10 @@ WebSockets API for OBS Studio. -[![Discord](https://img.shields.io/discord/715691013825364120.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/WBaSQ3A) [![Build Status](https://dev.azure.com/Palakis/obs-websocket/_apis/build/status/Palakis.obs-websocket?branchName=4.x-current)](https://dev.azure.com/Palakis/obs-websocket/_build/latest?definitionId=2&branchName=4.x-current) +[![CodeFactor](https://www.codefactor.io/repository/github/palakis/obs-websocket/badge)](https://www.codefactor.io/repository/github/palakis/obs-websocket) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social&label=Follow%20%40LePalakis)](https://twitter.com/LePalakis) +[![Discord](https://img.shields.io/discord/715691013825364120.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/WBaSQ3A) ## Downloads From adc46a80f9811e6adadc940d1b242372fa48e0cd Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Wed, 9 Dec 2020 21:43:41 +0900 Subject: [PATCH 160/178] Requests: SetVolume: allow volumes > 1.0 Allow volumes > 1.0 / > 0dB, which is legal in OBS (you can do this in Advanced Audio Properties). OBS allows up to +26dB gain, so we do the same. This corresponds to approximately 20x linear gain (actually 19.9526231497, but 20 is easier to explain and OBS doesn't care). --- src/WSRequestHandler_Sources.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 9aa5c260..94e9a06c 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -231,7 +231,7 @@ RpcResponse WSRequestHandler::GetSourceTypesList(const RpcRequest& request) * @param {boolean (optional)} `useDecibel` Output volume in decibels of attenuation instead of amplitude/mul. * * @return {String} `name` Source name. -* @return {double} `volume` Volume of the source. Between `0.0` and `1.0` if using mul, under `0.0` if using dB (since it is attenuating). +* @return {double} `volume` Volume of the source. Between `0.0` and `20.0` if using mul, under `26.0` if using dB. * @return {boolean} `muted` Indicates whether the source is muted. * * @api requests @@ -277,7 +277,7 @@ RpcResponse WSRequestHandler::GetVolume(const RpcRequest& request) * Set the volume of the specified source. Default request format uses mul, NOT SLIDER PERCENTAGE. * * @param {String} `source` Source name. -* @param {double} `volume` Desired volume. Must be between `0.0` and `1.0` for mul, and under 0.0 for dB. Note: OBS will interpret dB values under -100.0 as Inf. +* @param {double} `volume` Desired volume. Must be between `0.0` and `20.0` for mul, and under 26.0 for dB. OBS will interpret dB values under -100.0 as Inf. Note: The OBS volume sliders only reach a maximum of 1.0mul/0.0dB, however OBS actually supports larger values. * @param {boolean (optional)} `useDecibel` Interperet `volume` data as decibels instead of amplitude/mul. * * @api requests @@ -296,8 +296,8 @@ RpcResponse WSRequestHandler::SetVolume(const RpcRequest& request) QString sourceName = obs_data_get_string(request.parameters(), "source"); float sourceVolume = obs_data_get_double(request.parameters(), "volume"); - bool isNotValidDecibel = (useDecibel && sourceVolume > 0.0); - bool isNotValidMul = (!useDecibel && (sourceVolume < 0.0 || sourceVolume > 1.0)); + bool isNotValidDecibel = (useDecibel && sourceVolume > 26.0); + bool isNotValidMul = (!useDecibel && (sourceVolume < 0.0 || sourceVolume > 20.0)); if (sourceName.isEmpty() || isNotValidDecibel || isNotValidMul) { return request.failed("invalid request parameters"); } From d77e4ab10d42e4b4ca137a5e0f2e6568d73746a6 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Sun, 20 Dec 2020 06:20:47 +0000 Subject: [PATCH 161/178] docs(ci): Update protocol.md - 8a8ea92 [skip ci] --- docs/generated/comments.json | 8 ++++---- docs/generated/protocol.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index c432f672..cc02464d 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -5059,7 +5059,7 @@ ], "return": [ "{String} `name` Source name.", - "{double} `volume` Volume of the source. Between `0.0` and `1.0` if using mul, under `0.0` if using dB (since it is attenuating).", + "{double} `volume` Volume of the source. Between `0.0` and `20.0` if using mul, under `26.0` if using dB.", "{boolean} `muted` Indicates whether the source is muted." ], "api": "requests", @@ -5075,7 +5075,7 @@ { "type": "double", "name": "volume", - "description": "Volume of the source. Between `0.0` and `1.0` if using mul, under `0.0` if using dB (since it is attenuating)." + "description": "Volume of the source. Between `0.0` and `20.0` if using mul, under `26.0` if using dB." }, { "type": "boolean", @@ -5126,7 +5126,7 @@ "description": "Set the volume of the specified source. Default request format uses mul, NOT SLIDER PERCENTAGE.", "param": [ "{String} `source` Source name.", - "{double} `volume` Desired volume. Must be between `0.0` and `1.0` for mul, and under 0.0 for dB. Note: OBS will interpret dB values under -100.0 as Inf.", + "{double} `volume` Desired volume. Must be between `0.0` and `20.0` for mul, and under 26.0 for dB. OBS will interpret dB values under -100.0 as Inf. Note: The OBS volume sliders only reach a maximum of 1.0mul/0.0dB, however OBS actually supports larger values.", "{boolean (optional)} `useDecibel` Interperet `volume` data as decibels instead of amplitude/mul." ], "api": "requests", @@ -5142,7 +5142,7 @@ { "type": "double", "name": "volume", - "description": "Desired volume. Must be between `0.0` and `1.0` for mul, and under 0.0 for dB. Note: OBS will interpret dB values under -100.0 as Inf." + "description": "Desired volume. Must be between `0.0` and `20.0` for mul, and under 26.0 for dB. OBS will interpret dB values under -100.0 as Inf. Note: The OBS volume sliders only reach a maximum of 1.0mul/0.0dB, however OBS actually supports larger values." }, { "type": "boolean (optional)", diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 6a1e542f..9d9bd8a7 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -2083,7 +2083,7 @@ Get the volume of the specified source. Default response uses mul format, NOT SL | Name | Type | Description | | ---- | :---: | ------------| | `name` | _String_ | Source name. | -| `volume` | _double_ | Volume of the source. Between `0.0` and `1.0` if using mul, under `0.0` if using dB (since it is attenuating). | +| `volume` | _double_ | Volume of the source. Between `0.0` and `20.0` if using mul, under `26.0` if using dB. | | `muted` | _boolean_ | Indicates whether the source is muted. | @@ -2101,7 +2101,7 @@ Set the volume of the specified source. Default request format uses mul, NOT SLI | Name | Type | Description | | ---- | :---: | ------------| | `source` | _String_ | Source name. | -| `volume` | _double_ | Desired volume. Must be between `0.0` and `1.0` for mul, and under 0.0 for dB. Note: OBS will interpret dB values under -100.0 as Inf. | +| `volume` | _double_ | Desired volume. Must be between `0.0` and `20.0` for mul, and under 26.0 for dB. OBS will interpret dB values under -100.0 as Inf. Note: The OBS volume sliders only reach a maximum of 1.0mul/0.0dB, however OBS actually supports larger values. | | `useDecibel` | _boolean (optional)_ | Interperet `volume` data as decibels instead of amplitude/mul. | From 501e0f63f588e67dec5d818a7b7777e3f0f2787d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Mon, 7 Dec 2020 10:50:13 +0100 Subject: [PATCH 162/178] ci(linux): fix deb package file permissions --- CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 261d8c78..6b6f2550 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,12 +192,17 @@ if(UNIX AND NOT APPLE) file(GLOB locale_files data/locale/*.ini) + set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + if(${USE_UBUNTU_FIX}) - install(TARGETS obs-websocket - LIBRARY DESTINATION "/usr/lib/obs-plugins") + install(TARGETS obs-websocket LIBRARY + DESTINATION "/usr/lib/obs-plugins" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) endif() - install(TARGETS obs-websocket - LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins") + install(TARGETS obs-websocket LIBRARY + DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins" + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) install(FILES ${locale_files} DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/obs/obs-plugins/obs-websocket/locale") From 31c717eb400fcf36980280bedee75e1078516639 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sun, 20 Dec 2020 00:26:35 -0800 Subject: [PATCH 163/178] Docs: Add recording-paused to documentation [skip ci] It wasn't included for some reason. --- src/WSRequestHandler_Streaming.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/WSRequestHandler_Streaming.cpp b/src/WSRequestHandler_Streaming.cpp index aa0782c9..a77cffd1 100644 --- a/src/WSRequestHandler_Streaming.cpp +++ b/src/WSRequestHandler_Streaming.cpp @@ -11,9 +11,10 @@ * * @return {boolean} `streaming` Current streaming status. * @return {boolean} `recording` Current recording status. + * @return {boolean} `recording-paused` If recording is paused. + * @return {boolean} `preview-only` Always false. Retrocompatibility with OBSRemote. * @return {String (optional)} `stream-timecode` Time elapsed since streaming started (only present if currently streaming). * @return {String (optional)} `rec-timecode` Time elapsed since recording started (only present if currently recording). - * @return {boolean} `preview-only` Always false. Retrocompatibility with OBSRemote. * * @api requests * @name GetStreamingStatus From ba143f2636b0d17e6e83090acbcd85664dfd8dfe Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 19 Dec 2020 23:54:07 -0800 Subject: [PATCH 164/178] Translations: Update translations with latest from crowdin --- data/locale/ar-SA.ini | 1 + data/locale/de-DE.ini | 4 +++- data/locale/es-ES.ini | 6 +++++- data/locale/fr-FR.ini | 2 +- data/locale/hi-IN.ini | 1 + data/locale/it-IT.ini | 8 +++++++- data/locale/ja-JP.ini | 5 +++++ data/locale/ko-KR.ini | 18 ++++++++++++++++++ data/locale/nl-NL.ini | 9 +++++++++ data/locale/pl-PL.ini | 6 +++++- data/locale/pt-PT.ini | 8 +++++++- data/locale/ru-RU.ini | 5 ++++- data/locale/zh-CN.ini | 6 +++++- data/locale/zh-TW.ini | 2 +- 14 files changed, 72 insertions(+), 9 deletions(-) diff --git a/data/locale/ar-SA.ini b/data/locale/ar-SA.ini index e69de29b..8b137891 100644 --- a/data/locale/ar-SA.ini +++ b/data/locale/ar-SA.ini @@ -0,0 +1 @@ + diff --git a/data/locale/de-DE.ini b/data/locale/de-DE.ini index 3cd6e23b..d2f5efc9 100644 --- a/data/locale/de-DE.ini +++ b/data/locale/de-DE.ini @@ -3,6 +3,7 @@ OBSWebsocket.Settings.ServerEnable="WebSockets-Server aktivieren" OBSWebsocket.Settings.ServerPort="Server-Port" OBSWebsocket.Settings.AuthRequired="Authentifizierung aktivieren" OBSWebsocket.Settings.Password="Passwort" +OBSWebsocket.Settings.LockToIPv4="Nur IPv4 verwenden (deaktiviert IPv6)" OBSWebsocket.Settings.DebugEnable="Debug-Protokollierung aktivieren" OBSWebsocket.Settings.AlertsEnable="Infobereichbenachrichtigungen aktivieren" OBSWebsocket.NotifyConnect.Title="Neue Websocket-Verbindung" @@ -10,7 +11,8 @@ OBSWebsocket.NotifyConnect.Message="Client %1 verbunden" OBSWebsocket.NotifyDisconnect.Title="Websocket-Client getrennt" OBSWebsocket.NotifyDisconnect.Message="Client %1 getrennt" OBSWebsocket.Server.StartFailed.Title="Websocket-Serverfehler" -OBSWebsocket.Server.StartFailed.Message="Der WebSockets-Server konnte nicht gestartet werden, mögliche Gründe:\n - Der TCP-Port %1 wird möglicherweise gerade von einem anderen Programm verwendet. Versuchen Sie einen anderen Port in den Websocket-Servereinstellungen zu setzen oder alle Programme zu beenden, die den Port möglicherweise verwenden.\n - Ein unbekannter Netzwerkfehler ist aufgetreten. Versuchen Sie es mit anderen Einstellungen, einem OBS-Neustart oder einem Systemneustart erneut." +OBSWebsocket.Server.StartFailed.Message="Der WebSocket-Server konnte nicht gestartet werden, mögliche Gründe:\n - Der TCP-Port %1 wird möglicherweise gerade von einem anderen Programm verwendet. Versuchen Sie einen anderen Port in den Websocket-Servereinstellungen zu setzen oder alle Programme zu beenden, die den Port möglicherweise verwenden.\n - Fehler: %2" OBSWebsocket.ProfileChanged.Started="WebSockets-Server in diesem Profil aktiviert. Server gestartet." OBSWebsocket.ProfileChanged.Stopped="WebSockets-Server in diesem Profil deaktiviert. Server gestoppt." OBSWebsocket.ProfileChanged.Restarted="WebSockets-Server in diesem Profil geändert. Server startet neu." + diff --git a/data/locale/es-ES.ini b/data/locale/es-ES.ini index 511d2f91..7c82ef2b 100644 --- a/data/locale/es-ES.ini +++ b/data/locale/es-ES.ini @@ -1,3 +1,4 @@ +OBSWebsocket.Settings.DialogTitle="Configuración del servidor WebSocket" OBSWebsocket.Settings.ServerEnable="Habilitar el servidor WebSockets" OBSWebsocket.Settings.ServerPort="Puerto del Servidor" OBSWebsocket.Settings.AuthRequired="Habilitar autenticación" @@ -9,4 +10,7 @@ OBSWebsocket.NotifyConnect.Message="Cliente %1 conectado" OBSWebsocket.NotifyDisconnect.Title="Cliente WebSocket desconectado" OBSWebsocket.NotifyDisconnect.Message="Cliente %1 desconectado" OBSWebsocket.Server.StartFailed.Title="Falla en el servidor WebSockets" -OBSWebsocket.Server.StartFailed.Message="El servidor obs-websocket no se pudo iniciar, tal vez porque: \n - el puerto TCP %1 podría estar actualmente siendo usado este sistema, posiblemente por otra aplicación. Intente configurar un puerto TCP diferente en la configuración del servidor WebSocket, o detenga cualquier aplicación que pudiese estar utilizando este puerto \n - Un error de red desconocido ha afectado su sistema. Inténtelo de nuevo cambiando la configuración, reiniciando OBS o reiniciando su sistema." +OBSWebsocket.ProfileChanged.Started="El servidor WebSocket esta habilitado en este perfil. El servidor ha iniciado." +OBSWebsocket.ProfileChanged.Stopped="Servidor WebSockets deshabilitado en este perfil. Servidor detenido." +OBSWebsocket.ProfileChanged.Restarted="Puerto del servidor WebSockets cambiado en este perfil. Servidor reiniciado." + diff --git a/data/locale/fr-FR.ini b/data/locale/fr-FR.ini index b2ba9238..ed8fb085 100644 --- a/data/locale/fr-FR.ini +++ b/data/locale/fr-FR.ini @@ -10,7 +10,7 @@ OBSWebsocket.NotifyConnect.Message="Le client %1 s'est connecté" OBSWebsocket.NotifyDisconnect.Title="Déconnexion WebSocket" OBSWebsocket.NotifyDisconnect.Message="Le client %1 s'est déconnecté" OBSWebsocket.Server.StartFailed.Title="Impossible de démarrer le serveur WebSockets" -OBSWebsocket.Server.StartFailed.Message="Le serveur WebSockets n'a pas pu démarrer, peut-être parce que :\n - Le port TCP %1 est en cours d'utilisation sur ce système, certainement par un autre programme. Essayez un port différent dans les réglages du serveur WebSocket, ou arrêtez tout programme susceptible d'utiliser ce port.\n - Une erreur réseau inconnue est survenue. Essayez à nouveau en modifiant vos réglages, en redémarrant OBS ou en redémarrant votre ordinateur." OBSWebsocket.ProfileChanged.Started="Serveur WebSockets actif dans ce profil." OBSWebsocket.ProfileChanged.Stopped="Serveur WebSockets désactivé dans ce profil." OBSWebsocket.ProfileChanged.Restarted="Le port actuel diffère du port configuré dans ce profil. Serveur WebSockets redémarré." + diff --git a/data/locale/hi-IN.ini b/data/locale/hi-IN.ini index e69de29b..8b137891 100644 --- a/data/locale/hi-IN.ini +++ b/data/locale/hi-IN.ini @@ -0,0 +1 @@ + diff --git a/data/locale/it-IT.ini b/data/locale/it-IT.ini index df133462..4142ed47 100644 --- a/data/locale/it-IT.ini +++ b/data/locale/it-IT.ini @@ -1,7 +1,9 @@ +OBSWebsocket.Settings.DialogTitle="Impostazioni del server di WebSocket" OBSWebsocket.Settings.ServerEnable="Abilitare il server WebSockets" OBSWebsocket.Settings.ServerPort="Porta del server" OBSWebsocket.Settings.AuthRequired="Abilitare l'autenticazione" OBSWebsocket.Settings.Password="Password" +OBSWebsocket.Settings.LockToIPv4="Blocca il server per usare solo IPv4" OBSWebsocket.Settings.DebugEnable="Attivare la registrazione di debug" OBSWebsocket.Settings.AlertsEnable="Attivare gli avvisi di vassoio di sistema" OBSWebsocket.NotifyConnect.Title="Nuova connessione WebSocket" @@ -9,4 +11,8 @@ OBSWebsocket.NotifyConnect.Message="%1 cliente collegato" OBSWebsocket.NotifyDisconnect.Title="WebSocket cliente disconnesso" OBSWebsocket.NotifyDisconnect.Message="%1 cliente disconnesso" OBSWebsocket.Server.StartFailed.Title="Errore del WebSocket Server" -OBSWebsocket.Server.StartFailed.Message="Impossibile avviare, forse perché il server di WebSockets: \n - %1 porta TCP potrebbe essere attualmente in uso altrove su questo sistema, possibilmente da un'altra applicazione. Provare a impostare una porta TCP diversa nelle impostazioni del server di WebSockets, o arrestare tutte le applicazioni che potrebbero utilizzare questa porta. \n - è verificato un errore di rete sconosciuto sul sistema. Riprova modificando le impostazioni, riavviare OBS o riavvio del sistema." +OBSWebsocket.Server.StartFailed.Message="L'avvio del server WebSockets è fallito, forse perché:\n - La porta TCP %1 può attualmente essere in uso altrove su questo sistema, forse da un'altra applicazione. Provare a impostare una porta TCP diversa nelle impostazioni del server WebSocket o interrompere qualsiasi applicazione che potrebbe utilizzare questa porta.\n - Messaggio di errore: %2" +OBSWebsocket.ProfileChanged.Started="Server WebSockets abilitato in questo profilo. Il server è avviato." +OBSWebsocket.ProfileChanged.Stopped="Server WebSocket disabilitato in questo profilo. Server interrotto." +OBSWebsocket.ProfileChanged.Restarted="La porta del server WebSocket è stata modificata in questo profilo. Il server è stato riavviato." + diff --git a/data/locale/ja-JP.ini b/data/locale/ja-JP.ini index e80892a1..4218cdd7 100644 --- a/data/locale/ja-JP.ini +++ b/data/locale/ja-JP.ini @@ -1,3 +1,4 @@ +OBSWebsocket.Settings.DialogTitle="Websocket サーバー設定" OBSWebsocket.Settings.ServerEnable="WebSockets サーバーを有効にする" OBSWebsocket.Settings.ServerPort="サーバーポート" OBSWebsocket.Settings.AuthRequired="認証を有効にする" @@ -9,3 +10,7 @@ OBSWebsocket.NotifyConnect.Message="接続されているクライアント %1" OBSWebsocket.NotifyDisconnect.Title="WebSocket クライアントが切断されました" OBSWebsocket.NotifyDisconnect.Message="切断されたクライアント %1" OBSWebsocket.Server.StartFailed.Title="WebSockets サーバー障害" +OBSWebsocket.ProfileChanged.Started="このプロファイルでWebSocketサーバが有効になりました。サーバを起動しました。" +OBSWebsocket.ProfileChanged.Stopped="このプロファイルでWebSocketサーバが無効になりました。サーバを停止しました。" +OBSWebsocket.ProfileChanged.Restarted="このプロファイルでWebSocketサーバの通信ポートが変更されました。サーバを再起動しました。" + diff --git a/data/locale/ko-KR.ini b/data/locale/ko-KR.ini index e69de29b..0154da74 100644 --- a/data/locale/ko-KR.ini +++ b/data/locale/ko-KR.ini @@ -0,0 +1,18 @@ +OBSWebsocket.Settings.DialogTitle="웹소켓 서버 설정" +OBSWebsocket.Settings.ServerEnable="웹소켓 서버 활성화" +OBSWebsocket.Settings.ServerPort="서버 포트" +OBSWebsocket.Settings.AuthRequired="인증 활성화" +OBSWebsocket.Settings.Password="비밀번호" +OBSWebsocket.Settings.LockToIPv4="IPv4만 이용하여 서버를 연결" +OBSWebsocket.Settings.DebugEnable="디버그 로깅 활성화" +OBSWebsocket.Settings.AlertsEnable="시스템 트레이 알림 활성화" +OBSWebsocket.NotifyConnect.Title="새로운 웹소켓 연결" +OBSWebsocket.NotifyConnect.Message="클라이언트 %1 가 연결되었습니다" +OBSWebsocket.NotifyDisconnect.Title="웹소켓 클라이언트가 연결 해제되었습니다" +OBSWebsocket.NotifyDisconnect.Message="클라이언트 %1 가 연결이 해제되었습니다" +OBSWebsocket.Server.StartFailed.Title="웹소켓 서버 시작이 실패하였습니다" +OBSWebsocket.Server.StartFailed.Message="웹소켓 서버가 시작되지 못했습니다. \n 시스템 상의 다른 프로그램이 TCP 포트 %1을 사용 중인 것으로 보입니다. 다른 TCP 포트를 사용하거나, 해당 포트를 사용 중인 프로그램을 종료하고 다시 시도해주세요. \n 에러 메시지: %2" +OBSWebsocket.ProfileChanged.Started="프로파일 설정에 따라 웹소켓 서버가 활성화되었습니다. 서버가 시작되었습니다." +OBSWebsocket.ProfileChanged.Stopped="프로파일 설정에 따라 웹소켓 서버가 비활성화되었습니다. 서버가 중지되었습니다." +OBSWebsocket.ProfileChanged.Restarted="프로파일 설정에 따라 웹소켓 포트가 변경되었습니다. 서버가 재시작되었습니다." + diff --git a/data/locale/nl-NL.ini b/data/locale/nl-NL.ini index f3151408..29e72d61 100644 --- a/data/locale/nl-NL.ini +++ b/data/locale/nl-NL.ini @@ -1,4 +1,9 @@ +OBSWebsocket.Settings.DialogTitle="WebSockets Server Instellingen" +OBSWebsocket.Settings.ServerEnable="WebSockets server inschakelen" OBSWebsocket.Settings.ServerPort="Serverpoort" +OBSWebsocket.Settings.AuthRequired="Verificatie inschakelen" +OBSWebsocket.Settings.Password="Wachtwoord" +OBSWebsocket.Settings.LockToIPv4="Server vergrendelen om alleen IPv4 te gebruiken" OBSWebsocket.Settings.DebugEnable="Activeer debug logs" OBSWebsocket.Settings.AlertsEnable="Systemvak waarschuwingen inschakelen" OBSWebsocket.NotifyConnect.Title="Nieuwe WebSocket verbinding" @@ -7,3 +12,7 @@ OBSWebsocket.NotifyDisconnect.Title="WebSocket client connectie verbroken" OBSWebsocket.NotifyDisconnect.Message="Client %1 losgekoppeld" OBSWebsocket.Server.StartFailed.Title="Fout in WebSocket server" OBSWebsocket.Server.StartFailed.Message="De obs-websocket server kan niet worden gestart, misschien omdat: \n - TCP-poort %1 momenteel elders wordt gebruikt op dit systeem, eventueel door een andere toepassing. Probeer een andere TCP-poort in te stellen in de WebSocket Server-instellingen of stop elke toepassing die deze poort zou kunnen gebruiken.\n Een onbekende Netwerkfout op uw systeem. Probeer het opnieuw door de instellingen te wijzigen, OBS te herstarten of uw systeem te herstarten." +OBSWebsocket.ProfileChanged.Started="WebSockets server ingeschakeld in dit profiel. Server gestart." +OBSWebsocket.ProfileChanged.Stopped="WebSockets server uitgeschakeld in dit profiel. Server is gestopt." +OBSWebsocket.ProfileChanged.Restarted="WebSockets server poort is veranderd in dit profiel. Server is herstart." + diff --git a/data/locale/pl-PL.ini b/data/locale/pl-PL.ini index 984b630d..d83c3cea 100644 --- a/data/locale/pl-PL.ini +++ b/data/locale/pl-PL.ini @@ -1,5 +1,8 @@ +OBSWebsocket.Settings.DialogTitle="Ustawienia serwera WebSockets" OBSWebsocket.Settings.ServerEnable="Włącz serwer WebSockets" +OBSWebsocket.Settings.ServerPort="Port serwera" OBSWebsocket.Settings.AuthRequired="Wymagaj uwierzytelniania" +OBSWebsocket.Settings.Password="Hasło" OBSWebsocket.Settings.DebugEnable="Włącz rejestrowanie debugowania" OBSWebsocket.Settings.AlertsEnable="Włącz powiadomienia w zasobniku systemowym" OBSWebsocket.NotifyConnect.Title="Nowe połączenie WebSocket" @@ -7,4 +10,5 @@ OBSWebsocket.NotifyConnect.Message="Klient %1 połączony" OBSWebsocket.NotifyDisconnect.Title="Klient WebSocket odłączony" OBSWebsocket.NotifyDisconnect.Message="Klient %1 rozłączony" OBSWebsocket.Server.StartFailed.Title="Awaria serwera WebSockets" -OBSWebsocket.Server.StartFailed.Message="Nie udało się uruchomić serwera WebSockets, może a powodu: \n - TCP port %1 może być obecnie używany gdzie indziej w tym systemie, możliwie przez inną aplikację. Spróbuj ustawić inny port TCP w ustawieniach serwera WebSockets, lub zatrzymać dowolną aplikację, która może używać tego portu \n -nieznany błąd sieci wydarzył się w systemie. Spróbuj ponownie, zmieniając ustawienia, ponownie uruchamiając OBS lub ponownie uruchamiając system." +OBSWebsocket.ProfileChanged.Started="Serwer WebSockets włączony w tym profilu. Serwer uruchomiony." + diff --git a/data/locale/pt-PT.ini b/data/locale/pt-PT.ini index 211d8547..99de1931 100644 --- a/data/locale/pt-PT.ini +++ b/data/locale/pt-PT.ini @@ -1,7 +1,9 @@ +OBSWebsocket.Settings.DialogTitle="Configurações do servidor de WebSockets" OBSWebsocket.Settings.ServerEnable="Habilitar servidor de WebSockets" OBSWebsocket.Settings.ServerPort="Porta do Servidor" OBSWebsocket.Settings.AuthRequired="Activar autenticação" OBSWebsocket.Settings.Password="Palavra passe" +OBSWebsocket.Settings.LockToIPv4="Forçar apenas o uso de IPv4 (desabilitar IPv6)" OBSWebsocket.Settings.DebugEnable="Habilitar registro de debug" OBSWebsocket.Settings.AlertsEnable="Ativar Alertas da bandeja do sistema" OBSWebsocket.NotifyConnect.Title="Nova conexão WebSocket" @@ -9,4 +11,8 @@ OBSWebsocket.NotifyConnect.Message="Cliente %1 conectado" OBSWebsocket.NotifyDisconnect.Title="WebSocket cliente desconectado" OBSWebsocket.NotifyDisconnect.Message="Cliente %1 desconectado" OBSWebsocket.Server.StartFailed.Title="Falha do servidor de WebSocket" -OBSWebsocket.Server.StartFailed.Message="O servidor de WebSockets falhou ao iniciar, talvez porque: \n - TCP port %1 pode estar atualmente em uso em outro lugar sobre este sistema, possivelmente por outro aplicativo. Tente definir uma porta TCP diferente nas configurações do servidor de WebSockets, ou parar qualquer aplicativo que poderia estar usando este porto \n - um erro de rede desconhecido aconteceu no seu sistema. Tente novamente alterar configurações, reiniciando OBS ou reiniciando o sistema." +OBSWebsocket.Server.StartFailed.Message="O servidor de WebSockets falhou ao iniciar, possivelmente porque:\n - A porta TCP %1 pode já estar em uso em algum outro lugar neste sistema, possivelmente por outro aplicativo. Tente definir uma porta TCP diferente nas configurações do servidor de WebSockets, ou pare qualquer aplicativo que possa estar usando essa porta.\n - Mensagem de erro: %2" +OBSWebsocket.ProfileChanged.Started="Servidor de WebSockets habilitado nesse perfil. Servidor iniciado." +OBSWebsocket.ProfileChanged.Stopped="Servidor de WebSockets desabilitado nesse perfil. Servidor parado." +OBSWebsocket.ProfileChanged.Restarted="Porta do servidor de WebSockets foi alterada neste perfil. Servidor reiniciado." + diff --git a/data/locale/ru-RU.ini b/data/locale/ru-RU.ini index 782f33c0..d4893ff2 100644 --- a/data/locale/ru-RU.ini +++ b/data/locale/ru-RU.ini @@ -10,4 +10,7 @@ OBSWebsocket.NotifyConnect.Message="Клиент %1 подключен" OBSWebsocket.NotifyDisconnect.Title="Клиент WebSocket отключён" OBSWebsocket.NotifyDisconnect.Message="Клиент %1 отключен" OBSWebsocket.Server.StartFailed.Title="Сбой сервера WebSockets" -OBSWebsocket.Server.StartFailed.Message="Ошибка запуска сервера WebSockets. Вероятные причины:\n - Возможно, TCP-порт %1 занят другим приложением в системе. Попробуйте задать другой TCP-порт в настройках сервера WebSockets или закройте приложение, которое может использовать данный порт.\n - Произошла неизвестная сетевая ошибка в системе. Попробуйте снова после изменения настроек, перезапуска OBS или системы." +OBSWebsocket.ProfileChanged.Started="Сервер WebSockets включен в этом профиле. Сервер запущен." +OBSWebsocket.ProfileChanged.Stopped="Сервер WebSockets отключен в этом профиле. Сервер остановлен." +OBSWebsocket.ProfileChanged.Restarted="Порт сервера WebSockets изменен в этом профиле. Сервер перезапущен." + diff --git a/data/locale/zh-CN.ini b/data/locale/zh-CN.ini index a40d3432..cab511cc 100644 --- a/data/locale/zh-CN.ini +++ b/data/locale/zh-CN.ini @@ -1,3 +1,4 @@ +OBSWebsocket.Settings.DialogTitle="WebSockets 服务器设置" OBSWebsocket.Settings.ServerEnable="启用 WebSockets 服务器" OBSWebsocket.Settings.ServerPort="服务器端口" OBSWebsocket.Settings.AuthRequired="启用身份验证" @@ -9,4 +10,7 @@ OBSWebsocket.NotifyConnect.Message="客户端 %1 已连接" OBSWebsocket.NotifyDisconnect.Title="WebSocket 客户端已断开" OBSWebsocket.NotifyDisconnect.Message="客户端 %1 已断开连接" OBSWebsocket.Server.StartFailed.Title="WebSockets 服务器错误" -OBSWebsocket.Server.StartFailed.Message="WebSockets 服务器启动失败,可能是因为:\n - TCP 端口 %1 可能被本机的另一个应用程序占用。尝试在 WebSockets 服务器设置中设置不同的 TCP 端口,或关闭任何可能使用此端口的应用程序。\n - 在您的系统上发生了未知的网络错误。请尝试更改设置、重新启动 OBS 或重新启动系统。" +OBSWebsocket.ProfileChanged.Started="此配置文件中启用了 WebSockets 服务器。服务器已启动。" +OBSWebsocket.ProfileChanged.Stopped="此配置文件中禁用了 WebSockets 服务器。服务器已停止。" +OBSWebsocket.ProfileChanged.Restarted="此配置文件中的 WebSockets 服务器端口已更改。服务器已重新启动。" + diff --git a/data/locale/zh-TW.ini b/data/locale/zh-TW.ini index e72077df..41cc0591 100644 --- a/data/locale/zh-TW.ini +++ b/data/locale/zh-TW.ini @@ -6,4 +6,4 @@ OBSWebsocket.NotifyConnect.Message="客戶端 %1 已連線" OBSWebsocket.NotifyDisconnect.Title="WebSocket 客戶端已離線" OBSWebsocket.NotifyDisconnect.Message="客戶端 %1 已離線" OBSWebsocket.Server.StartFailed.Title="WebSocket 伺服器錯誤" -OBSWebsocket.Server.StartFailed.Message="WebSockets 伺服器啟動失敗,可能的原因有:\n - TCP 連接埠 %1 被系統的其他程式所使用,試著為 WebSockets 伺服器指定不同的 TCP 連接埠,或是關閉任何可能使用此連接埠的程式。\n - 發生的未知的網路錯誤,試著更改設定、重新啟動 OBS 或是重新啟動您的系統。" + From 229641aba06a148d00dd6f33cdf6e11591e7e2e7 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 24 Dec 2020 13:38:58 -0800 Subject: [PATCH 165/178] Requests: Fix wrong docs version for CreateScene --- src/WSRequestHandler_Scenes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WSRequestHandler_Scenes.cpp b/src/WSRequestHandler_Scenes.cpp index 9c317cdf..70734c1a 100644 --- a/src/WSRequestHandler_Scenes.cpp +++ b/src/WSRequestHandler_Scenes.cpp @@ -87,7 +87,7 @@ RpcResponse WSRequestHandler::GetSceneList(const RpcRequest& request) { * @api requests * @name CreateScene * @category scenes - * @since 4.8.0 + * @since unreleased */ RpcResponse WSRequestHandler::CreateScene(const RpcRequest& request) { if (!request.hasField("sceneName")) { From 9275f7c2a98a9b93b586c80098503060e8c32048 Mon Sep 17 00:00:00 2001 From: Eric Lindvall Date: Tue, 29 Dec 2020 11:27:51 -0800 Subject: [PATCH 166/178] Server: Stop WSServer on OBS exit This should fix issues with race conditions and crashes on OBS exit. --- src/WSEvents.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 80b565f7..38660b24 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -233,6 +233,7 @@ void WSEvents::FrontendEventHandler(enum obs_frontend_event event, void* private case OBS_FRONTEND_EVENT_EXIT: owner->unhookTransitionPlaybackEvents(); owner->OnExit(); + owner->_srv->stop(); break; } } From 2735f8063711862d457a4c73e90aa894212ca5a6 Mon Sep 17 00:00:00 2001 From: Dominik Nakamura Date: Thu, 7 Jan 2021 21:49:41 +0900 Subject: [PATCH 167/178] readme: Add Homebrew installation instructions Give a short hint that the project can be installed with Homebrew on MacOS as alternative to installing manually. --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index df8d28e8..2fdb7321 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,14 @@ WebSockets API for OBS Studio. Binaries for Windows, MacOS, and Linux are available in the [Releases](https://github.com/Palakis/obs-websocket/releases) section. +### Homebrew + +If you're using MacOS you can use Homebrew for installation as well: + +```sh +brew install obs-websocket +``` + ## Using obs-websocket Here is a list of available web clients: (compatible with tablets and other touch interfaces) @@ -40,7 +48,7 @@ Here's a list of available language APIs for obs-websocket : - C#/VB.NET: [obs-websocket-dotnet](https://github.com/Palakis/obs-websocket-dotnet) - Python 2 and 3: [obs-websocket-py](https://github.com/Elektordi/obs-websocket-py) by Guillaume Genty a.k.a Elektordi - Python 3.5+ with asyncio: [obs-ws-rc](https://github.com/KirillMysnik/obs-ws-rc) by Kirill Mysnik -- Python 3.6+ with asyncio: [simpleobsws](https://github.com/IRLToolkit/simpleobsws) by tt2468 +- Python 3.6+ with asyncio: [simpleobsws](https://github.com/IRLToolkit/simpleobsws) by tt2468 - Java 8+: [obs-websocket-java](https://github.com/Twasi/websocket-obs-java) by TwasiNET - Golang: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf - HTTP API: [obs-websocket-http](https://github.com/IRLToolkit/obs-websocket-http) by tt2468 @@ -80,12 +88,12 @@ These supporters have contributed financially to the project and made possible t --- -[Support Class](http://supportclass.net) designs and develops professional livestreams, with services ranging from broadcast graphics design and integration to event organization, along many other skills. +[Support Class](http://supportclass.net) designs and develops professional livestreams, with services ranging from broadcast graphics design and integration to event organization, along many other skills. [![Support Class](.github/images/supportclass_logo_blacktext.png)](http://supportclass.net) --- -[MediaUnit](http://www.mediaunit.no) is a Norwegian media company developing products and services for the media industry, primarly focused on web and events. +[MediaUnit](http://www.mediaunit.no) is a Norwegian media company developing products and services for the media industry, primarly focused on web and events. [![MediaUnit](.github/images/mediaunit_logo_black.png)](http://www.mediaunit.no/) From 3d704702baa7ab0e817d599e70034c93fb6f2c10 Mon Sep 17 00:00:00 2001 From: Dominik Nakamura Date: Thu, 7 Jan 2021 21:58:29 +0900 Subject: [PATCH 168/178] readme: Add Rust client library I created a client library in Rust to remote control OBS with obs-websocket. Adding my library to the list of available language APIs. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index df8d28e8..591f2013 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Here's a list of available language APIs for obs-websocket : - Golang: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf - HTTP API: [obs-websocket-http](https://github.com/IRLToolkit/obs-websocket-http) by tt2468 - CLI: [obs-cli](https://github.com/leafac/obs-cli) by leafac +- Rust: [obws](https://github.com/dnaka91/obws) by dnaka91 I'd like to know what you're building with or for obs-websocket. If you do something in this fashion, feel free to drop a message in `#project-showoff` in the [discord server!](https://discord.gg/WBaSQ3A) From 7e0874abb4d81253e870ad91f975c23b202ce8c3 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 24 Dec 2020 13:32:32 -0800 Subject: [PATCH 169/178] Translations: Remove dutch StartFailed message and update other translations For some reason crowdin included it even though it is not approved. The current unapproved translation uses the old string. --- data/locale/pl-PL.ini | 1 + data/locale/ru-RU.ini | 2 ++ 2 files changed, 3 insertions(+) diff --git a/data/locale/pl-PL.ini b/data/locale/pl-PL.ini index d83c3cea..8b434cda 100644 --- a/data/locale/pl-PL.ini +++ b/data/locale/pl-PL.ini @@ -3,6 +3,7 @@ OBSWebsocket.Settings.ServerEnable="Włącz serwer WebSockets" OBSWebsocket.Settings.ServerPort="Port serwera" OBSWebsocket.Settings.AuthRequired="Wymagaj uwierzytelniania" OBSWebsocket.Settings.Password="Hasło" +OBSWebsocket.Settings.LockToIPv4="Zablokuj serwer tylko za pomocą IPv4" OBSWebsocket.Settings.DebugEnable="Włącz rejestrowanie debugowania" OBSWebsocket.Settings.AlertsEnable="Włącz powiadomienia w zasobniku systemowym" OBSWebsocket.NotifyConnect.Title="Nowe połączenie WebSocket" diff --git a/data/locale/ru-RU.ini b/data/locale/ru-RU.ini index d4893ff2..efbf1f46 100644 --- a/data/locale/ru-RU.ini +++ b/data/locale/ru-RU.ini @@ -3,6 +3,7 @@ OBSWebsocket.Settings.ServerEnable="Включить сервер WebSockets" OBSWebsocket.Settings.ServerPort="Порт сервера" OBSWebsocket.Settings.AuthRequired="Включить авторизацию" OBSWebsocket.Settings.Password="Пароль" +OBSWebsocket.Settings.LockToIPv4="Блокировка сервера только с использованием IPv4" OBSWebsocket.Settings.DebugEnable="Включить ведение журнала отладки" OBSWebsocket.Settings.AlertsEnable="Включить оповещения в системном трее" OBSWebsocket.NotifyConnect.Title="Новое соединение WebSocket" @@ -10,6 +11,7 @@ OBSWebsocket.NotifyConnect.Message="Клиент %1 подключен" OBSWebsocket.NotifyDisconnect.Title="Клиент WebSocket отключён" OBSWebsocket.NotifyDisconnect.Message="Клиент %1 отключен" OBSWebsocket.Server.StartFailed.Title="Сбой сервера WebSockets" +OBSWebsocket.Server.StartFailed.Message="Сервер WebSockets не запустился, возможно, потому, что:\n-TCP-порт %1 в настоящее время может использоваться в другом месте этой системы, возможно, другим приложением. Попробуйте установить другой TCP-порт в настройках сервера WebSocket или остановить любое приложение, которое может использовать этот порт.\n-сообщение об ошибке: %2" OBSWebsocket.ProfileChanged.Started="Сервер WebSockets включен в этом профиле. Сервер запущен." OBSWebsocket.ProfileChanged.Stopped="Сервер WebSockets отключен в этом профиле. Сервер остановлен." OBSWebsocket.ProfileChanged.Restarted="Порт сервера WebSockets изменен в этом профиле. Сервер перезапущен." From bc436e9ec4a1fb25ccaca0152162566218f1ccc3 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Fri, 8 Jan 2021 04:58:07 -0800 Subject: [PATCH 170/178] Reorder library list --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 591f2013..308e1f15 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,9 @@ Here's a list of available language APIs for obs-websocket : - Python 3.6+ with asyncio: [simpleobsws](https://github.com/IRLToolkit/simpleobsws) by tt2468 - Java 8+: [obs-websocket-java](https://github.com/Twasi/websocket-obs-java) by TwasiNET - Golang: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf +- Rust: [obws](https://github.com/dnaka91/obws) by dnaka91 - HTTP API: [obs-websocket-http](https://github.com/IRLToolkit/obs-websocket-http) by tt2468 - CLI: [obs-cli](https://github.com/leafac/obs-cli) by leafac -- Rust: [obws](https://github.com/dnaka91/obws) by dnaka91 I'd like to know what you're building with or for obs-websocket. If you do something in this fashion, feel free to drop a message in `#project-showoff` in the [discord server!](https://discord.gg/WBaSQ3A) From 77f38bbf63c0550823514349630ce0db12335d87 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Mon, 18 Jan 2021 10:52:53 +0000 Subject: [PATCH 171/178] docs(ci): Update protocol.md - 853eeb2 [skip ci] --- docs/generated/comments.json | 20 +++++++++++++------- docs/generated/protocol.md | 3 ++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index cc02464d..34d49864 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -9680,9 +9680,10 @@ "return": [ "{boolean} `streaming` Current streaming status.", "{boolean} `recording` Current recording status.", + "{boolean} `recording-paused` If recording is paused.", + "{boolean} `preview-only` Always false. Retrocompatibility with OBSRemote.", "{String (optional)} `stream-timecode` Time elapsed since streaming started (only present if currently streaming).", - "{String (optional)} `rec-timecode` Time elapsed since recording started (only present if currently recording).", - "{boolean} `preview-only` Always false. Retrocompatibility with OBSRemote." + "{String (optional)} `rec-timecode` Time elapsed since recording started (only present if currently recording)." ], "api": "requests", "name": "GetStreamingStatus", @@ -9699,6 +9700,16 @@ "name": "recording", "description": "Current recording status." }, + { + "type": "boolean", + "name": "recording-paused", + "description": "If recording is paused." + }, + { + "type": "boolean", + "name": "preview-only", + "description": "Always false. Retrocompatibility with OBSRemote." + }, { "type": "String (optional)", "name": "stream-timecode", @@ -9708,11 +9719,6 @@ "type": "String (optional)", "name": "rec-timecode", "description": "Time elapsed since recording started (only present if currently recording)." - }, - { - "type": "boolean", - "name": "preview-only", - "description": "Always false. Retrocompatibility with OBSRemote." } ], "names": [ diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 9d9bd8a7..13e6b39a 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -3825,9 +3825,10 @@ _No specified parameters._ | ---- | :---: | ------------| | `streaming` | _boolean_ | Current streaming status. | | `recording` | _boolean_ | Current recording status. | +| `recording-paused` | _boolean_ | If recording is paused. | +| `preview-only` | _boolean_ | Always false. Retrocompatibility with OBSRemote. | | `stream-timecode` | _String (optional)_ | Time elapsed since streaming started (only present if currently streaming). | | `rec-timecode` | _String (optional)_ | Time elapsed since recording started (only present if currently recording). | -| `preview-only` | _boolean_ | Always false. Retrocompatibility with OBSRemote. | --- From 77380a098eb5dec174d1e477e3526fca9e93d3ff Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Tue, 19 Jan 2021 18:07:43 +0000 Subject: [PATCH 172/178] docs(ci): Update protocol.md - afc9c54 [skip ci] --- docs/generated/comments.json | 4 ++-- docs/generated/protocol.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 34d49864..ead2dae5 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -9424,7 +9424,7 @@ "api": "requests", "name": "CreateScene", "category": "scenes", - "since": "4.8.0", + "since": "unreleased", "params": [ { "type": "String", @@ -9447,7 +9447,7 @@ "sinces": [ { "name": "", - "description": "4.8.0" + "description": "unreleased" } ], "heading": { diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 13e6b39a..87d69c10 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -3700,7 +3700,7 @@ _No specified parameters._ ### CreateScene -- Added in v4.8.0 +- Unreleased Create a new scene scene. From bc3b09dce4bf25eb99007dabff078deb2f5b027d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Wed, 20 Jan 2021 00:08:24 +0100 Subject: [PATCH 173/178] WSServer(stop): wait for all connections to close --- src/WSServer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/WSServer.cpp b/src/WSServer.cpp index add0e1e1..33639dd1 100644 --- a/src/WSServer.cpp +++ b/src/WSServer.cpp @@ -121,13 +121,11 @@ void WSServer::stop() for (connection_hdl hdl : _connections) { _server.close(hdl, websocketpp::close::status::going_away, "Server stopping"); } - _connections.clear(); - _connectionProperties.clear(); _threadPool.waitForDone(); - while (!_server.stopped()) { - std::this_thread::sleep_for(std::chrono::milliseconds(1)); + while (_connections.size() > 0) { + std::this_thread::sleep_for(std::chrono::milliseconds(10)); } blog(LOG_INFO, "server stopped successfully"); From 492e9d8df72b1e5d83d298555cbfe7434d0d60fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Wed, 20 Jan 2021 00:28:50 +0100 Subject: [PATCH 174/178] editorconfig: set indent_size for C/C++ files --- .editorconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.editorconfig b/.editorconfig index 9d1d51a1..14b0f7bd 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,6 +3,7 @@ insert_final_newline = true [*.{c,cpp,h,hpp}] indent_style = tab +indent_size = 4 [*.{yml,yaml}] indent_style = space From 0d59983d1a971fcc1c4d070295dbed32270b58be Mon Sep 17 00:00:00 2001 From: tt2468 Date: Tue, 19 Jan 2021 18:30:18 -0800 Subject: [PATCH 175/178] Misc: Fix indentation of src files Replace 4-space code with tabs to conform with the way its supposed to be. --- src/ConnectionProperties.cpp | 6 +++--- src/ConnectionProperties.h | 8 ++++---- src/Utils.h | 12 ++++++------ src/WSRequestHandler_Recording.cpp | 18 +++++++++--------- src/WSRequestHandler_ReplayBuffer.cpp | 6 +++--- src/WSRequestHandler_Sources.cpp | 10 +++++----- src/WSServer.cpp | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/ConnectionProperties.cpp b/src/ConnectionProperties.cpp index 485123de..aa7c4525 100644 --- a/src/ConnectionProperties.cpp +++ b/src/ConnectionProperties.cpp @@ -19,16 +19,16 @@ with this program. If not, see #include "ConnectionProperties.h" ConnectionProperties::ConnectionProperties() - : _authenticated(false) + : _authenticated(false) { } bool ConnectionProperties::isAuthenticated() { - return _authenticated.load(); + return _authenticated.load(); } void ConnectionProperties::setAuthenticated(bool authenticated) { - _authenticated.store(authenticated); + _authenticated.store(authenticated); } \ No newline at end of file diff --git a/src/ConnectionProperties.h b/src/ConnectionProperties.h index a766ef6a..8bb87a27 100644 --- a/src/ConnectionProperties.h +++ b/src/ConnectionProperties.h @@ -23,9 +23,9 @@ with this program. If not, see class ConnectionProperties { public: - explicit ConnectionProperties(); - bool isAuthenticated(); - void setAuthenticated(bool authenticated); + explicit ConnectionProperties(); + bool isAuthenticated(); + void setAuthenticated(bool authenticated); private: - std::atomic _authenticated; + std::atomic _authenticated; }; \ No newline at end of file diff --git a/src/Utils.h b/src/Utils.h index 47a19f2d..0983ba4b 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -88,10 +88,10 @@ namespace Utils { const char* GetCurrentRecordingFilename(); QString nsToTimestamp(uint64_t ns); - struct AddSourceData { - obs_source_t *source; - obs_sceneitem_t *sceneItem; - bool setVisible; - }; - void AddSourceHelper(void *_data, obs_scene_t *scene); + struct AddSourceData { + obs_source_t *source; + obs_sceneitem_t *sceneItem; + bool setVisible; + }; + void AddSourceHelper(void *_data, obs_scene_t *scene); }; diff --git a/src/WSRequestHandler_Recording.cpp b/src/WSRequestHandler_Recording.cpp index db0c529d..d0a53f82 100644 --- a/src/WSRequestHandler_Recording.cpp +++ b/src/WSRequestHandler_Recording.cpp @@ -29,19 +29,19 @@ RpcResponse ifCanPause(const RpcRequest& request, std::function c * @since unreleased */ RpcResponse WSRequestHandler::GetRecordingStatus(const RpcRequest& request) { - auto events = GetEventsSystem(); + auto events = GetEventsSystem(); - OBSDataAutoRelease data = obs_data_create(); - obs_data_set_bool(data, "isRecording", obs_frontend_recording_active()); - obs_data_set_bool(data, "isRecordingPaused", obs_frontend_recording_paused()); + OBSDataAutoRelease data = obs_data_create(); + obs_data_set_bool(data, "isRecording", obs_frontend_recording_active()); + obs_data_set_bool(data, "isRecordingPaused", obs_frontend_recording_paused()); - if (obs_frontend_recording_active()) { - QString recordingTimecode = events->getRecordingTimecode(); - obs_data_set_string(data, "recordTimecode", recordingTimecode.toUtf8().constData()); + if (obs_frontend_recording_active()) { + QString recordingTimecode = events->getRecordingTimecode(); + obs_data_set_string(data, "recordTimecode", recordingTimecode.toUtf8().constData()); obs_data_set_string(data, "recordingFilename", Utils::GetCurrentRecordingFilename()); - } + } - return request.success(data); + return request.success(data); } /** diff --git a/src/WSRequestHandler_ReplayBuffer.cpp b/src/WSRequestHandler_ReplayBuffer.cpp index d4c83a27..2210fcf7 100644 --- a/src/WSRequestHandler_ReplayBuffer.cpp +++ b/src/WSRequestHandler_ReplayBuffer.cpp @@ -16,10 +16,10 @@ * @since unreleased */ RpcResponse WSRequestHandler::GetReplayBufferStatus(const RpcRequest& request) { - OBSDataAutoRelease data = obs_data_create(); - obs_data_set_bool(data, "isReplayBufferActive", obs_frontend_replay_buffer_active()); + OBSDataAutoRelease data = obs_data_create(); + obs_data_set_bool(data, "isReplayBufferActive", obs_frontend_replay_buffer_active()); - return request.success(data); + return request.success(data); } /** diff --git a/src/WSRequestHandler_Sources.cpp b/src/WSRequestHandler_Sources.cpp index 94e9a06c..8b044cf6 100644 --- a/src/WSRequestHandler_Sources.cpp +++ b/src/WSRequestHandler_Sources.cpp @@ -975,10 +975,10 @@ RpcResponse WSRequestHandler::GetTextFreetype2Properties(const RpcRequest& reque */ RpcResponse WSRequestHandler::SetTextFreetype2Properties(const RpcRequest& request) { - const char* sourceName = obs_data_get_string(request.parameters(), "source"); - if (!sourceName) { + const char* sourceName = obs_data_get_string(request.parameters(), "source"); + if (!sourceName) { return request.failed("invalid request parameters"); - } + } OBSSourceAutoRelease source = obs_get_source_by_name(sourceName); if (!source) { @@ -1681,8 +1681,8 @@ RpcResponse WSRequestHandler::SetAudioMonitorType(const RpcRequest& request) /** * Takes a picture snapshot of a source and then can either or both: -* - Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request) -* - Save it to disk (by specifying `saveToFilePath` in the request) +* - Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request) +* - Save it to disk (by specifying `saveToFilePath` in the request) * * At least `embedPictureFormat` or `saveToFilePath` must be specified. * diff --git a/src/WSServer.cpp b/src/WSServer.cpp index 33639dd1..6d155658 100644 --- a/src/WSServer.cpp +++ b/src/WSServer.cpp @@ -44,7 +44,7 @@ WSServer::WSServer() _connections(), _clMutex(QMutex::Recursive) { - _server.get_alog().clear_channels(websocketpp::log::alevel::frame_header | websocketpp::log::alevel::frame_payload | websocketpp::log::alevel::control); + _server.get_alog().clear_channels(websocketpp::log::alevel::frame_header | websocketpp::log::alevel::frame_payload | websocketpp::log::alevel::control); _server.init_asio(); #ifndef _WIN32 _server.set_reuse_addr(true); From 59ab9548c29ba31fd3675668001a9799354fc4a0 Mon Sep 17 00:00:00 2001 From: Azure CI <> Date: Wed, 20 Jan 2021 09:22:17 +0000 Subject: [PATCH 176/178] docs(ci): Update protocol.md - a1cf7f8 [skip ci] --- docs/generated/comments.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index ead2dae5..26798952 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -7327,7 +7327,7 @@ "level": 2, "text": "TakeSourceScreenshot" }, - "lead": "Takes a picture snapshot of a source and then can either or both: - Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request) - Save it to disk (by specifying `saveToFilePath` in the request)", + "lead": "Takes a picture snapshot of a source and then can either or both: \t- Send it over as a Data URI (base64-encoded data) in the response (by specifying `embedPictureFormat` in the request) \t- Save it to disk (by specifying `saveToFilePath` in the request)", "type": "class", "examples": [] } From 740a8a8d06e8e8312cdc522a1dbd4be83e2bbd5e Mon Sep 17 00:00:00 2001 From: Valter Minute Date: Wed, 20 Jan 2021 09:00:14 +0100 Subject: [PATCH 177/178] General: Add ScenesCollection object Adds a ScenesCollection object in the protocol definition, replacing the current Array return with Array, keeping it more coherent with other requests that return objects in the same format. This will help automated code generation from comment.json that otherwise would require ad-hoc handling for that specific request. Signed-off-by: Valter Minute --- docs/generated/comments.json | 37 +++++++++++++++++------ docs/generated/protocol.md | 8 +++-- src/WSRequestHandler_SceneCollections.cpp | 8 +++-- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index cc02464d..c61bea27 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -474,6 +474,31 @@ }, "examples": [] }, + { + "subheads": [], + "typedef": "{Object} `ScenesCollection`", + "property": "{String} `sc-name` Name of the scene collection", + "properties": [ + { + "type": "String", + "name": "sc-name", + "description": "Name of the scene collection" + } + ], + "typedefs": [ + { + "type": "Object", + "name": "ScenesCollection", + "description": "" + } + ], + "name": "", + "heading": { + "level": 2, + "text": "" + }, + "examples": [] + }, { "subheads": [], "typedef": "{Object} `Scene`", @@ -8218,24 +8243,16 @@ { "subheads": [], "description": "List available scene collections", - "return": [ - "{Array} `scene-collections` Scene collections list", - "{String} `scene-collections.*.sc-name` Scene collection name" - ], + "return": "{Array} `scene-collections` Scene collections list", "api": "requests", "name": "ListSceneCollections", "category": "scene collections", "since": "4.0.0", "returns": [ { - "type": "Array", + "type": "Array", "name": "scene-collections", "description": "Scene collections list" - }, - { - "type": "String", - "name": "scene-collections.*.sc-name", - "description": "Scene collection name" } ], "names": [ diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 9d9bd8a7..d3007b24 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -49,6 +49,7 @@ You can also refer to any of the client libraries listed on the [README](README. * [SceneItemTransform](#sceneitemtransform) * [OBSStats](#obsstats) * [Output](#output) + * [ScenesCollection](#scenescollection) * [Scene](#scene) - [Events](#events) * [Scenes](#scenes) @@ -344,6 +345,10 @@ These are complex types, such as `Source` and `Scene`, which are used as argumen | `totalFrames` | _int_ | Number of frames sent | | `droppedFrames` | _int_ | Number of frames dropped | | `totalBytes` | _int_ | Total bytes sent | +## ScenesCollection +| Name | Type | Description | +| ---- | :---: | ------------| +| `sc-name` | _String_ | Name of the scene collection | ## Scene | Name | Type | Description | | ---- | :---: | ------------| @@ -3308,8 +3313,7 @@ _No specified parameters._ | Name | Type | Description | | ---- | :---: | ------------| -| `scene-collections` | _Array<String>_ | Scene collections list | -| `scene-collections.*.sc-name` | _String_ | Scene collection name | +| `scene-collections` | _Array<ScenesCollection>_ | Scene collections list | --- diff --git a/src/WSRequestHandler_SceneCollections.cpp b/src/WSRequestHandler_SceneCollections.cpp index 77ce5d0a..8fc0ef42 100644 --- a/src/WSRequestHandler_SceneCollections.cpp +++ b/src/WSRequestHandler_SceneCollections.cpp @@ -2,6 +2,11 @@ #include "WSRequestHandler.h" +/** +* @typedef {Object} `ScenesCollection` +* @property {String} `sc-name` Name of the scene collection +*/ + /** * Change the active scene collection. * @@ -59,8 +64,7 @@ RpcResponse WSRequestHandler::GetCurrentSceneCollection(const RpcRequest& reques /** * List available scene collections * - * @return {Array} `scene-collections` Scene collections list - * @return {String} `scene-collections.*.sc-name` Scene collection name + * @return {Array} `scene-collections` Scene collections list * * @api requests * @name ListSceneCollections From ab453a0322168844672b499c09031ce035ce43bd Mon Sep 17 00:00:00 2001 From: Harm Date: Thu, 21 Jan 2021 10:56:46 +0100 Subject: [PATCH 178/178] readme: Added obs-java-client to the available API's --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1a1419f4..2ca82777 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Here's a list of available language APIs for obs-websocket : - Python 3.5+ with asyncio: [obs-ws-rc](https://github.com/KirillMysnik/obs-ws-rc) by Kirill Mysnik - Python 3.6+ with asyncio: [simpleobsws](https://github.com/IRLToolkit/simpleobsws) by tt2468 - Java 8+: [obs-websocket-java](https://github.com/Twasi/websocket-obs-java) by TwasiNET +- Java 11+: [obs-java-client](https://github.com/harm27/obs-java-client) by harm27 - Golang: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf - Rust: [obws](https://github.com/dnaka91/obws) by dnaka91 - HTTP API: [obs-websocket-http](https://github.com/IRLToolkit/obs-websocket-http) by tt2468