-
Notifications
You must be signed in to change notification settings - Fork 309
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
Add: ソングの書き出しダイアログを追加 #2287
Add: ソングの書き出しダイアログを追加 #2287
Changes from 6 commits
3bc974b
746e911
2da6078
a6c489a
f257ac7
d2da407
38b3449
235c8c0
e0546f1
0e9ffbd
ab10033
3074f3f
5865b94
dea09c3
e77378e
c7e81a9
fe0338e
4cdd363
a037a42
96a7298
0e250f7
e8e75fd
8be9c4d
e49714f
f62c512
a134148
04fb7ff
7685fd8
6a40314
ed909fc
7a01ce6
b693b20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<QCardActions :class="props.class"> | ||
<div>{{ title }}</div> | ||
<div :aria-label="description"> | ||
<QIcon name="help_outline" size="sm" class="help-hover-icon"> | ||
<QTooltip | ||
:delay="500" | ||
anchor="center right" | ||
self="center left" | ||
transitionShow="jump-right" | ||
transitionHide="jump-left" | ||
> | ||
{{ description }} | ||
</QTooltip> | ||
</QIcon> | ||
</div> | ||
<QSpace /> | ||
<slot /> | ||
</QCardActions> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
export type Props = { | ||
title: string; | ||
description: string; | ||
class?: unknown; // 型はquasarの定義を真似ている | ||
}; | ||
|
||
const props = defineProps<Props>(); | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@use "@/styles/visually-hidden" as visually-hidden; | ||
@use "@/styles/colors" as colors; | ||
|
||
.help-hover-icon { | ||
margin-left: 6px; | ||
color: colors.$display; | ||
opacity: 0.5; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<Presentation v-model="modelValue" @exportAudio="handleExportAudio" /> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import Presentation, { ExportTarget } from "./Presentation.vue"; | ||
import { useStore } from "@/store"; | ||
import { SongExportSetting } from "@/store/type"; | ||
|
||
defineOptions({ | ||
name: "ExportSongAudioDialog", | ||
}); | ||
|
||
const modelValue = defineModel<boolean>(); | ||
const store = useStore(); | ||
|
||
const handleExportAudio = ( | ||
target: ExportTarget, | ||
setting: SongExportSetting, | ||
) => { | ||
if (target === "master") { | ||
void store.dispatch("EXPORT_AUDIO_FILE", { setting }); | ||
} else { | ||
void store.dispatch("EXPORT_STEM_AUDIO_FILE", { setting }); | ||
} | ||
}; | ||
</script> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
<template> | ||
<QDialog ref="dialogRef" v-model="modelValue"> | ||
<QCard class="q-py-sm q-px-md dialog-card"> | ||
<QCardSection> | ||
<div class="text-h5">書き出し</div> | ||
</QCardSection> | ||
|
||
<QSeparator /> | ||
|
||
<QCardSection> | ||
<BaseCell | ||
title="書き出し対象" | ||
description="すべてのトラックをまとめて書き出すか、トラックごとに書き出すか選べます。" | ||
> | ||
<QBtnToggle | ||
v-model="exportTarget" | ||
:options="exportTargets" | ||
padding="xs md" | ||
unelevated | ||
color="surface" | ||
textColor="display" | ||
toggleColor="primary" | ||
toggleTextColor="display-on-primary" | ||
dense | ||
/> | ||
</BaseCell> | ||
<!-- TODO:実装する | ||
sevenc-nanashi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<BaseCell | ||
title="フォーマット" | ||
description="書き出す音声ファイルのフォーマットを選べます。" | ||
> | ||
<QBtnToggle | ||
v-model="audioFormat" | ||
:options="supportedFormats" | ||
padding="xs md" | ||
unelevated | ||
color="surface" | ||
textColor="display" | ||
toggleColor="primary" | ||
toggleTextColor="display-on-primary" | ||
dense | ||
/> | ||
</BaseCell> --> | ||
<BaseCell | ||
title="音声をステレオ化" | ||
description="ONの場合、音声データがモノラルからステレオに変換されてから保存が行われます。" | ||
> | ||
<QToggle v-model="isStereo" /> | ||
sevenc-nanashi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</BaseCell> | ||
sigprogramming marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<BaseCell | ||
title="音声のサンプリングレート" | ||
description="音声のサンプリングレートを変更できます。" | ||
Comment on lines
+34
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 量子化ビット数(ビット解像度)も設定できると良いかも。まあ必須ではないと思うので後で実装でも良さそう。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. このプルリクで入れると色々と大きくなりすぎそうなので別のPRでやります。 |
||
> | ||
<QSelect | ||
v-model="samplingRate" | ||
dense | ||
name="samplingRate" | ||
:options="samplingRateOptions" | ||
:optionLabel="renderSamplingRateLabel" | ||
> | ||
</QSelect> | ||
</BaseCell> | ||
<BaseCell | ||
title="リミッターを適用する" | ||
description="ONの場合、音量が制限されます。" | ||
> | ||
<QToggle v-model="withLimiter" /> | ||
</BaseCell> | ||
sevenc-nanashi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<BaseCell | ||
title="トラックのパラメーターを適用する" | ||
description="OFFの場合、VOICEVOX内のパン、ボリューム、ミュート設定が適用されません。" | ||
> | ||
<QToggle v-model="withTrackParameters" /> | ||
</BaseCell> | ||
</QCardSection> | ||
|
||
<QSeparator /> | ||
|
||
<QCardActions> | ||
<QSpace /> | ||
<QBtn | ||
unelevated | ||
align="right" | ||
label="キャンセル" | ||
color="toolbar-button" | ||
textColor="toolbar-button-display" | ||
class="text-no-wrap text-bold q-mr-sm" | ||
@click="handleCancel" | ||
/> | ||
<QBtn | ||
unelevated | ||
align="right" | ||
label="書き出し" | ||
sevenc-nanashi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
color="toolbar-button" | ||
textColor="toolbar-button-display" | ||
class="text-no-wrap text-bold q-mr-sm" | ||
@click="handleExportTrack" | ||
/> | ||
</QCardActions> | ||
</QCard> | ||
</QDialog> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
// メモ:前回の設定を引き継ぐため、他のダイアログでやっているようなinitializeValuesはやらない | ||
sevenc-nanashi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import { ref } from "vue"; | ||
import { useDialogPluginComponent } from "quasar"; | ||
import BaseCell from "./BaseCell.vue"; | ||
import { SongSupportedAudioFormat, SongExportSetting } from "@/store/type"; | ||
|
||
export type ExportTarget = "master" | "stem"; | ||
const { dialogRef, onDialogOK, onDialogCancel } = useDialogPluginComponent(); | ||
|
||
const modelValue = defineModel<boolean>(); | ||
const emit = defineEmits<{ | ||
/** 音声をエクスポートするときに呼ばれる */ | ||
exportAudio: [exportTarget: ExportTarget, setting: SongExportSetting]; | ||
}>(); | ||
|
||
// 書き出し対象選択 | ||
const exportTargets = [ | ||
{ | ||
label: "すべてのトラック", | ||
value: "master", | ||
}, | ||
{ | ||
label: "トラックごと", | ||
value: "stem", | ||
}, | ||
]; | ||
const exportTarget = ref<ExportTarget>("master"); | ||
|
||
// ステレオ | ||
const isStereo = ref<boolean>(true); | ||
|
||
// フォーマット選択 | ||
const audioFormat = ref<SongSupportedAudioFormat>("wav"); | ||
// const supportedFormats = [ | ||
// { | ||
// label: "WAV", | ||
// value: "wav", | ||
// }, | ||
// { | ||
// label: "mp3", | ||
// value: "mp3", | ||
// }, | ||
// { | ||
// label: "ogg", | ||
// value: "ogg", | ||
// }, | ||
// ]; | ||
sevenc-nanashi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// サンプルレート | ||
const samplingRate = ref<number>(48000); | ||
const samplingRateOptions = [24000, 44100, 48000, 88200, 96000]; | ||
const renderSamplingRateLabel = (rate: number) => `${rate} Hz`; | ||
|
||
// リミッター | ||
const withLimiter = ref<boolean>(true); | ||
|
||
// パン・ボリューム・ミュート | ||
const withTrackParameters = ref<boolean>(true); | ||
|
||
const handleExportTrack = () => { | ||
onDialogOK(); | ||
emit("exportAudio", exportTarget.value, { | ||
isStereo: isStereo.value, | ||
sampleRate: samplingRate.value, | ||
audioFormat: audioFormat.value, | ||
withLimiter: withLimiter.value, | ||
withTrackParameters: withTrackParameters.value, | ||
}); | ||
}; | ||
|
||
// キャンセルボタンクリック時 | ||
const handleCancel = () => { | ||
onDialogCancel(); | ||
modelValue.value = false; | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
.dialog-card { | ||
width: 700px; | ||
max-width: 80vw; | ||
} | ||
|
||
.scrollable-area { | ||
overflow-y: auto; | ||
max-height: calc(100vh - 100px - 295px); | ||
} | ||
</style> |
Hiroshiba marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!-- | ||
<!-- | ||
アップデート通知ダイアログのコンテナ。 | ||
スキップしたバージョンより新しいバージョンがあれば、ダイアログを表示する。 | ||
--> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. マルチエンジンオフのボタンと合わせました。 |
sevenc-nanashi marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コピーしたことがわかるように、ちょっとメモ書きだけ書いときますか!
こういうメモあった方がいいのかない方がいいのかわかんないですね。。。
ま、まあ、気が向けば・・・!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
気が向かない(というよりあってもそんなに特が無い気がする)のでパスします。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
了解です!
確かにあってもあんま無駄な気がしますが、ここにたどり着いたコミッターの方には便利だと思うので、ちょっとこちらで書いてみますね!