feat(ScreenShare): add ignore devices, only speakers

This commit is contained in:
Curve 2024-05-31 17:51:53 +02:00
parent ea427b6ace
commit 7405b6e127
No known key found for this signature in database
GPG key ID: 460F6C466BD35813
5 changed files with 44 additions and 13 deletions

View file

@ -27,7 +27,7 @@
"arrpc": "github:OpenAsar/arrpc#6960a8fd4d65d566da93dbdb8a7ca474aa0a3c9c"
},
"optionalDependencies": {
"@vencord/venmic": "^5.0.0"
"@vencord/venmic": "^6.0.0"
},
"devDependencies": {
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",

View file

@ -13,8 +13,8 @@ importers:
version: https://codeload.github.com/OpenAsar/arrpc/tar.gz/6960a8fd4d65d566da93dbdb8a7ca474aa0a3c9c
optionalDependencies:
'@vencord/venmic':
specifier: ^5.0.0
version: 5.0.0
specifier: ^6.0.0
version: 6.0.0
devDependencies:
'@fal-works/esbuild-plugin-global-externals':
specifier: ^2.1.2
@ -603,8 +603,8 @@ packages:
'@vencord/types@1.8.4':
resolution: {integrity: sha512-ogLqIOHVO+5zxKUVxAfGIAUZoEfIomrlg6f0cZ/2yd5vBAn1fA9Gi/NASoKfHZuJt8ZcYw329bgn0ah/VufqMg==}
'@vencord/venmic@5.0.0':
resolution: {integrity: sha512-28gPNLCZwjWk/r+J4Rg1Hgfp8apmFlkahGaADPASIbQ6lUjX2PVgOv4pxIPhsgMy1aZPaBwAIOeEVPoAKk6MCw==}
'@vencord/venmic@6.0.0':
resolution: {integrity: sha512-PpeUA1L1ApnNRGnFEkl3UVYobhho5zAJJCmj98vhhKHoPcolbfotcfxCSWkXY4sHmRc2OPGzjQpr9Ut5f7CqLg==}
engines: {node: '>=14.15'}
os: [linux]
@ -3034,7 +3034,7 @@ snapshots:
standalone-electron-types: 1.0.0
type-fest: 3.13.1
'@vencord/venmic@5.0.0':
'@vencord/venmic@6.0.0':
dependencies:
cmake-js: 7.3.0
node-addon-api: 8.0.0

View file

@ -81,14 +81,14 @@ ipcMain.handle(IpcEvents.VIRT_MIC_LIST, () => {
ipcMain.handle(IpcEvents.VIRT_MIC_START, (_, targets: Node[]) => {
const pid = getRendererAudioServicePid();
const settings = Settings.store;
const data: LinkData = {
include: targets,
exclude: [{ "application.process.id": pid }]
exclude: [{ "application.process.id": pid }],
ignore_devices: settings.audioIgnoreDevices
};
const settings = Settings.store;
if (settings.audioIgnoreInputMedia ?? true) {
data.exclude?.push({ "media.class": "Stream/Input/Audio" });
}
@ -106,11 +106,12 @@ ipcMain.handle(IpcEvents.VIRT_MIC_START, (_, targets: Node[]) => {
ipcMain.handle(IpcEvents.VIRT_MIC_START_SYSTEM, () => {
const pid = getRendererAudioServicePid();
const settings = Settings.store;
const data: LinkData = {
exclude: [{ "application.process.id": pid }],
only_speakers: settings.audioOnlySpeakers,
ignore_devices: settings.audioIgnoreDevices,
only_default_speakers: settings.audioOnlyDefaultSpeakers
};

View file

@ -188,6 +188,7 @@ function AudioSettingsModal({
</Modals.ModalHeader>
<Modals.ModalContent className="vcd-screen-picker-modal">
<Switch
hideBorder
onChange={v => (Settings.audioWorkaround = v)}
value={Settings.audioWorkaround ?? false}
note={
@ -199,11 +200,29 @@ function AudioSettingsModal({
>
Microphone Workaround
</Switch>
<Switch
hideBorder
onChange={v => (Settings.audioOnlySpeakers = v)}
value={Settings.audioOnlySpeakers ?? true}
note={
<>
When sharing entire desktop audio, only share apps that play to a speaker. You may want to
disable this when using "mix bussing".
</>
}
>
Only Speakers
</Switch>
<Switch
hideBorder
onChange={v => (Settings.audioOnlyDefaultSpeakers = v)}
value={Settings.audioOnlyDefaultSpeakers ?? true}
note={<>When sharing entire desktop audio, only share apps that play to the default speakers.</>}
note={
<>
When sharing entire desktop audio, only share apps that play to the <b>default</b> speakers.
You may want to disable this when using "mix bussing".
</>
}
>
Only Default Speakers
</Switch>
@ -221,13 +240,21 @@ function AudioSettingsModal({
value={Settings.audioIgnoreVirtual ?? true}
note={
<>
Exclude virtual nodes, such as nodes belonging to sinks, this might be useful when using
"mix bussing"
Exclude virtual nodes, such as nodes belonging to sinks. This might be useful when using
"mix bussing".
</>
}
>
Ignore Virtual
</Switch>
<Switch
hideBorder
onChange={v => (Settings.audioIgnoreDevices = v)}
value={Settings.audioIgnoreDevices ?? true}
note={<>Exclude device nodes, such as nodes belonging to microphones or speakers.</>}
>
Ignore Devices
</Switch>
<Switch
hideBorder
onChange={value => {

View file

@ -35,7 +35,10 @@ export interface Settings {
audioGranularSelect?: boolean;
audioIgnoreVirtual?: boolean;
audioIgnoreDevices?: boolean;
audioIgnoreInputMedia?: boolean;
audioOnlySpeakers?: boolean;
audioOnlyDefaultSpeakers?: boolean;
}