From 486f301c037922e257751d22fc896d614c7738d1 Mon Sep 17 00:00:00 2001 From: Curve Date: Sun, 9 Jun 2024 21:46:42 +0200 Subject: [PATCH] refactor(venmic): types --- src/main/venmic.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/venmic.ts b/src/main/venmic.ts index d17b507..885fd2d 100644 --- a/src/main/venmic.ts +++ b/src/main/venmic.ts @@ -4,7 +4,7 @@ * Copyright (c) 2023 Vendicated and Vencord contributors */ -import type { Node, PatchBay as PatchBayType } from "@vencord/venmic"; +import type { LinkData, Node, PatchBay as PatchBayType } from "@vencord/venmic"; import { app, ipcMain } from "electron"; import { join } from "path"; import { IpcEvents } from "shared/IpcEvents"; @@ -12,8 +12,6 @@ import { STATIC_DIR } from "shared/paths"; import { Settings } from "./settings"; -type LinkData = Parameters[0]; - let PatchBay: typeof PatchBayType | undefined; let patchBayInstance: PatchBayType | undefined; @@ -85,17 +83,17 @@ ipcMain.handle(IpcEvents.VIRT_MIC_START, (_, include: Node[]) => { const { ignoreDevices, ignoreInputMedia, ignoreVirtual, workaround } = Settings.store.audio ?? {}; const data: LinkData = { - include: include, + include, exclude: [{ "application.process.id": pid }], ignore_devices: ignoreDevices }; if (ignoreInputMedia ?? true) { - data.exclude!.push({ "media.class": "Stream/Input/Audio" }); + data.exclude.push({ "media.class": "Stream/Input/Audio" }); } if (ignoreVirtual) { - data.exclude!.push({ "node.virtual": "true" }); + data.exclude.push({ "node.virtual": "true" }); } if (workaround) { @@ -112,6 +110,7 @@ ipcMain.handle(IpcEvents.VIRT_MIC_START_SYSTEM, (_, exclude: Node[]) => { Settings.store.audio ?? {}; const data: LinkData = { + include: [], exclude: [{ "application.process.id": pid }, ...exclude], only_speakers: onlySpeakers, ignore_devices: ignoreDevices,