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

0.13.2をマージ #967

Merged
merged 4 commits into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ on:

env:
VOICEVOX_ENGINE_REPO_URL: "https://github.com/VOICEVOX/voicevox_engine"
VOICEVOX_ENGINE_VERSION: 0.13.0
VOICEVOX_RESOURCE_VERSION: 0.13.0
VOICEVOX_ENGINE_VERSION: 0.13.1
VOICEVOX_RESOURCE_VERSION: 0.13.1
VOICEVOX_EDITOR_VERSION:
|- # releaseタグ名か、workflow_dispatchでのバージョン名か、999.999.999が入る
${{ github.event.release.tag_name || github.event.inputs.version || '999.999.999' }}
Expand Down
9 changes: 9 additions & 0 deletions public/updateInfos.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"version": "0.13.2",
"descriptions": [
"キャラクター「WhiteCUL」「後鬼」「No.7」を追加",
"キャラクター「白上虎太郎」のスタイルを追加",
"バグ修正"
],
"contributors": ["kantas-spike", "PickledChair"]
},
{
"version": "0.13.1",
"descriptions": ["バグ修正"],
Expand Down
5 changes: 0 additions & 5 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1171,11 +1171,6 @@ ipcMainHandle("CHANGE_PIN_WINDOW", () => {
}
});

ipcMainHandle("IS_UNSET_DEFAULT_STYLE_ID", (_, speakerUuid) => {
const defaultStyleIds = store.get("defaultStyleIds");
return !defaultStyleIds.find((style) => style.speakerUuid === speakerUuid);
});

ipcMainHandle("GET_DEFAULT_HOTKEY_SETTINGS", () => {
return defaultHotkeySettings;
});
Expand Down
76 changes: 13 additions & 63 deletions src/components/DefaultStyleSelectDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,9 @@
<q-header class="q-py-sm">
<q-toolbar>
<div class="column">
<q-toolbar-title
v-if="isFirstTime && showCharacterInfos.length > 0"
class="text-display text-h6"
>「{{ showCharacterInfos[pageIndex].metas.speakerName }}」の{{
showCharacterInfos[pageIndex].metas.styles.length > 1
? "デフォルトのスタイル(喋り方)を選んでください"
: "サンプル音声を視聴できます"
}}
</q-toolbar-title>
<q-toolbar-title v-else class="text-display"
<q-toolbar-title class="text-display"
>設定 / デフォルトスタイル・試聴</q-toolbar-title
>
<span
v-if="
isFirstTime &&
showCharacterInfos.length > 0 &&
showCharacterInfos[pageIndex].metas.styles.length > 1
"
class="text-display text-caption q-ml-sm"
>
※後からでも変更できます
</span>
</div>

<q-space />
Expand All @@ -48,11 +29,11 @@
/>

<div class="text-subtitle2 text-no-wrap text-display q-mr-md">
{{ pageIndex + 1 }} / {{ showCharacterInfos.length }}
{{ pageIndex + 1 }} / {{ multiStyleCharacterInfos.length }}
</div>

<q-btn
v-if="pageIndex + 1 < showCharacterInfos.length"
v-if="pageIndex + 1 < multiStyleCharacterInfos.length"
v-show="canNext"
unelevated
label="次へ"
Expand Down Expand Up @@ -84,18 +65,20 @@
>
<div class="character-portrait-wrapper">
<img
v-if="showCharacterInfos.length > 0"
:src="showCharacterInfos[pageIndex].portraitPath"
v-if="multiStyleCharacterInfos.length > 0"
:src="multiStyleCharacterInfos[pageIndex].portraitPath"
class="character-portrait"
/>
</div>
</q-drawer>

<q-page-container>
<q-page v-if="showCharacterInfos && selectedStyleIndexes">
<q-page v-if="multiStyleCharacterInfos && selectedStyleIndexes">
<q-tab-panels v-model="pageIndex">
<q-tab-panel
v-for="(characterInfo, characterIndex) of showCharacterInfos"
v-for="(
characterInfo, characterIndex
) of multiStyleCharacterInfos"
:key="characterIndex"
:name="characterIndex"
>
Expand Down Expand Up @@ -215,56 +198,25 @@ export default defineComponent({
);
});

// アップデートで増えたスタイルがあれば、それらに対して起動時にデフォルトスタイル選択を問うための変数
// その他の場合は、characterInfosと同じになる
// FIXME: 現状はスタイルが増えてもデフォルトスタイルを問えないので、そこを改修しなければならない
const showCharacterInfos = ref(multiStyleCharacterInfos.value);

const isFirstTime = ref(false);
const selectedStyleIndexes = ref<(number | undefined)[]>([]);

