Commit Graph

46 Commits

Author SHA1 Message Date
tt2468
749ecc976b base, lib: Update plugin API example and tests
Updates the example and tests for the plugin API to include the latest
additions to the plugin API.
2022-05-10 23:04:21 -07:00
tt2468
dea0fcd561 Base: Add logging for compile time ASIO version 2022-01-07 23:00:48 -08:00
tt2468
e43ebde794 Base: Use static_cast in place of reinterpret_cast
static_cast is a much safer cast method
2021-12-30 00:21:29 -08:00
tt2468
40ff3f6960 Base: More code/comment nitpicks 2021-12-21 20:35:08 -08:00
tt2468
0f303504e1 Base: Nitpick cleanup for obs-websocket.cpp 2021-12-21 20:35:08 -08:00
tt2468
c4ab69481b Base: Move AutoRelease helpers to utils + build fix
- Moves the AutoRelease helpers to utils/Obs.h
- Fixes build using obsproject/obs-studio/pull/5580
2021-12-17 14:35:19 -08:00
tt2468
b490e4409b CMakeLists: Add runtime tests flag 2021-12-15 02:06:31 -08:00
tt2468
82d5468b73 EventHandler: [BREAKING] Rename ExternalPluginEvents to Vendors
Make it fit the rest of the naming
2021-12-14 21:51:30 -08:00
tt2468
2e7262fe11 docs: Document plugin api event 2021-12-14 18:33:50 -08:00
tt2468
5f261de143 WebSocketApi: Finish implementations 2021-12-14 18:22:52 -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
2a4e86d8da Base: Add more module exports + code cleanup 2021-11-21 02:50:41 -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
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
5ab091a40b Base: Move WebSocketServer to its own directory
Just helps with organization
2021-11-18 00:29:28 -08:00
tt2468
69494d9c85 Base: Add OBSSceneAutoRelease 2021-11-12 17:19:57 -08:00
tt2468
f0b207d021 Base: Add variable support to request batches + refactor
- Adds variables to execution types SERIAL_REALTIME and SERIAL_FRAME
- Pass by reference where copy is unnecessary
- Start WebSocket server after OBS finishes loading instead of on
plugin load
2021-10-01 17:34:09 -07:00
tt2468
981538aa2a Base: Make some items atomic 2021-09-30 19:14:17 -07:00
tt2468
c9fa09edc4 Config/Base: Refactor with fixes
Fixes these things:
- Websocket password is not generated if FirstLoad and overridden
- Save generated password immediately if FirstLoad
- Do not generate new password if FirstLoad and password already exists
- More logging
2021-09-17 02:25:30 -07:00
tt2468
a5a19b9952 Utils/Crypto: Use QRandomGenerator instead of qrand()
qrand() is obsolete, and QRandomGenerator produces numbers seeded from
the platform's RNG source. Makes our authentication system way more
secure too.
2021-09-17 02:00:30 -07:00
tt2468
e89c0c2b05 Base: More code cleanup and fixes 2021-09-04 10:47:51 -07:00
tt2468
7e1e1bc33c Base: Large plugin refactor
- Merge WebSocketProtocol into WebSocketServer
  - Having them separated was not doing anything productive
- Request: Move SessionPtr to RequestHandler
  - Less copying to do for batch requests
- Fully modularize EventHandler
  - Make BroadcastEvent a stored callback that WebSocketServer sets
- Return early on high volume events to avoid unnecessary compute
  - These events will only generate a json object when it is actually
needed
2021-09-04 10:04:00 -07:00
tt2468
b86107a699 Base: Add OBSPropertiesAutoDestroy 2021-08-30 13:55:05 -07:00
tt2468
0547e1f2da Base: Lots of changes 2021-08-27 04:19:42 -07:00
tt2468
fc08828773 Base: Update QMainWindow cast 2021-08-27 01:20:13 -07:00
tt2468
4d271da541 Base: Code cleanup and add some requests 2021-07-22 03:24:53 -07:00
tt2468
0a02015f7d Base: General code cleanup 2021-06-22 15:51:52 -07:00
tt2468
5157134b02 EventHandler: Add more code 2021-05-10 16:54:48 -07:00
tt2468
c0accd9cde base: Add EventHandler files 2021-05-10 15:48:41 -07:00
tt2468
ee751edf54 SettingsDialog: Mild refactor and add Connect Info dialog
Among lots of stuff:

- Generate a random password on first load

- Add `ConnectInfo` dialog including QR code display

- Add `Generate Password` button to generate a new random
password

- Delete `Copy Password to Clipboard` button

- Delete `GetConnectString` or whatever from WebSocketServer
(reimplemented the functionality directly into ConnectInfo)

- Added `GeneratePassword()` to Utils

Todo: Show warning when users specify their own passwords
2021-05-08 04:29:03 -07:00
tt2468
aa241ecc9e base: Make sure config is saved on exit 2021-04-28 11:45:34 -07:00
tt2468
b53b40d9c8 base: Improve logging 2021-04-28 11:43:39 -07:00
tt2468
948750da6a WebSocketServer: Start and stop 2021-04-28 10:27:32 -07:00
tt2468
98ec9d01ac base: Dumb #include redefinitions 2021-04-27 16:45:44 -07:00
tt2468
d9ee288cf1 base: cmake is fucking retarded 2021-04-27 16:33:47 -07:00
tt2468
08fda22d0f base: Include RPC version on load 2021-04-27 15:26:23 -07:00
tt2468
b61cf82e84 base: Shutdown websocket server on unload 2021-04-27 15:25:11 -07:00
tt2468
20de7409d8 base: Reset websocket server on unload 2021-04-27 15:21:30 -07:00
tt2468
8067cfb686 Base: Tons more shit 2021-04-27 14:52:48 -07:00
tt2468
f0dfe72aca base: Add starting WebSocketServer files 2021-04-27 09:18:06 -07:00
tt2468
6f2f207adc SettingsDialog: Add configs 2021-04-26 20:55:18 -07:00
tt2468
a8ca912044 generic: Add SettingsDialog and Config 2021-04-26 19:59:50 -07:00
tt2468
dd597f1ad6 everything: Massive amount of changes who knows 2021-04-26 08:46:11 -07:00
tt2468
f3d5cfbd18 Initial commit for attempted rewrite 2021-03-08 03:56:43 -08:00