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

obs-frontend-api: Add audio mixer functions

Open cg2121 opened this issue 3 years ago • 5 comments

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.

cg2121 avatar Oct 11 '22 04:10 cg2121

I think switching the view style (vertical to horizontal and vice versa) of the mixer may remove added sources through this method.

tytan652 avatar Oct 15 '22 23:10 tytan652

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.

cg2121 avatar Oct 31 '22 09:10 cg2121

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.

Fenrirthviti avatar Nov 11 '22 21:11 Fenrirthviti

The items added in the mixer are persistent.

cg2121 avatar Nov 12 '22 05:11 cg2121

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?

CodeYan01 avatar Jan 06 '23 06:01 CodeYan01

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.

cg2121 avatar Sep 09 '23 08:09 cg2121