Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
madosuki committed Apr 16, 2022
1 parent d1ccb97 commit 7f6cd34
Show file tree
Hide file tree
Showing 12 changed files with 212 additions and 18 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

env:
VOICEVOX_ENGINE_REPO_URL: "https://github.com/VOICEVOX/voicevox_engine"
VOICEVOX_ENGINE_VERSION: 0.11.4
VOICEVOX_ENGINE_VERSION: 0.12.1-preview
VOICEVOX_RESOURCE_VERSION: 0.11.4
VOICEVOX_EDITOR_VERSION:
|- # releaseのときはタグが、それ以外は999.999.999がバージョン名に
Expand All @@ -32,6 +32,7 @@ jobs:
- linux-noengine-cpu-prepackage
- windows-noengine-prepackage
- windows-noengine-cpu-prepackage
- windows-noengine-directml-prepackage
- macos-noengine-cpu-prepackage
include:
# Linux NVIDIA GPU
Expand Down Expand Up @@ -64,6 +65,13 @@ jobs:
nsis_web_artifact_name: "VOICEVOX-CPU Web Setup ${version}.${ext}"
sed_name: sed
os: windows-2019
# Windows DirectML
- artifact_name: windows-noengine-directml-prepackage
artifact_path: dist_electron/win-unpacked
package_name: voicevox-directml
nsis_web_artifact_name: "VOICEVOX-DirectML Web Setup ${version}.${ext}"
sed_name: sed
os: windows-2019
# macOS CPU
- artifact_name: macos-noengine-cpu-prepackage
artifact_path: dist_electron/mac
Expand Down Expand Up @@ -91,6 +99,7 @@ jobs:
run: |
# GPU: "name": "voicevox" => "name": "voicevox"
# CPU: "name": "voicevox" => "name": "voicevox-cpu"
# DirectML: "name": "voicevox" => "name": "voicevox-directml"
"${{ matrix.sed_name }}" -i 's/"name": "voicevox"/"name": "${{ matrix.package_name }}"/' package.json
# "${{ matrix.sed_name }}" -i 's/productName: "VOICEVOX"/productName: "${{ matrix.product_name }}"/' vue.config.js
Expand Down Expand Up @@ -274,6 +283,7 @@ jobs:
- linux-cpu-prepackage
- windows-nvidia-prepackage
- windows-cpu-prepackage
- windows-directml-prepackage
- macos-cpu-prepackage
include:
# Linux NVIDIA GPU
Expand Down Expand Up @@ -302,6 +312,12 @@ jobs:
voicevox_engine_asset_name: windows-cpu
compressed_artifact_name: voicevox-windows-cpu
app_asar_dir: prepackage/resources
# Windows DirectML
- artifact_name: windows-directml-prepackage
noengine_artifact_name: windows-noengine-directml-prepackage
voicevox_engine_asset_name: windows-directml
compressed_artifact_name: voicevox-windows-directml
app_asar_dir: prepackage/resources
# macOS CPU
- artifact_name: macos-cpu-prepackage
noengine_artifact_name: macos-noengine-cpu-prepackage
Expand Down Expand Up @@ -504,6 +520,7 @@ jobs:
- linux-cpu-appimage
- windows-nvidia-nsis-web
- windows-cpu-nsis-web
- windows-directml-nsis-web
- macos-cpu-dmg
include:
# Linux NVIDIA GPU
Expand Down Expand Up @@ -536,6 +553,13 @@ jobs:
nsis_web_artifact_name: "VOICEVOX-CPU Web Setup ${version}.${ext}"
sed_name: sed
os: windows-2019
# Windows DirectML
- artifact_name: windows-directml-nsis-web
engine_artifact_name: windows-directml-prepackage
package_name: voicevox-directml
nsis_web_artifact_name: "VOICEVOX-DirectML Web Setup ${version}.${ext}"
sed_name: sed
os: windows-2019
# macOS CPU
- artifact_name: macos-cpu-dmg
engine_artifact_name: macos-cpu-prepackage
Expand All @@ -558,17 +582,18 @@ jobs:
run: |
brew install gnu-sed
# NOTE: If the CPU/GPU builds have the same package name,
# NOTE: If the CPU/DirectML/GPU builds have the same package name,
# the NSIS installers and the 7z files have duplicate names.
# For Linux, If they have the same product name,
# the AppImages have duplicate names.
# Files with the same name cannot be uploaded to a single GitHub Release,
# so different package/product names should be used for CPU/GPU builds.
# so different package/product names should be used for CPU/DirectML/GPU builds.
- name: Replace package name & version
shell: bash
run: |
# GPU: "name": "voicevox" => "name": "voicevox"
# CPU: "name": "voicevox" => "name": "voicevox-cpu"
# DirectML: "name": "voicevox" => "name": "voicevox-directml"
"${{ matrix.sed_name }}" -i 's/"name": "voicevox"/"name": "${{ matrix.package_name }}"/' package.json
# "${{ matrix.sed_name }}" -i 's/productName: "VOICEVOX"/productName: "${{ matrix.product_name }}"/' vue.config.js
Expand Down Expand Up @@ -732,8 +757,10 @@ jobs:
- linux-cpu-prepackage-targz
- windows-nvidia-nsis-web
- windows-cpu-nsis-web
- windows-directml-nsis-web
- windows-nvidia-prepackage-zip
- windows-cpu-prepackage-zip
- windows-directml-prepackage-zip
- macos-cpu-dmg
- macos-cpu-prepackage-zip
include:
Expand Down
17 changes: 11 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"dayjs": "1.10.7",
"electron-log": "4.4.1",
"electron-store": "8.0.0",
"electron-window-state": "5.0.3",
"encoding-japanese": "1.0.30",
"immer": "9.0.2",
"lodash.debounce": "4.0.8",
Expand Down
34 changes: 32 additions & 2 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ import {
ActivePointScrollMode,
EngineInfo,
SplitTextWhenPasteType,
SplitterPosition,
} from "./type/preload";

