feat: audio mode

This commit is contained in:
2025-03-29 00:55:31 +00:00
parent ad5a800d1b
commit 17411e8f0d
9 changed files with 203 additions and 8 deletions

View File

@ -1,4 +1,6 @@
<script setup lang="ts">
import { computed } from 'vue';
import SelectButton from 'primevue/selectbutton';
import ToggleSwitch from 'primevue/toggleswitch';
import FileEditor from './FileEditor.vue';
import OptionCategory from './OptionCategory.vue';
@ -12,6 +14,54 @@ import { usePrfStore } from '../stores';
const prf = usePrfStore();
const audioModel = computed({
get() {
return prf.current?.data.mu3_ini?.audio ?? null;
},
set(value: 'Shared' | 'Excl6Ch' | 'Excl2Ch') {
if (prf.current!.data.mu3_ini === undefined) {
prf.current!.data.mu3_ini = {};
}
prf.current!.data.mu3_ini!.audio = value;
},
});
// const blacklistMinModel = computed({
// get() {
// if (prf.current?.data.mu3_ini?.blacklist === undefined) {
// return null;
// }
// return prf.current?.data.mu3_ini?.blacklist[0];
// },
// set(value: number) {
// if (prf.current!.data.mu3_ini === undefined) {
// prf.current!.data.mu3_ini = {};
// }
// prf.current!.data.mu3_ini!.blacklist = [
// value,
// prf.current!.data.mu3_ini!.blacklist?.[1] ?? 19999,
// ];
// },
// });
// const blacklistMaxModel = computed({
// get() {
// if (prf.current?.data.mu3_ini?.blacklist === undefined) {
// return null;
// }
// return prf.current?.data.mu3_ini?.blacklist[1];
// },
// set(value: number) {
// if (prf.current!.data.mu3_ini === undefined) {
// prf.current!.data.mu3_ini = {};
// }
// prf.current!.data.mu3_ini!.blacklist = [
// prf.current!.data.mu3_ini!.blacklist?.[0] ?? 10000,
// value,
// ];
// },
// });
prf.reload();
</script>
@ -36,6 +86,47 @@ prf.reload();
<!-- @vue-expect-error -->
<ToggleSwitch v-model="prf.current!.data.bepinex.console" />
</OptionRow>
<OptionRow
title="Audio mode"
tooltip="Exclusive 2-channel mode requires a patch"
>
<SelectButton
v-model="audioModel"
:options="[
{ title: 'Shared', value: 'Shared' },
{ title: 'Exclusive 6-channel', value: 'Excl6Ch' },
{ title: 'Exclusive 2-channel', value: 'Excl2Ch' },
]"
:allow-empty="true"
option-label="title"
option-value="value"
/></OptionRow>
<!-- <OptionRow
class="number-input"
title="Song ID Blacklist"
tooltip="Requires a patch"
><InputNumber
class="shrink"
size="small"
:min="10000"
:max="99999"
placeholder="10000"
:use-grouping="false"
:allow-empty="false"
v-model="blacklistMinModel" />
x
<InputNumber
class="shrink"
size="small"
:min="10000"
:max="99999"
placeholder="19999"
:use-grouping="false"
:allow-empty="false"
v-model="blacklistMaxModel"
/></OptionRow> -->
</OptionCategory>
</template>

View File

@ -19,6 +19,7 @@ const prf = usePrfStore();
icon="pi pi-plus"
class="chunithm-button profile-button"
@click="() => prf.create('chunithm')"
v-tooltip="'!!! Experimental !!!'"
/>
</div>
<div class="mt-12 flex flex-col flex-wrap align-middle gap-4">

View File

@ -31,6 +31,15 @@ const aimeCodeModel = computed({
},
});
const aimeCodePaste = (ev: ClipboardEvent) => {
aimeCodeModel.value =
ev.clipboardData
?.getData('text/plain')
.split('')
.filter((c) => c >= '0' && c <= '9')
.join('') ?? '';
};
(async () => {
const aime_path = await path.join(await prf.configDir, 'aime.txt');
aimeCode.value = await readTextFile(aime_path).catch(() => '');
@ -67,6 +76,7 @@ const aimeCodeModel = computed({
:maxlength="20"
placeholder="00000000000000000000"
v-model="aimeCodeModel"
@paste="aimeCodePaste"
/>
</OptionRow>
<div v-if="prf.current!.data.sgt.aime?.hasOwnProperty('AMNet')">

View File

@ -52,6 +52,7 @@ export interface ProfileData {
display: DisplayConfig;
network: NetworkConfig;
bepinex: BepInExConfig;
mu3_ini: Mu3IniConfig | undefined;
}
export interface SegatoolsConfig {
@ -88,10 +89,16 @@ export interface NetworkConfig {
subnet: string;
suffix: number | null;
}
export interface BepInExConfig {
console: boolean;
}
export interface Mu3IniConfig {
audio?: 'Shared' | 'Excl6Ch' | 'Excl2Ch';
// blacklist?: [number, number];
}
export interface Profile {
meta: ProfileMeta;
data: ProfileData;