全UIテキストをハードコードされた日本語文字列からTranslateクラス経由の多言語対応リソースへ完全移行しました。
YukkuriMovieMaker.Generatorをgitサブモジュールとして追加しソリューションファイルに組み込み、ソースジェネレータによるローカライズクラス自動生成の基盤を整えました。
ZeroDiskProxy/Localization/ディレクトリを新設し、[AutoGenLocalizer]属性を持つpartialクラスTranslateをTexts.csに定義しました。
.gitmodulesにYukkuriMovieMaker.GeneratorのGitHubリポジトリURLを登録し、サブモジュールとして管理します。
ZeroDiskProxy.slnxにYukkuriMovieMaker.Generatorプロジェクトを追加しました。
ProxyCacheManagerのプロキシ生成完了・キャンセル・失敗時のステータスメッセージをそれぞれTranslate.ProxyGenerationStatusCompleted・Translate.ProxyGenerationStatusCanceled・Translate.ProxyGenerationStatusFailedPrefixに置換しました。
ProxyGenerationItemの初期ステータス文字列をTranslate.ProxyGenerationStatusGeneratingに、格納先表示をTranslate.StorageMemory・Translate.StorageDiskに置換しました。
ZeroDiskProxySettings.NameプロパティをリテラルからTranslate.SettingsNameに変更しました。
SettingsViewModelの初期キャッシュ概要テキストをTranslate.CacheSummaryLoadingに変更しました。
キャッシュ削除ダイアログのメッセージをstring.Concatからstring.Format(Translate.CacheNoEntriesToDelete)およびstring.Format(Translate.CacheDeleteSummaryFormat, ...)に変更しました。
ダイアログタイトルをリテラルからTranslate.AppNameに変更しました。
プラグイン未初期化メッセージ・キャッシュ件数表示・メモリおよびディスク使用量表示・割当済メモリ表示をいずれもstring.FormatとTranslateキーに置き換えました。
CacheEntryViewModelのストレージ種別表示をTranslate.StorageMemory・Translate.StorageDiskに置換しました。
GenerationPopupView.xamlにxmlns:local名前空間宣言を追加し、ウィンドウタイトル・ヘッダ文言・空状態メッセージをすべて{x:Static local:Translate.XXX}バインディングに変更しました。
ZeroDiskProxySettingsView.xamlにxmlns:local名前空間宣言を追加し、設定カード説明文・全Expanderヘッダ・全ラベル・全ツールチップ・全ボタン文言・キャッシュ一覧ヘッダおよび空状態メッセージをすべて{x:Static local:Translate.XXX}バインディングに変更しました。
42 行
1.3 KiB
C#
42 行
1.3 KiB
C#
using System.Numerics;
|
|
using Vortice.Direct2D1;
|
|
using Vortice.Direct2D1.Effects;
|
|
using YukkuriMovieMaker.Commons;
|
|
using YukkuriMovieMaker.Plugin.FileSource;
|
|
|
|
namespace ZeroDiskProxy.Plugin;
|
|
|
|
internal sealed class ZeroDiskProxyVideoSourceWithScale : IVideoFileSource
|
|
{
|
|
private readonly IVideoFileSource _inner;
|
|
private readonly AffineTransform2D _scaleEffect;
|
|
private readonly ID2D1Image _output;
|
|
private int _disposed;
|
|
|
|
public TimeSpan Duration => _inner.Duration;
|
|
public ID2D1Image Output => _output;
|
|
|
|
internal ZeroDiskProxyVideoSourceWithScale(IVideoFileSource inner, IGraphicsDevicesAndContext devices, float proxyScale)
|
|
{
|
|
_inner = inner;
|
|
_scaleEffect = new AffineTransform2D(devices.DeviceContext);
|
|
_scaleEffect.SetInput(0, inner.Output, true);
|
|
_scaleEffect.TransformMatrix = Matrix3x2.CreateScale(1f / proxyScale);
|
|
_output = _scaleEffect.Output;
|
|
}
|
|
|
|
public void Update(TimeSpan time) => _inner.Update(time);
|
|
public int GetFrameIndex(TimeSpan time) => _inner.GetFrameIndex(time);
|
|
|
|
public void Dispose()
|
|
{
|
|
if (Interlocked.Exchange(ref _disposed, 1) != 0)
|
|
return;
|
|
|
|
_output.Dispose();
|
|
_scaleEffect.SetInput(0, null, true);
|
|
_scaleEffect.Dispose();
|
|
_inner.Dispose();
|
|
GC.SuppressFinalize(this);
|
|
}
|
|
} |