Commit Graph

76 Commits

Author SHA1 Message Date
tt2468
bbf9c283c0 eventhandler: Add SceneTransitionVideoEnded 2022-03-01 14:36:35 -08:00
tt2468
9ac7c5890e eventhandler: Add SceneTransitionEnded 2022-03-01 14:36:35 -08:00
tt2468
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
tt2468
db2ffa569a Base: Fix some formatting 2022-02-16 13:30:10 -08:00
Brendan Allan
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
Dominik Nakamura
ddf752fd03
docs: Fix wrong field name in SceneItemLockStateChanged 2022-01-29 23:50:12 +09:00
tt2468
d2ddde3229 eventhandler: Add a few transition events 2022-01-28 16:56:21 -08:00
tt2468
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
tt2468
6d216e0412 docs: Fix docs of InputAudioTracksChanged 2021-12-31 14:08:22 -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
a90dafb971
Merge pull request #885 from obsproject/feature/input-audio-requests-events
Input audio requests and events
2021-12-29 21:12:23 -08:00
tt2468
31997db509 EventHandler: Uncomment audio_monitoring signal 2021-12-29 21:05:28 -08:00
tt2468
1ed095de48 EventHandler: Add InputAudioBalanceChanged 2021-12-29 21:03:16 -08:00
tt2468
947450ce4e Revert "Revert "Events: Re-enable *Changing events""
This reverts commit c60d09246c.
2021-12-29 20:29:45 -08:00
tt2468
732d5af50c EventHandler: Add Ui category 2021-12-29 00:34:25 -08:00
tt2468
0939273abf EventSubscription: Add Ui category 2021-12-29 00:32:28 -08:00
tt2468
af217c05f1 EventHandler: [BREAKING] Rename CurrentSceneChanged to CurrentProgramSceneChanged
Now matches the requests
2021-12-28 23:53:58 -08:00
tt2468
e640ae1218 docs: Finish documenting events 2021-12-28 23:45:11 -08:00
tt2468
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
tt2468
a898bacd79 Utils: Rename VolumeMeter utils for consistency 2021-12-21 03:09:45 -08:00
tt2468
f566ccd76b Utils: Add output state util to utils 2021-12-21 01:32:12 -08:00
tt2468
d29b87ffc1 EventHandler: Remove unused file 2021-12-21 01:32:12 -08:00
tt2468
1e6a60f545 Utils: Rename ListHelper to ArrayHelper 2021-12-21 01:32:12 -08:00
tt2468
5cd1af426a Utils: Rename DataHelper to ObjectHelper 2021-12-21 01:32:12 -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
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
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
c95511eb5f Base: Remove UNUSED_PARAMETER() usages
I prefer to use undefined parameters instead.
2021-11-21 03:08:06 -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
Dominik Nakamura
6cb8eef96d
Events: Add events for record pause and resume 2021-11-19 15:24:00 +09:00
tt2468
c60d09246c Revert "Events: Re-enable *Changing events"
This reverts commit 32be21886c.
2021-11-17 03:16:42 -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
152faa5fe2 Events: Add profile/scene collection change events 2021-11-12 15:20:01 -08: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
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
ea948766a5 Events: Fix conversion warning
Thanks micolous for the report.
2021-09-24 18:54:48 -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
c43d829845 Events: Complete SceneItemTransformChanged 2021-09-03 15:58:50 -07:00
tt2468
bcdb8ee352 Events: Fix SceneItemListReindexed event name 2021-09-03 08:59:09 -07:00
tt2468
26bef074ac EventHandler: Add (disabled) InputAudioMonitorTypeChanged event 2021-08-31 06:39:09 -07:00
tt2468
ade9653ed6 Base: Only include required util namespaces 2021-08-27 04:34:06 -07:00
tt2468
0547e1f2da Base: Lots of changes 2021-08-27 04:19:42 -07:00
tt2468
4d271da541 Base: Code cleanup and add some requests 2021-07-22 03:24:53 -07:00
tt2468
ccb69754b5 EventHandler: Add unversionedInputKind to InputCreated 2021-06-16 01:22:14 -07:00
tt2468
94d7df0bc1 EventHandler: Add isGroup bool to create/remove scene events 2021-06-16 00:51:24 -07:00