Commit Graph

307 Commits

Author SHA1 Message Date
tt2468
eb8d69dca5 Base: Move request batch processing to requesthandler directory
Request batch processing had less to do with the protocol/server and
more to do with the actual request handler, so it felt better to move
it.
2021-12-13 19:10:08 -08:00
tt2468
e47de63786
docs: Fix request type typo 2021-12-13 12:33:35 -08:00
tt2468
d7887b4c32 WebSocketServer: Fix execution type 2021-12-11 23:28:37 -08:00
tt2468
de1f843ce6 WebSocketServer: Swap variable behavior and fix crash caused by const parameters 2021-12-10 23:58:14 -08:00
tt2468
5ac813b897 WebSocketServer: Tiny code cleanup 2021-12-10 22:33:52 -08:00
tt2468
43e2860709 WebSocketServer: Implement haltOnFailure for batch requests 2021-12-10 22:28:22 -08:00
tt2468
c9c5da6837 RequestBatchExecutionType: Change executionType values
Fits better for the front-facing API.
2021-12-10 22:00:02 -08:00
tt2468
b66d2284b3 WebSocketOpCode: Add IsValid check
Not used, but useful addition.
2021-12-10 21:59:13 -08:00
tt2468
fcbe11616d
docs: Overhaul documentation (#863)
More docs-related commits will follow, but this needs to be merged in order to continue with other development.

* Docs: Overhaul docs generator (beginning)

* docs: Rename comments file

* docs: Move comments gitignore

* docs: Initial request documentation

* docs: Improvements to comment processing

* docs: More improvements

* docs: Add enum functionality for protocol.json

* WebSocketServer: Document enums

* RequestHandler: Document RequestStatus enum

* Base: Move ObsWebSocketRequestBatchExecutionType to its own file

Moves it to its own file, renaming it to `RequestBatchExecutionType`.
Changes the RPC to use integer values for selecting execution type
instead of strings.

* docs: Update introduction header

Removes the enum section, and documents RequestBatchExecutionType.

* WebSocketCloseCode: Shuffle a bit

* Base: Use `field` instead of `key` or `parameter` in most places

* RequestStatus: Mild shuffle

It was really bothering me that OutputPaused and OutputNotPaused
had to be separated, so we're breaking it while we're breaking
other stuff.

* docs: Delete old files

They may be added back in some form, but for now I'm getting them
out of the way.

* docs: Add enum identifier value

Forgot to add this before, oops

* docs: Document more enums

* docs: Add basic protocol.md generator

* docs: More work on MD generator

* docs: MD generator should be finished now

* docs: More fixes

* docs: More fixes

* docs: More tweaks + add readme

* docs: Update readme and add inputs docs

* docs: More documentation
2021-12-10 21:38:18 -08:00
tt2468
6cec018c8d
WebSocketServer: Fix null check for request batch variables 2021-12-10 21:20:48 -08:00
tt2468
6d684eb07f ObsVolumeMeter: Don't use obs_weak_source_expired()
This function is not released yet.

TODO: Reenable its usage when OBS 27.2.0 is released.
2021-11-22 20:14:54 -08:00
tt2468
5704ea2970 Requests: Increase InputVolumeMeters update rate to 20/sec
We were using a 60ms interval before, which just feels too slow.
A 50ms interval feels much better.
2021-11-22 03:51:41 -08:00
tt2468
d48ddef031 EventHandler: Implement InputVolumeMeters
This is probably one of the most requested features for obs-websocket.
This currently works by firing an event to all explicit subscribers
with an array of all active audio sources every **60 milliseconds.**

The `inputLevelsMul` field follows this data format:

Base: [Channel, Channel]
Channel: [magnitude (mul), peak (mul), input_peak (mul)]

           *Not Muted*         *Muted*
Example: [[0.3, 0.5, 0.9], [0.0, 0.0, 0.0]]

(input_peak is the actual peak value, before volume adjustment.)

You may notice that the values are only in mul. This is because we are
trying to cut down on bandwidth. dB values can be calculated using this
formula:

`dB = 20.0 * log10(mul)`
2021-11-22 03:37:56 -08:00
tt2468
1ac6ac6c87 plugin-macros: Remove extra [obs-websocket] tag 2021-11-21 17:51:53 -08:00
tt2468
bc7b8d330a RequestHandler: Move RequestStatus.h to types directory 2021-11-21 03:13:53 -08:00
tt2468
c95511eb5f Base: Remove UNUSED_PARAMETER() usages
I prefer to use undefined parameters instead.
2021-11-21 03:08:06 -08:00
tt2468
2a4e86d8da Base: Add more module exports + code cleanup 2021-11-21 02:50:41 -08:00
tt2468
4d8013b07e SettingsDialog: Add 6 character minimum length
Security requirements should be held just like every other platform
out there, even if they are lax
2021-11-21 02:29:21 -08:00
tt2468
2e079ad681 WebSocketServer: Various code cleanup 2021-11-21 01:37:21 -08:00
tt2468
29a72f9af8 WebSocketServer: Use WebSocketOpCode where possible 2021-11-21 01:37:21 -08:00
tt2468
0a294a558e WebSocketServer: Move enums to types directory
Code cleanup, makes WebSocketServer match how enums are handled in
other parts of the plugin
2021-11-21 01:37:21 -08:00
tt2468
4ca259b790 Base: Enforce -Wall and fix compiler warnings
That was *a lot* of warnings.
2021-11-20 02:34:48 -08:00
tt2468
32a9e12f62 Base: Logging improvements
Use blog_debug() in place of almost all debug logging messages, and
change some log levels to be less verbose.
2021-11-20 01:50:49 -08:00
tt2468
60f12a16f3 plugin-macros: Add blog_debug()
obs-studio's LOG_DEBUG setting only works in very specific
circumstances, which is why we implement our own debug logging. This
will help a lot of code cleanup.
2021-11-20 01:46:01 -08:00
tt2468
99cbaaf34c Base: Implement ObsWebSocketApi + cleanup
- Implements a WIP ObsWebSocketApi, for obs-websocket-api.h. Events are
finished, but requests are not.
- Some logging improvements
- A bit of code cleanup around the plugin
2021-11-20 01:26:50 -08:00
tt2468
bd6c663775 Base: Add copyright header to source 2021-11-19 17:32:22 -08:00
tt2468
18ed1589ae Base: Update obs-websocket git locations
obs-websocket has moved to the obsproject
2021-11-19 17:24:15 -08:00
tt2468
07a20b6458
Merge pull request #856 from dnaka91/record-pause-resume
Events: Add events for record pause and resume
2021-11-18 22:28:04 -08:00
Dominik Nakamura
6cb8eef96d
Events: Add events for record pause and resume 2021-11-19 15:24:00 +09:00
tt2468
5ab091a40b Base: Move WebSocketServer to its own directory
Just helps with organization
2021-11-18 00:29:28 -08:00
tt2468
c60d09246c Revert "Events: Re-enable *Changing events"
This reverts commit 32be21886c.
2021-11-17 03:16:42 -08:00
tt2468
4076c0baa9 Requests: Add media input requests 2021-11-17 03:03:14 -08:00
tt2468
01013c1b27 Base: Fix compile error
I literally could have sworn I remember json::null() being valid, but
I guess not. Oops
2021-11-17 02:58:11 -08:00
tt2468
1dbb7a9686 Requests: Apply some code style changes 2021-11-17 02:14:13 -08:00
tt2468
0f17d3d6f8 Utils/Obs: Update StringHelper function names
I hated having `String` appended to half of the utils since it was
extra
2021-11-17 01:23:23 -08:00
tt2468
08eb2defbc Requests: Add GetMediaInputState 2021-11-17 01:17:40 -08:00
tt2468
7403264d42 Requests/Utils: Modify utils naming/usage
A bit too niche to have a util that takes an output and returns a
timecode string. Let's just make it take a duration in milliseconds.
2021-11-17 01:07:04 -08:00
tt2468
32be21886c Events: Re-enable *Changing events 2021-11-17 00:37:50 -08:00
tt2468
d5a702b0e8 Events: Disable *Changing events
CI fails right now because they are not yet included in an OBS release.
2021-11-17 00:36:53 -08:00
tt2468
0671ded7d1 Requests: Add recording requests 2021-11-17 00:30:17 -08:00
tt2468
9197a48088 Requests: Add SetSceneItemTransform
Yay party
2021-11-12 23:24:39 -08:00
tt2468
5faadc12de Utils/Obs: Add scaleX and scaleY plus new util 2021-11-12 23:23:51 -08:00
tt2468
45f7661a5d Requests: Add DuplicateSceneItem 2021-11-12 17:31:11 -08:00
tt2468
aa46bb74a5 RequestHandler/RPC: Add ValidateScene2 2021-11-12 17:30:46 -08:00
tt2468
af52a26e68 Utils: Add ability to specify transform/crop for scene item creation 2021-11-12 17:29:43 -08:00
tt2468
69494d9c85 Base: Add OBSSceneAutoRelease 2021-11-12 17:19:57 -08:00
tt2468
152faa5fe2 Events: Add profile/scene collection change events 2021-11-12 15:20:01 -08:00
tt2468
4e956d1ef4 Requests: Add note SetCurrentSceneCollection 2021-10-06 00:45:14 -07:00
tt2468
42c78f1831 Events: Prepare to add a few new OBS events
Pending PR merge and version release
2021-10-06 00:44:42 -07:00
tt2468
1b25e98dc2 Revert "Requests: Add Compare"
This reverts commit 3687086ce0.

I realized that I'm adding too much too fast, and that we should
focus on getting v5 out first.
2021-10-05 20:17:45 -07:00