Commit Graph

43 Commits

Author SHA1 Message Date
21886adb32 base: Fix generated header inclusion 2023-03-27 12:59:23 -04:00
a254172c12 eventhandler: Add reconnecting and reconnected stream output states
Closes #1050
2022-11-18 02:09:48 -08:00
23f883d906 eventhandler: Split some handling code into multi handlers
Code cleanup
2022-11-18 02:09:48 -08:00
8cabe24b77 eventhandler: Add ScreenshotSaved event
No, this does not trigger with `Get/SaveScreenshot`. I've tried to make
that super clear in the docs. Hopefully people don't get too confused.
2022-11-17 22:19:12 -08:00
6deadc25ac base: Change column limit to 132
A column limit of 80 is very restrictive and code readability was
suffering. A limit of 132 is more realistic for this plugin.
2022-06-07 21:36:51 -07:00
f73e78582b base: Format code 2022-05-13 21:19:29 -07:00
bbf9c283c0 eventhandler: Add SceneTransitionVideoEnded 2022-03-01 14:36:35 -08:00
9ac7c5890e eventhandler: Add SceneTransitionEnded 2022-03-01 14:36:35 -08:00
a7698a732f eventhandler: Add SceneTransitionStarted + cleanup
This commit cleans up a bunch of code in the event handler,
making it much easier to understand (IMO). I feel much better
about how we handle connecting and disconnecting callbacks. Before,
we were actually allowing a bunch of callbacks to stay connected and
get cleaned up. Now, we actually properly disconnect them.
2022-03-01 14:36:35 -08:00
db2ffa569a Base: Fix some formatting 2022-02-16 13:30:10 -08:00
361547a96d requesthandler: Filter requests & events (#888)
* Implement filter requests

* Fix CreateSourceFilter

* Implement most Filter events

* build against 27.1.3

* Update main.yml

* SourceFilterNameChanged rename

* revert main.yml changes

* rename SourceFilterCreated and revert CI changes

* cleanup

* Base: Various cleanups + fix -Werror

* Base: A few nitpicks/fixes

* requesthandler: Fix CreateSourceFilter

* utils: Fix CreateSourceFilter

Use obs_source_t* instead of OBSSourceAutoRelease to prevent double
release

* requesthandler: Remove filterIndex from CreateSourceFilter

The purpose of sceneItemEnabled in CreateSceneItem is to hide the
scene item while we still hold the scene mutex (guaranteeing the input
will never be shown). Since we don't hold a mutex when creating
filters, there's no reason to do any extra steps.

* requesthandler: Validate input/filter kinds in *DefaultSettings

Co-authored-by: tt2468 <tt2468@gmail.com>
2022-02-16 13:17:06 -08:00
d2ddde3229 eventhandler: Add a few transition events 2022-01-28 16:56:21 -08:00
3e2984fd7a eventhandler: Add SceneItemSelected event
So I didn't think anyone actually used this, but I was wrong. So I'm
adding it again.
2022-01-28 15:33:28 -08:00
1ed095de48 EventHandler: Add InputAudioBalanceChanged 2021-12-29 21:03:16 -08:00
af217c05f1 EventHandler: [BREAKING] Rename CurrentSceneChanged to CurrentProgramSceneChanged
Now matches the requests
2021-12-28 23:53:58 -08:00
e640ae1218 docs: Finish documenting events 2021-12-28 23:45:11 -08:00
91e3f5ee18 EventHandler: Remove platform include
Already included by obs-websocket.h, but does not have ifdefs
protecting strtoll. Better to just remove it.
2021-12-21 20:35:08 -08:00
a898bacd79 Utils: Rename VolumeMeter utils for consistency 2021-12-21 03:09:45 -08:00
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
bd6c663775 Base: Add copyright header to source 2021-11-19 17:32:22 -08:00
42c78f1831 Events: Prepare to add a few new OBS events
Pending PR merge and version release
2021-10-06 00:44:42 -07:00
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
e89c0c2b05 Base: More code cleanup and fixes 2021-09-04 10:47:51 -07:00
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
26bef074ac EventHandler: Add (disabled) InputAudioMonitorTypeChanged event 2021-08-31 06:39:09 -07:00
ade9653ed6 Base: Only include required util namespaces 2021-08-27 04:34:06 -07:00
0547e1f2da Base: Lots of changes 2021-08-27 04:19:42 -07:00
4d271da541 Base: Code cleanup and add some requests 2021-07-22 03:24:53 -07:00
aaadf4d2ff EventHandler: Remove unnecessary calldata helper 2021-06-13 04:50:04 -07:00
38c47bc76f EventHandler: Rename SceneListReindexed to SceneListChanged 2021-06-13 02:11:14 -07:00
7716b30c27 EventHandler: Minor refactor and some event additions 2021-06-13 00:46:42 -07:00
f608423045 EventHandler: Remove unnecessary CPU usage info 2021-06-12 22:59:47 -07:00
ca26f679c8 EventHandler: Add ReplayBufferSaved 2021-06-12 20:34:24 -07:00
19375921d3 EventHandler: Add media input events 2021-05-31 21:44:03 -07:00
6c03b86514 EventHandler: Add Outputs events and other files 2021-05-31 18:51:56 -07:00
9077ac911d EventHandler: Add some transition stuff
Transitions in OBS are implemented badly.
Not sure what will reasonably be possible with them.
I'll probably save implementing them for last
2021-05-14 03:59:00 -07:00
45d62e5ce0 EventHandler: General, Config, Scenes, Inputs 2021-05-14 01:13:27 -07:00
ab12d5f39f EventHandler: Add some events 2021-05-13 19:11:19 -07:00
11d28d17f1 EventHandler: Add EventSubscriptions enum 2021-05-13 17:34:57 -07:00
921bc81a7b EventHandler: More stuff 2021-05-10 22:46:53 -07:00
8b30d2e77e EventHandler: Add some calldata helpers 2021-05-10 18:34:27 -07:00
5157134b02 EventHandler: Add more code 2021-05-10 16:54:48 -07:00
c0accd9cde base: Add EventHandler files 2021-05-10 15:48:41 -07:00