Skip to content

Commit

Permalink
エディタ表示できた!
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Sep 7, 2024
1 parent 52c3e72 commit cdec85a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
10 changes: 7 additions & 3 deletions src/components/Sing/ScoreSequencer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ import { applyGaussianFilter, linearInterpolation } from "@/sing/utility";
import { useLyricInput } from "@/composables/useLyricInput";
import { ExhaustiveError } from "@/type/utility";
import { uuid4 } from "@/helpers/random";
import {
onMountedOrActivated,
onUnmountedOrDeactivated,
} from "@/composables/onMountOrActivate";
type PreviewMode =
| "ADD_NOTE"
Expand Down Expand Up @@ -1333,7 +1337,7 @@ onMounted(() => {
let firstActivation = true;
// スクロール位置を設定する
onActivated(() => {
onMountedOrActivated(() => {
const sequencerBodyElement = sequencerBody.value;
if (!sequencerBodyElement) {
throw new Error("sequencerBodyElement is null.");
Expand Down Expand Up @@ -1362,7 +1366,7 @@ onActivated(() => {
});
// リスナー登録
onActivated(() => {
onMountedOrActivated(() => {
void store.dispatch("ADD_PLAYHEAD_POSITION_CHANGE_LISTENER", {
listener: playheadPositionChangeListener,
});
Expand All @@ -1371,7 +1375,7 @@ onActivated(() => {
});
// リスナー解除
onDeactivated(() => {
onUnmountedOrDeactivated(() => {
void store.dispatch("REMOVE_PLAYHEAD_POSITION_CHANGE_LISTENER", {
listener: playheadPositionChangeListener,
});
Expand Down
2 changes: 0 additions & 2 deletions src/components/Sing/SingEditor.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import defaultTheme from "@/../public/themes/default.json";
import { cloneWithUnwrapProxy } from "@/helpers/cloneWithUnwrapProxy";
import { assetsPath } from "@/mock/engineMock/constants";

TODO: SingEditorの縦幅を変わらないようにする;

const meta: Meta<typeof SingEditor> = {
component: SingEditor,
args: {
Expand Down
4 changes: 1 addition & 3 deletions src/components/Sing/SingEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,8 @@ onetimeWatch(
@use "@/styles/variables" as vars;
@use "@/styles/colors" as colors;
.layout-container {
min-height: calc(100vh - #{vars.$menubar-height});
}
.sing-main {
height: calc(100vh - #{vars.$toolbar-height});
display: flex;
overflow: hidden;
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion src/mock/engineMock/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export function createOpenAPIEngineMock(): IEngineConnectorFactory {
volume,
phonemes,
volumeScale: 1.0,
outputSamplingRate: 44100,
outputSamplingRate: 24000,
outputStereo: false,
};
},
Expand Down
6 changes: 3 additions & 3 deletions src/mock/engineMock/singModelMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ export function notesAndFramePhonemesToPitchMock(
if (phoneme.phoneme == "pau") {
pitch = 0;
} else {
console.log("notesAndFramePhonemesToPitchMock phoneme", phoneme);

// IDが同じノートを探す
const note = notes
.filter((note) => note.id != undefined)
.find((note) => note.id == phoneme.noteId);
if (note == undefined)
throw new Error(`ノートが見つかりません: ${i} ${phoneme.phoneme}`);
throw new Error(
`ノートが見つかりません: index=${i} phoneme=${phoneme.phoneme}`,
);

if (note.key != undefined) {
pitch = phonemeAndKeyToPitchMock(phoneme.phoneme, note.key);
Expand Down
1 change: 1 addition & 0 deletions src/sing/phraseRendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const createNotesForRequestToEngine = (
);
const noteOffFrame = Math.round(noteOffSeconds * frameRate);
notesForRequestToEngine.push({
id: note.id,
key: note.noteNumber,
frameLength: noteOffFrame - noteOnFrame,
lyric: note.lyric,
Expand Down

0 comments on commit cdec85a

Please sign in to comment.