Skip to content

Commit

Permalink
[release-0.17] hotfix: プロジェクトファイル読み込みと声量・音域パラメータの初期化バグ修正 (#1927)
Browse files Browse the repository at this point in the history
* ロジェクトファイル読み込みと声量・音域パラメータの初期化バグ修正

* ワークアラウンド追加
  • Loading branch information
Hiroshiba authored Mar 9, 2024
1 parent 6a98b2c commit 2e20854
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
10 changes: 8 additions & 2 deletions src/components/Sing/SingEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ onetimeWatch(
notes: [],
},
});
// CI上のe2eテストのNemoエンジンには歌手がいないためエラーになるのでワークアラウンド
// FIXME: 歌手をいると見せかけるmock APIを作り、ここのtry catchを削除する
try {
await store.dispatch("SET_SINGER", {});
} catch (e) {
window.backend.logError(e);
}
}
await store.dispatch("SET_VOLUME", { volume: 0.6 });
Expand All @@ -101,8 +109,6 @@ onetimeWatch(
});
isCompletedInitialStartup.value = true;
await store.dispatch("SET_SINGER", {});
return "unwatch";
},
{
Expand Down
25 changes: 16 additions & 9 deletions src/components/Sing/ToolBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
<script setup lang="ts">
import { computed, watch, ref, onMounted, onUnmounted } from "vue";
import { useStore } from "@/store";
import { isProduction } from "@/type/preload";
import {
getSnapTypes,
Expand Down Expand Up @@ -214,7 +213,7 @@ watch(
() => {
bpmInputBuffer.value = tempos.value[0].bpm;
},
{ deep: true }
{ deep: true, immediate: true }
);
watch(
Expand All @@ -223,16 +222,24 @@ watch(
beatsInputBuffer.value = timeSignatures.value[0].beats;
beatTypeInputBuffer.value = timeSignatures.value[0].beatType;
},
{ deep: true }
{ deep: true, immediate: true }
);
watch(keyRangeAdjustment, () => {
keyRangeAdjustmentInputBuffer.value = keyRangeAdjustment.value;
});
watch(
keyRangeAdjustment,
() => {
keyRangeAdjustmentInputBuffer.value = keyRangeAdjustment.value;
},
{ immediate: true }
);
watch(volumeRangeAdjustment, () => {
volumeRangeAdjustmentInputBuffer.value = volumeRangeAdjustment.value;
});
watch(
volumeRangeAdjustment,
() => {
volumeRangeAdjustmentInputBuffer.value = volumeRangeAdjustment.value;
},
{ immediate: true }
);
const setBpmInputBuffer = (bpmStr: string | number | null) => {
const bpmValue = Number(bpmStr);
Expand Down
3 changes: 3 additions & 0 deletions src/store/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ const applySongProjectToStore = async (
await dispatch("SET_KEY_RANGE_ADJUSTMENT", {
keyRangeAdjustment: tracks[0].keyRangeAdjustment,
});
await dispatch("SET_VOLUME_RANGE_ADJUSTMENT", {
volumeRangeAdjustment: tracks[0].volumeRangeAdjustment,
});
await dispatch("SET_SCORE", {
score: {
tpqn,
Expand Down

0 comments on commit 2e20854

Please sign in to comment.