From 3f4936f1cf0ac80cefd547d4f7a3a1252974dc5a Mon Sep 17 00:00:00 2001 From: Oleh Polisan Date: Thu, 2 May 2024 21:25:30 +0300 Subject: [PATCH] restored accidentally (how???) removed code --- src/renderer/components/ScreenSharePicker.tsx | 62 +++++++++++-------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/src/renderer/components/ScreenSharePicker.tsx b/src/renderer/components/ScreenSharePicker.tsx index 253fccc..e9fd78e 100644 --- a/src/renderer/components/ScreenSharePicker.tsx +++ b/src/renderer/components/ScreenSharePicker.tsx @@ -334,9 +334,13 @@ function AudioSourcePickerLinux({ setOnlyDefaultSpeakers(b: boolean): void; }) { const [sources, _, loading] = useAwaiter(() => VesktopNative.virtmic.list(), { - fallbackValue: { ok: true, targets: [] } + fallbackValue: { ok: true, targets: [], hasPipewirePulse: true } }); + const allSources = sources.ok ? ["None", "Entire System", ...sources.targets] : null; + const hasPipewirePulse = sources.ok ? sources.hasPipewirePulse : true; + + const [ignorePulseWarning, setIgnorePulseWarning] = useState(false); return ( <> @@ -348,32 +352,38 @@ function AudioSourcePickerLinux({ Audio Source )} - {!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 - - - ) : ( - - Failed to retrieve Audio Sources. If you would like to stream with Audio, make sure you're - using Pipewire, not Pulseaudio - - ))} + {!sources.ok && sources.isGlibCxxOutdated && ( + + Failed to retrieve Audio Sources because your C++ library is too old to run + + venmic + + . See{" "} + + this guide + {" "} + for possible solutions. + + )} - {allSources && ( - ({ label: s, value: s, default: s === "None" }))} + isSelected={s => s === audioSource} + select={setAudioSource} + serialize={String} + /> + ) + ) : ( + + Could not find pipewire-pulse. This usually means that you do not run pipewire as your main + audio-server.
+ You can still continue, however, please beware that you can only share audio of apps that are + running under pipewire. +
+ setIgnorePulseWarning(true)}>I know what I'm doing +
)}