Skip to content

Commit

Permalink
Update: プロジェクトファイルの拡張子を .vvproj から .aisp に変更
Browse files Browse the repository at this point in the history
AivisSpeech Project file の略
現時点では VOICEVOX のプロジェクトファイルと同一フォーマットだが、今後 AivisSpeech 独自に変更する可能性もある
誤って VOICEVOX で作成したプロジェクトファイルをロードしてしまうのを防ぐためにも、異なる拡張子とした方が望ましい
  • Loading branch information
tsukumijima committed Mar 4, 2024
1 parent 71979b0 commit a18f6c9
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion build/installer_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ cat << EOS > "${MIME_INSTALL_DIR}/packages/aivisspeech.xml"
<comment>AivisSpeech Project file</comment>
<comment xml:lang="ja">AivisSpeech プロジェクトファイル</comment>
<sub-class-of type="application/json" />
<glob pattern="*.vvproj" />
<glob pattern="*.aisp" />
<icon name="aivisspeech" />
</mime-type>
<mime-type type="application/x-voicevox-plugin-package">
Expand Down
4 changes: 2 additions & 2 deletions electron-builder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ const builderOptions = {
files: ["dist/**/*", "package.json"],
fileAssociations: [
{
ext: "vvproj",
ext: "aisp",
name: "AivisSpeech Project file",
description: "AivisSpeech Project file",
role: "Editor",
icon: "icons/vvproj." + (isMac ? "icns" : "ico"),
icon: "icons/aisp." + (isMac ? "icns" : "ico"),
},
{
ext: "vvpp",
Expand Down
12 changes: 6 additions & 6 deletions src/backend/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ async function createWindow() {
let projectFilePath = "";
if (isMac) {
if (filePathOnMac) {
if (filePathOnMac.endsWith(".vvproj")) {
if (filePathOnMac.endsWith(".aisp")) {
projectFilePath = encodeURI(filePathOnMac);
}
filePathOnMac = undefined;
Expand All @@ -406,7 +406,7 @@ async function createWindow() {
if (
fs.existsSync(filePath) &&
fs.statSync(filePath).isFile() &&
filePath.endsWith(".vvproj")
filePath.endsWith(".aisp")
) {
projectFilePath = encodeURI(filePath);
}
Expand Down Expand Up @@ -759,7 +759,7 @@ ipcMainHandle("SHOW_PROJECT_SAVE_DIALOG", async (_, { title, defaultPath }) => {
dialog.showSaveDialog(win, {
title,
defaultPath,
filters: [{ name: "AivisSpeech Project file", extensions: ["vvproj"] }],
filters: [{ name: "AivisSpeech Project file", extensions: ["aisp"] }],
properties: ["showOverwriteConfirmation"],
})
);
Expand All @@ -772,7 +772,7 @@ ipcMainHandle("SHOW_PROJECT_SAVE_DIALOG", async (_, { title, defaultPath }) => {
ipcMainHandle("SHOW_PROJECT_LOAD_DIALOG", async (_, { title }) => {
const result = await dialog.showOpenDialog(win, {
title,
filters: [{ name: "AivisSpeech Project file", extensions: ["vvproj"] }],
filters: [{ name: "AivisSpeech Project file", extensions: ["aisp"] }],
properties: ["openFile", "createDirectory", "treatPackageAsDirectory"],
});
if (result.canceled) {
Expand Down Expand Up @@ -1213,8 +1213,8 @@ app.on("second-instance", async (event, argv, workDir, rawData) => {
reloadNeeded: true,
});
}
} else if (data.filePath.endsWith(".vvproj")) {
log.info("Second instance launched with vvproj file");
} else if (data.filePath.endsWith(".aisp")) {
log.info("Second instance launched with aisp file");
ipcMainSend(win, "LOAD_PROJECT_FILE", {
filePath: data.filePath,
confirm: true,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Talk/TalkEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -512,14 +512,14 @@ const loadDraggedFile = (event: { dataTransfer: DataTransfer | null }) => {
case ".txt":
store.dispatch("COMMAND_IMPORT_FROM_FILE", { filePath: file.path });
break;
case ".vvproj":
case ".aisp":
store.dispatch("LOAD_PROJECT_FILE", { filePath: file.path });
break;
default:
store.dispatch("SHOW_ALERT_DIALOG", {
title: "対応していないファイルです",
message:
"テキストファイル (.txt) とAivisSpeechプロジェクトファイル (.vvproj) に対応しています。",
"テキストファイル (.txt) とAivisSpeechプロジェクトファイル (.aisp) に対応しています。",
});
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/store/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export const projectStore = createPartialStore<ProjectStoreTypes>({

if (!filePath) {
// if new project: use generated name
defaultPath = `${context.getters.DEFAULT_PROJECT_FILE_BASE_NAME}.vvproj`;
defaultPath = `${context.getters.DEFAULT_PROJECT_FILE_BASE_NAME}.aisp`;
} else {
// if saveAs for existing project: use current project path
defaultPath = filePath;
Expand Down

0 comments on commit a18f6c9

Please sign in to comment.