refactor(venmic): types
This commit is contained in:
parent
570fa7544f
commit
486f301c03
1 changed files with 5 additions and 6 deletions
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* 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 { app, ipcMain } from "electron";
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import { IpcEvents } from "shared/IpcEvents";
|
import { IpcEvents } from "shared/IpcEvents";
|
||||||
|
@ -12,8 +12,6 @@ import { STATIC_DIR } from "shared/paths";
|
||||||
|
|
||||||
import { Settings } from "./settings";
|
import { Settings } from "./settings";
|
||||||
|
|
||||||
type LinkData = Parameters<PatchBayType["link"]>[0];
|
|
||||||
|
|
||||||
let PatchBay: typeof PatchBayType | undefined;
|
let PatchBay: typeof PatchBayType | undefined;
|
||||||
let patchBayInstance: 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 { ignoreDevices, ignoreInputMedia, ignoreVirtual, workaround } = Settings.store.audio ?? {};
|
||||||
|
|
||||||
const data: LinkData = {
|
const data: LinkData = {
|
||||||
include: include,
|
include,
|
||||||
exclude: [{ "application.process.id": pid }],
|
exclude: [{ "application.process.id": pid }],
|
||||||
ignore_devices: ignoreDevices
|
ignore_devices: ignoreDevices
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ignoreInputMedia ?? true) {
|
if (ignoreInputMedia ?? true) {
|
||||||
data.exclude!.push({ "media.class": "Stream/Input/Audio" });
|
data.exclude.push({ "media.class": "Stream/Input/Audio" });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ignoreVirtual) {
|
if (ignoreVirtual) {
|
||||||
data.exclude!.push({ "node.virtual": "true" });
|
data.exclude.push({ "node.virtual": "true" });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workaround) {
|
if (workaround) {
|
||||||
|
@ -112,6 +110,7 @@ ipcMain.handle(IpcEvents.VIRT_MIC_START_SYSTEM, (_, exclude: Node[]) => {
|
||||||
Settings.store.audio ?? {};
|
Settings.store.audio ?? {};
|
||||||
|
|
||||||
const data: LinkData = {
|
const data: LinkData = {
|
||||||
|
include: [],
|
||||||
exclude: [{ "application.process.id": pid }, ...exclude],
|
exclude: [{ "application.process.id": pid }, ...exclude],
|
||||||
only_speakers: onlySpeakers,
|
only_speakers: onlySpeakers,
|
||||||
ignore_devices: ignoreDevices,
|
ignore_devices: ignoreDevices,
|
||||||
|
|
Reference in a new issue