From d98ab6cc41ece85b90459c8f266d9adfa49ddf94 Mon Sep 17 00:00:00 2001 From: sabonerune <102559104+sabonerune@users.noreply.github.com> Date: Sun, 8 Oct 2023 12:13:17 +0900 Subject: [PATCH 01/18] =?UTF-8?q?feat:=20VITE=5FDEFAULT=5FENGINE=5FINFOS?= =?UTF-8?q?=E3=81=AEexecutionFilePath=E3=81=A7=E7=9B=B8=E5=AF=BE=E3=83=91?= =?UTF-8?q?=E3=82=B9=E3=81=8C=E4=BD=BF=E3=81=88=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B=E3=80=82=20(#1599)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/background/engineManager.ts | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 629b03bb40..da30d9400a 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ npm ci ## 実行 -`.env.production`をコピーして`.env`を作成し、`VITE_DEFAULT_ENGINE_INFOS`内の`executionFilePath`に`voicevox_engine`のフルパスを指定します。 +`.env.production`をコピーして`.env`を作成し、`VITE_DEFAULT_ENGINE_INFOS`内の`executionFilePath`に`voicevox_engine`のパスを指定します。 [製品版 VOICEVOX](https://voicevox.hiroshiba.jp/) のディレクトリのパスを指定すれば動きます。 diff --git a/src/background/engineManager.ts b/src/background/engineManager.ts index d35f5e4eb7..e78acb465b 100644 --- a/src/background/engineManager.ts +++ b/src/background/engineManager.ts @@ -58,8 +58,9 @@ function createDefaultEngineInfos(defaultEngineDir: string): EngineInfo[] { return { ...engineInfo, type: "default", + executionFilePath: path.resolve(engineInfo.executionFilePath), path: - engineInfo.path === undefined + engineInfo.path == undefined ? undefined : path.resolve(defaultEngineDir, engineInfo.path), }; @@ -193,8 +194,8 @@ export class EngineManager { fetchEngineDirectory(engineId: EngineId): string { const engineInfo = this.fetchEngineInfo(engineId); const engineDirectory = engineInfo.path; - if (engineDirectory == null) { - throw new Error(`engineDirectory is null: engineId == ${engineId}`); + if (engineDirectory == undefined) { + throw new Error(`engineDirectory is undefined: engineId == ${engineId}`); } return engineDirectory; @@ -385,7 +386,7 @@ export class EngineManager { for (const engineIdStr of Object.keys(this.engineProcessContainers)) { const engineId = EngineId(engineIdStr); const promise = this.killEngine(engineId); - if (promise === undefined) continue; + if (promise == undefined) continue; killingProcessPromises[engineId] = promise; } @@ -410,15 +411,15 @@ export class EngineManager { } const engineProcess = engineProcessContainer.engineProcess; - if (engineProcess === undefined) { + if (engineProcess == undefined) { // nop if no process started (already killed or not started yet) log.info(`ENGINE ${engineId}: Process not started`); return undefined; } - const engineNotExited = engineProcess.exitCode === null; - const engineNotKilled = engineProcess.signalCode === null; + const engineNotExited = engineProcess.exitCode == undefined; + const engineNotKilled = engineProcess.signalCode == undefined; log.info( `ENGINE ${engineId}: last exit code: ${engineProcess.exitCode}, signal: ${engineProcess.signalCode}` @@ -469,10 +470,10 @@ export class EngineManager { ); // エンジンのプロセスがすでに終了している、またはkillされている場合 - const engineExited = engineProcess?.exitCode !== null; - const engineKilled = engineProcess?.signalCode !== null; + const engineExited = engineProcess?.exitCode != undefined; + const engineKilled = engineProcess?.signalCode != undefined; - // engineProcess === undefinedの場合true + // engineProcess == undefinedの場合true if (engineExited || engineKilled) { log.info( `ENGINE ${engineId}: Process is not started yet or already killed. Starting process...` @@ -495,10 +496,9 @@ export class EngineManager { resolve(); }; - if (engineProcess === undefined) - throw Error("engineProcess === undefined"); - if (engineProcess.pid === undefined) - throw Error("engineProcess.pid === undefined"); + if (engineProcess == undefined) throw Error("engineProcess == undefined"); + if (engineProcess.pid == undefined) + throw Error("engineProcess.pid == undefined"); engineProcess.once("close", restartEngineOnProcessClosedCallback); @@ -508,7 +508,7 @@ export class EngineManager { ); treeKill(engineProcess.pid, (error) => { // error変数の値がundefined以外であればkillコマンドが失敗したことを意味します。 - if (error != null) { + if (error != undefined) { log.error(`ENGINE ${engineId}: Failed to kill process`); log.error(error); From e3f907e845aac13a822167c27e330baef4180876 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Mon, 9 Oct 2023 11:23:03 +0900 Subject: [PATCH 02/18] =?UTF-8?q?Playwright=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=81=8C=E8=90=BD=E3=81=A1=E3=81=9F=E3=82=89Github=E3=81=A7?= =?UTF-8?q?=E3=82=A2=E3=83=8E=E3=83=86=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=20(#1587?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- playwright.config.ts | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 0433216178..df8bde5c6c 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "test-watch:unit": "vitest --watch", "test:electron-e2e": "cross-env VITE_TARGET=electron playwright test", "test-watch:electron-e2e": "cross-env PWTEST_WATCH=1 VITE_TARGET=electron playwright test", - "test:browser-e2e": "cross-env VITE_TARGET=browser playwright test --reporter=html", - "test-watch:browser-e2e": "cross-env PWTEST_WATCH=1 VITE_TARGET=browser playwright test --reporter=html", + "test:browser-e2e": "cross-env VITE_TARGET=browser playwright test", + "test-watch:browser-e2e": "cross-env PWTEST_WATCH=1 VITE_TARGET=browser playwright test", "lint": "eslint --ext .js,.vue,.ts *.config.* src tests build", "fmt": "eslint --ext .js,.vue,.ts *.config.* src tests build --fix", "markdownlint": "markdownlint --ignore node_modules/ --ignore dist/ --ignore dist_electron/ ./", diff --git a/playwright.config.ts b/playwright.config.ts index 9865ea2294..cc20265641 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -58,14 +58,9 @@ const config: PlaywrightTestConfig = { fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, - reporter: [ - [ - "html", - { - open: process.env.CI ? "never" : "on-failure", - }, - ], - ], + reporter: process.env.CI + ? [["html", { open: "never" }], ["github"]] + : [["html", { open: "on-failure" }]], /* Retry on CI only */ retries: process.env.CI ? 2 : 0, use: { From 81578271af97f8b1e27083fa290b15e5a99137a0 Mon Sep 17 00:00:00 2001 From: Kai Date: Tue, 10 Oct 2023 02:05:09 +0900 Subject: [PATCH 03/18] =?UTF-8?q?AudioInfo=E3=82=B3=E3=83=B3=E3=83=9D?= =?UTF-8?q?=E3=83=BC=E3=83=8D=E3=83=B3=E3=83=88=E3=81=AB=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=82=8B=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=81=AE=E5=88=9D=E6=9C=9F=E5=80=A4=E3=82=84=E7=AF=84?= =?UTF-8?q?=E5=9B=B2=E3=82=92=E6=A7=8B=E9=80=A0=E5=8C=96=E3=81=99=E3=82=8B?= =?UTF-8?q?=20(#1596)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AudioInfo.vue | 69 +++++++++++++++++---------------- src/store/utility.ts | 75 ++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 34 deletions(-) diff --git a/src/components/AudioInfo.vue b/src/components/AudioInfo.vue index f1aecebdc0..3d732cc80b 100644 --- a/src/components/AudioInfo.vue +++ b/src/components/AudioInfo.vue @@ -318,6 +318,7 @@ import { } from "@/helpers/previewSliderHelper"; import { EngineManifest } from "@/openapi"; import { useDefaultPreset } from "@/composables/useDefaultPreset"; +import { SLIDER_PARAMETERS } from "@/store/utility"; const props = defineProps<{ @@ -355,11 +356,11 @@ const parameters = computed(() => [ modelValue: () => query.value?.speedScale ?? null, disable: () => uiLocked.value || supportedFeatures.value?.adjustSpeedScale === false, - max: () => 2, - min: () => 0.5, - step: () => 0.01, - scrollStep: () => 0.1, - scrollMinStep: () => 0.01, + max: SLIDER_PARAMETERS.SPEED.max, + min: SLIDER_PARAMETERS.SPEED.min, + step: SLIDER_PARAMETERS.SPEED.step, + scrollStep: SLIDER_PARAMETERS.SPEED.scrollStep, + scrollMinStep: SLIDER_PARAMETERS.SPEED.scrollMinStep, onChange: (speedScale: number) => store.dispatch("COMMAND_SET_AUDIO_SPEED_SCALE", { audioKey: props.activeAudioKey, @@ -375,10 +376,10 @@ const parameters = computed(() => [ modelValue: () => query.value?.pitchScale ?? null, disable: () => uiLocked.value || supportedFeatures.value?.adjustPitchScale === false, - max: () => 0.15, - min: () => -0.15, - step: () => 0.01, - scrollStep: () => 0.01, + max: SLIDER_PARAMETERS.PITCH.max, + min: SLIDER_PARAMETERS.PITCH.min, + step: SLIDER_PARAMETERS.PITCH.step, + scrollStep: SLIDER_PARAMETERS.PITCH.scrollStep, onChange: (pitchScale: number) => store.dispatch("COMMAND_SET_AUDIO_PITCH_SCALE", { audioKey: props.activeAudioKey, @@ -395,11 +396,11 @@ const parameters = computed(() => [ disable: () => uiLocked.value || supportedFeatures.value?.adjustIntonationScale === false, - max: () => 2, - min: () => 0, - step: () => 0.01, - scrollStep: () => 0.1, - scrollMinStep: () => 0.01, + max: SLIDER_PARAMETERS.INTONATION.max, + min: SLIDER_PARAMETERS.INTONATION.min, + step: SLIDER_PARAMETERS.INTONATION.step, + scrollStep: SLIDER_PARAMETERS.INTONATION.scrollStep, + scrollMinStep: SLIDER_PARAMETERS.INTONATION.scrollMinStep, onChange: (intonationScale: number) => store.dispatch("COMMAND_SET_AUDIO_INTONATION_SCALE", { audioKey: props.activeAudioKey, @@ -415,11 +416,11 @@ const parameters = computed(() => [ modelValue: () => query.value?.volumeScale ?? null, disable: () => uiLocked.value || supportedFeatures.value?.adjustVolumeScale === false, - max: () => 2, - min: () => 0, - step: () => 0.01, - scrollStep: () => 0.1, - scrollMinStep: () => 0.01, + max: SLIDER_PARAMETERS.VOLUME.max, + min: SLIDER_PARAMETERS.VOLUME.min, + step: SLIDER_PARAMETERS.VOLUME.step, + scrollStep: SLIDER_PARAMETERS.VOLUME.scrollStep, + scrollMinStep: SLIDER_PARAMETERS.VOLUME.scrollMinStep, onChange: (volumeScale: number) => store.dispatch("COMMAND_SET_AUDIO_VOLUME_SCALE", { audioKey: props.activeAudioKey, @@ -434,11 +435,11 @@ const parameters = computed(() => [ slider: previewSliderHelper({ modelValue: () => query.value?.prePhonemeLength ?? null, disable: () => uiLocked.value, - max: () => 1.5, - min: () => 0, - step: () => 0.01, - scrollStep: () => 0.1, - scrollMinStep: () => 0.01, + max: SLIDER_PARAMETERS.PRE_PHONEME_LENGTH.max, + min: SLIDER_PARAMETERS.PRE_PHONEME_LENGTH.min, + step: SLIDER_PARAMETERS.PRE_PHONEME_LENGTH.step, + scrollStep: SLIDER_PARAMETERS.PRE_PHONEME_LENGTH.scrollStep, + scrollMinStep: SLIDER_PARAMETERS.PRE_PHONEME_LENGTH.scrollMinStep, onChange: (prePhonemeLength: number) => store.dispatch("COMMAND_SET_AUDIO_PRE_PHONEME_LENGTH", { audioKey: props.activeAudioKey, @@ -453,11 +454,11 @@ const parameters = computed(() => [ slider: previewSliderHelper({ modelValue: () => query.value?.postPhonemeLength ?? null, disable: () => uiLocked.value, - max: () => 1.5, - min: () => 0, - step: () => 0.01, - scrollStep: () => 0.1, - scrollMinStep: () => 0.01, + max: SLIDER_PARAMETERS.POST_PHONEME_LENGTH.max, + min: SLIDER_PARAMETERS.POST_PHONEME_LENGTH.min, + step: SLIDER_PARAMETERS.POST_PHONEME_LENGTH.step, + scrollStep: SLIDER_PARAMETERS.POST_PHONEME_LENGTH.scrollStep, + scrollMinStep: SLIDER_PARAMETERS.POST_PHONEME_LENGTH.scrollMinStep, onChange: (postPhonemeLength: number) => store.dispatch("COMMAND_SET_AUDIO_POST_PHONEME_LENGTH", { audioKey: props.activeAudioKey, @@ -625,11 +626,11 @@ const morphingRateSlider = previewSliderHelper({ modelValue: () => audioItem.value.morphingInfo?.rate ?? null, disable: () => uiLocked.value, onChange: setMorphingRate, - max: () => 1, - min: () => 0, - step: () => 0.01, - scrollStep: () => 0.1, - scrollMinStep: () => 0.01, + max: SLIDER_PARAMETERS.MORPHING_RATE.max, + min: SLIDER_PARAMETERS.MORPHING_RATE.min, + step: SLIDER_PARAMETERS.MORPHING_RATE.step, + scrollStep: SLIDER_PARAMETERS.MORPHING_RATE.scrollStep, + scrollMinStep: SLIDER_PARAMETERS.MORPHING_RATE.scrollMinStep, }); // プリセット diff --git a/src/store/utility.ts b/src/store/utility.ts index 307b9d247c..28758b0ed7 100644 --- a/src/store/utility.ts +++ b/src/store/utility.ts @@ -32,6 +32,81 @@ export function sanitizeFileName(fileName: string): string { return fileName.replace(sanitizer, ""); } +/** + * AudioInfoコンポーネントに表示されるパラメータ + */ +export const SLIDER_PARAMETERS = { + /** + * 話速パラメータの定義 + */ + SPEED: { + max: () => 2, + min: () => 0.5, + step: () => 0.01, + scrollStep: () => 0.1, + scrollMinStep: () => 0.01, + }, + /** + * 音高パラメータの定義 + */ + PITCH: { + max: () => 0.15, + min: () => -0.15, + step: () => 0.01, + scrollStep: () => 0.01, + }, + /** + * 抑揚パラメータの定義 + */ + INTONATION: { + max: () => 2, + min: () => 0, + step: () => 0.01, + scrollStep: () => 0.1, + scrollMinStep: () => 0.01, + }, + /** + * 音量パラメータの定義 + */ + VOLUME: { + max: () => 2, + min: () => 0, + step: () => 0.01, + scrollStep: () => 0.1, + scrollMinStep: () => 0.01, + }, + /** + * 開始無音パラメータの定義 + */ + PRE_PHONEME_LENGTH: { + max: () => 1.5, + min: () => 0, + step: () => 0.01, + scrollStep: () => 0.1, + scrollMinStep: () => 0.01, + }, + /** + * 終了無音パラメータの定義 + */ + POST_PHONEME_LENGTH: { + max: () => 1.5, + min: () => 0, + step: () => 0.01, + scrollStep: () => 0.1, + scrollMinStep: () => 0.01, + }, + /** + * モーフィングレートパラメータの定義 + */ + MORPHING_RATE: { + max: () => 1, + min: () => 0, + step: () => 0.01, + scrollStep: () => 0.1, + scrollMinStep: () => 0.01, + }, +}; + export const replaceTagIdToTagString = { index: "連番", characterName: "キャラ", From 80c64b3b861308724080232a11d7b79979e10564 Mon Sep 17 00:00:00 2001 From: Nanashi Date: Tue, 10 Oct 2023 02:13:54 +0900 Subject: [PATCH 04/18] =?UTF-8?q?=E8=A4=87=E6=95=B0=E9=81=B8=E6=8A=9E?= =?UTF-8?q?=EF=BC=9AAudioInfo=E5=AF=BE=E5=BF=9C=20(#1577)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playwright.config.ts | 2 +- src/components/AudioInfo.vue | 58 ++++--- src/store/audio.ts | 150 ++++++++++++------ src/store/type.ts | 54 +++---- ...5\200\244\345\244\211\346\233\264.spec.ts" | 82 +++++++++- tests/e2e/navigators.ts | 4 +- 6 files changed, 242 insertions(+), 108 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index cc20265641..65ea42aad2 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -52,7 +52,7 @@ const config: PlaywrightTestConfig = { * Maximum time expect() should wait for the condition to be met. * For example in `await expect(locator).toHaveText();` */ - timeout: 30 * 1000, + timeout: 5 * 1000, }, /* Run tests in files in parallel */ fullyParallel: true, diff --git a/src/components/AudioInfo.vue b/src/components/AudioInfo.vue index 3d732cc80b..7c0c60da1d 100644 --- a/src/components/AudioInfo.vue +++ b/src/components/AudioInfo.vue @@ -1,5 +1,5 @@