Skip to content

obs-frontend-api: Add audio mixer functions#7584

Closed
cg2121 wants to merge 1 commit into
obsproject:masterfrom
cg2121:api-volume-controls
Closed

obs-frontend-api: Add audio mixer functions#7584
cg2121 wants to merge 1 commit into
obsproject:masterfrom
cg2121:api-volume-controls

Conversation

@cg2121
Copy link
Copy Markdown
Contributor

@cg2121 cg2121 commented Oct 11, 2022

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:

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

@WizardCM WizardCM added the kind/feature Functionality or other elements that the project doesn't currently have. label Oct 15, 2022
@tytan652
Copy link
Copy Markdown
Collaborator

tytan652 commented Oct 15, 2022

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

@cg2121 cg2121 force-pushed the api-volume-controls branch from da455d7 to e36a667 Compare October 31, 2022 09:57
@cg2121
Copy link
Copy Markdown
Contributor Author

cg2121 commented Oct 31, 2022

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 cg2121 force-pushed the api-volume-controls branch from e36a667 to 478cb55 Compare October 31, 2022 10:04
@cg2121 cg2121 added this to the OBS Studio 29.0 milestone Nov 10, 2022
@Fenrirthviti
Copy link
Copy Markdown
Member

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.

@cg2121
Copy link
Copy Markdown
Contributor Author

cg2121 commented Nov 12, 2022

The items added in the mixer are persistent.

@CodeYan01
Copy link
Copy Markdown
Contributor

CodeYan01 commented Jan 6, 2023

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?

Comment thread docs/sphinx/reference-frontend-api.rst Outdated
@cg2121 cg2121 removed this from the OBS Studio 29.1 milestone Mar 26, 2023
Adds functions to the frontend api to add and remove sources
from the audio mixer.
@cg2121 cg2121 force-pushed the api-volume-controls branch from f6fab1f to f7a9b9f Compare August 1, 2023 02:44
@cg2121
Copy link
Copy Markdown
Contributor Author

cg2121 commented Sep 9, 2023

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 cg2121 closed this Sep 9, 2023
@cg2121 cg2121 deleted the api-volume-controls branch September 9, 2023 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Functionality or other elements that the project doesn't currently have.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants