feat(ScreenShare): add ignore devices, only speakers
This commit is contained in:
parent
ea427b6ace
commit
7405b6e127
5 changed files with 44 additions and 13 deletions
|
@ -27,7 +27,7 @@
|
||||||
"arrpc": "github:OpenAsar/arrpc#6960a8fd4d65d566da93dbdb8a7ca474aa0a3c9c"
|
"arrpc": "github:OpenAsar/arrpc#6960a8fd4d65d566da93dbdb8a7ca474aa0a3c9c"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@vencord/venmic": "^5.0.0"
|
"@vencord/venmic": "^6.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
|
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
|
||||||
|
|
|
@ -13,8 +13,8 @@ importers:
|
||||||
version: https://codeload.github.com/OpenAsar/arrpc/tar.gz/6960a8fd4d65d566da93dbdb8a7ca474aa0a3c9c
|
version: https://codeload.github.com/OpenAsar/arrpc/tar.gz/6960a8fd4d65d566da93dbdb8a7ca474aa0a3c9c
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@vencord/venmic':
|
'@vencord/venmic':
|
||||||
specifier: ^5.0.0
|
specifier: ^6.0.0
|
||||||
version: 5.0.0
|
version: 6.0.0
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@fal-works/esbuild-plugin-global-externals':
|
'@fal-works/esbuild-plugin-global-externals':
|
||||||
specifier: ^2.1.2
|
specifier: ^2.1.2
|
||||||
|
@ -603,8 +603,8 @@ packages:
|
||||||
'@vencord/types@1.8.4':
|
'@vencord/types@1.8.4':
|
||||||
resolution: {integrity: sha512-ogLqIOHVO+5zxKUVxAfGIAUZoEfIomrlg6f0cZ/2yd5vBAn1fA9Gi/NASoKfHZuJt8ZcYw329bgn0ah/VufqMg==}
|
resolution: {integrity: sha512-ogLqIOHVO+5zxKUVxAfGIAUZoEfIomrlg6f0cZ/2yd5vBAn1fA9Gi/NASoKfHZuJt8ZcYw329bgn0ah/VufqMg==}
|
||||||
|
|
||||||
'@vencord/venmic@5.0.0':
|
'@vencord/venmic@6.0.0':
|
||||||
resolution: {integrity: sha512-28gPNLCZwjWk/r+J4Rg1Hgfp8apmFlkahGaADPASIbQ6lUjX2PVgOv4pxIPhsgMy1aZPaBwAIOeEVPoAKk6MCw==}
|
resolution: {integrity: sha512-PpeUA1L1ApnNRGnFEkl3UVYobhho5zAJJCmj98vhhKHoPcolbfotcfxCSWkXY4sHmRc2OPGzjQpr9Ut5f7CqLg==}
|
||||||
engines: {node: '>=14.15'}
|
engines: {node: '>=14.15'}
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
|
||||||
|
@ -3034,7 +3034,7 @@ snapshots:
|
||||||
standalone-electron-types: 1.0.0
|
standalone-electron-types: 1.0.0
|
||||||
type-fest: 3.13.1
|
type-fest: 3.13.1
|
||||||
|
|
||||||
'@vencord/venmic@5.0.0':
|
'@vencord/venmic@6.0.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
cmake-js: 7.3.0
|
cmake-js: 7.3.0
|
||||||
node-addon-api: 8.0.0
|
node-addon-api: 8.0.0
|
||||||
|
|
|
@ -81,14 +81,14 @@ ipcMain.handle(IpcEvents.VIRT_MIC_LIST, () => {
|
||||||
|
|
||||||
ipcMain.handle(IpcEvents.VIRT_MIC_START, (_, targets: Node[]) => {
|
ipcMain.handle(IpcEvents.VIRT_MIC_START, (_, targets: Node[]) => {
|
||||||
const pid = getRendererAudioServicePid();
|
const pid = getRendererAudioServicePid();
|
||||||
|
const settings = Settings.store;
|
||||||
|
|
||||||
const data: LinkData = {
|
const data: LinkData = {
|
||||||
include: targets,
|
include: targets,
|
||||||
exclude: [{ "application.process.id": pid }]
|
exclude: [{ "application.process.id": pid }],
|
||||||
|
ignore_devices: settings.audioIgnoreDevices
|
||||||
};
|
};
|
||||||
|
|
||||||
const settings = Settings.store;
|
|
||||||
|
|
||||||
if (settings.audioIgnoreInputMedia ?? true) {
|
if (settings.audioIgnoreInputMedia ?? true) {
|
||||||
data.exclude?.push({ "media.class": "Stream/Input/Audio" });
|
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, () => {
|
ipcMain.handle(IpcEvents.VIRT_MIC_START_SYSTEM, () => {
|
||||||
const pid = getRendererAudioServicePid();
|
const pid = getRendererAudioServicePid();
|
||||||
|
|
||||||
const settings = Settings.store;
|
const settings = Settings.store;
|
||||||
|
|
||||||
const data: LinkData = {
|
const data: LinkData = {
|
||||||
exclude: [{ "application.process.id": pid }],
|
exclude: [{ "application.process.id": pid }],
|
||||||
|
only_speakers: settings.audioOnlySpeakers,
|
||||||
|
ignore_devices: settings.audioIgnoreDevices,
|
||||||
only_default_speakers: settings.audioOnlyDefaultSpeakers
|
only_default_speakers: settings.audioOnlyDefaultSpeakers
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -188,6 +188,7 @@ function AudioSettingsModal({
|
||||||
</Modals.ModalHeader>
|
</Modals.ModalHeader>
|
||||||
<Modals.ModalContent className="vcd-screen-picker-modal">
|
<Modals.ModalContent className="vcd-screen-picker-modal">
|
||||||
<Switch
|
<Switch
|
||||||
|
hideBorder
|
||||||
onChange={v => (Settings.audioWorkaround = v)}
|
onChange={v => (Settings.audioWorkaround = v)}
|
||||||
value={Settings.audioWorkaround ?? false}
|
value={Settings.audioWorkaround ?? false}
|
||||||
note={
|
note={
|
||||||
|
@ -199,11 +200,29 @@ function AudioSettingsModal({
|
||||||
>
|
>
|
||||||
Microphone Workaround
|
Microphone Workaround
|
||||||
</Switch>
|
</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
|
<Switch
|
||||||
hideBorder
|
hideBorder
|
||||||
onChange={v => (Settings.audioOnlyDefaultSpeakers = v)}
|
onChange={v => (Settings.audioOnlyDefaultSpeakers = v)}
|
||||||
value={Settings.audioOnlyDefaultSpeakers ?? true}
|
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
|
Only Default Speakers
|
||||||
</Switch>
|
</Switch>
|
||||||
|
@ -221,13 +240,21 @@ function AudioSettingsModal({
|
||||||
value={Settings.audioIgnoreVirtual ?? true}
|
value={Settings.audioIgnoreVirtual ?? true}
|
||||||
note={
|
note={
|
||||||
<>
|
<>
|
||||||
Exclude virtual nodes, such as nodes belonging to sinks, this might be useful when using
|
Exclude virtual nodes, such as nodes belonging to sinks. This might be useful when using
|
||||||
"mix bussing"
|
"mix bussing".
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Ignore Virtual
|
Ignore Virtual
|
||||||
</Switch>
|
</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
|
<Switch
|
||||||
hideBorder
|
hideBorder
|
||||||
onChange={value => {
|
onChange={value => {
|
||||||
|
|
3
src/shared/settings.d.ts
vendored
3
src/shared/settings.d.ts
vendored
|
@ -35,7 +35,10 @@ export interface Settings {
|
||||||
audioGranularSelect?: boolean;
|
audioGranularSelect?: boolean;
|
||||||
|
|
||||||
audioIgnoreVirtual?: boolean;
|
audioIgnoreVirtual?: boolean;
|
||||||
|
audioIgnoreDevices?: boolean;
|
||||||
audioIgnoreInputMedia?: boolean;
|
audioIgnoreInputMedia?: boolean;
|
||||||
|
|
||||||
|
audioOnlySpeakers?: boolean;
|
||||||
audioOnlyDefaultSpeakers?: boolean;
|
audioOnlyDefaultSpeakers?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue