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

ENH: モーフィングUIの実装 #1030

Merged
merged 15 commits into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 1 addition & 206 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,212 +110,7 @@ if (!("properties" in electronStoreJsonSchema)) {
throw new Error("electronStoreJsonSchema must be object");
}
const store = new Store<ElectronStoreType>({
schema: {
useGpu: {
type: "boolean",
default: false,
},
inheritAudioInfo: {
type: "boolean",
default: true,
},
activePointScrollMode: {
type: "string",
enum: ["CONTINUOUSLY", "PAGE", "OFF"],
default: "OFF",
},
savingSetting: {
type: "object",
properties: {
fileEncoding: {
type: "string",
enum: ["UTF-8", "Shift_JIS"],
default: "UTF-8",
},
fileNamePattern: {
type: "string",
default: "",
},
fixedExportEnabled: { type: "boolean", default: false },
avoidOverwrite: { type: "boolean", default: false },
fixedExportDir: { type: "string", default: "" },
exportLab: { type: "boolean", default: false },
exportText: { type: "boolean", default: false },
outputStereo: { type: "boolean", default: false },
outputSamplingRate: {
oneOf: [{ type: "number" }, { const: "engineDefault" }],
default: "engineDefault",
},
audioOutputDevice: { type: "string", default: "default" },
},
default: {
fileEncoding: "UTF-8",
fileNamePattern: "",
fixedExportEnabled: false,
avoidOverwrite: false,
fixedExportDir: "",
exportLab: false,
exportText: false,
outputStereo: false,
outputSamplingRate: "engineDefault",
audioOutputDevice: "default",
splitTextWhenPaste: "PERIOD_AND_NEW_LINE",
},
},
// To future developers: if you are to modify the store schema with array type,
// for example, the hotkeySettings below,
// please remember to add a corresponding migration
// Learn more: https://github.com/sindresorhus/electron-store#migrations
hotkeySettings: {
type: "array",
items: {
type: "object",
properties: {
action: { type: "string" },
combination: { type: "string" },
},
},
default: defaultHotkeySettings,
},
toolbarSetting: {
type: "array",
items: {
type: "string",
},
default: defaultToolbarButtonSetting,
},
userCharacterOrder: {
type: "array",
items: {
type: "string",
},
default: [],
},
defaultStyleIds: {
type: "array",
items: {
type: "object",
properties: {
speakerUuid: { type: "string" },
defaultStyleId: { type: "number" },
},
},
default: [],
},
presets: {
type: "object",
properties: {
items: {
type: "object",
patternProperties: {
// uuid
"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}": {
type: "object",
properties: {
name: { type: "string" },
speedScale: { type: "number" },
pitchScale: { type: "number" },
intonationScale: { type: "number" },
volumeScale: { type: "number" },
prePhonemeLength: { type: "number" },
postPhonemeLength: { type: "number" },
morphingInfo: {
type: "object",
properties: {
rate: { type: "number" },
targetEngineId: {
type: "string",
pattern:
"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
},
targetSpeakerId: {
type: "string",
pattern:
"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
},
targetStyleId: { type: "number" },
},
},
},
},
},
additionalProperties: false,
},
keys: {
type: "array",
items: {
type: "string",
pattern:
"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
},
},
},
default: { items: {}, keys: [] },
},
currentTheme: {
type: "string",
default: "Default",
},
editorFont: {
anyOf: [{ const: "default" }, { const: "os" }],
},
experimentalSetting: {
type: "object",
properties: {
enablePreset: { type: "boolean", default: false },
enableInterrogativeUpspeak: {
type: "boolean",
default: false,
},
enableMorphing: { type: "boolean", default: false },
},
default: {
enablePreset: false,
enableInterrogativeUpspeak: false,
enableMorphing: false,
},
},
acceptRetrieveTelemetry: {
type: "string",
enum: ["Unconfirmed", "Accepted", "Refused"],
default: "Unconfirmed",
},
acceptTerms: {
type: "string",
enum: ["Unconfirmed", "Accepted", "Rejected"],
default: "Unconfirmed",
},
splitTextWhenPaste: {
type: "string",
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: {},
},
confirmedTips: {
type: "object",
properties: {
tweakableSliderByScroll: { type: "boolean", default: false },
},
default: {
tweakableSliderByScroll: false,
},
},
engineDirs: {
type: "array",
items: {
type: "string",
},
default: [],
},
},
schema: electronStoreJsonSchema.properties as Schema<ElectronStoreType>,
migrations: {
">=0.13": (store) => {
// acceptTems -> acceptTerms
Expand Down
9 changes: 9 additions & 0 deletions src/type/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,14 @@ export const electronStoreSchema = z
volumeScale: z.number(),
prePhonemeLength: z.number(),
postPhonemeLength: z.number(),
morphingInfo: z
.object({
rate: z.number(),
targetEngineId: z.string().uuid(),
targetSpeakerId: z.string().uuid(),
targetStyleId: z.number(),
})
.optional(),
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
})
)
.default({}),
Expand All @@ -469,6 +477,7 @@ export const electronStoreSchema = z
.object({
enablePreset: z.boolean().default(false),
enableInterrogativeUpspeak: z.boolean().default(false),
enableMorphing: z.boolean().default(false),
})
.passthrough()
.default({}),
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.