├── _pack_debug.bat ├── data ├── misc │ ├── yu.png │ ├── GynoidTalk.psd │ └── VOICEROID2.pdn ├── readme.txt └── manual │ ├── 操作画面.pdn │ ├── 操作画面.png │ ├── 置換画面.pdn │ ├── 置換画面.png │ ├── 設定画面_一般.pdn │ ├── 設定画面_一般.png │ ├── exo画面_共通.pdn │ ├── exo画面_共通.png │ ├── pukiwiki.txt │ ├── 使い方6_入力文.png │ ├── 設定画面_YMM.pdn │ ├── 設定画面_YMM.png │ ├── 設定画面_音声保存.pdn │ ├── 設定画面_音声保存.png │ ├── 使い方3_起動終了ボタン.png │ ├── 設定画面_AviUtl.pdn │ ├── 設定画面_AviUtl.png │ ├── exo画面_キャラクター別.pdn │ ├── exo画面_キャラクター別.png │ ├── 使い方5_VOICEROID選択.png │ ├── 設定画面_音声保存_ファイル命名.png │ ├── VOICEROID2_音声保存_ファイル分割設定.png │ └── VOICEROID2_音声保存_ボイスプリセットタグ.png ├── VoiceroidUtil ├── resources │ ├── icon │ │ ├── add.png │ │ ├── exo.png │ │ ├── ymm.png │ │ ├── main.ico │ │ ├── open.png │ │ ├── play.png │ │ ├── save.png │ │ ├── stop.png │ │ ├── arrow_up.png │ │ ├── config.png │ │ ├── main16.png │ │ ├── remove.png │ │ ├── running.png │ │ ├── arrow_down.png │ │ ├── file_sound.png │ │ ├── file_text.png │ │ ├── status_ng.png │ │ ├── status_ok.png │ │ ├── arrow_right.png │ │ ├── status_big_ng.png │ │ ├── status_big_ok.png │ │ ├── status_info.png │ │ ├── status_warn.png │ │ ├── text_replace.png │ │ ├── exited_notfound.png │ │ ├── status_big_info.png │ │ ├── status_big_warn.png │ │ └── exited_executable.png │ ├── voiceroid │ │ ├── ai_ng.png │ │ ├── ai_ok.png │ │ ├── akari.png │ │ ├── hime.png │ │ ├── iori.png │ │ ├── itako.png │ │ ├── sora.png │ │ ├── akane_ng.png │ │ ├── akane_ok.png │ │ ├── aoi_ng.png │ │ ├── aoi_ok.png │ │ ├── flower.png │ │ ├── kou_ng.png │ │ ├── kou_ok.png │ │ ├── maki_ng.png │ │ ├── maki_ok.png │ │ ├── mikoto.png │ │ ├── seika_ng.png │ │ ├── seika_ok.png │ │ ├── tsuina.png │ │ ├── una_ng.png │ │ ├── una_ok.png │ │ ├── zunko_ng.png │ │ ├── zunko_ok.png │ │ ├── aivoice_ng.png │ │ ├── aivoice_ok.png │ │ ├── galaco_ng.png │ │ ├── galaco_ok.png │ │ ├── kiritan_ng.png │ │ ├── kiritan_ok.png │ │ ├── shouta_ng.png │ │ ├── shouta_ok.png │ │ ├── tsuina-std.png │ │ ├── yukari_ng.png │ │ ├── yukari_ok.png │ │ ├── gynoidtalk_ng.png │ │ ├── gynoidtalk_ok.png │ │ ├── voiceroid2_ng.png │ │ └── voiceroid2_ok.png │ ├── Converters.xaml │ └── CommonBrushes.xaml ├── App.xaml ├── View │ ├── MainWindow.xaml.cs │ ├── AppConfigView.xaml.cs │ ├── ExoConfigView.xaml.cs │ ├── VoiceroidView.xaml.cs │ ├── AppStatusBar.xaml.cs │ ├── ExoCharaStyleView.xaml.cs │ ├── MovableValueControl.xaml.cs │ ├── AviUtlDropLayersControl.xaml.cs │ ├── TalkTextReplaceConfigView.xaml.cs │ ├── YmmCharaRelationsControl.xaml.cs │ ├── TalkTextReplaceItemsView.xaml.cs │ ├── MovableValueMoveModeControl.xaml.cs │ ├── ImeWatermarkTextBox.cs │ ├── VoiceroidKeywordsView.xaml.cs │ ├── YmmCharaRelationsControl.xaml │ ├── VoiceroidKeywordsView.xaml │ └── AviUtlDropLayersControl.xaml ├── Services │ ├── IWindowActivateService.cs │ ├── IVoiceroidActionService.cs │ ├── VoiceroidAction.cs │ ├── WindowActivateService.cs │ ├── IOpenFileDialogService.cs │ ├── IAviUtlFileDropService.cs │ ├── AviUtlFileDropService.cs │ ├── NullServices.cs │ └── VoiceroidActionService.cs ├── IVoiceroidItem.cs ├── ExoCharaStyleSet.cs ├── AviUtlDropLayerSet.cs ├── AppStatusType.cs ├── TalkTextReplacePreset.cs ├── FileNameFormat.cs ├── VoiceroidExecutablePathSet.cs ├── YmmCharaRelationSet.cs ├── packages.config ├── IAppStatus.cs ├── Properties │ ├── App.config │ ├── AssemblyInfo.cs │ └── App.manifest ├── VoiceroidExecutablePath.cs ├── AppStatus.cs ├── VoiceroidVisibility.cs ├── YmmCharaRelation.cs ├── ExoConfig.cs ├── AviUtlDropLayer.cs ├── ViewModel │ ├── AppStatusViewModel.cs │ └── ConfigViewModelBase.cs ├── TalkTextReplaceItemCollection.cs ├── TalkTextReplaceItem.cs ├── Mvvm │ ├── MainWindowConfigBehavior.cs │ └── IndexedCommandKeyBindingBehavior.cs ├── Extensions │ └── ObservableExtension.cs ├── ErrorLogFileTraceListener.cs ├── VoiceroidVisibilitySet.cs ├── VoiceroidItemBase.cs ├── ExoCharaStyle.cs └── TalkTextReplaceConfig.cs ├── RucheHome.Text ├── packages.config ├── Properties │ └── AssemblyInfo.cs ├── RucheHome.Text.csproj ├── IniFileSection.cs └── TextFileReader.cs ├── RucheHome.AviUtl ├── packages.config ├── ExEdit │ ├── ComponentCollection.cs │ ├── LayerItemCollection.cs │ ├── IComponent.cs │ ├── IMovableValueConstants.cs │ ├── IExoFileValueConverter.cs │ ├── FontDecoration.cs │ ├── IMovableValue.cs │ ├── UnknownComponent.cs │ ├── ExoFileItemAttribute.cs │ ├── BlendMode.cs │ ├── ComponentMaker.cs │ └── TextAlignment.cs ├── Properties │ └── AssemblyInfo.cs └── FontFamilyNameEnumerable.cs ├── RucheHomeLib ├── packages.config ├── Util │ ├── TextElementEnumerable.cs │ ├── NonNullCollection.cs │ ├── BindableBase.cs │ ├── ThreadTrace.cs │ └── BindableCollection.cs ├── Properties │ └── AssemblyInfo.cs └── Windows │ ├── Mvvm │ ├── Behaviors │ │ ├── FrameworkElementBehavior.cs │ │ └── ListBoxAutoScrollBehavior.cs │ ├── Converters │ │ ├── BooleanInverter.cs │ │ ├── BooleanVisibilityConverter.cs │ │ ├── MultiCommandConverter.cs │ │ ├── EnumValueDisplayConverter.cs │ │ └── MultiEnumerableEachConverter.cs │ └── Commands │ │ └── ProcessStartCommand.cs │ └── Media │ └── FontFamilyNameEnumerable.cs ├── .editorconfig ├── RucheHome.Voiceroid ├── packages.config ├── ProcessFactory.Voiceroid2Impl.cs ├── ProcessFactory.GynoidTalkImpl.cs ├── Properties │ └── AssemblyInfo.cs ├── VoiceroidInfo.cs └── FileSaveResult.cs ├── LICENSE ├── _build.bat ├── _pack.bat ├── README.md └── VoiceroidUtil.sln /_pack_debug.bat: -------------------------------------------------------------------------------- 1 | @call "%~dp0\_pack.bat" Debug 2 | -------------------------------------------------------------------------------- /data/misc/yu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/misc/yu.png -------------------------------------------------------------------------------- /data/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/readme.txt -------------------------------------------------------------------------------- /data/manual/操作画面.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/操作画面.pdn -------------------------------------------------------------------------------- /data/manual/操作画面.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/操作画面.png -------------------------------------------------------------------------------- /data/manual/置換画面.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/置換画面.pdn -------------------------------------------------------------------------------- /data/manual/置換画面.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/置換画面.png -------------------------------------------------------------------------------- /data/manual/設定画面_一般.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/設定画面_一般.pdn -------------------------------------------------------------------------------- /data/manual/設定画面_一般.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/設定画面_一般.png -------------------------------------------------------------------------------- /data/manual/exo画面_共通.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/exo画面_共通.pdn -------------------------------------------------------------------------------- /data/manual/exo画面_共通.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/exo画面_共通.png -------------------------------------------------------------------------------- /data/manual/pukiwiki.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/pukiwiki.txt -------------------------------------------------------------------------------- /data/manual/使い方6_入力文.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/使い方6_入力文.png -------------------------------------------------------------------------------- /data/manual/設定画面_YMM.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/設定画面_YMM.pdn -------------------------------------------------------------------------------- /data/manual/設定画面_YMM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/設定画面_YMM.png -------------------------------------------------------------------------------- /data/manual/設定画面_音声保存.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/設定画面_音声保存.pdn -------------------------------------------------------------------------------- /data/manual/設定画面_音声保存.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/設定画面_音声保存.png -------------------------------------------------------------------------------- /data/misc/GynoidTalk.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/misc/GynoidTalk.psd -------------------------------------------------------------------------------- /data/misc/VOICEROID2.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/misc/VOICEROID2.pdn -------------------------------------------------------------------------------- /data/manual/使い方3_起動終了ボタン.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/使い方3_起動終了ボタン.png -------------------------------------------------------------------------------- /data/manual/設定画面_AviUtl.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/設定画面_AviUtl.pdn -------------------------------------------------------------------------------- /data/manual/設定画面_AviUtl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/設定画面_AviUtl.png -------------------------------------------------------------------------------- /data/manual/exo画面_キャラクター別.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/exo画面_キャラクター別.pdn -------------------------------------------------------------------------------- /data/manual/exo画面_キャラクター別.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/exo画面_キャラクター別.png -------------------------------------------------------------------------------- /data/manual/使い方5_VOICEROID選択.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/使い方5_VOICEROID選択.png -------------------------------------------------------------------------------- /data/manual/設定画面_音声保存_ファイル命名.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/設定画面_音声保存_ファイル命名.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/add.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/exo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/exo.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/ymm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/ymm.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/main.ico -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/open.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/play.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/save.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/stop.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/arrow_up.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/config.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/main16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/main16.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/remove.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/running.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/running.png -------------------------------------------------------------------------------- /data/manual/VOICEROID2_音声保存_ファイル分割設定.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/VOICEROID2_音声保存_ファイル分割設定.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/arrow_down.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/file_sound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/file_sound.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/file_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/file_text.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/status_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/status_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/status_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/status_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/ai_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/ai_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/ai_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/ai_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/akari.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/akari.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/hime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/hime.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/iori.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/iori.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/itako.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/itako.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/sora.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/sora.png -------------------------------------------------------------------------------- /data/manual/VOICEROID2_音声保存_ボイスプリセットタグ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/data/manual/VOICEROID2_音声保存_ボイスプリセットタグ.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/arrow_right.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/status_big_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/status_big_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/status_big_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/status_big_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/status_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/status_info.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/status_warn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/status_warn.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/text_replace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/text_replace.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/akane_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/akane_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/akane_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/akane_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/aoi_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/aoi_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/aoi_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/aoi_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/flower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/flower.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/kou_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/kou_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/kou_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/kou_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/maki_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/maki_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/maki_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/maki_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/mikoto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/mikoto.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/seika_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/seika_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/seika_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/seika_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/tsuina.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/tsuina.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/una_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/una_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/una_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/una_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/zunko_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/zunko_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/zunko_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/zunko_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/exited_notfound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/exited_notfound.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/status_big_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/status_big_info.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/status_big_warn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/status_big_warn.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/aivoice_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/aivoice_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/aivoice_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/aivoice_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/galaco_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/galaco_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/galaco_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/galaco_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/kiritan_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/kiritan_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/kiritan_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/kiritan_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/shouta_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/shouta_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/shouta_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/shouta_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/tsuina-std.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/tsuina-std.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/yukari_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/yukari_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/yukari_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/yukari_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/icon/exited_executable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/icon/exited_executable.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/gynoidtalk_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/gynoidtalk_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/gynoidtalk_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/gynoidtalk_ok.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/voiceroid2_ng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/voiceroid2_ng.png -------------------------------------------------------------------------------- /VoiceroidUtil/resources/voiceroid/voiceroid2_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruche7/VoiceroidUtil/HEAD/VoiceroidUtil/resources/voiceroid/voiceroid2_ok.png -------------------------------------------------------------------------------- /RucheHome.Text/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /RucheHomeLib/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CA1031: Do not catch general exception types 4 | dotnet_diagnostic.CA1031.severity = silent 5 | 6 | [DynamicJson.cs] 7 | 8 | # Default severity for all analyzer diagnostics 9 | dotnet_analyzer_diagnostic.severity = silent 10 | -------------------------------------------------------------------------------- /VoiceroidUtil/App.xaml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// メインウィンドウクラス。 8 | /// 9 | public partial class MainWindow : Window 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public MainWindow() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/Services/IWindowActivateService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace VoiceroidUtil.Services 5 | { 6 | /// 7 | /// ウィンドウをアクティブにする処理を提供するインタフェース。 8 | /// 9 | public interface IWindowActivateService 10 | { 11 | /// 12 | /// ウィンドウをアクティブにする。 13 | /// 14 | Task Run(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/AppConfigView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// アプリ設定ビューを保持するユーザコントロールクラス。 8 | /// 9 | public partial class AppConfigView : UserControl 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public AppConfigView() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/ExoConfigView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// ExoConfigView.xaml の相互作用ロジック 8 | /// 9 | public partial class ExoConfigView : UserControl 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public ExoConfigView() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/VoiceroidView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// VOICEROID操作ビューを保持するユーザコントロールクラス。 8 | /// 9 | public partial class VoiceroidView : UserControl 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public VoiceroidView() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/AppStatusBar.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// AppStatus 情報表示ステータスバーを保持するユーザコントロールクラス。 8 | /// 9 | public partial class AppStatusBar : UserControl 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public AppStatusBar() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/ComponentCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using RucheHome.Util; 3 | 4 | namespace RucheHome.AviUtl.ExEdit 5 | { 6 | /// 7 | /// コンポーネントコレクションクラス。 8 | /// 9 | public class ComponentCollection : NonNullCollection 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public ComponentCollection() : base() 15 | { 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/LayerItemCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using RucheHome.Util; 3 | 4 | namespace RucheHome.AviUtl.ExEdit 5 | { 6 | /// 7 | /// レイヤーアイテムコレクションクラス。 8 | /// 9 | public class LayerItemCollection : NonNullCollection 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public LayerItemCollection() : base() 15 | { 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /VoiceroidUtil/IVoiceroidItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using RucheHome.Voiceroid; 4 | 5 | namespace VoiceroidUtil 6 | { 7 | /// 8 | /// VOICEROID識別IDに紐付くアイテムを表すインタフェース。 9 | /// 10 | public interface IVoiceroidItem : INotifyPropertyChanged 11 | { 12 | /// 13 | /// VOICEROID識別IDを取得する。 14 | /// 15 | VoiceroidId VoiceroidId { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/ExoCharaStyleView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// ExoCharaStyle 設定ビューを保持するユーザコントロールクラス。 8 | /// 9 | public partial class ExoCharaStyleView : UserControl 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public ExoCharaStyleView() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/MovableValueControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// MovableValue を設定するユーザコントロールクラス。 8 | /// 9 | public partial class MovableValueControl : UserControl 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public MovableValueControl() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/AviUtlDropLayersControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// AviUtlDropLayersControl.xaml の相互作用ロジック 8 | /// 9 | public partial class AviUtlDropLayersControl : UserControl 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public AviUtlDropLayersControl() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/TalkTextReplaceConfigView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// トークテキスト置換設定ビューを保持するユーザコントロールクラス。 8 | /// 9 | public partial class TalkTextReplaceConfigView : UserControl 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public TalkTextReplaceConfigView() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/YmmCharaRelationsControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// YmmCharaRelation 列挙をリスト表示するユーザコントロールクラス。 8 | /// 9 | public partial class YmmCharaRelationsControl : UserControl 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public YmmCharaRelationsControl() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/TalkTextReplaceItemsView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// トークテキスト置換アイテムコレクション操作ビューを保持するユーザコントロールクラス。 8 | /// 9 | public partial class TalkTextReplaceItemsView : UserControl 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public TalkTextReplaceItemsView() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/MovableValueMoveModeControl.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Controls; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// MovableValue の移動モード設定ビューを保持するユーザコントロールクラス。 8 | /// 9 | public partial class MovableValueMoveModeControl : UserControl 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public MovableValueMoveModeControl() => this.InitializeComponent(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /VoiceroidUtil/ExoCharaStyleSet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace VoiceroidUtil 5 | { 6 | /// 7 | /// ExoCharaStyle インスタンスセットクラス。 8 | /// 9 | [DataContract(Namespace = "")] 10 | public class ExoCharaStyleSet : VoiceroidItemSetBase 11 | { 12 | /// 13 | /// コンストラクタ。 14 | /// 15 | public ExoCharaStyleSet() : base() 16 | { 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /VoiceroidUtil/AviUtlDropLayerSet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace VoiceroidUtil 5 | { 6 | /// 7 | /// AviUtlDropLayer インスタンスセットクラス。 8 | /// 9 | [DataContract(Namespace = "")] 10 | public class AviUtlDropLayerSet : VoiceroidItemSetBase 11 | { 12 | /// 13 | /// コンストラクタ。 14 | /// 15 | public AviUtlDropLayerSet() : base() 16 | { 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /VoiceroidUtil/resources/Converters.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /RucheHome.Voiceroid/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /VoiceroidUtil/Services/IVoiceroidActionService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using RucheHome.Voiceroid; 4 | 5 | namespace VoiceroidUtil.Services 6 | { 7 | /// 8 | /// VOICEROIDプロセスに対するアクションを提供するインタフェース。 9 | /// 10 | public interface IVoiceroidActionService 11 | { 12 | /// 13 | /// VOICEROIDプロセスに対してアクションを行う。 14 | /// 15 | /// VOICEROIDプロセス。 16 | /// アクション種別。 17 | Task Run(IProcess process, VoiceroidAction action); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/IComponent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using RucheHome.Text; 3 | 4 | namespace RucheHome.AviUtl.ExEdit 5 | { 6 | /// 7 | /// レイヤーアイテムのコンポーネントインタフェース。 8 | /// 9 | public interface IComponent 10 | { 11 | /// 12 | /// コンポーネント名を取得する。 13 | /// 14 | string ComponentName { get; } 15 | 16 | /// 17 | /// このコンポーネントを 18 | /// 拡張編集オブジェクトファイルのアイテムコレクションに変換する。 19 | /// 20 | /// アイテムコレクション。 21 | IniFileItemCollection ToExoFileItems(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /VoiceroidUtil/resources/CommonBrushes.xaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /VoiceroidUtil/Services/VoiceroidAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace VoiceroidUtil.Services 4 | { 5 | /// 6 | /// VOICEROIDプロセスに対するアクションを表す列挙。 7 | /// 8 | public enum VoiceroidAction 9 | { 10 | /// 11 | /// 何もしない。 12 | /// 13 | None, 14 | 15 | /// 16 | /// 前面に出す。 17 | /// 18 | /// 19 | /// ZオーダーをVoiceroidUtilのメインウィンドウの次に設定する。 20 | /// ただし最前面表示状態にすることはない。 21 | /// 22 | Forward, 23 | 24 | /// 25 | /// タスクバーボタンの点滅を止める。 26 | /// 27 | StopFlash, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /VoiceroidUtil/AppStatusType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace VoiceroidUtil 4 | { 5 | /// 6 | /// アプリ状態種別列挙。 7 | /// 8 | public enum AppStatusType 9 | { 10 | /// 11 | /// 特に状態なし。 12 | /// 13 | None, 14 | 15 | /// 16 | /// 情報通知状態。 17 | /// 18 | Information, 19 | 20 | /// 21 | /// 警告のある状態。 22 | /// 23 | Warning, 24 | 25 | /// 26 | /// 処理に失敗した状態。 27 | /// 28 | Fail, 29 | 30 | /// 31 | /// 処理に成功した状態。 32 | /// 33 | Success, 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /VoiceroidUtil/TalkTextReplacePreset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace VoiceroidUtil 4 | { 5 | /// 6 | /// トークテキスト置換アイテムプリセットクラス。 7 | /// 8 | public class TalkTextReplacePreset 9 | { 10 | /// 11 | /// コンストラクタ。 12 | /// 13 | /// 説明文。 14 | public TalkTextReplacePreset(string description) => 15 | this.Description = 16 | description ?? throw new ArgumentNullException(nameof(description)); 17 | 18 | /// 19 | /// 説明文を取得する。 20 | /// 21 | public string Description { get; } 22 | 23 | /// 24 | /// トークテキスト置換アイテムコレクションを取得する。 25 | /// 26 | public TalkTextReplaceItemCollection Items { get; } = 27 | new TalkTextReplaceItemCollection(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /VoiceroidUtil/FileNameFormat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.Runtime.Serialization; 4 | 5 | namespace VoiceroidUtil 6 | { 7 | /// 8 | /// ファイル名フォーマット種別列挙。 9 | /// 10 | [DataContract(Namespace = "")] 11 | public enum FileNameFormat 12 | { 13 | [Display(Name = @"入力文")] 14 | [EnumMember] 15 | Text, 16 | 17 | [Display(Name = @"日時_入力文")] 18 | [EnumMember] 19 | DateTimeText, 20 | 21 | [Display(Name = @"キャラ名_入力文")] 22 | [EnumMember] 23 | NameText, 24 | 25 | [Display(Name = @"日時_キャラ名_入力文")] 26 | [EnumMember] 27 | DateTimeNameText, 28 | 29 | [Display(Name = @"キャラ名\入力文")] 30 | [EnumMember] 31 | TextInNameDirectory, 32 | 33 | [Display(Name = @"キャラ名\日時_入力文")] 34 | [EnumMember] 35 | DateTimeTextInNameDirectory, 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /VoiceroidUtil/VoiceroidExecutablePathSet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using RucheHome.Voiceroid; 6 | 7 | namespace VoiceroidUtil 8 | { 9 | /// 10 | /// VoiceroidExecutablePath インスタンスセットクラス。 11 | /// 12 | [DataContract(Namespace = "")] 13 | public class VoiceroidExecutablePathSet 14 | : VoiceroidItemSetBase 15 | { 16 | /// 17 | /// コンストラクタ。 18 | /// 19 | public VoiceroidExecutablePathSet() : base() 20 | { 21 | } 22 | 23 | /// 24 | /// アイテムセットとして保持するVOICEROID識別ID列挙を取得する。 25 | /// 26 | /// 27 | /// 操作不可能なものを除外する。 28 | /// 29 | protected override IEnumerable VoiceroidIds => 30 | AllVoiceroidIds.Where(id => id.GetInfo().IsControllable); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /VoiceroidUtil/YmmCharaRelationSet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using RucheHome.Voiceroid; 6 | 7 | namespace VoiceroidUtil 8 | { 9 | /// 10 | /// YmmCharaRelation インスタンスセットクラス。 11 | /// 12 | [DataContract(Namespace = "")] 13 | public class YmmCharaRelationSet : VoiceroidItemSetBase 14 | { 15 | /// 16 | /// コンストラクタ。 17 | /// 18 | public YmmCharaRelationSet() : base() 19 | { 20 | } 21 | 22 | /// 23 | /// アイテムセットとして保持するVOICEROID識別ID列挙を取得する。 24 | /// 25 | /// 26 | /// 複数VOICEROIDをまとめるプロセスを示すIDを除外する。 27 | /// 28 | protected override IEnumerable VoiceroidIds => 29 | AllVoiceroidIds.Where(id => !id.GetInfo().HasMultiCharacters); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /VoiceroidUtil/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/IMovableValueConstants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RucheHome.AviUtl.ExEdit 4 | { 5 | /// 6 | /// 移動可能な数値の定数情報を保持するインタフェース。 7 | /// 8 | public interface IMovableValueConstants 9 | { 10 | /// 11 | /// 小数点以下の桁数を取得する。 12 | /// 13 | int Digits { get; } 14 | 15 | /// 16 | /// 既定値を取得する。 17 | /// 18 | decimal DefaultValue { get; } 19 | 20 | /// 21 | /// 最小値を取得する。 22 | /// 23 | decimal MinValue { get; } 24 | 25 | /// 26 | /// 最大値を取得する。 27 | /// 28 | decimal MaxValue { get; } 29 | 30 | /// 31 | /// AviUtlのスライダーで編集可能な最小値を取得する。 32 | /// 33 | decimal MinSliderValue { get; } 34 | 35 | /// 36 | /// AviUtlのスライダーで編集可能な最大値を取得する。 37 | /// 38 | decimal MaxSliderValue { get; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /VoiceroidUtil/Services/WindowActivateService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using System.Windows; 4 | using static RucheHome.Util.ArgumentValidater; 5 | 6 | namespace VoiceroidUtil.Services 7 | { 8 | /// 9 | /// ウィンドウをアクティブにする処理を提供するクラス。 10 | /// 11 | public class WindowActivateService : IWindowActivateService 12 | { 13 | /// 14 | /// コンストラクタ。 15 | /// 16 | /// 対象ウィンドウ。 17 | public WindowActivateService(Window window) 18 | { 19 | ValidateArgumentNull(window, nameof(window)); 20 | 21 | this.Window = window; 22 | } 23 | 24 | /// 25 | /// 対象ウィンドウを取得する。 26 | /// 27 | private Window Window { get; } 28 | 29 | #region IWindowActivateService の実装 30 | 31 | public async Task Run() => 32 | await this.Window.Dispatcher.InvokeAsync(this.Window.Activate); 33 | 34 | #endregion 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/IExoFileValueConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RucheHome.AviUtl.ExEdit 4 | { 5 | /// 6 | /// .NETオブジェクト値と拡張編集オブジェクトファイルの文字列値との間の 7 | /// 変換処理を提供するインタフェース。 8 | /// 9 | public interface IExoFileValueConverter 10 | { 11 | /// 12 | /// .NETオブジェクト値を拡張編集オブジェクトファイルの文字列値に変換する。 13 | /// 14 | /// .NETオブジェクト値。 15 | /// .NETオブジェクトの型情報。 16 | /// 文字列値。変換できなかった場合は null 。 17 | string ToExoFileValue(object value, Type objectType); 18 | 19 | /// 20 | /// 拡張編集オブジェクトファイルの文字列値を.NETオブジェクト値に変換する。 21 | /// 22 | /// 文字列値。 23 | /// .NETオブジェクトの型情報。 24 | /// 25 | /// .NETオブジェクト値を持つタプル。変換できなかったならば null 。 26 | /// 27 | Tuple FromExoFileValue(string value, Type objectType); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /VoiceroidUtil/IAppStatus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | 4 | namespace VoiceroidUtil 5 | { 6 | /// 7 | /// アプリ状態を提供するインタフェース。 8 | /// 9 | public interface IAppStatus 10 | { 11 | /// 12 | /// 状態種別を取得する。 13 | /// 14 | AppStatusType StatusType { get; } 15 | 16 | /// 17 | /// 状態テキストを取得する。 18 | /// 19 | string StatusText { get; } 20 | 21 | /// 22 | /// オプショナルなサブ状態種別を取得する。 23 | /// 24 | AppStatusType SubStatusType { get; } 25 | 26 | /// 27 | /// オプショナルなサブ状態テキストを取得する。 28 | /// 29 | string SubStatusText { get; } 30 | 31 | /// 32 | /// オプショナルなサブ状態コマンドを取得する。 33 | /// 34 | ICommand SubStatusCommand { get; } 35 | 36 | /// 37 | /// オプショナルなサブ状態コマンドのチップテキストを取得する。 38 | /// 39 | string SubStatusCommandTip { get; } 40 | } 41 | } -------------------------------------------------------------------------------- /VoiceroidUtil/Services/IOpenFileDialogService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using Microsoft.WindowsAPICodePack.Dialogs; 5 | 6 | namespace VoiceroidUtil.Services 7 | { 8 | /// 9 | /// ファイルまたはディレクトリの選択ダイアログ処理を提供するインタフェース。 10 | /// 11 | public interface IOpenFileDialogService 12 | { 13 | /// 14 | /// ファイルまたはディレクトリの選択ダイアログ処理を行う。 15 | /// 16 | /// ダイアログタイトル。 17 | /// 初期ディレクトリパス。 18 | /// 拡張子フィルターリスト。 19 | /// 20 | /// ディレクトリ選択ダイアログとするならば true 。 21 | /// 22 | /// 選択したファイルのフルパス。選択されなかった場合は null 。 23 | Task Run( 24 | string title = null, 25 | string initialDirectory = null, 26 | IEnumerable filters = null, 27 | bool folderPicker = false); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 ruche 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /RucheHome.Voiceroid/ProcessFactory.Voiceroid2Impl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RucheHome.Voiceroid 4 | { 5 | partial class ProcessFactory 6 | { 7 | /// 8 | /// VOICEROID2用の IProcess インタフェース実装クラス。 9 | /// 10 | private class Voiceroid2Impl : Voiceroid2ImplBase 11 | { 12 | /// 13 | /// コンストラクタ。 14 | /// 15 | public Voiceroid2Impl() : base(VoiceroidId.Voiceroid2, true) 16 | { 17 | } 18 | 19 | #region ImplBase のオーバライド 20 | 21 | /// 22 | /// メインウィンドウタイトルであるか否かを取得する。 23 | /// 24 | /// タイトル。 25 | /// 26 | /// メインウィンドウタイトルならば true 。そうでなければ false 。 27 | /// 28 | /// 29 | /// スプラッシュウィンドウ等の判別用に用いる。 30 | /// 31 | protected override bool IsMainWindowTitle(string title) => 32 | title?.Contains(@"VOICEROID2") == true; 33 | 34 | #endregion 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /RucheHome.Voiceroid/ProcessFactory.GynoidTalkImpl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RucheHome.Voiceroid 4 | { 5 | partial class ProcessFactory 6 | { 7 | /// 8 | /// ガイノイドTalk用の IProcess インタフェース実装クラス。 9 | /// 10 | private sealed class GynoidTalkImpl : Voiceroid2ImplBase 11 | { 12 | /// 13 | /// コンストラクタ。 14 | /// 15 | public GynoidTalkImpl() : base(VoiceroidId.GynoidTalk, true) 16 | { 17 | } 18 | 19 | #region ImplBase のオーバライド 20 | 21 | /// 22 | /// メインウィンドウタイトルであるか否かを取得する。 23 | /// 24 | /// タイトル。 25 | /// 26 | /// メインウィンドウタイトルならば true 。そうでなければ false 。 27 | /// 28 | /// 29 | /// スプラッシュウィンドウ等の判別用に用いる。 30 | /// 31 | protected override bool IsMainWindowTitle(string title) => 32 | title?.Contains(@"ガイノイドTalk") == true; 33 | 34 | #endregion 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /VoiceroidUtil/Properties/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/FontDecoration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.Runtime.Serialization; 4 | 5 | namespace RucheHome.AviUtl.ExEdit 6 | { 7 | /// 8 | /// フォント装飾種別列挙。 9 | /// 10 | [DataContract(Namespace = "")] 11 | public enum FontDecoration 12 | { 13 | /// 14 | /// 装飾なしの標準文字。 15 | /// 16 | [Display(Name = @"標準文字")] 17 | [EnumMember] 18 | None = 0, 19 | 20 | /// 21 | /// 影付き文字。 22 | /// 23 | [Display(Name = @"影付き文字")] 24 | [EnumMember] 25 | Shadow = 1, 26 | 27 | /// 28 | /// 薄い影付き文字。 29 | /// 30 | [Display(Name = @"影付き文字(薄)")] 31 | [EnumMember] 32 | ThinShadow = 2, 33 | 34 | /// 35 | /// 縁取り文字。 36 | /// 37 | [Display(Name = @"縁取り文字")] 38 | [EnumMember] 39 | Edge = 3, 40 | 41 | /// 42 | /// 細い縁取り文字。 43 | /// 44 | [Display(Name = @"縁取り文字(細)")] 45 | [EnumMember] 46 | ThinEdge = 4, 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /RucheHome.Text/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 5 | // アセンブリに関連付けられている情報を変更するには、 6 | // これらの属性値を変更してください。 7 | [assembly: AssemblyTitle("RucheHome.Text")] 8 | [assembly: AssemblyDescription("The text utility subset of RucheHomeLib.")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("ruche-home")] 11 | [assembly: AssemblyProduct("RucheHome.Text")] 12 | [assembly: AssemblyCopyright("Copyright (C) 2016 ruche.")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから 17 | // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 18 | // その型の ComVisible 属性を true に設定してください。 19 | [assembly: ComVisible(false)] 20 | 21 | // このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります 22 | [assembly: Guid("cee2280c-8026-46de-872e-f629259890eb")] 23 | 24 | // アセンブリのバージョン情報は次の 4 つの値で構成されています: 25 | // 26 | // メジャー バージョン 27 | // マイナー バージョン 28 | // ビルド番号 29 | // Revision 30 | // 31 | // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を 32 | // 既定値にすることができます: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.2.0.*")] 35 | -------------------------------------------------------------------------------- /VoiceroidUtil/VoiceroidExecutablePath.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | using RucheHome.Voiceroid; 4 | 5 | namespace VoiceroidUtil 6 | { 7 | /// 8 | /// VOICEROIDの実行ファイルパスを保持するクラス。 9 | /// 10 | [DataContract(Namespace = "")] 11 | public class VoiceroidExecutablePath : VoiceroidItemBase 12 | { 13 | /// 14 | /// コンストラクタ。 15 | /// 16 | /// VOICEROID識別ID。 17 | public VoiceroidExecutablePath(VoiceroidId voiceroidId) : this(voiceroidId, null) 18 | { 19 | } 20 | 21 | /// 22 | /// コンストラクタ。 23 | /// 24 | /// VOICEROID識別ID。 25 | /// 実行ファイルパス。 26 | public VoiceroidExecutablePath(VoiceroidId voiceroidId, string path) 27 | : base(voiceroidId) 28 | => 29 | this.Path = path; 30 | 31 | /// 32 | /// 実行ファイルパスを取得または設定する。 33 | /// 34 | [DataMember] 35 | public string Path 36 | { 37 | get => this.path; 38 | set => this.SetProperty(ref this.path, value); 39 | } 40 | private string path = null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/ImeWatermarkTextBox.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | using Xceed.Wpf.Toolkit; 3 | 4 | namespace VoiceroidUtil.View 5 | { 6 | /// 7 | /// IMEの挙動を考慮した即時反映バインディングを行う、 8 | /// の派生クラス。 9 | /// 10 | /// 11 | /// 12 | /// Windows10 May 2020 Update 以降の新MS-IMEが、 プロパティに 13 | /// UpdateSourceTrigger=PropertyChanged でバインディングされた 14 | /// TextBox での変換時におかしな挙動となるため、その対処のために用意したクラス。 15 | /// 16 | /// 17 | /// プロパティへのバインディング時は 18 | /// UpdateSourceTrigger=Explicit とすることを推奨する。 19 | /// 20 | /// 21 | public class ImeWatermarkTextBox : WatermarkTextBox 22 | { 23 | /// 24 | /// コンストラクタ。 25 | /// 26 | public ImeWatermarkTextBox() 27 | { 28 | } 29 | 30 | /// 31 | /// プロパティの変更時に呼び出される。 32 | /// 33 | /// イベント引数。 34 | protected override void OnTextChanged(TextChangedEventArgs e) 35 | { 36 | // 自前でバインディングソース更新 37 | this.GetBindingExpression(TextProperty).UpdateSource(); 38 | 39 | base.OnTextChanged(e); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /RucheHomeLib/Util/TextElementEnumerable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | 6 | namespace RucheHome.Util 7 | { 8 | /// 9 | /// サロゲートペアを考慮した文字列挙を提供するクラス。 10 | /// 11 | public class TextElementEnumerable : IEnumerable 12 | { 13 | /// 14 | /// コンストラクタ。 15 | /// 16 | /// 対象文字列。 17 | public TextElementEnumerable(string text) => this.Text = text; 18 | 19 | /// 20 | /// 対象文字列を取得する。 21 | /// 22 | public string Text { get; } 23 | 24 | #region IEnumerable の実装 25 | 26 | /// 27 | /// 文字列挙子を取得する。 28 | /// 29 | /// 文字列挙子。 30 | public IEnumerator GetEnumerator() 31 | { 32 | for (var e = StringInfo.GetTextElementEnumerator(this.Text); e.MoveNext(); ) 33 | { 34 | yield return e.GetTextElement(); 35 | } 36 | } 37 | 38 | #endregion 39 | 40 | #region IEnumerable の明示的実装 41 | 42 | IEnumerator IEnumerable.GetEnumerator() => 43 | StringInfo.GetTextElementEnumerator(this.Text); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /VoiceroidUtil/AppStatus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | 4 | namespace VoiceroidUtil 5 | { 6 | /// 7 | /// アプリ状態を提供するクラス。 8 | /// 9 | internal class AppStatus : IAppStatus 10 | { 11 | /// 12 | /// コンストラクタ。 13 | /// 14 | public AppStatus() 15 | { 16 | } 17 | 18 | /// 19 | /// 状態種別を取得または設定する。 20 | /// 21 | public AppStatusType StatusType { get; set; } = AppStatusType.None; 22 | 23 | /// 24 | /// 状態テキストを取得または設定する。 25 | /// 26 | public string StatusText { get; set; } = ""; 27 | 28 | /// 29 | /// オプショナルなサブ状態種別を取得または設定する。 30 | /// 31 | public AppStatusType SubStatusType { get; set; } = AppStatusType.None; 32 | 33 | /// 34 | /// オプショナルなサブ状態テキストを取得または設定する。 35 | /// 36 | public string SubStatusText { get; set; } = ""; 37 | 38 | /// 39 | /// オプショナルなサブ状態コマンドを取得または設定する。 40 | /// 41 | public ICommand SubStatusCommand { get; set; } = null; 42 | 43 | /// 44 | /// オプショナルなサブ状態コマンドのチップテキストを取得または設定する。 45 | /// 46 | public string SubStatusCommandTip { get; set; } = null; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /RucheHome.Voiceroid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using System.Windows.Markup; 4 | 5 | // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 6 | // アセンブリに関連付けられている情報を変更するには、 7 | // これらの属性値を変更してください。 8 | [assembly: AssemblyTitle("RucheHome.Voiceroid")] 9 | [assembly: AssemblyDescription("The library for VOICEROID.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("ruche-home")] 12 | [assembly: AssemblyProduct("RucheHome.Voiceroid")] 13 | [assembly: AssemblyCopyright("Copyright (C) 2016 ruche.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから 18 | // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 19 | // その型の ComVisible 属性を true に設定してください。 20 | [assembly: ComVisible(false)] 21 | 22 | // このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります 23 | [assembly: Guid("e7c4802c-d723-44b6-a272-9e570c84e754")] 24 | 25 | // アセンブリのバージョン情報は次の 4 つの値で構成されています: 26 | // 27 | // メジャー バージョン 28 | // マイナー バージョン 29 | // ビルド番号 30 | // Revision 31 | // 32 | // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を 33 | // 既定値にすることができます: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.16.1.*")] 36 | 37 | // XML名前空間 38 | [assembly: XmlnsDefinition( 39 | @"http://schemas.ruche-home.net/xaml/voiceroid", 40 | @"RucheHome.Voiceroid")] 41 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using System.Windows.Markup; 4 | 5 | // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 6 | // アセンブリに関連付けられている情報を変更するには、 7 | // これらの属性値を変更してください。 8 | [assembly: AssemblyTitle("RucheHome.AviUtl")] 9 | [assembly: AssemblyDescription("The library for AviUtl.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("ruche-home")] 12 | [assembly: AssemblyProduct("RucheHome.AviUtl")] 13 | [assembly: AssemblyCopyright("Copyright (C) 2016 ruche.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから 18 | // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 19 | // その型の ComVisible 属性を true に設定してください。 20 | [assembly: ComVisible(false)] 21 | 22 | // このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります 23 | [assembly: Guid("ef44d39c-4106-4e7b-ae0d-9a3b41de6eac")] 24 | 25 | // アセンブリのバージョン情報は次の 4 つの値で構成されています: 26 | // 27 | // メジャー バージョン 28 | // マイナー バージョン 29 | // ビルド番号 30 | // Revision 31 | // 32 | // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を 33 | // 既定値にすることができます: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.8.0.*")] 36 | 37 | // XML名前空間 38 | [assembly: XmlnsDefinition( 39 | @"http://schemas.ruche-home.net/xaml/aviutl", 40 | @"RucheHome.AviUtl")] 41 | [assembly: XmlnsDefinition( 42 | @"http://schemas.ruche-home.net/xaml/aviutl", 43 | @"RucheHome.AviUtl.ExEdit")] 44 | -------------------------------------------------------------------------------- /VoiceroidUtil/VoiceroidVisibility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | using RucheHome.Voiceroid; 4 | 5 | namespace VoiceroidUtil 6 | { 7 | /// 8 | /// VOICEROIDの表示設定を保持するクラス。 9 | /// 10 | [DataContract(Namespace = "")] 11 | public class VoiceroidVisibility : VoiceroidItemBase 12 | { 13 | /// 14 | /// コンストラクタ。 15 | /// 16 | /// VOICEROID識別ID。 17 | public VoiceroidVisibility(VoiceroidId voiceroidId) : this(voiceroidId, true) 18 | { 19 | } 20 | 21 | /// 22 | /// コンストラクタ。 23 | /// 24 | /// VOICEROID識別ID。 25 | /// 表示するならば true 。 26 | public VoiceroidVisibility(VoiceroidId voiceroidId, bool visible) 27 | : base(voiceroidId) 28 | => 29 | this.IsVisible = visible; 30 | 31 | /// 32 | /// VOICEROIDを表示するか否かを取得する。 33 | /// 34 | [DataMember] 35 | public bool IsVisible 36 | { 37 | get => this.visible; 38 | set => this.SetProperty(ref this.visible, value); 39 | } 40 | private bool visible = true; 41 | 42 | /// 43 | /// デシリアライズの直前に呼び出される。 44 | /// 45 | [OnDeserializing] 46 | private void OnDeserializing(StreamingContext context) => this.IsVisible = true; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /_build.bat: -------------------------------------------------------------------------------- 1 | @setlocal 2 | @echo off 3 | set RET=1 4 | 5 | where VsMSBuildCmd.bat >nul 2>&1 6 | if errorlevel 1 ( 7 | echo Please set path to "Common7\Tools" in Visual Studio install directory. 8 | goto ON_ERROR 9 | ) 10 | 11 | call VsMSBuildCmd.bat 12 | if errorlevel 1 goto ON_ERROR 13 | 14 | pushd "%~dp0" 15 | 16 | REM ---- For clean packaging 17 | rmdir /S /Q VoiceroidUtil\bin\Release >nul 2>&1 18 | 19 | REM ---- NuGet (if installed) 20 | where nuget >nul 2>&1 21 | if errorlevel 1 ( 22 | echo Nuget is not installed. 23 | ) else ( 24 | nuget update -self 25 | nuget restore VoiceroidUtil.sln 26 | if errorlevel 1 goto ON_ERROR_POPD 27 | ) 28 | 29 | REM ---- Overwrite resources 30 | if exist __resources ( 31 | rmdir /S /Q __resources_temp >nul 2>&1 32 | xcopy /Y /E /I VoiceroidUtil\resources __resources_temp 33 | if errorlevel 1 goto ON_ERROR_POPD 34 | xcopy /Y /E /I __resources VoiceroidUtil\resources 35 | if errorlevel 1 goto ON_ERROR_RESET_RESOURCE 36 | ) 37 | 38 | REM ---- Build solution 39 | MSBuild VoiceroidUtil.sln /m /t:Rebuild /p:Configuration=Debug 40 | if errorlevel 1 goto ON_ERROR_RESET_RESOURCE 41 | MSBuild VoiceroidUtil.sln /m /t:Rebuild /p:Configuration=Release 42 | if errorlevel 1 goto ON_ERROR_RESET_RESOURCE 43 | 44 | set RET=0 45 | 46 | REM ---- Reset resources 47 | :ON_ERROR_RESET_RESOURCE 48 | if exist __resources ( 49 | xcopy /Y /E /I __resources_temp VoiceroidUtil\resources 50 | rmdir /S /Q __resources_temp >nul 2>&1 51 | ) 52 | 53 | :ON_ERROR_POPD 54 | popd 55 | 56 | :ON_ERROR 57 | if not "%RET%"=="0" pause 58 | endlocal && exit /b %RET% 59 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/IMovableValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | 4 | namespace RucheHome.AviUtl.ExEdit 5 | { 6 | /// 7 | /// 移動可能な数値を表すインタフェース。 8 | /// 9 | public interface IMovableValue : INotifyPropertyChanged 10 | { 11 | /// 12 | /// 定数情報を取得する。 13 | /// 14 | IMovableValueConstants Constants { get; } 15 | 16 | /// 17 | /// 開始値を取得または設定する。 18 | /// 19 | decimal Begin { get; set; } 20 | 21 | /// 22 | /// 終端値を取得または設定する。 23 | /// 24 | /// 25 | /// 移動モードが MoveMode.None の場合は無視される。 26 | /// 27 | decimal End { get; set; } 28 | 29 | /// 30 | /// 移動モードを取得または設定する。 31 | /// 32 | MoveMode MoveMode { get; set; } 33 | 34 | /// 35 | /// 加速を行うか否かを取得または設定する。 36 | /// 37 | /// 38 | /// 移動モードが加減速指定不可ならば無視される。 39 | /// 40 | bool IsAccelerating { get; set; } 41 | 42 | /// 43 | /// 減速を行うか否かを取得または設定する。 44 | /// 45 | /// 46 | /// 移動モードが加減速指定不可ならば無視される。 47 | /// 48 | bool IsDecelerating { get; set; } 49 | 50 | /// 51 | /// 移動フレーム間隔を取得または設定する。 52 | /// 53 | /// 54 | /// 移動モードが移動フレーム間隔設定を持たないならば無視される。 55 | /// 56 | int Interval { get; set; } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /VoiceroidUtil/Services/IAviUtlFileDropService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using RucheHome.AviUtl.ExEdit.GcmzDrops; 5 | 6 | namespace VoiceroidUtil.Services 7 | { 8 | /// 9 | /// AviUtl拡張編集タイムラインへのファイルドロップ処理を提供するインタフェース。 10 | /// 11 | public interface IAviUtlFileDropService 12 | { 13 | /// 14 | /// AviUtl拡張編集タイムラインへのファイルドロップ処理を行う。 15 | /// 16 | /// ファイルパス。 17 | /// ドロップ後に進めるフレーム数。 18 | /// レイヤー位置指定。既定位置にするならば 0 。 19 | /// 20 | /// タイムアウトミリ秒数。負数ならばタイムアウトしない。 21 | /// 22 | /// 処理結果。 23 | Task Run( 24 | string filePath, 25 | int stepFrameCount = 0, 26 | int layer = 0, 27 | int timeoutMilliseconds = -1); 28 | 29 | /// 30 | /// AviUtl拡張編集タイムラインへのファイルドロップ処理を行う。 31 | /// 32 | /// ファイルパス列挙。 33 | /// ドロップ後に進めるフレーム数。 34 | /// レイヤー位置指定。既定位置にするならば 0 。 35 | /// 36 | /// タイムアウトミリ秒数。負数ならばタイムアウトしない。 37 | /// 38 | /// 処理結果。 39 | Task Run( 40 | IEnumerable filePathes, 41 | int stepFrameCount = 0, 42 | int layer = 0, 43 | int timeoutMilliseconds = -1); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /_pack.bat: -------------------------------------------------------------------------------- 1 | @setlocal 2 | @echo off 3 | 4 | set TARGET_CONFIG=%~1 5 | if "%TARGET_CONFIG%"=="" set TARGET_CONFIG=Release 6 | 7 | set SRC_EXE_DIR=%~dp0\VoiceroidUtil\bin\%TARGET_CONFIG% 8 | set SRC_EXE_FILE=%SRC_EXE_DIR%\VoiceroidUtil.exe 9 | set SRC_DOC_FILE=%~dp0\data\readme.txt 10 | set DEST_BASE_DIR=%~dp0\__release\VoiceroidUtil 11 | if not "%TARGET_CONFIG%"=="Release" set DEST_BASE_DIR=%DEST_BASE_DIR%_%TARGET_CONFIG% 12 | set DEST_SYSTEM_DIR=%DEST_BASE_DIR%\system 13 | 14 | REM ---- check source 15 | 16 | if not exist "%SRC_EXE_FILE%" ( 17 | echo "%SRC_EXE_FILE%" is not found. 18 | goto ON_ERROR 19 | ) 20 | if not exist "%SRC_DOC_FILE%" ( 21 | echo "%SRC_DOC_FILE%" is not found. 22 | goto ON_ERROR 23 | ) 24 | 25 | REM ---- remake destination 26 | 27 | if exist "%DEST_BASE_DIR%" rmdir /S /Q "%DEST_BASE_DIR%" 28 | mkdir "%DEST_BASE_DIR%" 29 | if errorlevel 1 goto ON_ERROR 30 | 31 | if exist "%DEST_SYSTEM_DIR%" rmdir /S /Q "%DEST_SYSTEM_DIR%" 32 | mkdir "%DEST_SYSTEM_DIR%" 33 | if errorlevel 1 goto ON_ERROR 34 | 35 | REM ---- copy files 36 | 37 | xcopy /Y "%SRC_EXE_FILE%" "%DEST_BASE_DIR%" 38 | if errorlevel 1 goto ON_ERROR 39 | xcopy /Y "%SRC_EXE_FILE%.config" "%DEST_BASE_DIR%" 40 | if errorlevel 1 goto ON_ERROR 41 | xcopy /Y "%SRC_EXE_DIR%"\*.dll "%DEST_SYSTEM_DIR%" 42 | if errorlevel 1 goto ON_ERROR 43 | xcopy /Y /I "%SRC_EXE_DIR%\ja" "%DEST_SYSTEM_DIR%\ja" 44 | if errorlevel 1 goto ON_ERROR 45 | xcopy /Y "%SRC_DOC_FILE%" "%DEST_BASE_DIR%" 46 | if errorlevel 1 goto ON_ERROR 47 | 48 | REM ---- remove unused files 49 | 50 | del /S /Q "%DEST_SYSTEM_DIR%"\Xceed.Wpf.AvalonDock.* >nul 2>&1 51 | del /S /Q "%DEST_SYSTEM_DIR%"\Xceed.Wpf.DataGrid.dll >nul 2>&1 52 | 53 | exit /b 0 54 | 55 | :ON_ERROR 56 | pause 57 | exit /b 1 58 | -------------------------------------------------------------------------------- /VoiceroidUtil/YmmCharaRelation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | using RucheHome.Voiceroid; 4 | 5 | namespace VoiceroidUtil 6 | { 7 | /// 8 | /// VOICEROIDと『ゆっくりMovieMaker3』のキャラ名との紐付けを定義するクラス。 9 | /// 10 | [DataContract(Namespace = "")] 11 | public class YmmCharaRelation : VoiceroidItemBase 12 | { 13 | /// 14 | /// コンストラクタ。 15 | /// 16 | /// VOICEROID識別ID。 17 | public YmmCharaRelation(VoiceroidId voiceroidId) : this(voiceroidId, null) 18 | { 19 | } 20 | 21 | /// 22 | /// コンストラクタ。 23 | /// 24 | /// VOICEROID識別ID。 25 | /// 26 | /// 『ゆっくりMovieMaker3』のキャラ名。 null ならばVOICEROID識別IDから決定する。 27 | /// 28 | public YmmCharaRelation(VoiceroidId voiceroidId, string ymmCharaName) 29 | : base(voiceroidId) 30 | => 31 | this.YmmCharaName = ymmCharaName ?? voiceroidId.GetInfo()?.ShortName ?? ""; 32 | 33 | /// 34 | /// 『ゆっくりMovieMaker3』のキャラ名を取得または設定する。 35 | /// 36 | [DataMember] 37 | public string YmmCharaName 38 | { 39 | get => this.ymmCharaName; 40 | set => this.SetProperty(ref this.ymmCharaName, value ?? ""); 41 | } 42 | private string ymmCharaName = ""; 43 | 44 | /// 45 | /// デシリアライズの直前に呼び出される。 46 | /// 47 | [OnDeserializing] 48 | private void OnDeserializing(StreamingContext context) => 49 | this.YmmCharaName = ""; // null 回避 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /VoiceroidUtil/ExoConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | using RucheHome.Util; 4 | 5 | namespace VoiceroidUtil 6 | { 7 | /// 8 | /// AviUtl拡張編集ファイル用設定クラス。 9 | /// 10 | [DataContract(Namespace = "")] 11 | public class ExoConfig : BindableConfigBase 12 | { 13 | /// 14 | /// コンストラクタ。 15 | /// 16 | public ExoConfig() 17 | { 18 | // イベントハンドラ追加のためにプロパティ経由で設定 19 | this.Common = new ExoCommonConfig(); 20 | this.CharaStyles = new ExoCharaStyleSet(); 21 | } 22 | 23 | /// 24 | /// 共通設定を取得または設定する。 25 | /// 26 | [DataMember] 27 | public ExoCommonConfig Common 28 | { 29 | get => this.common; 30 | set => 31 | this.SetPropertyWithPropertyChangedChain( 32 | ref this.common, 33 | value ?? new ExoCommonConfig()); 34 | } 35 | private ExoCommonConfig common = null; 36 | 37 | /// 38 | /// キャラクター別スタイルを取得または設定する。 39 | /// 40 | [DataMember] 41 | public ExoCharaStyleSet CharaStyles 42 | { 43 | get => this.charaStyles; 44 | set => 45 | this.SetPropertyWithPropertyChangedChain( 46 | ref this.charaStyles, 47 | value ?? new ExoCharaStyleSet()); 48 | } 49 | private ExoCharaStyleSet charaStyles = null; 50 | 51 | /// 52 | /// デシリアライズの直前に呼び出される。 53 | /// 54 | [OnDeserializing] 55 | private void OnDeserializing(StreamingContext context) => this.ResetDataMembers(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/VoiceroidKeywordsView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows; 5 | using System.Windows.Controls; 6 | using RucheHome.Voiceroid; 7 | 8 | namespace VoiceroidUtil.View 9 | { 10 | /// 11 | /// VOICEROIDキーワード表示を行うユーザコントロールクラス。 12 | /// 13 | public partial class VoiceroidKeywordsView : UserControl 14 | { 15 | /// 16 | /// コンストラクタ。 17 | /// 18 | public VoiceroidKeywordsView() => this.InitializeComponent(); 19 | 20 | /// 21 | /// VoiceroidNameHeader 依存関係プロパティ。 22 | /// 23 | public static readonly DependencyProperty VoiceroidNameHeaderProperty = 24 | DependencyProperty.Register( 25 | nameof(VoiceroidNameHeader), 26 | typeof(object), 27 | typeof(VoiceroidKeywordsView), 28 | new UIPropertyMetadata(@"VOICEROID")); 29 | 30 | /// 31 | /// VOICEROID名のヘッダ文字列を取得または設定する。 32 | /// 33 | public object VoiceroidNameHeader 34 | { 35 | get => this.GetValue(VoiceroidNameHeaderProperty); 36 | set => this.SetValue(VoiceroidNameHeaderProperty, value); 37 | } 38 | 39 | /// 40 | /// VOICEROID短縮名とキーワードリスト文字列のディクショナリを取得する。 41 | /// 42 | public IReadOnlyDictionary VoiceroidKeywords { get; } = 43 | ((VoiceroidId[])Enum.GetValues(typeof(VoiceroidId))) 44 | .Where(id => id.GetInfo().Keywords.Count > 0) 45 | .ToDictionary( 46 | id => id.GetInfo().ShortName, 47 | id => string.Join(@", ", id.GetInfo().Keywords)); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /RucheHomeLib/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using System.Windows.Markup; 4 | 5 | // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 6 | // アセンブリに関連付けられている情報を変更するには、 7 | // これらの属性値を変更してください。 8 | [assembly: AssemblyTitle("RucheHomeLib")] 9 | [assembly: AssemblyDescription( 10 | "The common library for ruche's .NET tools. (.NET Framework 4.5 or later)")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("ruche-home")] 13 | [assembly: AssemblyProduct("RucheHomeLib")] 14 | [assembly: AssemblyCopyright("Copyright (C) 2016 ruche.")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから 19 | // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 20 | // その型の ComVisible 属性を true に設定してください。 21 | [assembly: ComVisible(false)] 22 | 23 | // このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります 24 | [assembly: Guid("df1b25fe-0fdf-4c86-a779-aff5217a7c6b")] 25 | 26 | // アセンブリのバージョン情報は次の 4 つの値で構成されています: 27 | // 28 | // メジャー バージョン 29 | // マイナー バージョン 30 | // ビルド番号 31 | // Revision 32 | // 33 | // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を 34 | // 既定値にすることができます: 35 | // [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyVersion("1.12.0.*")] 37 | 38 | [assembly: XmlnsDefinition( 39 | @"http://schemas.ruche-home.net/xaml/windows/mvvm", 40 | @"RucheHome.Windows.Mvvm")] 41 | [assembly: XmlnsDefinition( 42 | @"http://schemas.ruche-home.net/xaml/windows/mvvm", 43 | @"RucheHome.Windows.Mvvm.Behaviors")] 44 | [assembly: XmlnsDefinition( 45 | @"http://schemas.ruche-home.net/xaml/windows/mvvm", 46 | @"RucheHome.Windows.Mvvm.Commands")] 47 | [assembly: XmlnsDefinition( 48 | @"http://schemas.ruche-home.net/xaml/windows/mvvm", 49 | @"RucheHome.Windows.Mvvm.Converters")] 50 | -------------------------------------------------------------------------------- /RucheHomeLib/Windows/Mvvm/Behaviors/FrameworkElementBehavior.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using Microsoft.Xaml.Behaviors; 4 | 5 | namespace RucheHome.Windows.Mvvm.Behaviors 6 | { 7 | /// 8 | /// UI要素のロード完了時呼び出しをサポートするビヘイビアの基底クラス。 9 | /// 10 | /// FrameworkElement 派生型。 11 | public abstract class FrameworkElementBehavior : Behavior 12 | where T : FrameworkElement 13 | { 14 | /// 15 | /// コンストラクタ。 16 | /// 17 | protected FrameworkElementBehavior() : base() 18 | { 19 | } 20 | 21 | /// 22 | /// UI要素のロード完了時に呼び出される。 23 | /// 24 | /// 25 | /// アタッチ時点でロード完了済みの場合は即座に呼び出される。 26 | /// 27 | protected virtual void OnAssociatedObjectLoaded() 28 | { 29 | } 30 | 31 | /// 32 | /// UI要素のロード完了時に呼び出される。 33 | /// 34 | private void OnLoaded(object sender, RoutedEventArgs e) 35 | { 36 | this.AssociatedObject.Loaded -= this.OnLoaded; 37 | 38 | this.OnAssociatedObjectLoaded(); 39 | } 40 | 41 | #region Behavior のオーバライド 42 | 43 | /// 44 | /// ビヘイビアをアタッチした時に呼び出される。 45 | /// 46 | protected override void OnAttached() 47 | { 48 | base.OnAttached(); 49 | 50 | if (this.AssociatedObject.IsLoaded) 51 | { 52 | // ロード済みなら即呼び出し 53 | this.OnAssociatedObjectLoaded(); 54 | } 55 | else 56 | { 57 | // 未ロードなら呼び出し予約 58 | this.AssociatedObject.Loaded += this.OnLoaded; 59 | } 60 | } 61 | 62 | #endregion 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /VoiceroidUtil/AviUtlDropLayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | using RucheHome.AviUtl.ExEdit.GcmzDrops; 4 | using RucheHome.Voiceroid; 5 | 6 | namespace VoiceroidUtil 7 | { 8 | /// 9 | /// VOICEROIDのAviUtl拡張編集ファイルドロップ先レイヤー番号を保持するクラス。 10 | /// 11 | [DataContract(Namespace = "")] 12 | public class AviUtlDropLayer : VoiceroidItemBase 13 | { 14 | /// 15 | /// コンストラクタ。 16 | /// 17 | /// VOICEROID識別ID。 18 | public AviUtlDropLayer(VoiceroidId voiceroidId) : this(voiceroidId, MinLayer - 1) 19 | { 20 | } 21 | 22 | /// 23 | /// コンストラクタ。 24 | /// 25 | /// VOICEROID識別ID。 26 | /// 27 | /// レイヤー番号。範囲外ならばVOICEROID識別IDから決定する。 28 | /// 29 | public AviUtlDropLayer(VoiceroidId voiceroidId, int layer) : base(voiceroidId) => 30 | this.Layer = 31 | (layer < MinLayer || layer > MaxLayer) ? ((int)voiceroidId * 2 + 10) : layer; 32 | 33 | /// 34 | /// レイヤー番号の最小許容値。 35 | /// 36 | public const int MinLayer = FileDrop.MinLayer; 37 | 38 | /// 39 | /// レイヤー番号の最大許容値。 40 | /// 41 | public const int MaxLayer = FileDrop.MaxLayer - 1; 42 | 43 | /// 44 | /// レイヤー番号を取得または設定する。 45 | /// 46 | [DataMember] 47 | public int Layer 48 | { 49 | get => this.layer; 50 | set => 51 | this.SetProperty( 52 | ref this.layer, 53 | Math.Min(Math.Max(MinLayer, value), MaxLayer)); 54 | } 55 | private int layer = 1; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /RucheHomeLib/Windows/Mvvm/Converters/BooleanInverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace RucheHome.Windows.Mvvm.Converters 7 | { 8 | /// 9 | /// 真偽値を反転させるクラス。 10 | /// 11 | public class BooleanInverter : IValueConverter 12 | { 13 | /// 14 | /// 真偽値を反転させる。 15 | /// 16 | /// 真偽値。 17 | /// 無視される。 18 | /// 無視される。 19 | /// 無視される。 20 | /// 21 | /// 真偽値を反転させた値。失敗した場合は DependencyProperty.UnsetValue 。 22 | /// 23 | public object Convert( 24 | object value, 25 | Type targetType, 26 | object parameter, 27 | CultureInfo culture) 28 | { 29 | if (value is bool v) 30 | { 31 | return !v; 32 | } 33 | 34 | var nv = value as bool?; 35 | return nv.HasValue ? (bool?)!nv.Value : DependencyProperty.UnsetValue; 36 | } 37 | 38 | /// 39 | /// 真偽値を反転させる。 40 | /// 41 | /// 真偽値。 42 | /// 無視される。 43 | /// 無視される。 44 | /// 無視される。 45 | /// 46 | /// 真偽値を反転させた値。失敗した場合は DependencyProperty.UnsetValue 。 47 | /// 48 | public object ConvertBack( 49 | object value, 50 | Type targetType, 51 | object parameter, 52 | CultureInfo culture) 53 | => 54 | this.Convert(value, targetType, parameter, culture); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /RucheHomeLib/Windows/Mvvm/Behaviors/ListBoxAutoScrollBehavior.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Controls; 4 | 5 | namespace RucheHome.Windows.Mvvm.Behaviors 6 | { 7 | /// 8 | /// ListBox クラスに選択項目への自動スクロールを提供するビヘイビア。 9 | /// 10 | public class ListBoxAutoScrollBehavior : FrameworkElementBehavior 11 | { 12 | /// 13 | /// コンストラクタ。 14 | /// 15 | public ListBoxAutoScrollBehavior() : base() 16 | { 17 | } 18 | 19 | /// 20 | /// 選択項目が変更された時に呼び出される。 21 | /// 22 | private void OnSelectionChanged(object sender, SelectionChangedEventArgs e) 23 | { 24 | var listBox = this.AssociatedObject; 25 | var index = listBox.SelectedIndex; 26 | if (index >= 0 && index < listBox.Items.Count) 27 | { 28 | listBox.ScrollIntoView(listBox.Items[index]); 29 | } 30 | } 31 | 32 | #region FrameworkElementBehavior のオーバライド 33 | 34 | /// 35 | /// ItemsControl のロード完了時に呼び出される。 36 | /// 37 | protected override void OnAssociatedObjectLoaded() => 38 | this.AssociatedObject.SelectionChanged += this.OnSelectionChanged; 39 | 40 | /// 41 | /// ビヘイビアをデタッチする直前に呼び出される。 42 | /// 43 | protected override void OnDetaching() 44 | { 45 | this.AssociatedObject.SelectionChanged -= this.OnSelectionChanged; 46 | 47 | base.OnDetaching(); 48 | } 49 | 50 | /// 51 | /// 自身の型のインスタンスを作成する。 52 | /// 53 | /// 作成されたインスタンス。 54 | protected override Freezable CreateInstanceCore() => new ListBoxAutoScrollBehavior(); 55 | 56 | #endregion 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /RucheHomeLib/Windows/Mvvm/Converters/BooleanVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace RucheHome.Windows.Mvvm.Converters 7 | { 8 | /// 9 | /// 真偽値と System.Windows.Visibility 値との変換および逆変換を行うクラス。 10 | /// 11 | public class BooleanVisibilityConverter : IValueConverter 12 | { 13 | /// 14 | /// 真偽値を System.Windows.Visibility 値に変換する。 15 | /// 16 | /// 真偽値。 17 | /// 無視される。 18 | /// 無視される。 19 | /// 無視される。 20 | /// 21 | /// System.Windows.Visibility 値。 22 | /// 変換できない場合は DependencyProperty.UnsetValue 。 23 | /// 24 | public object Convert( 25 | object value, 26 | Type targetType, 27 | object parameter, 28 | CultureInfo culture) 29 | => 30 | (value is bool v) ? 31 | (v ? Visibility.Visible : Visibility.Collapsed) : DependencyProperty.UnsetValue; 32 | 33 | /// 34 | /// System.Windows.Visibility 値を真偽値に変換する。 35 | /// 36 | /// System.Windows.Visibility 値。 37 | /// 無視される。 38 | /// 無視される。 39 | /// 無視される。 40 | /// 真偽値。変換できない場合は DependencyProperty.UnsetValue 。 41 | public object ConvertBack( 42 | object value, 43 | Type targetType, 44 | object parameter, 45 | CultureInfo culture) 46 | => 47 | (value is Visibility v) ? (v == Visibility.Visible) : DependencyProperty.UnsetValue; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/FontFamilyNameEnumerable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Drawing.Text; 5 | using System.Linq; 6 | 7 | namespace RucheHome.AviUtl 8 | { 9 | /// 10 | /// AviUtlで使われるフォントファミリ名列挙を提供するクラス。 11 | /// 12 | public class FontFamilyNameEnumerable : IEnumerable 13 | { 14 | /// 15 | /// コンストラクタ。フォントファミリ名でソートする。 16 | /// 17 | public FontFamilyNameEnumerable() : this(true) 18 | { 19 | } 20 | 21 | /// 22 | /// コンストラクタ。 23 | /// 24 | /// フォントファミリ名でソートするならば true 。 25 | public FontFamilyNameEnumerable(bool sorting) => this.IsSorting = sorting; 26 | 27 | /// 28 | /// フォントコレクションを取得する。 29 | /// 30 | private InstalledFontCollection Fonts { get; } = new InstalledFontCollection(); 31 | 32 | /// 33 | /// フォントファミリ名でソートするか否かを取得する。 34 | /// 35 | private bool IsSorting { get; } 36 | 37 | #region IEnumerable の実装 38 | 39 | /// 40 | /// フォントファミリ名の列挙子を取得する。 41 | /// 42 | /// フォントファミリ名の列挙子。 43 | public IEnumerator GetEnumerator() 44 | { 45 | var e = 46 | this.Fonts.Families 47 | .Select(f => f.Name) 48 | .Where(n => !string.IsNullOrWhiteSpace(n)); 49 | return this.IsSorting ? e.OrderBy(n => n).GetEnumerator() : e.GetEnumerator(); 50 | } 51 | 52 | #endregion 53 | 54 | #region IEnumerable の明示的実装 55 | 56 | IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator(); 57 | 58 | #endregion 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /RucheHomeLib/Util/NonNullCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | 6 | namespace RucheHome.Util 7 | { 8 | /// 9 | /// 要素に null 値を含まないコレクションクラス。 10 | /// 11 | /// 要素型。 12 | public class NonNullCollection : Collection 13 | { 14 | /// 15 | /// コンストラクタ。 16 | /// 17 | public NonNullCollection() : base() 18 | { 19 | } 20 | 21 | /// 22 | /// コンストラクタ。 23 | /// 24 | /// ラップ対象のリスト。 25 | public NonNullCollection(IList list) : base(list) 26 | { 27 | if (list.Any(v => v == null)) 28 | { 29 | throw new ArgumentException(@"Some items are null.", nameof(list)); 30 | } 31 | } 32 | 33 | /// 34 | /// 要素の挿入時に呼び出される。 35 | /// 36 | /// 挿入先インデックス。 37 | /// 挿入する要素。 38 | protected override void InsertItem(int index, T item) 39 | { 40 | if (item == null) 41 | { 42 | throw new ArgumentException(@"The item is null.", nameof(item)); 43 | } 44 | 45 | base.InsertItem(index, item); 46 | } 47 | 48 | /// 49 | /// 要素の上書き時に呼び出される。 50 | /// 51 | /// 上書き先インデックス。 52 | /// 上書きする要素。 53 | protected override void SetItem(int index, T item) 54 | { 55 | if (item == null) 56 | { 57 | throw new ArgumentException(@"The item is null.", nameof(item)); 58 | } 59 | 60 | base.SetItem(index, item); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VoiceroidUtil 2 | 3 | ## About 4 | 5 | VOICEROID動画制作支援ツール『VoiceroidUtil』のソースです。 6 | 7 | * MIT License です。 8 | * ビルドには Visual Studio 2022 が必要です。 9 | * 外部ライブラリは NuGet で取得しています。 10 | * 画像リソースの一部は再配布禁止のため、ダミー画像がコミットされています。 11 | * 使用したライブラリや素材の詳細は [data/readme.txt](data/readme.txt) を参照してください。 12 | 13 | ## Repository rules 14 | 15 | version 1.4.0 リリース以降は下記のルールで作業しています。 16 | 17 | * `master` には基本的に直接コミットしない。 18 | * 作業ブランチから Pull Request を通して反映する。 19 | * [README.md](README.md)(当ファイル)の編集と、 [data/manual](data/manual) ディレクトリ以下を修正する場合のみ例外とする。 20 | * 機能追加、バグ修正等を行う際はまず Issue を立て、それに対応するブランチを作成して作業する。 21 | * 機能追加のブランチ名は `feature/Issue番号-機能内容` とする。(ex. `feature/5-exo_output`) 22 | * バグ修正のブランチ名は `fix/Issue番号-バグ内容` とする。(ex. `fix/7-crash_at_save`) 23 | * リリース用のドキュメント類の更新作業は `release/vバージョン番号` ブランチを作成して行う。(ex. `release/v1.5.0`) 24 | * 基本的にはリリース直前に `master` へ反映する。 25 | 26 | ## Release work 27 | 28 | リリース時に行う作業まとめ。 29 | 30 | 1. ローカルの `release/vバージョン番号` ブランチで下記作業を行う。 31 | 1. [data/readme.txt](data/readme.txt) を更新する。 32 | 2. [data/manual](data/manual) ディレクトリ以下を更新する。 33 | 3. [VoiceroidUtil/Properties/AssemblyInfo.cs](VoiceroidUtil/Properties/AssemblyInfo.cs) の `AssemblyVersion` 属性を書き換える。 34 | 4. `git push` を実施する。 35 | 2. `release/vバージョン番号` ブランチの Pull Request を行い、 `master` へマージする。 36 | * Pull Request のタイトルは `version バージョン番号` とする。 37 | 3. ローカルの `master` ブランチで下記作業を行う。 38 | 1. `git pull` を実施する。 39 | 2. [build_and_pack.bat](build_and_pack.bat) でビルドする。 40 | 3. __release/VoiceroidUtil ディレクトリを __release/VoiceroidUtil-日付 ディレクトリに改名してZIP圧縮する。 41 | 4. Draft a new release する。 42 | * タグは `vバージョン番号` とする。(ex. `v1.5.1`) 43 | * タイトルは `version バージョン番号` とする。(ex. `version 1.5.1`) 44 | * 説明文には更新履歴を簡潔に記載する。 45 | * ZIPファイルを添付する。 46 | 5. Webサイトで下記作業を行う。 47 | 1. ダウンロードページにZIPファイルを添付し、リンクを更新する。 48 | 2. マニュアルページを [data/manual](data/manual) ディレクトリ以下のデータで更新する。 49 | 3. トップページを更新する。 50 | 4. アプリ更新情報JSONファイルを更新する。 51 | 6. Twitterでの告知等を行う。 52 | -------------------------------------------------------------------------------- /VoiceroidUtil/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using System.Windows; 4 | 5 | // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 6 | // アセンブリに関連付けられている情報を変更するには、 7 | // これらの属性値を変更してください。 8 | [assembly: AssemblyTitle("VoiceroidUtil")] 9 | [assembly: AssemblyDescription("The utility tool for VOICEROID.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("ruche-home")] 12 | [assembly: AssemblyProduct("VoiceroidUtil")] 13 | [assembly: AssemblyCopyright("Copyright (C) 2016 ruche.")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから 18 | // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 19 | // その型の ComVisible 属性を true に設定してください。 20 | [assembly: ComVisible(false)] 21 | 22 | //ローカライズ可能なアプリケーションのビルドを開始するには、 23 | //.csproj ファイルの CultureYouAreCodingWith を 24 | // 内部で設定します。たとえば、 25 | //ソース ファイルで英語を使用している場合、 を en-US に設定します。次に、 26 | //下の NeutralResourceLanguage 属性のコメントを解除します。下の行の "en-US" を 27 | //プロジェクト ファイルの UICulture 設定と一致するよう更新します。 28 | 29 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 30 | 31 | 32 | [assembly: ThemeInfo( 33 | ResourceDictionaryLocation.None, //テーマ固有のリソース ディクショナリが置かれている場所 34 | //(リソースがページ、 35 | //またはアプリケーション リソース ディクショナリに見つからない場合に使用されます) 36 | ResourceDictionaryLocation.SourceAssembly //汎用リソース ディクショナリが置かれている場所 37 | //(リソースがページ、 38 | //アプリケーション、またはいずれのテーマ固有のリソース ディクショナリにも見つからない場合に使用されます) 39 | )] 40 | 41 | 42 | // アセンブリのバージョン情報は次の 4 つの値で構成されています: 43 | // 44 | // メジャー バージョン 45 | // マイナー バージョン 46 | // ビルド番号 47 | // Revision 48 | // 49 | // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を 50 | // 既定値にすることができます: 51 | // [assembly: AssemblyVersion("1.0.*")] 52 | [assembly: AssemblyVersion("1.17.1.*")] 53 | -------------------------------------------------------------------------------- /VoiceroidUtil/ViewModel/AppStatusViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reactive.Linq; 3 | using Reactive.Bindings; 4 | using Reactive.Bindings.Extensions; 5 | using RucheHome.Windows.Mvvm.Commands; 6 | using static RucheHome.Util.ArgumentValidater; 7 | 8 | namespace VoiceroidUtil.ViewModel 9 | { 10 | /// 11 | /// アプリ状態を提供する ViewModel クラス。 12 | /// 13 | public class AppStatusViewModel : ViewModelBase 14 | { 15 | /// 16 | /// コンストラクタ。 17 | /// 18 | /// アプリ状態値のプッシュ通知。 19 | public AppStatusViewModel(IObservable statusObservable) 20 | { 21 | ValidateArgumentNull(statusObservable, nameof(statusObservable)); 22 | 23 | this.Status = 24 | statusObservable 25 | .Where(s => s != null) 26 | .ToReadOnlyReactiveProperty( 27 | new AppStatus(), 28 | ReactivePropertyMode.RaiseLatestValueOnSubscribe) 29 | .AddTo(this.CompositeDisposable); 30 | } 31 | 32 | /// 33 | /// アプリ状態値を取得する。 34 | /// 35 | public IReadOnlyReactiveProperty Status { get; } 36 | 37 | #region デザイン時用定義 38 | 39 | /// 40 | /// デザイン時用コンストラクタ。 41 | /// 42 | [Obsolete(@"Design time only.")] 43 | public AppStatusViewModel() 44 | : 45 | this( 46 | Observable.Return( 47 | new AppStatus 48 | { 49 | StatusType = AppStatusType.Success, 50 | StatusText = @"デザイン時用テキスト", 51 | SubStatusType = AppStatusType.Warning, 52 | SubStatusText = @"デザイン時用サブテキスト", 53 | SubStatusCommand = new ProcessStartCommand(@"C:"), 54 | SubStatusCommandTip = @"C: を開く", 55 | })) 56 | { 57 | } 58 | 59 | #endregion 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/UnknownComponent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using RucheHome.Text; 4 | 5 | namespace RucheHome.AviUtl.ExEdit 6 | { 7 | /// 8 | /// VoiceroidUtilが認識しないコンポーネントを表すクラス。 9 | /// 10 | public class UnknownComponent : IComponent, ICloneable 11 | { 12 | /// 13 | /// コンストラクタ。 14 | /// 15 | public UnknownComponent() 16 | { 17 | } 18 | 19 | /// 20 | /// コピーコンストラクタ。 21 | /// 22 | /// コピー元。 23 | public UnknownComponent(UnknownComponent src) 24 | { 25 | if (src == null) 26 | { 27 | throw new ArgumentNullException(nameof(src)); 28 | } 29 | 30 | this.Items = src.Items.Clone(); 31 | } 32 | 33 | /// 34 | /// コンポーネント名を取得する。 35 | /// 36 | public string ComponentName => 37 | this.Items.FirstOrDefault(item => item?.Name == @"_name").Value ?? ""; 38 | 39 | /// 40 | /// アイテムコレクションを取得または設定する。 41 | /// 42 | public IniFileItemCollection Items 43 | { 44 | get => this.items; 45 | set => this.items = value ?? new IniFileItemCollection(); 46 | } 47 | private IniFileItemCollection items = new IniFileItemCollection(); 48 | 49 | /// 50 | /// このコンポーネントを 51 | /// 拡張編集オブジェクトファイルのアイテムコレクションに変換する。 52 | /// 53 | /// アイテムコレクション。 54 | public IniFileItemCollection ToExoFileItems() => this.Items.Clone(); 55 | 56 | /// 57 | /// このコンポーネントのクローンを作成する。 58 | /// 59 | /// クローン。 60 | public UnknownComponent Clone() => new UnknownComponent(this); 61 | 62 | #region ICloneable の明示的実装 63 | 64 | /// 65 | /// このオブジェクトのクローンを作成する。 66 | /// 67 | /// クローン。 68 | object ICloneable.Clone() => this.Clone(); 69 | 70 | #endregion 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /RucheHomeLib/Windows/Mvvm/Converters/MultiCommandConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | using System.Windows; 5 | using System.Windows.Data; 6 | using System.Windows.Input; 7 | using RucheHome.Windows.Mvvm.Commands; 8 | 9 | namespace RucheHome.Windows.Mvvm.Converters 10 | { 11 | /// 12 | /// MultiBinding クラスにより複数バインドされた ICommand 値を、 13 | /// それらをすべて順番に実行する単一の ICommand 値に変換するクラス。 14 | /// 15 | public class MultiCommandConverter : IMultiValueConverter 16 | { 17 | /// 18 | /// ICommand 値配列から単一の ICommand 値に変換する。 19 | /// 20 | /// ICommand 値配列。 21 | /// 無視される。 22 | /// 無視される。 23 | /// 無視される。 24 | /// 25 | /// すべてのコマンドを順番に実行する ICommand 値。 26 | /// 引数が不正な場合は DependencyProperty.UnsetValue 。 27 | /// 28 | public object Convert( 29 | object[] values, 30 | Type targetType, 31 | object parameter, 32 | CultureInfo culture) 33 | { 34 | if (values?.All(v => v is ICommand) != true) 35 | { 36 | return DependencyProperty.UnsetValue; 37 | } 38 | 39 | var commands = values.Cast().ToArray(); 40 | 41 | return 42 | new RelayCommand( 43 | p => 44 | Array.ForEach( 45 | commands, 46 | c => 47 | { 48 | if (c?.CanExecute(p) == true) 49 | { 50 | c.Execute(p); 51 | } 52 | })); 53 | } 54 | 55 | object[] IMultiValueConverter.ConvertBack( 56 | object value, 57 | Type[] targetTypes, 58 | object parameter, 59 | CultureInfo culture) 60 | => 61 | throw new NotSupportedException(); // 逆変換は非サポート 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /VoiceroidUtil/TalkTextReplaceItemCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using RucheHome.Util; 5 | using RucheHome.Util.Extensions.String; 6 | 7 | namespace VoiceroidUtil 8 | { 9 | /// 10 | /// TalkTextReplaceItem インスタンスコレクションクラス。 11 | /// 12 | public class TalkTextReplaceItemCollection : BindableCollection 13 | { 14 | /// 15 | /// コンストラクタ。 16 | /// 17 | public TalkTextReplaceItemCollection() : base() 18 | { 19 | } 20 | 21 | /// 22 | /// コンストラクタ。 23 | /// 24 | /// コレクションの初期値となるアイテム列挙。 25 | public TalkTextReplaceItemCollection(IEnumerable items) 26 | : base(items) 27 | { 28 | } 29 | 30 | /// 31 | /// 現在のアイテム群を用いて文字列を置換する。 32 | /// 33 | /// 置換対象文字列。 34 | /// 置換後の文字列。 35 | public string Replace(string src) 36 | { 37 | if (src != null) 38 | { 39 | var items = this.Where(i => i.IsAvailable()); 40 | if (items.Any()) 41 | { 42 | return 43 | src.Replace( 44 | items.Select(i => i.OldValue), 45 | items.Select(i => i.NewValue)); 46 | } 47 | } 48 | 49 | return src; 50 | } 51 | 52 | #region BindableCollection のオーバライド 53 | 54 | protected override void InsertItem(int index, TalkTextReplaceItem item) 55 | { 56 | // null は無視 57 | if (item != null) 58 | { 59 | base.InsertItem(index, item); 60 | } 61 | } 62 | 63 | protected override void SetItem(int index, TalkTextReplaceItem item) 64 | { 65 | // null は無視 66 | if (item != null) 67 | { 68 | base.SetItem(index, item); 69 | } 70 | } 71 | 72 | #endregion 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /RucheHomeLib/Windows/Mvvm/Converters/EnumValueDisplayConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.Globalization; 4 | using System.Reflection; 5 | using System.Windows; 6 | using System.Windows.Data; 7 | 8 | namespace RucheHome.Windows.Mvvm.Converters 9 | { 10 | /// 11 | /// 任意の列挙型の値を、 DisplayAttribute 属性による表示文字列に変換するクラス。 12 | /// 13 | public class EnumValueDisplayConverter : IValueConverter 14 | { 15 | /// 16 | /// 列挙値から DisplayAttribute 属性の Name 値による表示文字列に変換する。 17 | /// 18 | /// 列挙値。 19 | /// 無視される。 20 | /// 無視される。 21 | /// 無視される。 22 | /// 23 | /// DisplayAttribute 属性の Name 値による表示文字列。 24 | /// 定義されていない場合は DependencyProperty.UnsetValue 。 25 | /// 26 | public object Convert( 27 | object value, 28 | Type targetType, 29 | object parameter, 30 | CultureInfo culture) 31 | { 32 | try 33 | { 34 | // 列挙値名取得 35 | var name = Enum.GetName(value.GetType(), value); 36 | if (name == null) 37 | { 38 | return DependencyProperty.UnsetValue; 39 | } 40 | 41 | // 列挙値のメタデータ取得 42 | var info = value.GetType().GetField(name); 43 | if (info == null) 44 | { 45 | return DependencyProperty.UnsetValue; 46 | } 47 | 48 | // DisplayAttribute 属性から表示文字列を取得 49 | return 50 | info.GetCustomAttribute(false)?.GetName() ?? 51 | DependencyProperty.UnsetValue; 52 | } 53 | catch { } 54 | 55 | return DependencyProperty.UnsetValue; 56 | } 57 | 58 | object IValueConverter.ConvertBack( 59 | object value, 60 | Type targetType, 61 | object parameter, 62 | CultureInfo culture) 63 | => 64 | DependencyProperty.UnsetValue; // 逆変換は非サポート 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /VoiceroidUtil/TalkTextReplaceItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | using RucheHome.Util; 4 | 5 | namespace VoiceroidUtil 6 | { 7 | /// 8 | /// トークテキスト置換アイテムクラス。 9 | /// 10 | [DataContract(Namespace = "")] 11 | public class TalkTextReplaceItem : BindableConfigBase 12 | { 13 | /// 14 | /// コンストラクタ。 15 | /// 16 | public TalkTextReplaceItem() 17 | { 18 | } 19 | 20 | /// 21 | /// アイテムが有効であるか否かを取得または設定する。 22 | /// 23 | [DataMember] 24 | public bool IsEnabled 25 | { 26 | get => this.enabled; 27 | set => this.SetProperty(ref this.enabled, value); 28 | } 29 | private bool enabled = true; 30 | 31 | /// 32 | /// 置換元文字列を取得または設定する。 33 | /// 34 | [DataMember] 35 | public string OldValue 36 | { 37 | get => this.oldValue; 38 | set => this.SetProperty(ref this.oldValue, value ?? ""); 39 | } 40 | private string oldValue = ""; 41 | 42 | /// 43 | /// 置換先文字列を取得または設定する。 44 | /// 45 | [DataMember] 46 | public string NewValue 47 | { 48 | get => this.newValue; 49 | set => this.SetProperty(ref this.newValue, value ?? ""); 50 | } 51 | private string newValue = ""; 52 | 53 | /// 54 | /// アイテムが利用可能であるか否かを取得する。 55 | /// 56 | /// 利用可能ならば true 。そうでなければ false 。 57 | /// 58 | /// IsEnable が true かつ OldValue が空文字列でなければ利用可能。 59 | /// 60 | public bool IsAvailable() => 61 | this.IsEnabled && !string.IsNullOrEmpty(this.OldValue); 62 | 63 | /// 64 | /// アイテムのクローンを作成する。 65 | /// 66 | /// アイテムのクローン。 67 | public TalkTextReplaceItem Clone() 68 | => 69 | new TalkTextReplaceItem 70 | { 71 | IsEnabled = this.IsEnabled, 72 | OldValue = this.OldValue, 73 | NewValue = this.NewValue, 74 | }; 75 | 76 | /// 77 | /// デシリアライズの直前に呼び出される。 78 | /// 79 | [OnDeserializing] 80 | private void OnDeserializing(StreamingContext context) => this.ResetDataMembers(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/ExoFileItemAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RucheHome.AviUtl.ExEdit 4 | { 5 | /// 6 | /// プロパティと拡張編集オブジェクトファイルのアイテムとの相互変換情報を提供する 7 | /// 属性クラス。 8 | /// 9 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] 10 | public sealed class ExoFileItemAttribute : Attribute 11 | { 12 | /// 13 | /// コンストラクタ。 14 | /// 15 | /// アイテム名。 16 | /// 17 | /// コンバータ型には typeof(DefaultExoFileValueConverter) が利用される。 18 | /// 19 | public ExoFileItemAttribute(string name) 20 | : this(name, typeof(DefaultExoFileValueConverter)) 21 | { 22 | } 23 | 24 | /// 25 | /// コンストラクタ。 26 | /// 27 | /// アイテム名。 28 | /// 29 | /// コンバータ型。 30 | /// IExoFileValueConverter インタフェースを実装しており、 31 | /// かつ引数なしのパブリックなコンストラクタを持つ必要がある。 32 | /// 33 | public ExoFileItemAttribute(string name, Type converterType) 34 | { 35 | if (name == null) 36 | { 37 | throw new ArgumentNullException(nameof(name)); 38 | } 39 | if (converterType == null) 40 | { 41 | throw new ArgumentNullException(nameof(converterType)); 42 | } 43 | if (!typeof(IExoFileValueConverter).IsAssignableFrom(converterType)) 44 | { 45 | throw new ArgumentException( 46 | @"Invalid converter type.", 47 | nameof(converterType)); 48 | } 49 | if (converterType.GetConstructor(Type.EmptyTypes) == null) 50 | { 51 | throw new ArgumentException( 52 | @"The converter type has not default constructor.", 53 | nameof(converterType)); 54 | } 55 | 56 | this.Name = name; 57 | this.ConverterType = converterType; 58 | } 59 | 60 | /// 61 | /// アイテム名を取得する。 62 | /// 63 | public string Name { get; } 64 | 65 | /// 66 | /// コンバータ型を取得する。 67 | /// 68 | public Type ConverterType { get; } 69 | 70 | /// 71 | /// アイテムの順序を取得または設定する。 72 | /// 73 | public int Order { get; set; } = int.MaxValue; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /VoiceroidUtil/Mvvm/MainWindowConfigBehavior.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Windows; 4 | using Microsoft.Xaml.Behaviors; 5 | using RucheHome.Util; 6 | 7 | namespace VoiceroidUtil.Mvvm 8 | { 9 | /// 10 | /// メインウィンドウ設定のロード、適用、セーブを担うビヘイビアクラス。 11 | /// 12 | public class MainWindowConfigBehavior : Behavior 13 | { 14 | /// 15 | /// メインウィンドウ設定の保持と読み書きを行うオブジェクトを取得する。 16 | /// 17 | private ConfigKeeper ConfigKeeper { get; } = 18 | new ConfigKeeper(nameof(VoiceroidUtil)); 19 | 20 | /// 21 | /// ウィンドウが最初に表示された時に呼び出される。 22 | /// 23 | private void OnWindowContentRendered(object sender, EventArgs e) => 24 | this.ConfigKeeper.Value?.ApplyMaximizedTo(this.AssociatedObject); 25 | 26 | /// 27 | /// ウィンドウが閉じようとしている時に呼び出される。 28 | /// 29 | private void OnWindowClosing(object sender, CancelEventArgs e) 30 | { 31 | if (this.ConfigKeeper.Value == null) 32 | { 33 | this.ConfigKeeper.Value = new MainWindowConfig(); 34 | } 35 | 36 | this.ConfigKeeper.Value.CopyFrom(this.AssociatedObject); 37 | this.ConfigKeeper.Save(); 38 | } 39 | 40 | #region Behavior のオーバライド 41 | 42 | protected override void OnAttached() 43 | { 44 | base.OnAttached(); 45 | 46 | this.AssociatedObject.Closing += this.OnWindowClosing; 47 | 48 | if (this.ConfigKeeper.Value == null && !this.ConfigKeeper.Load()) 49 | { 50 | return; 51 | } 52 | 53 | this.ConfigKeeper.Value.ApplyLocationTo(this.AssociatedObject); 54 | if (this.AssociatedObject.IsMeasureValid) 55 | { 56 | this.OnWindowContentRendered(this.AssociatedObject, EventArgs.Empty); 57 | } 58 | else 59 | { 60 | this.AssociatedObject.ContentRendered += this.OnWindowContentRendered; 61 | } 62 | } 63 | 64 | protected override void OnDetaching() 65 | { 66 | this.AssociatedObject.ContentRendered -= this.OnWindowContentRendered; 67 | this.AssociatedObject.Closing -= this.OnWindowClosing; 68 | 69 | base.OnDetaching(); 70 | } 71 | 72 | protected override Freezable CreateInstanceCore() => new MainWindowConfigBehavior(); 73 | 74 | #endregion 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/BlendMode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.Runtime.Serialization; 4 | 5 | namespace RucheHome.AviUtl.ExEdit 6 | { 7 | /// 8 | /// 合成モード列挙。 9 | /// 10 | [DataContract(Namespace = "")] 11 | public enum BlendMode 12 | { 13 | /// 14 | /// 通常。 15 | /// 16 | [Display(Name = @"通常")] 17 | [EnumMember] 18 | Normal = 0, 19 | 20 | /// 21 | /// 加算。 22 | /// 23 | [Display(Name = @"加算")] 24 | [EnumMember] 25 | Add = 1, 26 | 27 | /// 28 | /// 減算。 29 | /// 30 | [Display(Name = @"減算")] 31 | [EnumMember] 32 | Subtract = 2, 33 | 34 | /// 35 | /// 乗算。 36 | /// 37 | [Display(Name = @"乗算")] 38 | [EnumMember] 39 | Multiply = 3, 40 | 41 | /// 42 | /// スクリーン。 43 | /// 44 | [Display(Name = @"スクリーン")] 45 | [EnumMember] 46 | Screen = 4, 47 | 48 | /// 49 | /// オーバーレイ。 50 | /// 51 | [Display(Name = @"オーバーレイ")] 52 | [EnumMember] 53 | Overlay = 5, 54 | 55 | /// 56 | /// 比較(明)。 57 | /// 58 | [Display(Name = @"比較(明)")] 59 | [EnumMember] 60 | Lighten = 6, 61 | 62 | /// 63 | /// 比較(暗)。 64 | /// 65 | [Display(Name = @"比較(暗)")] 66 | [EnumMember] 67 | Darken = 7, 68 | 69 | /// 70 | /// 輝度。 71 | /// 72 | [Display(Name = @"輝度")] 73 | [EnumMember] 74 | Luminosity = 8, 75 | 76 | /// 77 | /// 色差。 78 | /// 79 | [Display(Name = @"色差")] 80 | [EnumMember] 81 | ColorDifference = 9, 82 | 83 | /// 84 | /// 陰影。 85 | /// 86 | [Display(Name = @"陰影")] 87 | [EnumMember] 88 | LinearBurn = 10, 89 | 90 | /// 91 | /// 明暗。 92 | /// 93 | [Display(Name = @"明暗")] 94 | [EnumMember] 95 | LinearLight = 11, 96 | 97 | /// 98 | /// 差分。 99 | /// 100 | [Display(Name = @"差分")] 101 | [EnumMember] 102 | Difference = 12, 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /RucheHomeLib/Windows/Media/FontFamilyNameEnumerable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using System.Linq; 6 | using System.Windows.Markup; 7 | using System.Windows.Media; 8 | 9 | namespace RucheHome.Windows.Media 10 | { 11 | /// 12 | /// フォントファミリ名列挙を提供するクラス。 13 | /// 14 | public class FontFamilyNameEnumerable : IEnumerable 15 | { 16 | /// 17 | /// CultureInfo.CurrentCulture でローカライズされるフォントファミリ名列挙。 18 | /// 19 | public static readonly FontFamilyNameEnumerable Current = 20 | new FontFamilyNameEnumerable(CultureInfo.CurrentCulture); 21 | 22 | /// 23 | /// コンストラクタ。ローカライズは行わない。 24 | /// 25 | public FontFamilyNameEnumerable() => this.Language = null; 26 | 27 | /// 28 | /// コンストラクタ。 29 | /// 30 | /// 31 | /// ローカライズ対象のカルチャ情報。ローカライズを行わないならば null 。 32 | /// 33 | public FontFamilyNameEnumerable(CultureInfo culture) 34 | => 35 | this.Language = 36 | (culture == null) ? null : XmlLanguage.GetLanguage(culture.IetfLanguageTag); 37 | 38 | /// 39 | /// コンストラクタ。 40 | /// 41 | /// 42 | /// ローカライズに用いる言語。ローカライズを行わないならば null 。 43 | /// 44 | public FontFamilyNameEnumerable(XmlLanguage language) => this.Language = language; 45 | 46 | /// 47 | /// フォントファミリ名のローカライズに用いる言語を取得する。 48 | /// 49 | /// 言語。ローカライズを行わないならば null 。 50 | public XmlLanguage Language { get; } 51 | 52 | #region IEnumerable の実装 53 | 54 | /// 55 | /// フォントファミリ名の列挙子を取得する。 56 | /// 57 | /// フォントファミリ名の列挙子。 58 | public IEnumerator GetEnumerator() => 59 | (this.Language == null) ? 60 | Fonts.SystemFontFamilies.Select(f => f.Source).GetEnumerator() : 61 | Fonts.SystemFontFamilies 62 | .Select( 63 | f => 64 | f.FamilyNames.TryGetValue(this.Language, out var name) ? 65 | name : f.Source) 66 | .GetEnumerator(); 67 | 68 | #endregion 69 | 70 | #region IEnumerable の明示的実装 71 | 72 | IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator(); 73 | 74 | #endregion 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /VoiceroidUtil/Services/AviUtlFileDropService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows; 6 | using System.Windows.Interop; 7 | using RucheHome.AviUtl.ExEdit.GcmzDrops; 8 | using static RucheHome.Util.ArgumentValidater; 9 | 10 | namespace VoiceroidUtil.Services 11 | { 12 | /// 13 | /// AviUtl拡張編集タイムラインへのファイルドロップ処理を提供するクラス。 14 | /// 15 | public class AviUtlFileDropService : IAviUtlFileDropService 16 | { 17 | /// 18 | /// コンストラクタ。 19 | /// 20 | /// VoiceroidUtilのメインウィンドウ。 21 | public AviUtlFileDropService(Window mainWindow) 22 | { 23 | ValidateArgumentNull(mainWindow, nameof(mainWindow)); 24 | 25 | this.MainWindow = mainWindow; 26 | } 27 | 28 | /// 29 | /// VoiceroidUtilのメインウィンドウを取得する。 30 | /// 31 | private Window MainWindow { get; } 32 | 33 | #region IAviUtlFileDropService の実装 34 | 35 | public Task Run( 36 | string filePath, 37 | int stepFrameCount = 0, 38 | int layer = 0, 39 | int timeoutMilliseconds = -1) 40 | { 41 | FileDrop.ValidateFilePath(filePath, nameof(filePath)); 42 | 43 | return this.Run(new[] { filePath }, stepFrameCount, layer, timeoutMilliseconds); 44 | } 45 | 46 | public async Task Run( 47 | IEnumerable filePathes, 48 | int stepFrameCount = 0, 49 | int layer = 0, 50 | int timeoutMilliseconds = -1) 51 | { 52 | FileDrop.ValidateFilePathes(filePathes, nameof(filePathes)); 53 | 54 | // コピーしておく 55 | var filePathesClone = filePathes.ToArray(); 56 | 57 | // VoiceroidUtilのメインウィンドウハンドル取得 58 | var mainWin = this.MainWindow; 59 | var mainWinHandle = 60 | await mainWin.Dispatcher.InvokeAsync( 61 | () => new WindowInteropHelper(mainWin).Handle); 62 | if (mainWinHandle == IntPtr.Zero) 63 | { 64 | return FileDrop.Result.Fail; 65 | } 66 | 67 | // ファイルドロップ処理実施 68 | return 69 | await Task.Run( 70 | () => 71 | FileDrop.Run( 72 | mainWinHandle, 73 | filePathesClone, 74 | stepFrameCount, 75 | layer, 76 | timeoutMilliseconds)); 77 | } 78 | 79 | #endregion 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/YmmCharaRelationsControl.xaml: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /VoiceroidUtil/Extensions/ObservableExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Linq; 4 | using System.Linq.Expressions; 5 | using System.Reactive.Linq; 6 | using Reactive.Bindings; 7 | using Reactive.Bindings.Extensions; 8 | 9 | namespace VoiceroidUtil.Extensions 10 | { 11 | /// 12 | /// IObservable{T} ジェネリックインタフェースの拡張メソッドを提供する静的クラス。 13 | /// 14 | public static class ObservableExtension 15 | { 16 | /// 17 | /// IObservable{T} オブジェクトのプッシュ通知対象オブジェクトに対して 18 | /// ObserveProperty 拡張メソッドを呼び出す。 19 | /// 20 | /// 21 | /// プッシュ通知対象オブジェクト。 22 | /// INotifyPropertyChanged を実装している必要がある。 23 | /// 24 | /// 25 | /// プッシュ通知対象オブジェクト内プロパティの型。 26 | /// 27 | /// IObservable{T} オブジェクト。 28 | /// 29 | /// プッシュ通知対象オブジェクト内プロパティセレクタ。 30 | /// 31 | /// 32 | public static IObservable ObserveInnerProperty( 33 | this IObservable self, 34 | Expression> selector) 35 | where T : INotifyPropertyChanged 36 | => 37 | self.Select(o => o.ObserveProperty(selector)).Switch(); 38 | 39 | /// 40 | /// IObservable{T} オブジェクトの内包オブジェクトのプロパティを 41 | /// 対象とする ReadOnlyReactiveProperty{TProperty} オブジェクトを作成する。 42 | /// 43 | /// 44 | /// 内包オブジェクト。 INotifyPropertyChanged を実装している必要がある。 45 | /// 46 | /// 内包オブジェクト内プロパティの型。 47 | /// IObservable{T} オブジェクト。 48 | /// 内包オブジェクト内プロパティセレクタ。 49 | /// 50 | /// 同値への変更時にも通知を行うならば true 。 51 | /// 52 | /// ReadOnlyReactiveProperty{TProperty} オブジェクト。 53 | public static ReadOnlyReactiveProperty 54 | MakeInnerReadOnlyReactiveProperty( 55 | this IObservable self, 56 | Expression> selector, 57 | bool notifyOnSameValue = false) 58 | where T : INotifyPropertyChanged 59 | { 60 | var mode = ReactivePropertyMode.RaiseLatestValueOnSubscribe; 61 | if (!notifyOnSameValue) 62 | { 63 | mode |= ReactivePropertyMode.DistinctUntilChanged; 64 | } 65 | 66 | return 67 | self 68 | .ObserveInnerProperty(selector) 69 | .ToReadOnlyReactiveProperty(mode: mode); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /RucheHome.Text/RucheHome.Text.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {CEE2280C-8026-46DE-872E-F629259890EB} 8 | Library 9 | Properties 10 | RucheHome.Text 11 | RucheHome.Text 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | true 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | true 33 | 34 | 35 | 36 | ..\packages\ReadJEnc.1.3.1.2\lib\net45\Hnx8.ReadJEnc.dll 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /VoiceroidUtil/ErrorLogFileTraceListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace VoiceroidUtil 7 | { 8 | /// 9 | /// VoiceroidUtilのトレース情報をエラーログファイルに書き出す TraceListener クラス。 10 | /// 11 | public class ErrorLogFileTraceListener : TraceListener 12 | { 13 | /// 14 | /// コンストラクタ。 15 | /// 16 | public ErrorLogFileTraceListener() : base() 17 | { 18 | } 19 | 20 | /// 21 | /// コンストラクタ。 22 | /// 23 | /// このインスタンスの名前。 24 | public ErrorLogFileTraceListener(string name) : base(name) 25 | { 26 | } 27 | 28 | /// 29 | /// 保存先ディレクトリパスを取得するためのデリゲートを取得または設定する。 30 | /// 31 | /// 32 | /// この値が null の場合はマイドキュメントが利用される。 33 | /// 34 | public Func DirectoryPathGetter { get; set; } = null; 35 | 36 | /// 37 | /// エラーログ書き出し先ファイルパスを作成する。 38 | /// 39 | /// ファイルパス。作成できなかった場合は null 。 40 | private string MakeFilePath() 41 | { 42 | var dirPath = 43 | (this.DirectoryPathGetter != null) ? 44 | this.DirectoryPathGetter() : 45 | Environment.GetFolderPath( 46 | Environment.SpecialFolder.Personal, 47 | Environment.SpecialFolderOption.DoNotVerify); 48 | if (string.IsNullOrWhiteSpace(dirPath)) 49 | { 50 | return null; 51 | } 52 | 53 | if (!Directory.Exists(dirPath)) 54 | { 55 | try 56 | { 57 | Directory.CreateDirectory(dirPath); 58 | } 59 | catch 60 | { 61 | return null; 62 | } 63 | } 64 | 65 | return 66 | Path.Combine( 67 | dirPath, 68 | nameof(VoiceroidUtil) + @"Error-" + 69 | DateTime.Now.ToString(@"yyMMdd") + @".txt"); 70 | } 71 | 72 | #region TraceListener のオーバライド 73 | 74 | public override void Write(string message) 75 | { 76 | var path = this.MakeFilePath(); 77 | if (string.IsNullOrWhiteSpace(path)) 78 | { 79 | return; 80 | } 81 | 82 | try 83 | { 84 | File.AppendAllText(path, message, Encoding.Unicode); 85 | } 86 | catch { } 87 | } 88 | 89 | public override void WriteLine(string message) => 90 | this.Write(message + Environment.NewLine); 91 | 92 | #endregion 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/ComponentMaker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using RucheHome.Text; 4 | 5 | namespace RucheHome.AviUtl.ExEdit 6 | { 7 | /// 8 | /// コンポーネント生成処理を提供する静的クラス。 9 | /// 10 | public static class ComponentMaker 11 | { 12 | /// 13 | /// 拡張編集オブジェクトファイルのアイテムコレクションから 14 | /// コンポーネントを作成する。 15 | /// 16 | /// アイテムコレクション。 17 | /// コンポーネント。 18 | public static IComponent FromExoFileItems(IniFileItemCollection items) 19 | { 20 | if (items == null) 21 | { 22 | throw new ArgumentNullException(nameof(items)); 23 | } 24 | 25 | var result = 26 | Methods 27 | .Select(m => m.CanMake(items) ? m.Make(items) : null) 28 | .FirstOrDefault(c => c != null); 29 | if (result == null) 30 | { 31 | throw new InvalidCastException(@"Cannot make a component."); 32 | } 33 | 34 | return result; 35 | } 36 | 37 | /// 38 | /// パース用メソッド群を保持するクラス。 39 | /// 40 | private class ParseMethods 41 | { 42 | /// 43 | /// パース可能であるか否かを調べるメソッド。 44 | /// 45 | public Func CanMake; 46 | 47 | /// 48 | /// パースを行うメソッド。 49 | /// 50 | public Func Make; 51 | } 52 | 53 | /// 54 | /// パース用メソッド群。 55 | /// 56 | private static readonly ParseMethods[] Methods = 57 | { 58 | new ParseMethods 59 | { 60 | CanMake = TextComponent.HasComponentName, 61 | Make = TextComponent.FromExoFileItems, 62 | }, 63 | new ParseMethods 64 | { 65 | CanMake = AudioFileComponent.HasComponentName, 66 | Make = AudioFileComponent.FromExoFileItems, 67 | }, 68 | new ParseMethods 69 | { 70 | CanMake = RenderComponent.HasComponentName, 71 | Make = RenderComponent.FromExoFileItems, 72 | }, 73 | new ParseMethods 74 | { 75 | CanMake = PlayComponent.HasComponentName, 76 | Make = PlayComponent.FromExoFileItems, 77 | }, 78 | new ParseMethods 79 | { 80 | CanMake = _ => true, 81 | Make = items => new UnknownComponent { Items = items.Clone() }, 82 | }, 83 | }; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /VoiceroidUtil/Services/NullServices.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | using Microsoft.WindowsAPICodePack.Dialogs; 5 | using RucheHome.AviUtl.ExEdit.GcmzDrops; 6 | using RucheHome.Voiceroid; 7 | 8 | namespace VoiceroidUtil.Services 9 | { 10 | /// 11 | /// 何も行わないサービス群を提供する静的クラス。 12 | /// 13 | public static class NullServices 14 | { 15 | /// 16 | /// IOpenFileDialogService インタフェースの何も行わない実装を取得する。 17 | /// 18 | public static IOpenFileDialogService OpenFileDialog => Impl; 19 | 20 | /// 21 | /// IVoiceroidActionService インタフェースの何も行わない実装を取得する。 22 | /// 23 | public static IVoiceroidActionService VoiceroidAction => Impl; 24 | 25 | /// 26 | /// IWindowActivateService インタフェースの何も行わない実装を取得する。 27 | /// 28 | public static IWindowActivateService WindowActivate => Impl; 29 | 30 | /// 31 | /// IAviUtlFileDropService インタフェースの何も行わない実装を取得する。 32 | /// 33 | public static IAviUtlFileDropService AviUtlFileDrop => Impl; 34 | 35 | /// 36 | /// 各サービスインタフェースの何も行わない実装を提供するクラス。 37 | /// 38 | private class ServiceImpl 39 | : 40 | IOpenFileDialogService, 41 | IVoiceroidActionService, 42 | IWindowActivateService, 43 | IAviUtlFileDropService 44 | { 45 | Task IOpenFileDialogService.Run( 46 | string title, 47 | string initialDirectory, 48 | IEnumerable filters, 49 | bool folderPicker) 50 | => 51 | Task.FromResult(null); 52 | 53 | Task IVoiceroidActionService.Run(IProcess process, VoiceroidAction action) => 54 | Task.FromResult(0); 55 | 56 | Task IWindowActivateService.Run() => 57 | Task.FromResult(0); 58 | 59 | Task IAviUtlFileDropService.Run( 60 | string filePath, 61 | int stepFrameCount, 62 | int layer, 63 | int timeoutMilliseconds) 64 | => 65 | Task.FromResult(FileDrop.Result.Success); 66 | 67 | Task IAviUtlFileDropService.Run( 68 | IEnumerable filePath, 69 | int stepFrameCount, 70 | int layer, 71 | int timeoutMilliseconds) 72 | => 73 | Task.FromResult(FileDrop.Result.Success); 74 | } 75 | 76 | /// 77 | /// 各サービスインタフェースの何も行わない実装を取得する。 78 | /// 79 | private static ServiceImpl Impl { get; } = new ServiceImpl(); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /RucheHomeLib/Util/BindableBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Runtime.CompilerServices; 5 | using System.Runtime.Serialization; 6 | using System.Threading; 7 | 8 | namespace RucheHome.Util 9 | { 10 | /// 11 | /// プロパティ変更通知をサポートするクラスの抽象基底クラス。 12 | /// 13 | [DataContract(Namespace = "")] 14 | public abstract class BindableBase : INotifyPropertyChanged 15 | { 16 | /// 17 | /// コンストラクタ。 18 | /// 19 | protected BindableBase() 20 | { 21 | } 22 | 23 | /// 24 | /// 複数スレッドからプロパティを更新する際の 25 | /// PropertyChanged イベント通知に用いる同期コンテキストを取得または設定する。 26 | /// 27 | /// 28 | /// 複数スレッドから操作することがない場合、設定する必要はない。 29 | /// 30 | public SynchronizationContext SynchronizationContext { get; set; } = null; 31 | 32 | /// 33 | /// プロパティ値を設定し、変更をイベント通知する。 34 | /// 35 | /// プロパティ値の型。 36 | /// 設定先フィールド。 37 | /// 設定値。 38 | /// 39 | /// プロパティ名。 CallerMemberNameAttribute により自動設定される。 40 | /// 41 | protected void SetProperty( 42 | ref T field, 43 | T value, 44 | [CallerMemberName] string propertyName = null) 45 | { 46 | if (!EqualityComparer.Default.Equals(field, value)) 47 | { 48 | field = value; 49 | this.RaisePropertyChanged(propertyName); 50 | } 51 | } 52 | 53 | /// 54 | /// PropertyChanged イベントを発生させる。 55 | /// 56 | /// 57 | /// プロパティ名。指定しなければ CallerMemberNameAttribute により自動設定される。 58 | /// 59 | protected void RaisePropertyChanged([CallerMemberName] string propertyName = null) 60 | { 61 | void invoker() => 62 | this.PropertyChanged?.Invoke( 63 | this, 64 | new PropertyChangedEventArgs(propertyName)); 65 | 66 | var context = this.SynchronizationContext; 67 | if (context == null || context == SynchronizationContext.Current) 68 | { 69 | // 同期不要 or 同一スレッド なのでそのまま実行 70 | invoker(); 71 | } 72 | else 73 | { 74 | // 同期コンテキストへポスト 75 | context.Post(_ => invoker(), null); 76 | } 77 | } 78 | 79 | #region INotifyPropertyChanged の実装 80 | 81 | /// 82 | /// プロパティ値の変更時に呼び出されるイベント。 83 | /// 84 | public event PropertyChangedEventHandler PropertyChanged; 85 | 86 | #endregion 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /VoiceroidUtil/Properties/App.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 52 | 59 | 60 | 61 | 62 | 63 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /VoiceroidUtil/VoiceroidVisibilitySet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Diagnostics; 5 | using System.Linq; 6 | using System.Runtime.Serialization; 7 | using RucheHome.Voiceroid; 8 | 9 | namespace VoiceroidUtil 10 | { 11 | /// 12 | /// VoiceroidVisibility インスタンスセットクラス。 13 | /// 14 | [DataContract(Namespace = "")] 15 | public class VoiceroidVisibilitySet : VoiceroidItemSetBase 16 | { 17 | /// 18 | /// コンストラクタ。 19 | /// 20 | public VoiceroidVisibilitySet() : base() 21 | { 22 | } 23 | 24 | /// 25 | /// アイテムセットから表示するアイテムのみ選別したコレクションを作成する。 26 | /// 27 | /// アイテムの型。 28 | /// VOICEROID識別IDに紐付くアイテムセット。 29 | /// 30 | /// 1アイテムも選択されない場合に全選択と見なすならば true 。 31 | /// 32 | /// 表示するアイテムのみ選別したコレクション。 33 | public ReadOnlyCollection SelectVisibleOf( 34 | VoiceroidItemSetBase src, 35 | bool selectAllIfEmpty = true) 36 | where TItem : IVoiceroidItem 37 | => 38 | this.SelectVisibleOfCore(src, selectAllIfEmpty, i => i.VoiceroidId); 39 | 40 | /// 41 | /// VOICEROIDプロセス列挙から表示するプロセスのみ選別したコレクションを作成する。 42 | /// 43 | /// プロセス列挙。 44 | /// 45 | /// 1プロセスも選択されない場合に全選択と見なすならば true 。 46 | /// 47 | /// 表示するプロセスのみ選別したコレクション。 48 | public ReadOnlyCollection SelectVisibleOf( 49 | IEnumerable src, 50 | bool selectAllIfEmpty = true) 51 | => 52 | this.SelectVisibleOfCore(src, selectAllIfEmpty, p => p.Id); 53 | 54 | /// 55 | /// 列挙から表示する要素のみ選別したコレクションを作成する。 56 | /// 57 | /// 列挙要素型。 58 | /// 列挙。 59 | /// 60 | /// 1要素も選択されない場合に全選択するならば true 。 61 | /// 62 | /// 63 | /// 列挙要素から VoiceroidId 値を取得するデリゲート。 64 | /// 65 | /// 表示する要素のみ選別したコレクション。 66 | private ReadOnlyCollection SelectVisibleOfCore( 67 | IEnumerable src, 68 | bool selectAllIfEmpty, 69 | Func idSelector) 70 | { 71 | Debug.Assert(idSelector != null); 72 | 73 | if (src == null) 74 | { 75 | throw new ArgumentNullException(nameof(src)); 76 | } 77 | 78 | var c = src.Where(i => this[idSelector(i)].IsVisible); 79 | 80 | return ((selectAllIfEmpty && !c.Any()) ? src : c).ToList().AsReadOnly(); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /VoiceroidUtil/VoiceroidItemBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using System.Runtime.Serialization; 4 | using RucheHome.Util; 5 | using RucheHome.Voiceroid; 6 | 7 | namespace VoiceroidUtil 8 | { 9 | /// 10 | /// VOICEROID識別IDに紐付くアイテムのベースクラス。 11 | /// 12 | [DataContract(Namespace = "")] 13 | public class VoiceroidItemBase : BindableConfigBase, IVoiceroidItem 14 | { 15 | /// 16 | /// コンストラクタ。 17 | /// 18 | /// VOICEROID識別ID。 19 | public VoiceroidItemBase(VoiceroidId voiceroidId) => this.VoiceroidId = voiceroidId; 20 | 21 | /// 22 | /// VOICEROID識別IDを取得する。 23 | /// 24 | public VoiceroidId VoiceroidId 25 | { 26 | get => this.voiceroidId; 27 | private set 28 | { 29 | this.SetProperty( 30 | ref this.voiceroidId, 31 | Enum.IsDefined(value.GetType(), value) ? 32 | value : VoiceroidId.YukariEx); 33 | 34 | // 関連プロパティを更新 35 | var info = this.VoiceroidId.GetInfo(); 36 | this.VoiceroidName = info.Name; 37 | this.VoiceroidShortName = info.ShortName; 38 | this.HasMultiVoiceroidCharacters = info.HasMultiCharacters; 39 | } 40 | } 41 | private VoiceroidId voiceroidId = VoiceroidId.YukariEx; 42 | 43 | /// 44 | /// VoiceroidId プロパティのシリアライズ用ラッパプロパティ。 45 | /// 46 | [DataMember(Name = nameof(VoiceroidId))] 47 | [SuppressMessage("CodeQuality", "IDE0051")] 48 | private string VoiceroidIdString 49 | { 50 | get => this.VoiceroidId.ToString(); 51 | set => 52 | this.VoiceroidId = 53 | Enum.TryParse(value, out VoiceroidId id) ? id : VoiceroidId.YukariEx; 54 | } 55 | 56 | /// 57 | /// VOICEROID名を取得する。 58 | /// 59 | public string VoiceroidName 60 | { 61 | get => this.voiceroidName; 62 | private set => this.SetProperty(ref this.voiceroidName, value ?? ""); 63 | } 64 | private string voiceroidName = ""; 65 | 66 | /// 67 | /// VOICEROID短縮名を取得する。 68 | /// 69 | public string VoiceroidShortName 70 | { 71 | get => this.voiceroidShortName; 72 | private set => this.SetProperty(ref this.voiceroidShortName, value ?? ""); 73 | } 74 | private string voiceroidShortName = ""; 75 | 76 | /// 77 | /// 複数キャラクターを保持しているか否かを取得する。 78 | /// 79 | public bool HasMultiVoiceroidCharacters 80 | { 81 | get => this.multiVoiceroidCharacter; 82 | private set => this.SetProperty(ref this.multiVoiceroidCharacter, value); 83 | } 84 | private bool multiVoiceroidCharacter = false; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /RucheHomeLib/Windows/Mvvm/Commands/ProcessStartCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Windows.Input; 4 | 5 | namespace RucheHome.Windows.Mvvm.Commands 6 | { 7 | /// 8 | /// コマンドパラメータ、またはプロパティ値を 9 | /// Process.Start メソッドに渡すコマンドを定義するクラス。 10 | /// 11 | /// 12 | /// 有効なコマンドパラメータが設定されていればそれをファイル名として用いる。 13 | /// そうでなければプロパティ値を用いる。 14 | /// 15 | public class ProcessStartCommand : ICommand 16 | { 17 | /// 18 | /// コンストラクタ。 19 | /// 20 | /// ファイル名。 21 | /// コマンドライン引数文字列。 22 | public ProcessStartCommand(string fileName = null, string arguments = null) 23 | { 24 | this.FileName = fileName; 25 | this.Arguments = arguments; 26 | } 27 | 28 | /// 29 | /// ファイル名を取得または設定する。 30 | /// 31 | /// 32 | /// null ならばプロパティ値を利用しない。 33 | /// 34 | public string FileName { get; set; } 35 | 36 | /// 37 | /// コマンドライン引数文字列を取得または設定する。 38 | /// 39 | /// 40 | /// null ならばコマンドライン引数なしで実行する。 41 | /// コマンドパラメータを用いる場合は無視される。 42 | /// 43 | public string Arguments { get; set; } 44 | 45 | #region ICommand の実装 46 | 47 | /// 48 | /// コマンドを実行可能であるか否かを取得する。 49 | /// 50 | /// コマンドパラメータ。 51 | /// 常に true 。 52 | public bool CanExecute(object parameter) => true; 53 | 54 | /// 55 | /// コマンド処理を行う。 56 | /// 57 | /// コマンドパラメータ。 58 | public void Execute(object parameter) 59 | { 60 | var fileName = parameter as string; 61 | string arguments = null; 62 | 63 | // コマンドパラメータが無効ならプロパティ値を用いる 64 | if (string.IsNullOrWhiteSpace(fileName)) 65 | { 66 | fileName = this.FileName; 67 | arguments = this.Arguments; 68 | 69 | if (fileName == null) 70 | { 71 | return; 72 | } 73 | } 74 | 75 | try 76 | { 77 | if (arguments == null) 78 | { 79 | Process.Start(fileName); 80 | } 81 | else 82 | { 83 | Process.Start(fileName, arguments); 84 | } 85 | } 86 | catch { } 87 | } 88 | 89 | #endregion 90 | 91 | #region ICommand の明示的実装 92 | 93 | event EventHandler ICommand.CanExecuteChanged 94 | { 95 | add { } 96 | remove { } 97 | } 98 | 99 | #endregion 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/VoiceroidKeywordsView.xaml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /RucheHomeLib/Util/ThreadTrace.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Runtime.CompilerServices; 4 | 5 | namespace RucheHome.Util 6 | { 7 | /// 8 | /// 時刻、スレッドID、呼び出し元情報付きのトレース出力を行う静的クラス。 9 | /// 10 | public static class ThreadTrace 11 | { 12 | /// 13 | /// 時刻、スレッドID、呼び出し元情報を付けてテキストと改行をトレース出力する。 14 | /// 15 | /// テキスト。不要ならば null 。 16 | /// 17 | /// 呼び出し元メンバ名。 CallerMemberNameAttribute により自動設定される。 18 | /// 19 | /// 20 | /// 呼び出し元ファイル名。 CallerFilePathAttribute により自動設定される。 21 | /// 22 | /// 23 | /// 呼び出し元行番号。 CallerLineNumberAttribute により自動設定される。 24 | /// 25 | [Conditional("TRACE")] 26 | public static void WriteLine( 27 | string text = null, 28 | [CallerMemberName] string member = "", 29 | [CallerFilePath] string file = "", 30 | [CallerLineNumber] int line = 0) 31 | => 32 | Trace.WriteLine(ThreadDebug.MakeMessage(text, member, file, line)); 33 | 34 | /// 35 | /// 時刻、スレッドID、呼び出し元情報を付けて値と改行をトレース出力する。 36 | /// 37 | /// 値。 38 | /// 39 | /// 呼び出し元メンバ名。 CallerMemberNameAttribute により自動設定される。 40 | /// 41 | /// 42 | /// 呼び出し元ファイル名。 CallerFilePathAttribute により自動設定される。 43 | /// 44 | /// 45 | /// 呼び出し元行番号。 CallerLineNumberAttribute により自動設定される。 46 | /// 47 | [Conditional("TRACE")] 48 | public static void WriteLine( 49 | object value, 50 | [CallerMemberName] string member = "", 51 | [CallerFilePath] string file = "", 52 | [CallerLineNumber] int line = 0) 53 | => 54 | WriteLine(value?.ToString(), member, file, line); 55 | 56 | /// 57 | /// 時刻、スレッドID、呼び出し元情報を付けて例外情報と改行をトレース出力する。 58 | /// 59 | /// 例外情報。 60 | /// 61 | /// スタックトレースを出力するならば true 。そうでなければ false 。 62 | /// 63 | /// 64 | /// 呼び出し元メンバ名。 CallerMemberNameAttribute により自動設定される。 65 | /// 66 | /// 67 | /// 呼び出し元ファイル名。 CallerFilePathAttribute により自動設定される。 68 | /// 69 | /// 70 | /// 呼び出し元行番号。 CallerLineNumberAttribute により自動設定される。 71 | /// 72 | [Conditional("TRACE")] 73 | public static void WriteException( 74 | Exception exception, 75 | bool withStackTrace = false, 76 | [CallerMemberName] string member = "", 77 | [CallerFilePath] string file = "", 78 | [CallerLineNumber] int line = 0) 79 | => 80 | WriteLine( 81 | ThreadDebug.MakeExceptionText(exception, withStackTrace), 82 | member, 83 | file, 84 | line); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /RucheHomeLib/Windows/Mvvm/Converters/MultiEnumerableEachConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Windows; 6 | using System.Windows.Data; 7 | 8 | namespace RucheHome.Windows.Mvvm.Converters 9 | { 10 | /// 11 | /// 複数の IEnumerable の同一インデックス要素同士に IMultiValueConverter を適用し、 12 | /// 結果を List{object} で返すクラス。 13 | /// 14 | /// 15 | /// 各々の IEnumerable の要素数が異なる場合、一番少ない要素数まで処理する。 16 | /// 17 | public class MultiEnumerableEachConverter : DependencyObject, IMultiValueConverter 18 | { 19 | /// 20 | /// Converter 依存関係プロパティ。 21 | /// 22 | public static readonly DependencyProperty ConverterProperty = 23 | DependencyProperty.Register( 24 | nameof(Converter), 25 | typeof(IMultiValueConverter), 26 | typeof(MultiEnumerableEachConverter), 27 | new PropertyMetadata(null)); 28 | 29 | /// 30 | /// 各要素に対して適用する IMultiValueConverter を取得または設定する。 31 | /// 32 | public IMultiValueConverter Converter 33 | { 34 | get => (IMultiValueConverter)this.GetValue(ConverterProperty); 35 | set => this.SetValue(ConverterProperty, value); 36 | } 37 | 38 | /// 39 | /// IEnumerable 値配列から単一の List{object} 値に変換する。 40 | /// 41 | /// IEnumerable 値配列。 42 | /// 無視される。 43 | /// コンバータに渡される。 44 | /// コンバータに渡される。 45 | /// 46 | /// 各要素にコンバータを適用した結果の List{object} 値。 47 | /// 引数が不正な場合やコンバータが設定されていない場合は 48 | /// DependencyProperty.UnsetValue 。 49 | /// 50 | public object Convert( 51 | object[] values, 52 | Type targetType, 53 | object parameter, 54 | CultureInfo culture) 55 | { 56 | if ( 57 | this.Converter == null || 58 | values?.All(v => v != null && v is IEnumerable) != true) 59 | { 60 | return DependencyProperty.UnsetValue; 61 | } 62 | 63 | var arrays = 64 | values.Select(v => ((IEnumerable)v).Cast().ToArray()).ToArray(); 65 | var count = arrays.Min(v => v.Length); 66 | 67 | var results = 68 | Enumerable.Range(0, count) 69 | .Select( 70 | i => 71 | this.Converter.Convert( 72 | arrays.Select(a => a[i]).ToArray(), 73 | typeof(object), 74 | parameter, 75 | culture)) 76 | .ToList(); 77 | 78 | return 79 | results.Any(r => r == DependencyProperty.UnsetValue) ? 80 | DependencyProperty.UnsetValue : results; 81 | } 82 | 83 | object[] IMultiValueConverter.ConvertBack( 84 | object value, 85 | Type[] targetTypes, 86 | object parameter, 87 | CultureInfo culture) 88 | => 89 | throw new NotImplementedException(); // 逆変換は非サポート 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /VoiceroidUtil/ExoCharaStyle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | using RucheHome.AviUtl.ExEdit; 4 | using RucheHome.Voiceroid; 5 | 6 | namespace VoiceroidUtil 7 | { 8 | /// 9 | /// AviUtl拡張編集ファイル用のキャラ別スタイルを保持するクラス。 10 | /// 11 | [DataContract(Namespace = "")] 12 | public class ExoCharaStyle : VoiceroidItemBase 13 | { 14 | /// 15 | /// コンストラクタ。 16 | /// 17 | /// VOICEROID識別ID。 18 | public ExoCharaStyle(VoiceroidId voiceroidId) : base(voiceroidId) 19 | { 20 | // イベントハンドラ追加のためにプロパティ経由で設定 21 | this.Render = new RenderComponent(); 22 | this.Text = new TextComponent(); 23 | this.Play = new PlayComponent(); 24 | this.PlaySpeed = new MovableValue(); 25 | } 26 | 27 | /// 28 | /// 標準描画コンポーネントを取得または設定する。 29 | /// 30 | [DataMember] 31 | public RenderComponent Render 32 | { 33 | get => this.render; 34 | set => 35 | this.SetPropertyWithPropertyChangedChain( 36 | ref this.render, 37 | value ?? new RenderComponent()); 38 | } 39 | private RenderComponent render = null; 40 | 41 | /// 42 | /// テキストコンポーネントを取得または設定する。 43 | /// 44 | [DataMember] 45 | public TextComponent Text 46 | { 47 | get => this.text; 48 | set => 49 | this.SetPropertyWithPropertyChangedChain( 50 | ref this.text, 51 | value ?? new TextComponent()); 52 | } 53 | private TextComponent text = null; 54 | 55 | /// 56 | /// テキストを1つ上のオブジェクトでクリッピングするか否かを取得または設定する。 57 | /// 58 | [DataMember] 59 | public bool IsTextClipping 60 | { 61 | get => this.textClipping; 62 | set => this.SetProperty(ref this.textClipping, value); 63 | } 64 | private bool textClipping = false; 65 | 66 | /// 67 | /// 標準再生コンポーネントを取得または設定する。 68 | /// 69 | [DataMember] 70 | public PlayComponent Play 71 | { 72 | get => this.play; 73 | set => 74 | this.SetPropertyWithPropertyChangedChain( 75 | ref this.play, 76 | value ?? new PlayComponent()); 77 | } 78 | private PlayComponent play = null; 79 | 80 | /// 81 | /// 再生速度を取得または設定する。 82 | /// 83 | [DataMember] 84 | public MovableValue PlaySpeed 85 | { 86 | get => this.playSpeed; 87 | set => 88 | this.SetPropertyWithPropertyChangedChain( 89 | ref this.playSpeed, 90 | value ?? new MovableValue()); 91 | } 92 | private MovableValue playSpeed = null; 93 | 94 | /// 95 | /// デシリアライズの直前に呼び出される。 96 | /// 97 | [OnDeserializing] 98 | private void OnDeserializing(StreamingContext context) => 99 | this.ResetDataMembers(VoiceroidId.YukariEx); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /VoiceroidUtil.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31903.59 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VoiceroidUtil", "VoiceroidUtil\VoiceroidUtil.csproj", "{5E0283FF-752B-45A6-A898-8C7FC6A730ED}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RucheHomeLib", "RucheHomeLib\RucheHomeLib.csproj", "{DF1B25FE-0FDF-4C86-A779-AFF5217A7C6B}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RucheHome.Voiceroid", "RucheHome.Voiceroid\RucheHome.Voiceroid.csproj", "{E7C4802C-D723-44B6-A272-9E570C84E754}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RucheHome.Text", "RucheHome.Text\RucheHome.Text.csproj", "{CEE2280C-8026-46DE-872E-F629259890EB}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RucheHome.AviUtl", "RucheHome.AviUtl\RucheHome.AviUtl.csproj", "{EF44D39C-4106-4E7B-AE0D-9A3B41DE6EAC}" 15 | EndProject 16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C3D0056E-BAC5-49EA-B2CC-9EEC2DA0A86A}" 17 | ProjectSection(SolutionItems) = preProject 18 | .editorconfig = .editorconfig 19 | .gitignore = .gitignore 20 | LICENSE = LICENSE 21 | README.md = README.md 22 | EndProjectSection 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|Any CPU = Debug|Any CPU 27 | Release|Any CPU = Release|Any CPU 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {5E0283FF-752B-45A6-A898-8C7FC6A730ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {5E0283FF-752B-45A6-A898-8C7FC6A730ED}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {5E0283FF-752B-45A6-A898-8C7FC6A730ED}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {5E0283FF-752B-45A6-A898-8C7FC6A730ED}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {DF1B25FE-0FDF-4C86-A779-AFF5217A7C6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {DF1B25FE-0FDF-4C86-A779-AFF5217A7C6B}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {DF1B25FE-0FDF-4C86-A779-AFF5217A7C6B}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {DF1B25FE-0FDF-4C86-A779-AFF5217A7C6B}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {E7C4802C-D723-44B6-A272-9E570C84E754}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {E7C4802C-D723-44B6-A272-9E570C84E754}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {E7C4802C-D723-44B6-A272-9E570C84E754}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {E7C4802C-D723-44B6-A272-9E570C84E754}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {CEE2280C-8026-46DE-872E-F629259890EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {CEE2280C-8026-46DE-872E-F629259890EB}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {CEE2280C-8026-46DE-872E-F629259890EB}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {CEE2280C-8026-46DE-872E-F629259890EB}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {EF44D39C-4106-4E7B-AE0D-9A3B41DE6EAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {EF44D39C-4106-4E7B-AE0D-9A3B41DE6EAC}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {EF44D39C-4106-4E7B-AE0D-9A3B41DE6EAC}.Release|Any CPU.ActiveCfg = Release|Any CPU 49 | {EF44D39C-4106-4E7B-AE0D-9A3B41DE6EAC}.Release|Any CPU.Build.0 = Release|Any CPU 50 | EndGlobalSection 51 | GlobalSection(SolutionProperties) = preSolution 52 | HideSolutionNode = FALSE 53 | EndGlobalSection 54 | GlobalSection(ExtensibilityGlobals) = postSolution 55 | SolutionGuid = {0C009CB4-AB46-4AD5-9C78-4E66106A5250} 56 | EndGlobalSection 57 | EndGlobal 58 | -------------------------------------------------------------------------------- /RucheHome.Voiceroid/VoiceroidInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | 6 | namespace RucheHome.Voiceroid 7 | { 8 | /// 9 | /// VOICEROID識別IDに紐付く情報を保持するクラス。 10 | /// 11 | public class VoiceroidInfo 12 | { 13 | /// 14 | /// コンストラクタ。 15 | /// 16 | /// VOICEROID識別ID。 17 | /// 操作対象として選択可能ならば true 。 18 | /// VOICEROID名。 19 | /// 20 | /// VOICEROIDを識別するためのキーワード列挙。キーワード不要ならば null 。 21 | /// 22 | /// アプリプロセス名。 23 | /// プロダクト名。 24 | /// 25 | /// VOICEROID短縮名。VOICEROID名と同一ならば null を指定してよい。 26 | /// 27 | /// 28 | /// 表示プロダクト名。プロダクト名と同一ならば null を指定してよい。 29 | /// 30 | /// 複数キャラクターを保持しているならば true 。 31 | internal VoiceroidInfo( 32 | VoiceroidId id, 33 | bool controllable, 34 | string name, 35 | IEnumerable keywords, 36 | string appProcessName, 37 | string product, 38 | string shortName = null, 39 | string displayProduct = null, 40 | bool multiCharacters = false) 41 | { 42 | this.Id = id; 43 | this.IsControllable = controllable; 44 | this.Name = name ?? throw new ArgumentNullException(nameof(name)); 45 | this.ShortName = shortName ?? name; 46 | this.Keywords = 47 | new ReadOnlyCollection((keywords ?? new string[0]).ToList()); 48 | this.AppProcessName = 49 | appProcessName ?? throw new ArgumentNullException(nameof(appProcessName)); 50 | this.Product = product ?? throw new ArgumentNullException(nameof(product)); 51 | this.DisplayProduct = displayProduct ?? product; 52 | this.HasMultiCharacters = multiCharacters; 53 | } 54 | 55 | /// 56 | /// VOICEROID識別IDを取得する。 57 | /// 58 | public VoiceroidId Id { get; } 59 | 60 | /// 61 | /// 操作対象として選択可能であるか否かを取得する。 62 | /// 63 | public bool IsControllable { get; } 64 | 65 | /// 66 | /// VOICEROID名を取得する。 67 | /// 68 | public string Name { get; } 69 | 70 | /// 71 | /// VOICEROID短縮名を取得する。 72 | /// 73 | public string ShortName { get; } 74 | 75 | /// 76 | /// VOICEROIDを識別するためのキーワードコレクションを取得する。 77 | /// 78 | public ReadOnlyCollection Keywords { get; } 79 | 80 | /// 81 | /// アプリプロセス名を取得する。 82 | /// 83 | public string AppProcessName { get; } 84 | 85 | /// 86 | /// プロダクト名を取得する。 87 | /// 88 | public string Product { get; } 89 | 90 | /// 91 | /// 表示プロダクト名を取得する。 92 | /// 93 | public string DisplayProduct { get; } 94 | 95 | /// 96 | /// 複数キャラクターを保持しているか否かを取得する。 97 | /// 98 | public bool HasMultiCharacters { get; } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /RucheHome.Text/IniFileSection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Runtime.Serialization; 4 | 5 | namespace RucheHome.Text 6 | { 7 | /// 8 | /// INIファイルのセクションを表すクラス。 9 | /// 10 | [DataContract(Namespace = "")] 11 | public class IniFileSection 12 | { 13 | /// 14 | /// コンストラクタ。 15 | /// 16 | /// 17 | /// セクション名。制御文字や改行文字が含まれていてはならない。 18 | /// 19 | /// アイテムコレクション。 20 | public IniFileSection(string name, IniFileItemCollection items) 21 | { 22 | ValidateName(name, nameof(name)); 23 | if (items == null) 24 | { 25 | throw new ArgumentNullException(nameof(items)); 26 | } 27 | 28 | this.Name = name; 29 | this.Items = items; 30 | } 31 | 32 | /// 33 | /// コンストラクタ。アイテムコレクションは空となる。 34 | /// 35 | /// 36 | /// セクション名。制御文字や改行文字が含まれていてはならない。 37 | /// 38 | public IniFileSection(string name) : this(name, new IniFileItemCollection()) 39 | { 40 | } 41 | 42 | /// 43 | /// セクション名を取得する。 44 | /// 45 | [DataMember] 46 | public string Name 47 | { 48 | get => this.name; 49 | private set 50 | { 51 | ValidateName(value, nameof(value)); 52 | 53 | this.name = value; 54 | } 55 | } 56 | private string name = ""; 57 | 58 | /// 59 | /// アイテムコレクションを取得する。 60 | /// 61 | [DataMember] 62 | public IniFileItemCollection Items { get; private set; } 63 | 64 | /// 65 | /// このオブジェクトのクローンを作成する。 66 | /// 67 | /// このオブジェクトのクローン。 68 | public IniFileSection Clone() => new IniFileSection(this.Name, this.Items.Clone()); 69 | 70 | /// 71 | /// セクション名の正当性をチェックする。 72 | /// 73 | /// セクション名。 74 | /// 例外送出時に用いる引数名。 75 | private static void ValidateName(string name, string argName) 76 | { 77 | if (name == null) 78 | { 79 | throw new ArgumentNullException(argName); 80 | } 81 | if ( 82 | name.IndexOfAny(new[] { '\r', '\n' }) >= 0 || 83 | name.Any(c => char.IsControl(c))) 84 | { 85 | throw new ArgumentException( 86 | @"Some invalid characters are contained in the section name.", 87 | argName); 88 | } 89 | } 90 | 91 | /// 92 | /// デシリアライズの直前に呼び出される。 93 | /// 94 | [OnDeserializing] 95 | private void OnDeserializing(StreamingContext context) 96 | { 97 | this.Name = ""; 98 | this.Items = new IniFileItemCollection(); 99 | } 100 | 101 | #region Object のオーバライド 102 | 103 | /// 104 | /// INIファイルのセクション形式を表す文字列値を取得する。 105 | /// 106 | /// INIファイルのセクション形式を表す文字列値。 107 | public override string ToString() => 108 | @"[" + this.Name + @"]" + Environment.NewLine + this.Items; 109 | 110 | #endregion 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /RucheHome.AviUtl/ExEdit/TextAlignment.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.Runtime.Serialization; 4 | 5 | namespace RucheHome.AviUtl.ExEdit 6 | { 7 | /// 8 | /// テキスト配置種別列挙。 9 | /// 10 | [DataContract(Namespace = "")] 11 | public enum TextAlignment 12 | { 13 | /// 14 | /// 左上。 15 | /// 16 | [Display(Name = @"左寄せ[上]")] 17 | [EnumMember] 18 | TopLeft = 0, 19 | 20 | /// 21 | /// 中央上。 22 | /// 23 | [Display(Name = @"中央揃え[上]")] 24 | [EnumMember] 25 | TopCenter = 1, 26 | 27 | /// 28 | /// 右上。 29 | /// 30 | [Display(Name = @"右寄せ[上]")] 31 | [EnumMember] 32 | TopRight = 2, 33 | 34 | /// 35 | /// 左中央。 36 | /// 37 | [Display(Name = @"左寄せ[中]")] 38 | [EnumMember] 39 | MiddleLeft = 3, 40 | 41 | /// 42 | /// 中央。 43 | /// 44 | [Display(Name = @"中央揃え[中]")] 45 | [EnumMember] 46 | MiddleCenter = 4, 47 | 48 | /// 49 | /// 右中央。 50 | /// 51 | [Display(Name = @"右寄せ[中]")] 52 | [EnumMember] 53 | MiddleRight = 5, 54 | 55 | /// 56 | /// 左下。 57 | /// 58 | [Display(Name = @"左寄せ[下]")] 59 | [EnumMember] 60 | BottomLeft = 6, 61 | 62 | /// 63 | /// 中央下。 64 | /// 65 | [Display(Name = @"中央揃え[下]")] 66 | [EnumMember] 67 | BottomCenter = 7, 68 | 69 | /// 70 | /// 右下。 71 | /// 72 | [Display(Name = @"右寄せ[下]")] 73 | [EnumMember] 74 | BottomRight = 8, 75 | 76 | /// 77 | /// 縦書き右上。 78 | /// 79 | [Display(Name = @"縦書 上寄[右]")] 80 | [EnumMember] 81 | VerticalRightTop = 9, 82 | 83 | /// 84 | /// 縦書き右中央。 85 | /// 86 | [Display(Name = @"縦書 中央[右]")] 87 | [EnumMember] 88 | VerticalRightMiddle = 10, 89 | 90 | /// 91 | /// 縦書き右下。 92 | /// 93 | [Display(Name = @"縦書 下寄[右]")] 94 | [EnumMember] 95 | VerticalRightBottom = 11, 96 | 97 | /// 98 | /// 縦書き中央上。 99 | /// 100 | [Display(Name = @"縦書 上寄[中]")] 101 | [EnumMember] 102 | VerticalCenterTop = 12, 103 | 104 | /// 105 | /// 縦書き中央。 106 | /// 107 | [Display(Name = @"縦書 中央[中]")] 108 | [EnumMember] 109 | VerticalCenterMiddle = 13, 110 | 111 | /// 112 | /// 縦書き中央下。 113 | /// 114 | [Display(Name = @"縦書 下寄[中]")] 115 | [EnumMember] 116 | VerticalCenterBottom = 14, 117 | 118 | /// 119 | /// 縦書き左上。 120 | /// 121 | [Display(Name = @"縦書 上寄[左]")] 122 | [EnumMember] 123 | VerticalLeftTop = 15, 124 | 125 | /// 126 | /// 縦書き左中央。 127 | /// 128 | [Display(Name = @"縦書 中央[左]")] 129 | [EnumMember] 130 | VerticalLeftMiddle = 16, 131 | 132 | /// 133 | /// 縦書き左下。 134 | /// 135 | [Display(Name = @"縦書 下寄[左]")] 136 | [EnumMember] 137 | VerticalLeftBottom = 17, 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /VoiceroidUtil/ViewModel/ConfigViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Linq.Expressions; 4 | using Reactive.Bindings; 5 | using VoiceroidUtil.Extensions; 6 | using static RucheHome.Util.ArgumentValidater; 7 | 8 | namespace VoiceroidUtil.ViewModel 9 | { 10 | /// 11 | /// 設定値を保持する ViewModel のベースクラス。 12 | /// 13 | /// 設定値の型。 14 | public abstract class ConfigViewModelBase : ViewModelBase 15 | where TConfig : INotifyPropertyChanged 16 | { 17 | /// 18 | /// コンストラクタ。 19 | /// 20 | /// 21 | /// 再生や音声保存に関わる設定値の変更可否状態値。 22 | /// 23 | /// 設定値。 24 | protected ConfigViewModelBase( 25 | IReadOnlyReactiveProperty canModify, 26 | IReadOnlyReactiveProperty config) 27 | { 28 | ValidateArgumentNull(canModify, nameof(canModify)); 29 | ValidateArgumentNull(config, nameof(config)); 30 | 31 | this.CanModify = canModify; 32 | this.BaseConfig = config; 33 | } 34 | 35 | /// 36 | /// 再生や音声保存に関わる設定値を変更できる状態か否かを取得する。 37 | /// 38 | public IReadOnlyReactiveProperty CanModify { get; } 39 | 40 | /// 41 | /// 設定値を取得する。 42 | /// 43 | protected IReadOnlyReactiveProperty BaseConfig { get; } 44 | 45 | /// 46 | /// 設定値のプロパティのプッシュ通知オブジェクトを作成する。 47 | /// 48 | /// プロパティ型。 49 | /// プロパティセレクタ。 50 | /// プッシュ通知オブジェクト。 51 | protected IObservable ObserveConfigProperty( 52 | Expression> selector) 53 | => 54 | this.BaseConfig.ObserveInnerProperty(selector); 55 | 56 | /// 57 | /// 設定値のプロパティをラップする ReactiveProperty{T} オブジェクトを作成する。 58 | /// 59 | /// プロパティ型。 60 | /// プロパティセレクタ。 61 | /// 62 | /// CanModify プロパティ値に依らず値変更可能ならば true 。 63 | /// 64 | /// 65 | /// 同値への変更時にも通知を行うならば true 。 66 | /// 67 | /// ReactiveProperty{T} オブジェクト。 68 | protected ReactiveProperty MakeConfigProperty( 69 | Expression> selector, 70 | bool alwaysCanModify = false, 71 | bool notifyOnSameValue = false) 72 | => 73 | this.MakeInnerPropertyOf( 74 | this.BaseConfig, 75 | selector, 76 | alwaysCanModify ? null : this.CanModify, 77 | notifyOnSameValue); 78 | 79 | /// 80 | /// 設定値のプロパティをラップする 81 | /// ReadOnlyReactiveProperty{T} オブジェクトを作成する。 82 | /// 83 | /// プロパティ型。 84 | /// プロパティセレクタ。 85 | /// 86 | /// 同値への変更時にも通知を行うならば true 。 87 | /// 88 | /// ReadOnlyReactiveProperty{T} オブジェクト。 89 | protected ReadOnlyReactiveProperty MakeReadOnlyConfigProperty( 90 | Expression> selector, 91 | bool notifyOnSameValue = false) 92 | => 93 | this.MakeInnerReadOnlyPropertyOf( 94 | this.BaseConfig, 95 | selector, 96 | notifyOnSameValue); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /RucheHome.Voiceroid/FileSaveResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RucheHome.Voiceroid 4 | { 5 | /// 6 | /// ファイル保存処理結果を保持する構造体。 7 | /// 8 | public struct FileSaveResult : IEquatable 9 | { 10 | /// 11 | /// コンストラクタ。 12 | /// 13 | /// ファイル保存成否。 14 | /// 15 | /// 保存ファイルパス。本体側の自動命名による保存時は空文字列。 16 | /// 17 | /// 保存失敗時のエラーテキスト。 18 | /// 保存失敗時の追加情報テキスト。 19 | public FileSaveResult( 20 | bool succeeded, 21 | string filePath = null, 22 | string error = null, 23 | string extraMessage = null) 24 | { 25 | this.IsSucceeded = succeeded; 26 | this.FilePath = filePath; 27 | this.Error = error; 28 | this.ExtraMessage = extraMessage; 29 | } 30 | 31 | /// 32 | /// ファイル保存に成功したか否かを取得する。 33 | /// 34 | public bool IsSucceeded { get; } 35 | 36 | /// 37 | /// 保存ファイルパスを取得する。 38 | /// 39 | /// 40 | /// 本体側の自動命名による保存時は空文字列を返す。 41 | /// 42 | public string FilePath { get; } 43 | 44 | /// 45 | /// 保存失敗時のエラーテキストを取得する。 46 | /// 47 | public string Error { get; } 48 | 49 | /// 50 | /// 保存失敗時の追加情報テキストを取得する。 51 | /// 52 | public string ExtraMessage { get; } 53 | 54 | /// 55 | /// 等価比較演算子のオーバーロード。 56 | /// 57 | /// 左辺値。 58 | /// 右辺値。 59 | /// 等しいならば true 。そうでなければ false 。 60 | public static bool operator ==(FileSaveResult left, FileSaveResult right) => 61 | left.Equals(right); 62 | 63 | /// 64 | /// 非等価比較演算子のオーバーロード。 65 | /// 66 | /// 左辺値。 67 | /// 右辺値。 68 | /// 等しくないならば true 。そうでなければ false 。 69 | public static bool operator !=(FileSaveResult left, FileSaveResult right) => 70 | !(left == right); 71 | 72 | #region Object のオーバライド 73 | 74 | /// 75 | /// 他のオブジェクトと等価であるか否かを取得する。 76 | /// 77 | /// 比較対象。 78 | /// 等しいならば true 。そうでなければ false 。 79 | public override bool Equals(object obj) => 80 | (obj is FileSaveResult r) && this.Equals(r); 81 | 82 | /// 83 | /// ハッシュコード値を取得する。 84 | /// 85 | /// ハッシュコード値。 86 | public override int GetHashCode() => 87 | this.IsSucceeded.GetHashCode() ^ 88 | this.FilePath.GetHashCode() ^ 89 | this.Error.GetHashCode(); 90 | 91 | #endregion 92 | 93 | #region IEquatable の実装 94 | 95 | /// 96 | /// 他のファイル保存処理結果と等価であるか否かを取得する。 97 | /// 98 | /// 比較対象。 99 | /// 等しいならば true 。そうでなければ false 。 100 | public bool Equals(FileSaveResult other) => 101 | this.IsSucceeded == other.IsSucceeded && 102 | this.FilePath == other.FilePath && 103 | this.Error == other.Error && 104 | this.ExtraMessage == other.ExtraMessage; 105 | 106 | #endregion 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /VoiceroidUtil/TalkTextReplaceConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | using System.Windows.Data; 4 | using RucheHome.Util; 5 | 6 | namespace VoiceroidUtil 7 | { 8 | /// 9 | /// トークテキスト置換設定クラス。 10 | /// 11 | [DataContract(Namespace = "")] 12 | public class TalkTextReplaceConfig : BindableConfigBase 13 | { 14 | /// 15 | /// コンストラクタ。 16 | /// 17 | public TalkTextReplaceConfig() 18 | { 19 | // イベントハンドラ追加のためにプロパティ経由で設定 20 | this.VoiceReplaceItems = 21 | new TalkTextReplaceItemCollection { new TalkTextReplaceItem() }; 22 | this.TextFileReplaceItems = 23 | new TalkTextReplaceItemCollection { new TalkTextReplaceItem() }; 24 | } 25 | 26 | /// 27 | /// 音声文字列置換アイテムコレクションを取得または設定する。 28 | /// 29 | [DataMember] 30 | public TalkTextReplaceItemCollection VoiceReplaceItems 31 | { 32 | get => this.voiceReplaceItems; 33 | set 34 | { 35 | var v = value ?? new TalkTextReplaceItemCollection(); 36 | if (v != this.voiceReplaceItems) 37 | { 38 | this.RemoveBindableCollectionEventChain(this.voiceReplaceItems); 39 | this.AddBindableCollectionEventChain(v); 40 | this.SetProperty(ref this.voiceReplaceItems, v); 41 | 42 | // 複数スレッドからのアクセスを許可 43 | BindingOperations.EnableCollectionSynchronization( 44 | this.VoiceReplaceItems, 45 | new object()); 46 | } 47 | } 48 | } 49 | private TalkTextReplaceItemCollection voiceReplaceItems = null; 50 | 51 | /// 52 | /// テキストファイル文字列置換アイテムコレクションを取得または設定する。 53 | /// 54 | [DataMember] 55 | public TalkTextReplaceItemCollection TextFileReplaceItems 56 | { 57 | get => this.textFileReplaceItems; 58 | set 59 | { 60 | var v = value ?? new TalkTextReplaceItemCollection(); 61 | if (v != this.textFileReplaceItems) 62 | { 63 | this.RemoveBindableCollectionEventChain(this.textFileReplaceItems); 64 | this.AddBindableCollectionEventChain(v); 65 | this.SetProperty(ref this.textFileReplaceItems, v); 66 | 67 | // 複数スレッドからのアクセスを許可 68 | BindingOperations.EnableCollectionSynchronization( 69 | this.TextFileReplaceItems, 70 | new object()); 71 | } 72 | } 73 | } 74 | private TalkTextReplaceItemCollection textFileReplaceItems = null; 75 | 76 | /// 77 | /// デシリアライズの直前に呼び出される。 78 | /// 79 | [OnDeserializing] 80 | private void OnDeserializing(StreamingContext context) 81 | { 82 | this.ResetDataMembers(); 83 | 84 | // コレクションは空にしておく 85 | this.VoiceReplaceItems.Clear(); 86 | this.TextFileReplaceItems.Clear(); 87 | } 88 | 89 | /// 90 | /// デシリアライズの完了時に呼び出される。 91 | /// 92 | [OnDeserialized] 93 | private void OnDeserialized(StreamingContext context) 94 | { 95 | // コレクションが空ならアイテムを1つ追加しておく 96 | if (this.VoiceReplaceItems.Count <= 0) 97 | { 98 | this.VoiceReplaceItems.Add(new TalkTextReplaceItem()); 99 | } 100 | if (this.TextFileReplaceItems.Count <= 0) 101 | { 102 | this.TextFileReplaceItems.Add(new TalkTextReplaceItem()); 103 | } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /RucheHomeLib/Util/BindableCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.ComponentModel; 5 | 6 | namespace RucheHome.Util 7 | { 8 | /// 9 | /// プロパティ変更通知をサポートするオブジェクトのコレクションクラス。 10 | /// 11 | /// 12 | /// コレクション要素型。 INotifyPropertyChanged インタフェースを実装する必要がある。 13 | /// 14 | public class BindableCollection : ObservableCollection 15 | where TItem : INotifyPropertyChanged 16 | { 17 | /// 18 | /// コンストラクタ。 19 | /// 20 | public BindableCollection() : base() 21 | { 22 | } 23 | 24 | /// 25 | /// コンストラクタ。 26 | /// 27 | /// コレクションの初期値となるアイテム列挙。 28 | public BindableCollection(IEnumerable items) : base(items) 29 | { 30 | foreach (var item in this) 31 | { 32 | if (item != null) 33 | { 34 | item.PropertyChanged += this.OnItemPropertyChanged; 35 | } 36 | } 37 | } 38 | 39 | /// 40 | /// コレクション要素のプロパティ値が変更された時に呼び出されるイベント。 41 | /// 42 | public event PropertyChangedEventHandler ItemPropertyChanged = null; 43 | 44 | /// 45 | /// 要素の挿入時に呼び出される。 46 | /// 47 | /// 挿入先インデックス。 48 | /// 挿入する要素。 49 | protected override void InsertItem(int index, TItem item) 50 | { 51 | if (item != null) 52 | { 53 | item.PropertyChanged += this.OnItemPropertyChanged; 54 | } 55 | 56 | base.InsertItem(index, item); 57 | } 58 | 59 | /// 60 | /// 要素の上書き時に呼び出される。 61 | /// 62 | /// 上書き先インデックス。 63 | /// 上書きする要素。 64 | protected override void SetItem(int index, TItem item) 65 | { 66 | var oldItem = this[index]; 67 | if (oldItem != null) 68 | { 69 | oldItem.PropertyChanged -= this.OnItemPropertyChanged; 70 | } 71 | if (item != null) 72 | { 73 | item.PropertyChanged += this.OnItemPropertyChanged; 74 | } 75 | 76 | base.SetItem(index, item); 77 | } 78 | 79 | /// 80 | /// 要素の削除時に呼び出される。 81 | /// 82 | /// 削除先インデックス。 83 | protected override void RemoveItem(int index) 84 | { 85 | var oldItem = this[index]; 86 | if (oldItem != null) 87 | { 88 | oldItem.PropertyChanged -= this.OnItemPropertyChanged; 89 | } 90 | 91 | base.RemoveItem(index); 92 | } 93 | 94 | /// 95 | /// 要素のクリア時に呼び出される。 96 | /// 97 | protected override void ClearItems() 98 | { 99 | foreach (var item in this) 100 | { 101 | if (item != null) 102 | { 103 | item.PropertyChanged -= this.OnItemPropertyChanged; 104 | } 105 | } 106 | 107 | base.ClearItems(); 108 | } 109 | 110 | /// 111 | /// コレクション要素のプロパティ値が変更された時に呼び出される。 112 | /// 113 | /// コレクション要素。 114 | /// プロパティ値変更イベントパラメータ。 115 | protected virtual void OnItemPropertyChanged( 116 | object sender, 117 | PropertyChangedEventArgs e) 118 | => 119 | this.ItemPropertyChanged?.Invoke(sender, e); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /VoiceroidUtil/View/AviUtlDropLayersControl.xaml: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /RucheHome.Text/TextFileReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | 6 | namespace RucheHome.Text 7 | { 8 | /// 9 | /// 文字コードを自動判別してテキストファイルを読み取る処理を提供する静的クラス。 10 | /// 11 | public static class TextFileReader 12 | { 13 | /// 14 | /// 文字コードを自動判別してテキストファイルを読み取る。 15 | /// 16 | /// ファイルパス。 17 | /// 読み取った文字列。読み取れなかった場合は null 。 18 | public static string Read(string filePath) => 19 | (filePath == null) ? 20 | throw new ArgumentNullException(nameof(filePath)) : 21 | ReadAll(new[] { filePath })[0]; 22 | 23 | /// 24 | /// 文字コードを自動判別してテキストファイルを読み取る。 25 | /// 26 | /// ファイル情報。 27 | /// 読み取った文字列。読み取れなかった場合は null 。 28 | public static string Read(FileInfo fileInfo) => 29 | (fileInfo == null) ? 30 | throw new ArgumentNullException(nameof(fileInfo)) : 31 | ReadAll(new[] { fileInfo })[0]; 32 | 33 | /// 34 | /// 文字コードを自動判別して複数のテキストファイルを読み取る。 35 | /// 36 | /// ファイルパス列挙。 37 | /// 38 | /// 読み取った文字列のリスト。 39 | /// 読み取れなかったファイルについては null が格納される。 40 | /// 41 | public static List ReadAll(IEnumerable filePathes) 42 | { 43 | if (filePathes == null) 44 | { 45 | throw new ArgumentNullException(nameof(filePathes)); 46 | } 47 | if (!filePathes.Any()) 48 | { 49 | throw new ArgumentException( 50 | @"`" + nameof(filePathes) + @"` is empty.", 51 | nameof(filePathes)); 52 | } 53 | if (filePathes.Any(p => p == null)) 54 | { 55 | throw new ArgumentException( 56 | @"Some file pathes in `" + nameof(filePathes) + @"` are null.", 57 | nameof(filePathes)); 58 | } 59 | 60 | return ReadAll(filePathes.Select(p => new FileInfo(p))); 61 | } 62 | 63 | /// 64 | /// 文字コードを自動判別して複数のテキストファイルを読み取る。 65 | /// 66 | /// ファイル情報列挙。 67 | /// 68 | /// 読み取った文字列のリスト。 69 | /// 読み取れなかったファイルについては null が格納される。 70 | /// 71 | public static List ReadAll(IEnumerable fileInfos) 72 | { 73 | if (fileInfos == null) 74 | { 75 | throw new ArgumentNullException(nameof(fileInfos)); 76 | } 77 | if (!fileInfos.Any()) 78 | { 79 | throw new ArgumentException( 80 | @"`" + nameof(fileInfos) + @"` is empty.", 81 | nameof(fileInfos)); 82 | } 83 | if (fileInfos.Any(info => info == null)) 84 | { 85 | throw new ArgumentException( 86 | @"Some FileInfo in `" + nameof(fileInfos) + @"` are null.", 87 | nameof(fileInfos)); 88 | } 89 | 90 | var maxLength = fileInfos.Max(info => info.Length); 91 | if (maxLength > int.MaxValue) 92 | { 93 | throw new ArgumentException(@"Too large file."); 94 | } 95 | 96 | using (var reader = new Hnx8.ReadJEnc.FileReader((int)maxLength)) 97 | { 98 | return 99 | fileInfos 100 | .Select( 101 | info => 102 | { 103 | reader.Read(info); 104 | return reader.Text; 105 | }) 106 | .ToList(); 107 | } 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /VoiceroidUtil/Services/VoiceroidActionService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using System.Windows; 4 | using System.Windows.Interop; 5 | using RucheHome.Util; 6 | using RucheHome.Voiceroid; 7 | using RucheHome.Windows.WinApi; 8 | using static RucheHome.Util.ArgumentValidater; 9 | 10 | namespace VoiceroidUtil.Services 11 | { 12 | /// 13 | /// VOICEROIDプロセスに対するアクションを提供するクラス。 14 | /// 15 | public class VoiceroidActionService : IVoiceroidActionService 16 | { 17 | /// 18 | /// コンストラクタ。 19 | /// 20 | /// VoiceroidUtilのメインウィンドウ。 21 | public VoiceroidActionService(Window mainWindow) 22 | { 23 | ValidateArgumentNull(mainWindow, nameof(mainWindow)); 24 | 25 | this.MainWindow = mainWindow; 26 | } 27 | 28 | /// 29 | /// VoiceroidUtilのメインウィンドウを取得する。 30 | /// 31 | private Window MainWindow { get; } 32 | 33 | /// 34 | /// Forward アクション処理を行う。 35 | /// 36 | /// VOICEROIDプロセスのメインウィンドウ。 37 | private void DoForwardAction(Win32Window processWindow) 38 | { 39 | // VoiceroidUtilのメインウィンドウ作成 40 | var mainWinHandle = new WindowInteropHelper(this.MainWindow).Handle; 41 | if (mainWinHandle == IntPtr.Zero) 42 | { 43 | return; 44 | } 45 | var mainWin = new Win32Window(mainWinHandle); 46 | 47 | // 最小化されていたら元に戻す 48 | if (processWindow.State == WindowState.Minimized) 49 | { 50 | processWindow.Restore(); 51 | } 52 | 53 | // VoiceroidUtilが最前面表示されているか? 54 | if (mainWin.IsTopmost) 55 | { 56 | // アクティブにして非最前面ウィンドウ内の先頭へ 57 | try 58 | { 59 | processWindow.Activate(); 60 | } 61 | catch (Exception ex) 62 | { 63 | ThreadTrace.WriteException(ex); 64 | } 65 | } 66 | else 67 | { 68 | // VoiceroidUtilのすぐ後ろにZオーダーを設定 69 | try 70 | { 71 | processWindow.MoveZOrderAfter(mainWin); 72 | } 73 | catch (Exception ex) 74 | { 75 | ThreadTrace.WriteException(ex); 76 | } 77 | } 78 | } 79 | 80 | /// 81 | /// StopFlash アクション処理を行う。 82 | /// 83 | /// VOICEROIDプロセスのメインウィンドウ。 84 | private void DoStopFlashAction(Win32Window processWindow) => 85 | processWindow.FlashTray(false); 86 | 87 | #region IVoiceroidActionService の実装 88 | 89 | public async Task Run(IProcess process, VoiceroidAction action) 90 | { 91 | ValidateArgumentNull(process, nameof(process)); 92 | 93 | if ( 94 | process.MainWindowHandle == IntPtr.Zero || 95 | action == VoiceroidAction.None) 96 | { 97 | return; 98 | } 99 | 100 | // VOICEROIDのメインウィンドウ作成 101 | var processWin = new Win32Window(process.MainWindowHandle); 102 | 103 | // アクション別メソッド作成 104 | Action method = null; 105 | switch (action) 106 | { 107 | case VoiceroidAction.Forward: 108 | method = () => this.DoForwardAction(processWin); 109 | break; 110 | 111 | case VoiceroidAction.StopFlash: 112 | method = () => this.DoStopFlashAction(processWin); 113 | break; 114 | 115 | default: 116 | return; 117 | } 118 | 119 | // メソッド実施 120 | await this.MainWindow.Dispatcher.InvokeAsync(method); 121 | } 122 | 123 | #endregion 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /VoiceroidUtil/Mvvm/IndexedCommandKeyBindingBehavior.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Windows; 6 | using System.Windows.Input; 7 | using System.Windows.Markup; 8 | using RucheHome.Windows.Mvvm.Behaviors; 9 | 10 | namespace VoiceroidUtil.Mvvm 11 | { 12 | /// 13 | /// 修飾キーと数字キーの組み合わせをコマンド列挙の各要素に割り当てるビヘイビアクラス。 14 | /// 15 | [ContentProperty(nameof(Commands))] 16 | public class IndexedCommandKeyBindingBehavior 17 | : FrameworkElementBehavior 18 | { 19 | /// 20 | /// コンストラクタ。 21 | /// 22 | public IndexedCommandKeyBindingBehavior() : base() 23 | { 24 | } 25 | 26 | /// 27 | /// Modifiers 依存関係プロパティ。 28 | /// 29 | public static readonly DependencyProperty ModifiersProperty = 30 | DependencyProperty.Register( 31 | nameof(Modifiers), 32 | typeof(ModifierKeys), 33 | typeof(IndexedCommandKeyBindingBehavior), 34 | new PropertyMetadata(ModifierKeys.Control)); 35 | 36 | /// 37 | /// 修飾キーの組み合わせを取得または設定する。 38 | /// 39 | public ModifierKeys Modifiers 40 | { 41 | get => (ModifierKeys)this.GetValue(ModifiersProperty); 42 | set => this.SetValue(ModifiersProperty, value); 43 | } 44 | 45 | /// 46 | /// Commands 依存関係プロパティ。 47 | /// 48 | public static readonly DependencyProperty CommandsProperty = 49 | DependencyProperty.Register( 50 | nameof(Commands), 51 | typeof(IEnumerable), 52 | typeof(IndexedCommandKeyBindingBehavior), 53 | new PropertyMetadata(null)); 54 | 55 | /// 56 | /// コマンド列挙を取得または設定する。 57 | /// 58 | /// 59 | /// 実体が ICommand である object の列挙も受け取れるようにする。 60 | /// 61 | public IEnumerable Commands 62 | { 63 | get => (IEnumerable)this.GetValue(CommandsProperty); 64 | set => this.SetValue(CommandsProperty, value); 65 | } 66 | 67 | #region FrameworkElementBehavior のオーバライド 68 | 69 | /// 70 | /// FrameworkElement のロード完了時に呼び出される。 71 | /// 72 | protected override void OnAssociatedObjectLoaded() 73 | { 74 | var commands = this.Commands?.Cast(); 75 | var inputBindings = this.AssociatedObject.InputBindings; 76 | if ( 77 | commands == null || 78 | commands.Any(c => !(c is ICommand)) || 79 | inputBindings == null) 80 | { 81 | return; 82 | } 83 | 84 | var keyBindings = 85 | commands 86 | .Take(10) 87 | .Cast() 88 | .SelectMany( 89 | (command, index) => 90 | new[] 91 | { 92 | new KeyBinding( 93 | command, 94 | (index < 9) ? (Key.D1 + index) : Key.D0, 95 | this.Modifiers), 96 | new KeyBinding( 97 | command, 98 | (index < 9) ? (Key.NumPad1 + index) : Key.NumPad0, 99 | this.Modifiers), 100 | }) 101 | .ToArray(); 102 | inputBindings.AddRange(keyBindings); 103 | } 104 | 105 | /// 106 | /// 自身の型のインスタンスを作成する。 107 | /// 108 | /// 作成されたインスタンス。 109 | protected override Freezable CreateInstanceCore() => 110 | new IndexedCommandKeyBindingBehavior(); 111 | 112 | #endregion 113 | } 114 | } 115 | --------------------------------------------------------------------------------