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

マルチトラック:インポートに対応 #2126

Merged

Conversation

sevenc-nanashi
Copy link
Member

内容

インポートをマルチトラックに対応させます。

関連 Issue

スクリーンショット・動画など

image

その他

(なし)

@sevenc-nanashi sevenc-nanashi requested a review from a team as a code owner June 20, 2024 07:36
@sevenc-nanashi sevenc-nanashi requested review from Hiroshiba and removed request for a team June 20, 2024 07:36
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ほぼLGTMです!!

もしよければ、マルチトラック用の何かしらのimport&objectスナップショットテストあると安心かもです。

src/store/singing.ts Show resolved Hide resolved
src/store/singing.ts Outdated Show resolved Hide resolved
src/components/Dialog/ImportSongProjectDialog.vue Outdated Show resolved Hide resolved
Comment on lines -284 to +306
if (project.value == null || selectedTrack.value == null) {
if (project.value == null || selectedTrackIndexes.value == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他と合わせて、空っぽのときもエラーでも良いかも
(そのままでも良いかも)

このあたりの処理(disableになってるかとか)をstorybook辺りでテスト書けるとかっこいいかもですね

Comment on lines 117 to 118
const isTracksEmpty = (tracks: Map<TrackId, Track>) =>
tracks.size === 1 && [...tracks.values()][0].notes.length === 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こういうのがいっぱい詰め込まれたutitliyあった記憶。
そちらに似た関数あればそちらに書くほうがまとまり良いかも。

あとsize==0のときもempty判定で良いかも?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sing/domain.tsにisValid系がたくさんありましたが、Map<TrackId, Tracks>を使ってるのはここくらいしかないのでここに置くのがいいかな~って感じでした。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

domain.tsに置くとsinging.tsがすっきりするので、domain.tsに置いても良いと思います。
また、この関数ではkey(TrackId)は必要ないので、引数の型はTrack[]でも良いかもです。
isTrackEmpty: (track: Track) => booleanにして
tracksArray.length === 1 && isTrackEmpty(tracksArray[0])でも良いかも。

src/store/singing.ts Outdated Show resolved Hide resolved
@Hiroshiba Hiroshiba self-requested a review June 20, 2024 14:55
src/store/singing.ts Outdated Show resolved Hide resolved
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ほぼLGTMです!

src/components/Dialog/ImportSongProjectDialog.vue Outdated Show resolved Hide resolved
src/components/Dialog/ImportSongProjectDialog.vue Outdated Show resolved Hide resolved
src/store/singing.ts Outdated Show resolved Hide resolved
src/store/singing.ts Outdated Show resolved Hide resolved
src/store/singing.ts Outdated Show resolved Hide resolved
src/store/singing.ts Show resolved Hide resolved
src/store/singing.ts Outdated Show resolved Hide resolved
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

ちょっとこちらでUIの調整をさせていただこうと思います!
(詳細開くとはみ出る点は未解決ですが。。)

startFrame: 0,
trackId,
});
// 色々な処理を動かすため、二重にセットする
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも忘れないようにTODOコメント入れさせていただきます 🙇

@Hiroshiba Hiroshiba merged commit 7771ae9 into VOICEVOX:project-multitrack Jun 30, 2024
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants