コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
7d79561bba | ||
|
|
fb44c7f90d | ||
|
|
9d12098663 |
検索条件に一致するファイルはありません
@@ -13,7 +13,8 @@ internal sealed class VideoCacheDatabase : IVideoCacheDatabase
|
||||
private const int FormatVersion = 1;
|
||||
private const int HeaderSize = 32;
|
||||
private const int HeaderCrcOffset = 16;
|
||||
private const string DbFileName = "zerodiskproxy.vdb";
|
||||
private const string OldDbFileName = "zerodiskproxy.vdb";
|
||||
private const string DbFileName = "proxyforge.vdb";
|
||||
private const string BackupSuffix = ".bak";
|
||||
private const string TempSuffix = ".tmp";
|
||||
|
||||
@@ -33,6 +34,49 @@ internal sealed class VideoCacheDatabase : IVideoCacheDatabase
|
||||
Directory.CreateDirectory(_cacheDirectory);
|
||||
_dbPath = Path.Combine(_cacheDirectory, DbFileName);
|
||||
_backupPath = _dbPath + BackupSuffix;
|
||||
|
||||
var oldDbPath = Path.Combine(_cacheDirectory, OldDbFileName);
|
||||
if (File.Exists(oldDbPath) && !File.Exists(_dbPath))
|
||||
{
|
||||
Debug.WriteLine("[VideoCacheDatabase] Starting robust data migration to ProxyForge format.");
|
||||
try
|
||||
{
|
||||
var migrationTempPath = _dbPath + ".migration.tmp";
|
||||
File.Copy(oldDbPath, migrationTempPath, true);
|
||||
|
||||
var oldBackupPath = oldDbPath + BackupSuffix;
|
||||
var migrationBackupTempPath = _backupPath + ".migration.tmp";
|
||||
var hasBackup = File.Exists(oldBackupPath);
|
||||
if (hasBackup)
|
||||
{
|
||||
File.Copy(oldBackupPath, migrationBackupTempPath, true);
|
||||
}
|
||||
|
||||
File.Move(migrationTempPath, _dbPath, true);
|
||||
if (hasBackup)
|
||||
{
|
||||
File.Move(migrationBackupTempPath, _backupPath, true);
|
||||
}
|
||||
|
||||
File.Delete(oldDbPath);
|
||||
if (hasBackup)
|
||||
{
|
||||
File.Delete(oldBackupPath);
|
||||
}
|
||||
var oldTempPath = oldDbPath + TempSuffix;
|
||||
if (File.Exists(oldTempPath))
|
||||
{
|
||||
File.Delete(oldTempPath);
|
||||
}
|
||||
|
||||
Debug.WriteLine("[VideoCacheDatabase] Migration completed successfully. Legacy files removed.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(string.Concat("[VideoCacheDatabase] Migration failed: ", ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
_diskStore = new VideoCacheDiskStore(_cacheDirectory);
|
||||
|
||||
Span<byte> hashBuf = stackalloc byte[32];
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxyForge.Interfaces;
|
||||
|
||||
internal interface IWindowThemeService
|
||||
{
|
||||
void Bind(Window window);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using ProxyForge.Core;
|
||||
using ProxyForge.Detection;
|
||||
using ProxyForge.Interfaces;
|
||||
using ProxyForge.Memory;
|
||||
using ProxyForge.Services;
|
||||
using ProxyForge.Settings;
|
||||
using ProxyForge.Streaming;
|
||||
using ProxyForge.ViewModels;
|
||||
@@ -60,6 +61,7 @@ internal sealed class PluginHost : IDisposable
|
||||
var chunkAllocator = new ChunkAllocator(65536);
|
||||
|
||||
MfSession.AddRef();
|
||||
WindowThemeRegistry.Register(new WindowThemeService());
|
||||
|
||||
IProxyEncoderFactory encoderFactory = new MfProxyEncoderFactory(
|
||||
budget,
|
||||
@@ -124,6 +126,7 @@ internal sealed class PluginHost : IDisposable
|
||||
{
|
||||
var vm = new GenerationPopupViewModel(CacheManager.ActiveGenerations);
|
||||
_popupView = new GenerationPopupView(vm);
|
||||
WindowThemeRegistry.Bind(_popupView);
|
||||
|
||||
var mainWindow = Application.Current?.MainWindow;
|
||||
if (mainWindow is { IsLoaded: true })
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>1.0.0</Version>
|
||||
<Version>1.0.1</Version>
|
||||
<Platforms>AnyCPU;x64;x64</Platforms>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using ProxyForge.Interfaces;
|
||||
using System.Windows;
|
||||
|
||||
namespace ProxyForge.Services;
|
||||
|
||||
internal static class WindowThemeRegistry
|
||||
{
|
||||
private static IWindowThemeService _service = NullWindowThemeService.Instance;
|
||||
|
||||
internal static void Register(IWindowThemeService service)
|
||||
=> Interlocked.Exchange(ref _service, service ?? NullWindowThemeService.Instance);
|
||||
|
||||
internal static void Bind(Window window)
|
||||
=> _service.Bind(window);
|
||||
|
||||
private sealed class NullWindowThemeService : IWindowThemeService
|
||||
{
|
||||
internal static readonly NullWindowThemeService Instance = new();
|
||||
private NullWindowThemeService() { }
|
||||
public void Bind(Window window) { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using ProxyForge.Interfaces;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace ProxyForge.Services;
|
||||
|
||||
internal sealed class WindowThemeService : IWindowThemeService
|
||||
{
|
||||
public void Bind(Window window)
|
||||
{
|
||||
if (window is null) return;
|
||||
window.SourceInitialized += (_, _) => ApplyCurrentTheme(window);
|
||||
window.Loaded += (_, _) => ApplyCurrentTheme(window);
|
||||
}
|
||||
|
||||
private static void ApplyCurrentTheme(Window window)
|
||||
{
|
||||
if (!OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000)) return;
|
||||
var hwnd = new WindowInteropHelper(window).Handle;
|
||||
if (hwnd == nint.Zero) return;
|
||||
|
||||
var captionBrush = (window.TryFindResource(SystemColors.ControlBrushKey) as SolidColorBrush) ?? Brushes.White;
|
||||
var textBrush = (window.TryFindResource(SystemColors.WindowTextBrushKey) as SolidColorBrush) ?? Brushes.Black;
|
||||
|
||||
SetDwmColor(hwnd, NativeMethods.DwmwaCaption, captionBrush.Color);
|
||||
SetDwmColor(hwnd, NativeMethods.DwmwaBorder, captionBrush.Color);
|
||||
SetDwmColor(hwnd, NativeMethods.DwmwaText, textBrush.Color);
|
||||
}
|
||||
|
||||
private static void SetDwmColor(nint hwnd, uint attribute, Color color)
|
||||
{
|
||||
uint colorRef = color.R | ((uint)color.G << 8) | ((uint)color.B << 16);
|
||||
NativeMethods.DwmSetWindowAttribute(hwnd, attribute, ref colorRef, sizeof(uint));
|
||||
}
|
||||
|
||||
private static class NativeMethods
|
||||
{
|
||||
internal const uint DwmwaCaption = 35;
|
||||
internal const uint DwmwaBorder = 34;
|
||||
internal const uint DwmwaText = 36;
|
||||
|
||||
[DllImport("dwmapi.dll")]
|
||||
internal static extern int DwmSetWindowAttribute(nint hwnd, uint dwAttribute, ref uint pvAttribute, uint cbAttribute);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ YukkuriMovieMaker4 (YMM4) 上で動作する**動画プロキシ自動生成プ
|
||||
大容量の動画ファイルから低解像度プロキシを自動生成し、編集中のプレビュー負荷を軽減します。
|
||||
プロキシはディスクにキャッシュされ、動画出力(エクスポート)時にはオリジナル解像度に自動で切り替わるため、最終出力の品質に影響を与えません。
|
||||
|
||||

|
||||
|
||||
## 概要
|
||||
|
||||
本プラグインは、YMM4の映像ファイルソースとして動作します。
|
||||
|
||||
サブモジュール
+1
サブモジュール YukkuriMovieMaker.Generator が 9d67caf6e6 で追加されました。
バイナリファイルは表示されません。
|
変更後 幅: | 高さ: | サイズ: 519 KiB |
新しいイシューから参照
ユーザーをブロックする