import log from "electron-log";
import dayjs from "dayjs";
import windowStateKeeper from "electron-window-state";

// silly以上のログをコンソールに出力
log.transports.console.format = "[{h}:{i}:{s}.{ms}] [{level}] {text}";
Expand Down Expand Up @@ -208,6 +210,7 @@ const store = new Store<{
acceptRetrieveTelemetry: AcceptRetrieveTelemetryStatus;
acceptTerms: AcceptTermsStatus;
splitTextWhenPaste: SplitTextWhenPasteType;
splitterPosition: SplitterPosition;
}>({
schema: {
useGpu: {
Expand Down Expand Up @@ -359,6 +362,15 @@ const store = new Store<{
enum: ["PERIOD_AND_NEW_LINE", "NEW_LINE", "OFF"],
default: "PERIOD_AND_NEW_LINE",
},
splitterPosition: {
type: "object",
properties: {
portraitPaneWidth: { type: "number" },
audioInfoPaneWidth: { type: "number" },
audioDetailPaneHeight: { type: "number" },
},
default: {},
},
},
migrations: {},
});
Expand Down Expand Up @@ -739,9 +751,16 @@ let willQuit = false;
let filePathOnMac: string | null = null;
// create window
async function createWindow() {
const mainWindowState = windowStateKeeper({
defaultWidth: 800,
defaultHeight: 600,
});

win = new BrowserWindow({
width: 800,
height: 600,
x: mainWindowState.x,
y: mainWindowState.y,
width: mainWindowState.width,
height: mainWindowState.height,
frame: false,
titleBarStyle: "hidden",
trafficLightPosition: { x: 6, y: 4 },
Expand Down Expand Up @@ -813,6 +832,8 @@ async function createWindow() {
}
}
});

mainWindowState.manage(win);
}

