obs-studio
obs-studio copied to clipboard
obs-frontend-api: Add audio mixer functions
Description
Adds functions to the frontend api to add and remove sources from the audio mixer
Motivation and Context
In one of my plugins, the source is private, so these functions allow me to add it to the audio mixer.
How Has This Been Tested?
Tested with my plugin.
Types of changes
- New feature (non-breaking change which adds 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.
I think switching the view style (vertical to horizontal and vice versa) of the mixer may remove added sources through this method.
I think switching the view style (vertical to horizontal and vice versa) of the mixer may remove added sources through this method.
That works as expected. The only problem was that it wouldn't work when unhiding all audio sources. The latest update to this PR fixes that.
That works as expected. The only problem was that it wouldn't work when unhiding all audio sources. The latest update to this PR fixes that.
Can you confirm if this means the sources are persisted, or removed? This comment is not clear on what the actual result is. I would hope that changing modes does not remove sources added using this API.
The items added in the mixer are persistent.
General question: What happens when you name your private source the same as an existing user-added source? And add it to the mixer? Would it not cause an issue?
I've found out that there is a function called obs_source_set_hidden, that allows me to disable saving the source in the main ui, so I can save it in my plugin instead. This means I no longer need a private source and my source can show up in the audio mixer, so this PR is no longer needed.