Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ソロ全解除をして再生すると、全解除前のように聞こえるバグの修正 #2199

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/store/singing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2365,8 +2365,10 @@ export const singingStore = createPartialStore<SingingStoreTypes>({
track.solo = false;
}
},
action({ commit }) {
action({ commit, dispatch }) {
commit("UNSOLO_ALL_TRACKS");

dispatch("RENDER");
},
},

Expand Down Expand Up @@ -2503,26 +2505,30 @@ export const singingCommandStore = transformCommandStore(
singingStore.mutations.SET_TIME_SIGNATURE(draft, { timeSignature });
},
// 拍子を設定する。既に同じ位置に拍子が存在する場合は置き換える。
action({ commit }, { timeSignature }: { timeSignature: TimeSignature }) {
action({ commit, dispatch }, { timeSignature }) {
if (!isValidTimeSignature(timeSignature)) {
throw new Error("The time signature is invalid.");
}
commit("COMMAND_SET_TIME_SIGNATURE", { timeSignature });

dispatch("RENDER");
},
},
COMMAND_REMOVE_TIME_SIGNATURE: {
mutation(draft, { measureNumber }) {
singingStore.mutations.REMOVE_TIME_SIGNATURE(draft, { measureNumber });
},
// 拍子を削除する。先頭の拍子の場合はデフォルトの拍子に置き換える。
action({ state, commit }, { measureNumber }: { measureNumber: number }) {
action({ state, commit, dispatch }, { measureNumber }) {
const exists = state.timeSignatures.some((value) => {
return value.measureNumber === measureNumber;
});
if (!exists) {
throw new Error("The time signature does not exist.");
}
commit("COMMAND_REMOVE_TIME_SIGNATURE", { measureNumber });

dispatch("RENDER");
},
},
COMMAND_ADD_NOTES: {
Expand Down Expand Up @@ -2738,8 +2744,10 @@ export const singingCommandStore = transformCommandStore(
mutation(draft) {
singingStore.mutations.UNSOLO_ALL_TRACKS(draft, undefined);
},
action({ commit }) {
action({ commit, dispatch }) {
commit("COMMAND_UNSOLO_ALL_TRACKS");

dispatch("RENDER");
},
},

Expand Down
Loading