From b4587182c28172bea8837e6477ea34f7cf9e1305 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 18 Jul 2024 01:54:29 -0400 Subject: [PATCH] Fixes --- .../betterMicrophone/constants/constants.ts | 2 +- .../components/MicrophoneSettingsModal.tsx | 331 ------------------ .../betterScreenshare/constants/constants.ts | 2 +- .../stores/microphoneStore.ts | 94 ----- .../philsPluginLibrary/patches/audio.ts | 2 +- .../philsPluginLibrary/store/index.ts | 2 - .../store/microphoneStore.ts | 94 ----- .../store/screenshareAudioStore.ts | 41 --- .../store/screenshareStore.ts | 122 ------- 9 files changed, 3 insertions(+), 687 deletions(-) delete mode 100644 src/equicordplugins/betterScreenshare/components/MicrophoneSettingsModal.tsx delete mode 100644 src/equicordplugins/betterScreenshare/stores/microphoneStore.ts delete mode 100644 src/equicordplugins/philsPluginLibrary/store/microphoneStore.ts delete mode 100644 src/equicordplugins/philsPluginLibrary/store/screenshareAudioStore.ts delete mode 100644 src/equicordplugins/philsPluginLibrary/store/screenshareStore.ts diff --git a/src/equicordplugins/betterMicrophone/constants/constants.ts b/src/equicordplugins/betterMicrophone/constants/constants.ts index 961c3d20..f006dddf 100644 --- a/src/equicordplugins/betterMicrophone/constants/constants.ts +++ b/src/equicordplugins/betterMicrophone/constants/constants.ts @@ -21,7 +21,7 @@ import { Devs } from "@utils/constants"; import { types } from "../../philsPluginLibrary"; export const PluginInfo = { - PLUGIN_NAME: "BetterMicrophone", + PLUGIN_NAME: "PhilsBetterMicrophone", DESCRIPTION: "This plugin allows you to further customize your microphone.", AUTHOR: { ...Devs.philhk, diff --git a/src/equicordplugins/betterScreenshare/components/MicrophoneSettingsModal.tsx b/src/equicordplugins/betterScreenshare/components/MicrophoneSettingsModal.tsx deleted file mode 100644 index 5762a442..00000000 --- a/src/equicordplugins/betterScreenshare/components/MicrophoneSettingsModal.tsx +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2023 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - -import { Flex } from "@components/Flex"; -import { Switch } from "@components/Switch"; -import { ModalSize } from "@utils/modal"; -import { Card, Forms, Select, Slider, TextInput, useEffect, useState } from "@webpack/common"; -import { SelectOption } from "@webpack/types"; - -import { MicrophoneProfile, MicrophoneStore } from "../../betterMicrophone/stores"; -import { - ProfilableStore, - SettingsModal, - SettingsModalCard, - SettingsModalCardItem, - SettingsModalCardRow, - SettingsModalProfilesCard, - validateNumberInput, - validateTextInputNumber -} from "../../philsPluginLibrary"; -import { Styles } from "../../philsPluginLibrary/styles"; - -const simpleVoiceBitrates: readonly SelectOption[] = [ - { - label: "Normal", - value: 96 - }, - { - label: "Medium-High", - value: 160 - }, - { - label: "High", - value: 320 - }, - { - label: "Very-High", - value: 512 - } -] as const; - -export interface MicrophoneSettingsModalProps extends React.ComponentProps { - microphoneStore: ProfilableStore; - showInfo?: boolean; -} - -export const MicrophoneSettingsModal = (props: MicrophoneSettingsModalProps) => { - const { microphoneStore, showInfo } = props; - - const { - currentProfile, - simpleMode, - setSimpleMode, - deleteProfile, - duplicateProfile, - getCurrentProfile, - getDefaultProfiles, - getProfile, - getProfiles, - isCurrentProfileADefaultProfile, - profiles, - saveProfile, - setChannels, - setChannelsEnabled, - setCurrentProfile, - setFreq, - setFreqEnabled, - setPacsize, - setPacsizeEnabled, - setRate, - setRateEnabled, - setVoiceBitrate, - setVoiceBitrateEnabled - } = microphoneStore.use(); - - const { - name, - channels, - channelsEnabled, - freq, - freqEnabled, - pacsize, - pacsizeEnabled, - rate, - rateEnabled, - voiceBitrate, - voiceBitrateEnabled - } = currentProfile; - - const [isSaving, setIsSaving] = useState(false); - - const [rateInput, setRateInput] = useState(rate ? rate.toString() : ""); - const [freqInput, setFreqInput] = useState(freq ? freq.toString() : ""); - const [pacsizeInput, setPacsizeInput] = useState(pacsize ? pacsize.toString() : ""); - const [channelsInput, setChannelsInput] = useState(channels ? channels.toString() : ""); - - useEffect(() => { - setRateInput(rate ? rate.toString() : ""); - setFreqInput(freq ? freq.toString() : ""); - setPacsizeInput(pacsize ? pacsize.toString() : ""); - setChannelsInput(channels ? channels.toString() : ""); - }, [rate, freq, pacsize, channels]); - - const simpleToggle = - - Simple - setSimpleMode(checked)} /> - ; - - const settingsCardVoiceBitrateSimple = - setVoiceBitrateEnabled(status) - }}> - -