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

[project-sequencer-statemachine] ツールに対応 #2517

Conversation

sigprogramming
Copy link
Contributor

@sigprogramming sigprogramming commented Jan 31, 2025

内容

ツールに対応します。

具体的には以下を行います。

  • ツールごとにIdleStateを用意
    • SelectNotesToolIdleStateを追加
    • EditNotesToolIdleStateを追加
    • DrawPitchToolIdleStateを追加
    • ErasePitchToolIdleStateを追加
  • 各IdleStateからプレビュー処理のステート(addNoteStateなど)を使用できるように
    • プレビュー処理のステートにreturnStateIdを渡すように変更

関連 Issue

その他

@voicevox-preview-pages
Copy link

voicevox-preview-pages bot commented Jan 31, 2025

🚀 プレビュー用ページを作成しました 🚀

更新時点でのコミットハッシュ:99c0bbe

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 15 changed files in this pull request and generated 1 comment.

Files not reviewed (10)
  • src/sing/sequencerStateMachine/states/moveNoteState.ts: Evaluated as low risk
  • src/sing/sequencerStateMachine/index.ts: Evaluated as low risk
  • src/sing/sequencerStateMachine/states/resizeNoteRightState.ts: Evaluated as low risk
  • src/composables/useSequencerStateMachine.ts: Evaluated as low risk
  • src/sing/sequencerStateMachine/states/resizeNoteLeftState.ts: Evaluated as low risk
  • src/sing/sequencerStateMachine/states/addNoteState.ts: Evaluated as low risk
  • src/sing/sequencerStateMachine/states/erasePitchState.ts: Evaluated as low risk
  • src/sing/sequencerStateMachine/states/selectNotesWithRectState.ts: Evaluated as low risk
  • src/sing/sequencerStateMachine/states/drawPitchState.ts: Evaluated as low risk
  • src/sing/sequencerStateMachine/states/selectNotesToolIdleState.ts: Evaluated as low risk

src/sing/stateMachine.ts Outdated Show resolved Hide resolved
@sigprogramming sigprogramming marked this pull request as ready for review January 31, 2025 22:07
@sigprogramming sigprogramming requested a review from a team as a code owner January 31, 2025 22:07
@sigprogramming sigprogramming requested review from Hiroshiba and removed request for a team January 31, 2025 22:07
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.

一点すごい難しそうな点に気づいてしまったのでコメントしました 🙇

Comment on lines +34 to +40
if (isOnCommandOrCtrlKeyDown(input.mouseEvent)) {
setNextState("erasePitch", {
cursorPosAtStart: input.cursorPos,
targetTrackId: selectedTrackId,
returnStateId: this.id,
});
} else {
Copy link
Member

Choose a reason for hiding this comment

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

これなかなか・・・という相当難しそうなのですが、今のmainブランチだとペンモードでctrl押すと消しゴムツールが選ばれてるようなUIになるんですよねー。。。
難度を考えなければStateがEraseに移動すべきなんですが。。。どうしましょう。。。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ctrl押したときですが、「消しゴムツールが選ばれる」ではなく「消しゴムツールと同じ動作になる」でも良いかもと思っています。(ステートは変えずに、動作とマウスカーソルを変える形)
ちなみにVoiSonaでは、Ctrlキーを押すとマウスカーソルは変わりますが、ツールの選択状態の表示は変わらないようになっていました。

ステートを変える(Eraseに移動する)形にするなら、今はステートが次のステートを決定する設計になっているので、EraseにtransitionStateIdOnCtrlKeyReleasedを渡す感じになるかなと思います。
(遷移先のステートの決定をステート以外が行う設計にすればもっと自然になると思いますが、ひとまず今の設計で各ステートの処理を一通り実装して、その後改良、という流れで進めるのが良いかなと思っています)

Copy link
Member

Choose a reason for hiding this comment

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

たしかに、消しゴムアイコンにさえすればツールの選択状態は変えなくても良さそうにも感じました!!

共有まで…! @romot-co

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!!

@Hiroshiba Hiroshiba enabled auto-merge (squash) February 2, 2025 13:35
@Hiroshiba Hiroshiba disabled auto-merge February 2, 2025 13:35
@Hiroshiba Hiroshiba merged commit fce6ce8 into VOICEVOX:project-sequencer-statemachine Feb 2, 2025
10 checks passed
@sigprogramming sigprogramming deleted the support_tools branch February 2, 2025 15:58
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.

2 participants