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

ソング:voicevox以外のプロジェクトファイルもドラッグ&ドロップでインポートできるようにする #2607

Open
3 tasks
sevenc-nanashi opened this issue Mar 9, 2025 · 0 comments

Comments

@sevenc-nanashi
Copy link
Member

sevenc-nanashi commented Mar 9, 2025

内容

ustやmidなどをD&Dで読み込めるようにしたいです。

Pros 良くなる点

便利。

Cons 悪くなる点

ないはず?

実現方法

ソングのドラッグ&ドロップ機構に拡張子判断を足せば良さそう?

@Hiroshiba 追記)
トーク側のドラッグ&ドロップ機構がこちらにあります:

// ドラッグ&ドロップ
const dragEventCounter = ref(0);
const loadDraggedFile = (event: { dataTransfer: DataTransfer | null }) => {
if (!event.dataTransfer || event.dataTransfer.files.length === 0) return;
const file = event.dataTransfer.files[0];
// electronの場合のみファイルパスを取得できる
const filePath = isElectron ? window.backend.getPathForFile(file) : undefined;
switch (path.extname(file.name)) {
case ".txt":
if (filePath) {
void store.actions.COMMAND_IMPORT_FROM_FILE({ type: "path", filePath });
} else {
void store.actions.COMMAND_IMPORT_FROM_FILE({ type: "file", file });
}
break;
case ".vvproj":
if (filePath) {
void store.actions.LOAD_PROJECT_FILE({ type: "path", filePath });
} else {
void store.actions.LOAD_PROJECT_FILE({ type: "file", file });
}
break;
default:
void store.actions.SHOW_ALERT_DIALOG({
title: "対応していないファイルです",
message:
"テキストファイル (.txt) とVOICEVOXプロジェクトファイル (.vvproj) に対応しています。",
});
}
};

VOICEVOXのバージョン

0.23.0

OSの種類/ディストリ/バージョン

  • Windows
  • macOS
  • Linux

その他

https://x.com/Mogura_0708/status/1898441467280175501?utm_source=yjrealtime&utm_medium=search より。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant