obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

libobs: Add "source_update" signal

Open gxalpha opened this issue 3 years ago • 1 comments

Description

Adds a source signal that gets triggered when a source's settings are updated.

~~There is update_properties, but it acts in a very different way. Confirmation that it's not supposed to do what the new signal does would be great.~~

Motivation and Context

Writing a feature / plugin (probably plugin for the time being) that requires constantly watching a source's settings.

How Has This Been Tested?

macOS 13 Connected to the signal via signal_handler_connect(obs_source_get_signal_handler(source), "update", source_update_signal, data) and saw the signal being triggered each time the source was updated.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

gxalpha avatar Sep 17 '22 21:09 gxalpha

I'm now certain that the update_properties and the new signal I added are not the same.

Tells any open source properties windows to perform a UI refresh

Websockets to the rescue again!

gxalpha avatar Sep 18 '22 00:09 gxalpha

Seems fine, however I'm not sure if this event shouldn't be named "source_properties_update" because I'd expect a "source_update" to signal an actual change triggered by the source itself.

PatTheMav avatar Oct 06 '22 16:10 PatTheMav

source_properties_update would indicate that the signal is something about the properties, which it isn't ("properties" is exclusively used with the the properties API in every other OBS terminology). Other signals like source_add, source_show, source_activate etc aren't triggered by the source either, so this PR is just following convention.

gxalpha avatar Oct 06 '22 16:10 gxalpha