// ダイアログが開かれたときに初期値を求める
watch(
() => props.modelValue,
async (newValue, oldValue) => {
if (!oldValue && newValue) {
showCharacterInfos.value = [];
selectedStyleIndexes.value = await Promise.all(
multiStyleCharacterInfos.value.map(async (info) => {
const styles = info.metas.styles;
const isUnsetDefaultStyleId = await store.dispatch(
"IS_UNSET_DEFAULT_STYLE_ID",
{ speakerUuid: info.metas.speakerUuid }
);
if (isUnsetDefaultStyleId) {
isFirstTime.value = true;
showCharacterInfos.value.push(info);
return undefined;
}

const defaultStyleId = store.state.defaultStyleIds.find(
(x) => x.speakerUuid === info.metas.speakerUuid
)?.defaultStyleId;

const index = styles.findIndex(
const index = info.metas.styles.findIndex(
(style) => style.styleId === defaultStyleId
);
return index === -1 ? undefined : index;
})
);
if (!isFirstTime.value) {
showCharacterInfos.value = multiStyleCharacterInfos.value;
} else {
selectedStyleIndexes.value = showCharacterInfos.value.map(
(info) => {
if (info.metas.styles.length > 1) {
return undefined;
} else {
return 0;
}
}
);
}
}
}
);
Expand All @@ -273,7 +225,7 @@ export default defineComponent({
selectedStyleIndexes.value[characterIndex] = styleIndex;

// 音声を再生する。同じ話者/styleIndexだったら停止する。
const selectedCharacter = showCharacterInfos.value[characterIndex];
const selectedCharacter = multiStyleCharacterInfos.value[characterIndex];
const selectedStyleInfo = selectedCharacter.metas.styles[styleIndex];
if (
playing.value !== undefined &&
Expand Down Expand Up @@ -335,7 +287,7 @@ export default defineComponent({
const defaultStyleIds = JSON.parse(
JSON.stringify(store.state.defaultStyleIds)
) as DefaultStyleId[];
showCharacterInfos.value.forEach((info, idx) => {
multiStyleCharacterInfos.value.forEach((info, idx) => {
const defaultStyleInfo = {
speakerUuid: info.metas.speakerUuid,
defaultStyleId:
Expand All @@ -351,7 +303,6 @@ export default defineComponent({
}
});
store.dispatch("SET_DEFAULT_STYLE_IDS", defaultStyleIds);
isFirstTime.value = false;

stop();
modelValueComputed.value = false;
Expand All @@ -360,8 +311,7 @@ export default defineComponent({

return {
modelValueComputed,
showCharacterInfos,
isFirstTime,
multiStyleCharacterInfos,
selectedStyleIndexes,
selectStyleIndex,
pageIndex,
Expand Down
4 changes: 0 additions & 4 deletions src/electron/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ const api: Sandbox = {
return ipcRenderer.invoke("HOTKEY_SETTINGS", { newData });
},

isUnsetDefaultStyleId: async (speakerUuid: string) => {
return await ipcRendererInvoke("IS_UNSET_DEFAULT_STYLE_ID", speakerUuid);
},

getDefaultHotkeySettings: async () => {
return await ipcRendererInvoke("GET_DEFAULT_HOTKEY_SETTINGS");
},
Expand Down
7 changes: 0 additions & 7 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,13 @@ export const indexStore = createPartialStore<IndexStoreTypes>({
},
},

IS_UNSET_DEFAULT_STYLE_ID: {
async action(_, { speakerUuid }) {
return await window.electron.isUnsetDefaultStyleId(speakerUuid);
},
},

LOAD_DEFAULT_STYLE_IDS: {
async action({ commit, getters }) {
let defaultStyleIds = await window.electron.getSetting("defaultStyleIds");

const allCharacterInfos = getters.GET_ALL_CHARACTER_INFOS;

// デフォルトスタイルが設定されていない場合は0をセットする
// FIXME: 保存しているものとstateのものが異なってしまうので良くない。デフォルトスタイルが未設定の場合はAudioCellsを表示しないようにすべき
const unsetCharacterInfos = [...allCharacterInfos.keys()].filter(
(speakerUuid) =>
!defaultStyleIds.some((styleId) => styleId.speakerUuid == speakerUuid)
Expand Down
4 changes: 0 additions & 4 deletions src/store/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,6 @@ export type IndexStoreTypes = {
action(): Promise<string>;
};

IS_UNSET_DEFAULT_STYLE_ID: {
action(payload: { speakerUuid: string }): Promise<boolean>;
};

LOAD_DEFAULT_STYLE_IDS: {
action(): Promise<void>;
};
Expand Down
5 changes: 0 additions & 5 deletions src/type/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,6 @@ export type IpcIHData = {
return: HotkeySetting[];
};

IS_UNSET_DEFAULT_STYLE_ID: {
args: [speakerUuid: string];
return: boolean;
};

GET_DEFAULT_HOTKEY_SETTINGS: {
args: [];
return: HotkeySetting[];
Expand Down
1 change: 0 additions & 1 deletion src/type/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export interface Sandbox {
hotkeySettings(newData?: HotkeySetting): Promise<HotkeySetting[]>;
checkFileExists(file: string): Promise<boolean>;
changePinWindow(): void;
isUnsetDefaultStyleId(speakerUuid: string): Promise<boolean>;
getDefaultHotkeySettings(): Promise<HotkeySetting[]>;
getDefaultToolbarSetting(): Promise<ToolbarSetting>;
theme(newData?: string): Promise<ThemeSetting | void>;
Expand Down
11 changes: 0 additions & 11 deletions src/views/EditorHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -481,17 +481,6 @@ export default defineComponent({
const newCharacters = await store.dispatch("GET_NEW_CHARACTERS");
isCharacterOrderDialogOpenComputed.value = newCharacters.length > 0;

// スタイルが複数あって未選択なキャラがいる場合はデフォルトスタイル選択ダイアログを表示
let isUnsetDefaultStyleIds = false;
for (const info of orderedAllCharacterInfos.value) {
isUnsetDefaultStyleIds ||=
info.metas.styles.length > 1 &&
(await store.dispatch("IS_UNSET_DEFAULT_STYLE_ID", {
speakerUuid: info.metas.speakerUuid,
}));
}
isDefaultStyleSelectDialogOpenComputed.value = isUnsetDefaultStyleIds;

// 最初のAudioCellを作成
const audioItem: AudioItem = await store.dispatch(
"GENERATE_AUDIO_ITEM",
Expand Down