diff --git a/package.json b/package.json index ea29c6f..917dd41 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "arrpc": "github:OpenAsar/arrpc#98879cae0565e6fce34e4cb6f544bf42c6a7e7c8" }, "optionalDependencies": { - "@vencord/venmic": "^3.3.3" + "@vencord/venmic": "^3.4.1" }, "devDependencies": { "@fal-works/esbuild-plugin-global-externals": "^2.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e4d219..7099617 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,8 +11,8 @@ dependencies: optionalDependencies: '@vencord/venmic': - specifier: ^3.3.3 - version: 3.3.3 + specifier: ^3.4.1 + version: 3.4.1 devDependencies: '@fal-works/esbuild-plugin-global-externals': @@ -1000,8 +1000,8 @@ packages: type-fest: 3.13.1 dev: true - /@vencord/venmic@3.3.3: - resolution: {integrity: sha512-qC3fPAUtw8j5L6uV3m9BGEnKpuOAlrYeZzFgILF3bFnDNFE9ANJsYttoHt80laBU7C1Xo56tHG2vVpLBsH+sgw==} + /@vencord/venmic@3.4.1: + resolution: {integrity: sha512-PkMXx53nxiYBLWxiMRaBjBm8aTTJTcueKsMZ0v35TtIQ93yfuSzfCilDFLs3kYz1uQHArTaI9IGQykgmSfe/2w==} engines: {node: '>=14.15'} os: [linux] requiresBuild: true @@ -1333,11 +1333,11 @@ packages: possible-typed-array-names: 1.0.0 dev: true - /axios@1.6.7(debug@4.3.4): - resolution: {integrity: sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==} + /axios@1.6.8(debug@4.3.4): + resolution: {integrity: sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==} requiresBuild: true dependencies: - follow-redirects: 1.15.5(debug@4.3.4) + follow-redirects: 1.15.6(debug@4.3.4) form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -1576,7 +1576,7 @@ packages: hasBin: true requiresBuild: true dependencies: - axios: 1.6.7(debug@4.3.4) + axios: 1.6.8(debug@4.3.4) debug: 4.3.4 fs-extra: 11.2.0 lodash.isplainobject: 4.0.6 @@ -2540,8 +2540,8 @@ packages: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} dev: true - /follow-redirects@1.15.5(debug@4.3.4): - resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} + /follow-redirects@1.15.6(debug@4.3.4): + resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} engines: {node: '>=4.0'} requiresBuild: true peerDependencies: diff --git a/src/main/venmic.ts b/src/main/venmic.ts index c6f9d44..b86e7f6 100644 --- a/src/main/venmic.ts +++ b/src/main/venmic.ts @@ -72,11 +72,12 @@ ipcMain.handle(IpcEvents.VIRT_MIC_START, (_, targets: string[], workaround?: boo return obtainVenmic()?.link(data); }); -ipcMain.handle(IpcEvents.VIRT_MIC_START_SYSTEM, (_, workaround?: boolean) => { +ipcMain.handle(IpcEvents.VIRT_MIC_START_SYSTEM, (_, workaround?: boolean, onlyDefaultSpeakers?: boolean) => { const pid = getRendererAudioServicePid(); const data: LinkData = { - exclude: [{ key: "application.process.id", value: pid }] + exclude: [{ key: "application.process.id", value: pid }], + only_default_speakers: onlyDefaultSpeakers }; if (workaround) { diff --git a/src/preload/VesktopNative.ts b/src/preload/VesktopNative.ts index 625b8c1..4fc068a 100644 --- a/src/preload/VesktopNative.ts +++ b/src/preload/VesktopNative.ts @@ -64,7 +64,8 @@ export const VesktopNative = { list: () => invoke<{ ok: false; isGlibcxxToOld: boolean } | { ok: true; targets: string[] }>(IpcEvents.VIRT_MIC_LIST), start: (targets: string[], workaround?: boolean) => invoke(IpcEvents.VIRT_MIC_START, targets, workaround), - startSystem: (workaround?: boolean) => invoke(IpcEvents.VIRT_MIC_START_SYSTEM, workaround), + startSystem: (workaround?: boolean, onlyDefaultSpeakers?: boolean) => + invoke(IpcEvents.VIRT_MIC_START_SYSTEM, workaround, onlyDefaultSpeakers), stop: () => invoke(IpcEvents.VIRT_MIC_STOP) }, arrpc: { diff --git a/src/renderer/components/ScreenSharePicker.tsx b/src/renderer/components/ScreenSharePicker.tsx index 9842afe..eddfd7a 100644 --- a/src/renderer/components/ScreenSharePicker.tsx +++ b/src/renderer/components/ScreenSharePicker.tsx @@ -6,7 +6,7 @@ import "./screenSharePicker.css"; -import { closeModal, Margins, Modals, openModal, useAwaiter } from "@vencord/types/utils"; +import { closeModal, Margins, Modals, ModalSize, openModal, useAwaiter } from "@vencord/types/utils"; import { findStoreLazy, onceReady } from "@vencord/types/webpack"; import { Button, @@ -37,6 +37,7 @@ interface StreamSettings { audio: boolean; audioSource?: string; workaround?: boolean; + onlyDefaultSpeakers?: boolean; } export interface StreamPick extends StreamSettings { @@ -167,54 +168,61 @@ function StreamSettings({ ); return ( -
- What you're streaming - - - {source.name} - +
+
+ What you're streaming + + + {source.name} + - Stream Settings + Stream Settings - -
-
- Resolution -
- {StreamResolutions.map(res => ( - - ))} -
-
+ +
+
+ Resolution +
+ {StreamResolutions.map(res => ( + + ))} +
+
-
- Frame Rate -
- {StreamFps.map(fps => ( - - ))} -
-
-
+
+ Frame Rate +
+ {StreamFps.map(fps => ( + + ))} +
+
+
+
+
+
{isWindows && ( setSettings(s => ({ ...s, audioSource: source }))} - setWorkaround={workaround => setSettings(s => ({ ...s, workaround: workaround }))} + setWorkaround={value => setSettings(s => ({ ...s, workaround: value }))} + setOnlyDefaultSpeakers={value => setSettings(s => ({ ...s, onlyDefaultSpeakers: value }))} /> )} - +
); } @@ -242,13 +252,17 @@ function StreamSettings({ function AudioSourcePickerLinux({ audioSource, workaround, + onlyDefaultSpeakers, setAudioSource, - setWorkaround + setWorkaround, + setOnlyDefaultSpeakers }: { audioSource?: string; workaround?: boolean; + onlyDefaultSpeakers?: boolean; setAudioSource(s: string): void; setWorkaround(b: boolean): void; + setOnlyDefaultSpeakers(b: boolean): void; }) { const [sources, _, loading] = useAwaiter(() => VesktopNative.virtmic.list(), { fallbackValue: { ok: true, targets: [] } @@ -256,49 +270,74 @@ function AudioSourcePickerLinux({ const allSources = sources.ok ? ["None", "Entire System", ...sources.targets] : null; return ( -
- Audio - {loading && Loading Audio sources...} - {!sources.ok && - (sources.isGlibcxxToOld ? ( - - Failed to retrieve Audio Sources because your C++ library is too old to run venmic. If you would - like to stream with Audio, see{" "} - - this guide - - + <> + Audio Settings + + {loading ? ( + Loading Audio Sources... ) : ( - - Failed to retrieve Audio Sources. If you would like to stream with Audio, make sure you're using - Pipewire, not Pulseaudio - - ))} + Audio Source + )} - {allSources && ( - ({ label: s, value: s, default: s === "None" }))} + isSelected={s => s === audioSource} + select={setAudioSource} + serialize={String} + /> + )} - - Work around an issue that causes the microphone to be shared instead of the correct audio. Only - enable if you're experiencing this issue. - - } - > - Microphone Workaround - -
+ + + + Work around an issue that causes the microphone to be shared instead of the correct audio. + Only enable if you're experiencing this issue. + + } + > + Microphone Workaround + + + + When sharing entire desktop audio, only share apps that play to the default speakers and + ignore apps that play to other speakers or devices. + + } + > + Only Default Speakers + + + ); } @@ -323,7 +362,7 @@ function ModalComponent({ }); return ( - + ScreenShare diff --git a/src/renderer/components/screenSharePicker.css b/src/renderer/components/screenSharePicker.css index 356a1ca..c9e8110 100644 --- a/src/renderer/components/screenSharePicker.css +++ b/src/renderer/components/screenSharePicker.css @@ -11,6 +11,12 @@ gap: 1em; } +.vcd-screen-picker-settings-grid { + gap: 1em; + display: grid; + grid-template-columns: 1fr 1fr; +} + .vcd-screen-picker-grid { display: grid; grid-template-columns: 1fr 1fr;