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

feat: VST版エディタをマージ #2521

Open
wants to merge 121 commits into
base: project-vst
Choose a base branch
from

Conversation

sevenc-nanashi
Copy link
Member

内容

自リポジトリのVST版エディタをマージします。

関連 Issue

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

(なし)

その他

(なし)

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.

コードなるほどでした!!

ちょっとまだ大まかにしか読めてないのですが、一旦レビューコメントまで・・・!

.eslintrc.js Outdated Show resolved Hide resolved
src/backend/browser/sandbox.ts Outdated Show resolved Hide resolved
src/backend/vst/ipc.ts Outdated Show resolved Hide resolved
src/backend/vst/ipc.ts Outdated Show resolved Hide resolved
src/backend/vst/vstPlugin.ts Outdated Show resolved Hide resolved
src/components/Sing/ScoreSequencer.vue Outdated Show resolved Hide resolved
Comment on lines 42 to +43
let engineInfos;
if (isElectron) {
if (isElectron && isNode) {
Copy link
Member

Choose a reason for hiding this comment

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

特にVSTに関係ない変更ですかね?

変更自体は良さそう感!
でもいつの間にかmain側でこの辺が変わって、projectブランチがマージされるころにはこのコードを忘れていて、マージしてバグるということが起きそうかも。
mainにマージできると嬉しそう!

Copy link
Member Author

Choose a reason for hiding this comment

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

特にVSTに関係ない変更ですかね?

  • vst版のプラグインを差し込むためにvst/vstPlugin.tsが読まれる
  • vstPlugin.tsはbrowser/contract.tsが依存にあるのでそれが読み込まれる
  • browser/contract.tsの時限爆弾(この行)が爆発する

って感じでした。

mainにマージできると嬉しそう!

後でPRします。

Copy link
Member

Choose a reason for hiding this comment

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

お これPR済みでしたらresolveお願いできると!

* trueが返されたらunwatchするwatch
* "unwatch"が返されたらunwatchするwatch
Copy link
Member

Choose a reason for hiding this comment

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

これもついでにmainに入れられると・・・!
(でも流石に変わらなそうなのでどっちでも良さそう)

src/store/singing.ts Outdated Show resolved Hide resolved
src/store/singing.ts Outdated Show resolved Hide resolved
Comment on lines +3554 to +3558
GET_SINGING_VOICE: {
action(_, { key }) {
return singingVoiceCache.get(key);
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

キャッシュから取得なので、GET_SINGING_VOICE_FROM_CACHEが良いかも。

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.

ちょっと一旦ひとかたまりのコメントまで!
#2521 (comment)

...browserSandbox,
async getAppInfos() {
const appInfo = {
name: await getProjectName(),
Copy link
Member

Choose a reason for hiding this comment

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

ここプロジェクト名にしてる意図はなんでしょう 👀
(ブラウザと挙動合わせて良さそう、と思ってます)

Copy link
Member Author

Choose a reason for hiding this comment

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

Electron版の再現ですね。

あ、getProjectNameはCARGO_PKG_NAMEを取得する関数です。(紛らわしいので変えます)

Copy link
Member

@Hiroshiba Hiroshiba Feb 16, 2025

Choose a reason for hiding this comment

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

なるほど・・・・・・?
あれこれ、もしかしたらbackendへの実装要らないかもですね!!

VOICEVOX VSTと表示したい感じでしょうか。たぶんVST内なのは自明なので、VSTはむしろ無い方が良いかも。
スマホ版アプリタイトルに「スマホ版」とは書かなそうだなと。

これelectron側に実装あるのもVITEがなかった時代の名残というか、appからしか取れなかった時代の名残な気がするので、直でVITEから得れば良い気がする!!
ちょっとPR作ります!!

作っちゃいました!
#2538

src/backend/vst/sandbox.ts Show resolved Hide resolved
logError(params.map(String).join(" "));
},

async getInitialProjectFilePath() {
Copy link
Member

Choose a reason for hiding this comment

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

コツですが、typeや他の実装と順番を合わせておいたほうが良いです。こういうとこが割れ窓になってくる。
順番違い見つけたら積極的に直しちゃってください!!

* VST版のSandBox実装
* ブラウザ版のSandBoxを継承している
*/
export const api: Sandbox = {
Copy link
Member

Choose a reason for hiding this comment

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

あ~ここ順番ぐちゃぐちゃですね!
すみません、いったん並び替えお願いします!!

* ブラウザ版のSandBoxを継承している
*/
export const api: Sandbox = {
...browserSandbox,
Copy link
Member

Choose a reason for hiding this comment

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

例えばgetAltPortInfos辺りとかブラウザ版のを使ってますが、仮にブラウザ版側にブラウザ版専用の機能が実装されたらバグると思います!
その関数の挙動によっては致命的な問題になりえるはずです。

ちなみにこれをもうちょっと一般化すると、SOLID原則のOに反してると思います。(最近本で読んで理解しました)
Open-Closedの法則。ブラウザ版の影響範囲がブラウザ版でclosedじゃないので。

こんな感じで、今ブラウザと挙動が一緒でも、vstにとってどうあるべきかが大事なんですよね。
この関数群オブジェクトがどういう処理をするかだけ考えるのではなく、どの概念に使われて、どうあるべきなのかを考えると良いと思います。

...browserSandboxをやめて、本当に共通化しても良さそうなとこはhoge() => {return browserSandbox.hoge()}などとするのはどうでしょうか。

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.

4 participants