const menuTemplateForMac: Electron.MenuItemConstructorOptions[] = [
Expand Down Expand Up @@ -1164,12 +1185,21 @@ ipcMainHandle("SET_EXPERIMENTAL_SETTING", (_, experimentalSetting) => {
store.set("experimentalSetting", experimentalSetting);
});

<<<<<<< HEAD
ipcMainHandle("GET_SPLIT_TEXT_WHEN_PASTE", () => {
return store.get("splitTextWhenPaste");
});
ipcMainHandle("SET_SPLIT_TEXT_WHEN_PASTE", (_, splitTextWhenPaste) => {
store.set("splitTextWhenPaste", splitTextWhenPaste);
=======
ipcMainHandle("GET_SPLITTER_POSITION", () => {
return store.get("splitterPosition");
});
ipcMainHandle("SET_SPLITTER_POSITION", (_, splitterPosition) => {
store.set("splitterPosition", splitterPosition);
>>>>>>> 5a37c37dfabb23e441989d2c0a43df8ecfbd721d
});
// app callback
Expand Down
8 changes: 8 additions & 0 deletions src/electron/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ const api: Sandbox = {
return await ipcRendererInvoke("SET_EXPERIMENTAL_SETTING", setting);
},

getSplitterPosition: async () => {
return await ipcRendererInvoke("GET_SPLITTER_POSITION");
},

setSplitterPosition: async (splitterPosition) => {
return await ipcRendererInvoke("SET_SPLITTER_POSITION", splitterPosition);
},

getDefaultHotkeySettings: async () => {
return await ipcRendererInvoke("GET_DEFAULT_HOTKEY_SETTINGS");
},
Expand Down
1 change: 1 addition & 0 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export const indexStore: VoiceVoxStoreOptions<
promises.push(dispatch("GET_ACCEPT_TERMS"));
promises.push(dispatch("GET_EXPERIMENTAL_SETTING"));
promises.push(dispatch("INIT_SPLIT_TEXT_WHEN_PASTE"));
promises.push(dispatch("GET_SPLITTER_POSITION"));

await Promise.all(promises).then(() => {
dispatch("ON_VUEX_READY");
Expand Down
17 changes: 17 additions & 0 deletions src/store/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ export const settingStoreState: SettingStoreState = {
enableInterrogativeUpspeak: false,
},
splitTextWhenPaste: "PERIOD_AND_NEW_LINE",
splitterPosition: {
audioDetailPaneHeight: undefined,
audioInfoPaneWidth: undefined,
portraitPaneWidth: undefined,
},
};

export const settingStore: VoiceVoxStoreOptions<
Expand Down Expand Up @@ -105,6 +110,9 @@ export const settingStore: VoiceVoxStoreOptions<
SET_SPLIT_TEXT_WHEN_PASTE(state, { splitTextWhenPaste }) {
state.splitTextWhenPaste = splitTextWhenPaste;
},
SET_SPLITTER_POSITION(state, { splitterPosition }) {
state.splitterPosition = splitterPosition;
},
},
actions: {
GET_SAVING_SETTING({ commit }) {
Expand Down Expand Up @@ -249,6 +257,15 @@ export const settingStore: VoiceVoxStoreOptions<
window.electron.setSplitTextWhenPaste(splitTextWhenPaste);
commit("SET_SPLIT_TEXT_WHEN_PASTE", { splitTextWhenPaste });
},
GET_SPLITTER_POSITION({ dispatch }) {
window.electron.getSplitterPosition().then((splitterPosition) => {
dispatch("SET_SPLITTER_POSITION", { splitterPosition });
});
},
SET_SPLITTER_POSITION({ commit }, { splitterPosition }) {
window.electron.setSplitterPosition(splitterPosition);
commit("SET_SPLITTER_POSITION", { splitterPosition });
},
},
};

Expand Down
11 changes: 11 additions & 0 deletions src/store/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
ActivePointScrollMode,
EngineInfo,
SplitTextWhenPasteType,
SplitterPosition,
} from "@/type/preload";
import { IEngineConnectorFactory } from "@/infrastructures/EngineConnector";
import { QVueGlobals } from "quasar";
Expand Down Expand Up @@ -769,6 +770,7 @@ export type SettingStoreState = {
acceptRetrieveTelemetry: AcceptRetrieveTelemetryStatus;
experimentalSetting: ExperimentalSetting;
splitTextWhenPaste: SplitTextWhenPasteType;
splitterPosition: SplitterPosition;
};

type SettingStoreTypes = {
Expand Down Expand Up @@ -845,6 +847,15 @@ type SettingStoreTypes = {
mutation: { splitTextWhenPaste: SplitTextWhenPasteType };
action(payload: { splitTextWhenPaste: SplitTextWhenPasteType }): void;
};

GET_SPLITTER_POSITION: {
action(): void;
};

SET_SPLITTER_POSITION: {
mutation: { splitterPosition: SplitterPosition };
action(payload: { splitterPosition: SplitterPosition }): void;
};
};

export type SettingGetters = StoreType<SettingStoreTypes, "getter">;
Expand Down
10 changes: 10 additions & 0 deletions src/type/ipc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,16 @@ type IpcIHData = {
return: void;
};

GET_SPLITTER_POSITION: {
args: [];
return: import("@/type/preload").SplitterPosition;
};

SET_SPLITTER_POSITION: {
args: [splitterPosition: import("@/type/preload").SplitterPosition];
return: void;
};

THEME: {
args: [obj: { newData?: string }];
return: import("@/type/preload").ThemeSetting | void;
Expand Down
8 changes: 8 additions & 0 deletions src/type/preload.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export interface Sandbox {
setAcceptTerms(acceptTerms: AcceptTermsStatus): Promise<void>;
getExperimentalSetting(): Promise<ExperimentalSetting>;
setExperimentalSetting(setting: ExperimentalSetting): Promise<void>;
getSplitterPosition(): Promise<SplitterPosition>;
setSplitterPosition(splitterPosition: SplitterPosition): Promise<void>;
getDefaultHotkeySettings(): Promise<HotKeySetting[]>;
getDefaultToolbarSetting(): Promise<ToolbarSetting>;
theme(newData?: string): Promise<ThemeSetting | void>;
Expand Down Expand Up @@ -266,3 +268,9 @@ export type ExperimentalSetting = {
enablePreset: boolean;
enableInterrogativeUpspeak: boolean;
};

export type SplitterPosition = {
portraitPaneWidth: number | undefined;
audioInfoPaneWidth: number | undefined;
audioDetailPaneHeight: number | undefined;
};
Loading

0 comments on commit 7f6cd34

Please sign in to comment.