refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control, and asked for Actions and a first automatic release with the server package and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md). - Chronos everywhere: a byte-exact rename of contents and paths, then a per-language review of the forms the old name's ending had dictated. - Gitea instead of GitHub: the update check, licence, issue and support links read ChronosReleasesUrl; the update check takes the highest stable version, offers a pre-release build its final release and reports a repository it cannot see as a failed check. EULA, security policy and Gitea issue forms live at the repository root. - Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release, nightly image and performance gates in the .NET SDK container with git checkout and the system SQLite. The release cross-compiles the Windows programs, checks their icon, version and DPI manifest, packs installers and zips, publishes the Gitea release and pushes the server image (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows runner (WINDOWS_RUNNER). - New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the docker-exec script, which Gitea's service containers do not allow; the throw-away server runs without durability) and pe-check. - Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR, 3 on the shared runner; the weekly performance gates keep theirs). BREAKING CHANGE: programs, settings, data folders, file types, environment variables and the Docker image use the new name; nothing is migrated from Titano, which never had a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #6.
This commit is contained in:
1 parent
c99842cc86
commit
f2b58522b9
1801 files changed
+11804
-10676
No files matched your search
@@ -2,7 +2,7 @@ using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Titano.App.About;
|
||||
namespace Chronos.App.About;
|
||||
|
||||
/// <summary>The newest public release (BRIEF §18) with its downloadable files.</summary>
|
||||
public sealed record ReleaseInfo(Version Version, string Tag, string PageUrl)
|
||||
@@ -14,8 +14,9 @@ public sealed record ReleaseInfo(Version Version, string Tag, string PageUrl)
|
||||
public sealed record ReleaseAsset(string Name, string DownloadUrl, long Size);
|
||||
|
||||
/// <summary>
|
||||
/// Update check against the GitHub Releases API of the public releases repository (BRIEF §18, §19.4): reads the
|
||||
/// latest release, ignores drafts and pre-releases, and compares its tag with the running version.
|
||||
/// Update check against the Gitea releases API of the releases repository (BRIEF §18, §19.4, amended 2026-10-23, R2):
|
||||
/// reads the published stable releases, takes the highest version (Gitea's own "latest" is the most recently created
|
||||
/// one, which a re-published older tag or a backport would become), and compares it with the running version.
|
||||
/// </summary>
|
||||
public static class UpdateCheck
|
||||
{
|
||||
@@ -32,12 +33,25 @@ public static class UpdateCheck
|
||||
return new Version(version.Major, version.Minor, Math.Max(0, version.Build));
|
||||
}
|
||||
|
||||
/// <summary>The release described by a <c>releases/latest</c> response; null for drafts, pre-releases or unparsable tags.
|
||||
/// Assets without an https download link are left out.</summary>
|
||||
/// <summary>
|
||||
/// The newest release of a releases-list response (an array: the highest version wins) or of one release object;
|
||||
/// null when there is none. Drafts, pre-releases, unparsable tags and pages without an https link are skipped, and
|
||||
/// so are assets without an https download link.
|
||||
/// </summary>
|
||||
public static ReleaseInfo? Parse(string json)
|
||||
{
|
||||
using var document = JsonDocument.Parse(json);
|
||||
var root = document.RootElement;
|
||||
return root.ValueKind switch
|
||||
{
|
||||
JsonValueKind.Array => root.EnumerateArray().Select(ParseRelease).OfType<ReleaseInfo>().MaxBy(r => r.Version),
|
||||
JsonValueKind.Object => ParseRelease(root),
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
private static ReleaseInfo? ParseRelease(JsonElement root)
|
||||
{
|
||||
if (root.ValueKind != JsonValueKind.Object) return null;
|
||||
if (Flag(root, "draft") || Flag(root, "prerelease")) return null;
|
||||
var tag = root.TryGetProperty("tag_name", out var t) && t.ValueKind == JsonValueKind.String ? t.GetString() : null;
|
||||
@@ -47,22 +61,44 @@ public static class UpdateCheck
|
||||
return new ReleaseInfo(version, tag, url) { Assets = ParseAssets(root) };
|
||||
}
|
||||
|
||||
/// <summary>True when <paramref name="release"/> is newer than <paramref name="running"/> (build/revision ignored).</summary>
|
||||
public static bool IsNewer(ReleaseInfo release, Version running) =>
|
||||
release.Version > new Version(running.Major, running.Minor, Math.Max(0, running.Build));
|
||||
/// <summary>
|
||||
/// True when <paramref name="release"/> is newer than <paramref name="running"/> (build/revision ignored). A
|
||||
/// pre-release build (<paramref name="runningIsPrerelease"/>, "0.1.0-rc.1") is older than the release of its own
|
||||
/// version: only stable releases are read, so the equal version is the final one.
|
||||
/// </summary>
|
||||
public static bool IsNewer(ReleaseInfo release, Version running, bool runningIsPrerelease = false)
|
||||
{
|
||||
var current = new Version(running.Major, running.Minor, Math.Max(0, running.Build));
|
||||
return release.Version > current || (runningIsPrerelease && release.Version == current);
|
||||
}
|
||||
|
||||
/// <summary>"0.1.0-rc.1" and "v0.1.0-beta" are pre-releases; "0.1.0" and "0.1.0+abc" (build metadata) are not.</summary>
|
||||
public static bool IsPrerelease(string? informationalVersion)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(informationalVersion)) return false;
|
||||
var text = informationalVersion.Trim();
|
||||
var plus = text.IndexOf('+');
|
||||
if (plus >= 0) text = text[..plus];
|
||||
return text.Contains('-');
|
||||
}
|
||||
|
||||
/// <summary>The running version from an informational version such as "0.1.0" or "0.1.0+abc".</summary>
|
||||
public static Version RunningVersion(string informationalVersion) => ParseVersion(informationalVersion) ?? new Version(0, 0, 0);
|
||||
|
||||
/// <summary>Asks the releases API for the latest release; null when there is none (404) or it cannot be read.</summary>
|
||||
/// <exception cref="HttpRequestException">The request failed.</exception>
|
||||
/// <summary>
|
||||
/// Asks the releases API for the newest stable release; null when the repository has none or the answer cannot be
|
||||
/// read. A 404 means the repository itself cannot be seen (Gitea answers so for a private or missing repository):
|
||||
/// that is a failed check, never "up to date".
|
||||
/// </summary>
|
||||
/// <exception cref="HttpRequestException">The request failed, or the repository was not found.</exception>
|
||||
public static async Task<ReleaseInfo?> FetchAsync(HttpClient http, string apiUrl, string userAgentVersion, CancellationToken ct)
|
||||
{
|
||||
using var request = new HttpRequestMessage(HttpMethod.Get, apiUrl);
|
||||
request.Headers.UserAgent.Add(new ProductInfoHeaderValue("Titano", userAgentVersion));
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/vnd.github+json"));
|
||||
request.Headers.UserAgent.Add(new ProductInfoHeaderValue("Chronos", userAgentVersion));
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
|
||||
using var response = await http.SendAsync(request, ct).ConfigureAwait(false);
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.NotFound) return null;
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
throw new HttpRequestException($"The releases repository was not found or is not public: {apiUrl}", null, response.StatusCode);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var json = await response.Content.ReadAsStringAsync(ct).ConfigureAwait(false);
|
||||
try
|
||||
@@ -6,7 +6,7 @@ using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Titano.App.About;
|
||||
namespace Chronos.App.About;
|
||||
|
||||
/// <summary>A downloaded update was refused: the release lacks a setup or checksum line, or the bytes do not match.</summary>
|
||||
public sealed class UpdateVerificationException(string message) : Exception(message);
|
||||
@@ -15,7 +15,7 @@ public sealed class UpdateVerificationException(string message) : Exception(mess
|
||||
/// "Download" of the update notice (BRIEF §18, P1): fetches the package of the latest release that upgrades this copy
|
||||
/// (the setup, or the portable zip for a portable copy) into a temporary folder and keeps it only when its SHA-256
|
||||
/// equals the line for it in the release's <c>SHA256SUMS</c>. BRIEF §8.6 does not list starting an installer among the
|
||||
/// OS actions Titano may perform, so callers show the verified file in Explorer and the user runs or unpacks it. An
|
||||
/// OS actions Chronos may perform, so callers show the verified file in Explorer and the user runs or unpacks it. An
|
||||
/// interrupted download resumes from its partial file; a transfer that stalls fails after <see cref="IdleTimeout"/>
|
||||
/// instead of hanging.
|
||||
/// </summary>
|
||||
@@ -31,12 +31,12 @@ public static class UpdateDownload
|
||||
private static readonly SearchValues<char> Hex = SearchValues.Create("0123456789abcdefABCDEF");
|
||||
|
||||
/// <summary>
|
||||
/// The file that upgrades this copy: the desktop setup ("Titano-Setup-1.2.3.exe", not the Uploader's) or, for a
|
||||
/// portable copy, the portable zip ("Titano-win-x64-portable-1.2.3.zip"); null when the release has none.
|
||||
/// The file that upgrades this copy: the desktop setup ("Chronos-Setup-1.2.3.exe", not the Uploader's) or, for a
|
||||
/// portable copy, the portable zip ("Chronos-win-x64-portable-1.2.3.zip"); null when the release has none.
|
||||
/// </summary>
|
||||
public static ReleaseAsset? Package(ReleaseInfo release, bool portable)
|
||||
{
|
||||
var (prefix, extension) = portable ? ("Titano-win-x64-portable-", ".zip") : ("Titano-Setup-", ".exe");
|
||||
var (prefix, extension) = portable ? ("Chronos-win-x64-portable-", ".zip") : ("Chronos-Setup-", ".exe");
|
||||
return release.Assets.FirstOrDefault(a => a.Name.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)
|
||||
&& a.Name.EndsWith(extension, StringComparison.OrdinalIgnoreCase)
|
||||
&& a.Name == Path.GetFileName(a.Name));
|
||||
@@ -47,8 +47,8 @@ public static class UpdateDownload
|
||||
/// <summary>The release carries both the package for this copy and <c>SHA256SUMS</c>; otherwise only its page can be opened.</summary>
|
||||
public static bool CanDownload(ReleaseInfo release, bool portable) => Package(release, portable) is not null && Checksums(release) is not null;
|
||||
|
||||
/// <summary><c>%TEMP%\Titano\updates</c>: one folder per release below it, all owned by Titano.</summary>
|
||||
public static string Root(string tempPath) => Path.Combine(tempPath, "Titano", "updates");
|
||||
/// <summary><c>%TEMP%\Chronos\updates</c>: one folder per release below it, all owned by Chronos.</summary>
|
||||
public static string Root(string tempPath) => Path.Combine(tempPath, "Chronos", "updates");
|
||||
|
||||
/// <summary>The folder of one release below <paramref name="root"/>, named after its tag.</summary>
|
||||
public static string Folder(string root, ReleaseInfo release) =>
|
||||
@@ -86,7 +86,7 @@ public static class UpdateDownload
|
||||
IProgress<double>? progress, TimeSpan idleTimeout, CancellationToken ct)
|
||||
{
|
||||
var package = Package(release, portable)
|
||||
?? throw new UpdateVerificationException($"Release {release.Tag} has no {(portable ? "portable zip" : "Titano setup")}.");
|
||||
?? throw new UpdateVerificationException($"Release {release.Tag} has no {(portable ? "portable zip" : "Chronos setup")}.");
|
||||
var checksums = Checksums(release) ?? throw new UpdateVerificationException($"Release {release.Tag} has no {ChecksumsName}.");
|
||||
var text = await WhileReceivingAsync(idle => ReadChecksumsAsync(http, checksums, userAgentVersion, idle.Token), idleTimeout, ct).ConfigureAwait(false);
|
||||
var expected = ParseChecksums(text).GetValueOrDefault(package.Name)
|
||||
@@ -198,7 +198,7 @@ public static class UpdateDownload
|
||||
private static async Task<HttpResponseMessage> SendAsync(HttpClient http, ReleaseAsset asset, string userAgentVersion, long offset, CancellationToken ct)
|
||||
{
|
||||
using var request = new HttpRequestMessage(HttpMethod.Get, asset.DownloadUrl);
|
||||
request.Headers.UserAgent.Add(new ProductInfoHeaderValue("Titano", userAgentVersion));
|
||||
request.Headers.UserAgent.Add(new ProductInfoHeaderValue("Chronos", userAgentVersion));
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/octet-stream"));
|
||||
if (offset > 0) request.Headers.Range = new RangeHeaderValue(offset, null);
|
||||
var response = await http.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, ct).ConfigureAwait(false);
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.About;
|
||||
namespace Chronos.App.About;
|
||||
|
||||
/// <summary>Where the update notice stands.</summary>
|
||||
public enum UpdateState
|
||||
@@ -27,12 +27,16 @@ public sealed record UpdateHost(
|
||||
Func<CancellationToken, Task<ReleaseInfo?>> CheckAsync,
|
||||
Func<ReleaseInfo, IProgress<double>?, CancellationToken, Task<string>> DownloadAsync,
|
||||
Action<string> OpenUrl,
|
||||
Action<string> Reveal);
|
||||
Action<string> Reveal)
|
||||
{
|
||||
/// <summary>The running build is a pre-release ("0.1.0-rc.1"): the final release of the same version is newer.</summary>
|
||||
public bool RunningIsPrerelease { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The update notice of About and Settings › Updates (BRIEF §18): checks the latest release, downloads and verifies the
|
||||
/// package that upgrades this copy (<see cref="UpdateDownload"/>: the setup, or the portable zip for a portable copy)
|
||||
/// and shows it in Explorer. Running it is left to the user because BRIEF §8.6 lets Titano only open links and show
|
||||
/// and shows it in Explorer. Running it is left to the user because BRIEF §8.6 lets Chronos only open links and show
|
||||
/// files. A release without that package or without <c>SHA256SUMS</c> only opens its page; a capture run never touches
|
||||
/// the network. The flow owns its two commands so that their can-execute state follows every change.
|
||||
/// </summary>
|
||||
@@ -111,7 +115,7 @@ public sealed class UpdateFlow
|
||||
/// <summary>Sets a check result without the network (capture, tests). A package already verified for the same release stays offered.</summary>
|
||||
public void SetResult(ReleaseInfo? release, bool failed = false)
|
||||
{
|
||||
var newer = !failed && release is not null && UpdateCheck.IsNewer(release, _host.Running) ? release : null;
|
||||
var newer = !failed && release is not null && UpdateCheck.IsNewer(release, _host.Running, _host.RunningIsPrerelease) ? release : null;
|
||||
var keepPackage = newer is not null && PackagePath is not null && newer.Tag == Release?.Tag && File.Exists(PackagePath);
|
||||
Release = newer;
|
||||
if (!keepPackage) PackagePath = null;
|
||||
@@ -1,4 +1,4 @@
|
||||
<Application x:Class="Titano.App.App"
|
||||
<Application x:Class="Chronos.App.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
ShutdownMode="OnMainWindowClose">
|
||||
@@ -1,26 +1,26 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using Titano.App.DesignTime;
|
||||
using Titano.App.Editor;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Shell;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Titano.Ui.Theming;
|
||||
using Chronos.App.DesignTime;
|
||||
using Chronos.App.Editor;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Shell;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Ui.Mvvm;
|
||||
using Chronos.Ui.Theming;
|
||||
|
||||
namespace Titano.App;
|
||||
namespace Chronos.App;
|
||||
|
||||
/// <summary>
|
||||
/// Titano desktop client. Local mode starts here: settings and language before the first window, then the window,
|
||||
/// Chronos desktop client. Local mode starts here: settings and language before the first window, then the window,
|
||||
/// then the index and the job engine (<see cref="AppServices"/>) off the UI thread. <c>--capture <dir></c>
|
||||
/// renders every screen with synthetic data in a throw-away data folder and exits. A file argument is a
|
||||
/// <c>.titano</c> project file (Explorer passes it on a double-click) opened once the index is open. One Titano runs
|
||||
/// <c>.chronos</c> project file (Explorer passes it on a double-click) opened once the index is open. One Chronos runs
|
||||
/// per data folder: a second launch hands its file to the running one and exits, or, when the running one is closing,
|
||||
/// waits for it to exit and starts with the file (<see cref="SingleInstance"/>).
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
/// <summary>How long a launch waits for a Titano that is closing (it gives its services up to 10 s to stop).</summary>
|
||||
/// <summary>How long a launch waits for a Chronos that is closing (it gives its services up to 10 s to stop).</summary>
|
||||
private static readonly TimeSpan ClosingWait = TimeSpan.FromSeconds(30);
|
||||
|
||||
private readonly TaskCompletionSource _started = new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
@@ -41,10 +41,10 @@ public partial class App : Application
|
||||
var capture = captureIndex >= 0;
|
||||
// Capture never reads or writes the user's data folder.
|
||||
Environment = capture ? AppEnvironment.ForCapture() : AppEnvironment.Detect();
|
||||
_log = new FileLogSink(Environment.LogDirectory, "titano");
|
||||
_log = new FileLogSink(Environment.LogDirectory, "chronos");
|
||||
// Capture runs in CI: mirror the log to stderr so failures are visible in the job output.
|
||||
Log.SetSink(capture ? new TeeLogSink(_log, new StderrLogSink()) : _log);
|
||||
Log.Info("app", $"Titano {AppServices.VersionText} starting; data at {Environment.DataDirectory}");
|
||||
Log.Info("app", $"Chronos {AppServices.VersionText} starting; data at {Environment.DataDirectory}");
|
||||
// Settings tells the user once the window is up.
|
||||
if (Environment.PortableSyncRoot is { } portableIn) Log.Warning("app", $"This portable copy runs in the OneDrive folder {portableIn}: its data is kept outside it");
|
||||
if (Environment.EarlierPortableData is { } earlier) Log.Warning("app", $"The data this portable copy kept in {earlier} before is left there and no longer used");
|
||||
@@ -58,19 +58,19 @@ public partial class App : Application
|
||||
{
|
||||
if (SingleInstance.HandOver(Environment.DataDirectory, projectFile is null ? [] : [projectFile]))
|
||||
{
|
||||
Log.Info("app", "Titano already runs on this data folder; arguments handed over");
|
||||
Log.Info("app", "Chronos already runs on this data folder; arguments handed over");
|
||||
Shutdown();
|
||||
return;
|
||||
}
|
||||
// No answer: the running Titano is closing (it stops listening first). Start once it has exited.
|
||||
// No answer: the running Chronos is closing (it stops listening first). Start once it has exited.
|
||||
_instance = SingleInstance.WaitForTurn(Environment.DataDirectory, ClosingWait);
|
||||
if (_instance is null)
|
||||
{
|
||||
Log.Info("app", "Titano already runs on this data folder and did not answer");
|
||||
Log.Info("app", "Chronos already runs on this data folder and did not answer");
|
||||
Shutdown();
|
||||
return;
|
||||
}
|
||||
Log.Info("app", "The previous Titano on this data folder has exited");
|
||||
Log.Info("app", "The previous Chronos on this data folder has exited");
|
||||
}
|
||||
// From now on: a launch while the window and the index open is kept until the shell can take it.
|
||||
_instance.Listen();
|
||||
@@ -104,7 +104,7 @@ public partial class App : Application
|
||||
_ = ScreenCapture.RunAsync(window, shell, sample!, dir);
|
||||
return;
|
||||
}
|
||||
// Closing the main window ends Titano: later launches wait for it instead of handing over a file it cannot open.
|
||||
// Closing the main window ends Chronos: later launches wait for it instead of handing over a file it cannot open.
|
||||
window.Closed += (_, _) =>
|
||||
{
|
||||
_windowClosed = true;
|
||||
@@ -139,7 +139,7 @@ public partial class App : Application
|
||||
{
|
||||
if (_windowClosed)
|
||||
{
|
||||
Log.Warning("app", "A launch arrived while Titano was closing; its arguments are ignored");
|
||||
Log.Warning("app", "A launch arrived while Chronos was closing; its arguments are ignored");
|
||||
return;
|
||||
}
|
||||
if (MainWindow is { } window)
|
||||
@@ -182,7 +182,7 @@ public partial class App : Application
|
||||
|
||||
public void SaveSettings()
|
||||
{
|
||||
// A launch that handed over to the running Titano exits before loading any settings.
|
||||
// A launch that handed over to the running Chronos exits before loading any settings.
|
||||
if (Settings is null) return;
|
||||
try
|
||||
{
|
||||
@@ -211,7 +211,7 @@ public partial class App : Application
|
||||
Log.Warning("app", "Services stopped with an error", ex);
|
||||
}
|
||||
_instance?.Dispose();
|
||||
Log.Info("app", "Titano exiting");
|
||||
Log.Info("app", "Chronos exiting");
|
||||
_log?.Dispose();
|
||||
if (Environment.IsCapture) Environment.DeleteCaptureData();
|
||||
base.OnExit(e);
|
||||
+10
-10
@@ -1,17 +1,17 @@
|
||||
using System.IO;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Settings;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Settings;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>
|
||||
/// An in-window dialog of the Archive screen: one primary action, one way out. While its action runs, the way out
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
|
||||
xmlns:ar="clr-namespace:Titano.App.Archiving"
|
||||
xmlns:infra="clr-namespace:Titano.App.Infrastructure"
|
||||
xmlns:shell="clr-namespace:Titano.App.Shell">
|
||||
xmlns:ui="clr-namespace:Chronos.Ui.Controls;assembly=Chronos.Ui"
|
||||
xmlns:l="clr-namespace:Chronos.Ui.Localization;assembly=Chronos.Ui"
|
||||
xmlns:ar="clr-namespace:Chronos.App.Archiving"
|
||||
xmlns:infra="clr-namespace:Chronos.App.Infrastructure"
|
||||
xmlns:shell="clr-namespace:Chronos.App.Shell">
|
||||
<!-- In-window dialogs of the archive engine's operations, shared by the Archive manager and the Library. -->
|
||||
<!-- Rows that only show text: focusable, so the arrow keys move through a long list. -->
|
||||
<Style x:Key="ListBoxItem.Preview" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Row}">
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Archiving;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Archiving;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>
|
||||
/// Why an Archive screen action stopped, as one localized sentence chosen by cause (BRIEF §0.2 rule 6). The
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
using System.Globalization;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Naming;
|
||||
using Titano.Data.Repositories;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Naming;
|
||||
using Chronos.Data.Repositories;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>A bar of a chart: label, magnitude, the text after the bar and the hover text.</summary>
|
||||
public sealed record BarValue(string Label, double Value, string ValueText, string ToolTip);
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
using System.Windows.Input;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Ui.Controls;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Ui.Controls;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>A visible row of the archive tree: indentation, expander, title, figures and availability.</summary>
|
||||
public sealed class ArchiveTreeRowViewModel(ArchiveTreeNode node, ArchiveAvailability availability, Action<ArchiveTreeNode> toggle) : ObservableObject
|
||||
@@ -1,6 +1,6 @@
|
||||
using Titano.App.Shell;
|
||||
using Chronos.App.Shell;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>
|
||||
/// The Archive views that <c>--capture</c> renders (<c>archive-<view>-<theme>.png</c>) and the screen smoke
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Globalization;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
public enum TreeNodeKind
|
||||
{
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
using System.IO;
|
||||
using Titano.Data;
|
||||
using Chronos.Data;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>The archive the Import and Archive screens work on: the one at the remembered root, else the first indexed.</summary>
|
||||
public static class CurrentArchive
|
||||
@@ -20,7 +20,7 @@ public static class CurrentArchive
|
||||
return archives.FirstOrDefault(a => string.Equals(Normalize(a.RootPath), wanted, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
public static async Task<Core.Model.Archive?> FindAsync(TitanoDatabase db, string? lastRoot, CancellationToken cancellationToken = default) =>
|
||||
public static async Task<Core.Model.Archive?> FindAsync(ChronosDatabase db, string? lastRoot, CancellationToken cancellationToken = default) =>
|
||||
Pick(await db.Archives.ListAsync(cancellationToken).ConfigureAwait(false), lastRoot);
|
||||
|
||||
private static string Normalize(string path)
|
||||
+9
-9
@@ -1,14 +1,14 @@
|
||||
using System.IO;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Shell;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Shell;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>
|
||||
/// "Delete…" of the Library and the Archive manager (BRIEF §0.2 rule 8, §12.2, §12.5) in an in-window dialog that says
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Globalization;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Data.Archiving;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Data.Archiving;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>The words of a delete dry run (<see cref="DeletePlan"/>): the destructive confirmation and the lines of what cannot move.</summary>
|
||||
public static class DeletePlans
|
||||
+8
-8
@@ -1,12 +1,12 @@
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Jobs;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Data.Repositories;
|
||||
using Titano.Ui.Controls;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Jobs;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Data.Repositories;
|
||||
using Chronos.Ui.Controls;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>A group of identical photos: the copies and where they are; the first one counts as the original.</summary>
|
||||
public sealed record DuplicateRow(string Title, string Detail, IReadOnlyList<string> Places, Guid SequenceId);
|
||||
+8
-8
@@ -1,12 +1,12 @@
|
||||
using Titano.App.Library;
|
||||
using Titano.App.Settings;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Naming;
|
||||
using Titano.Data.Repositories;
|
||||
using Chronos.App.Library;
|
||||
using Chronos.App.Settings;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Naming;
|
||||
using Chronos.Data.Repositories;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>What a mass rename changes: the sequence titles (Rename) or the folder layout (Move).</summary>
|
||||
public enum RenameMode
|
||||
@@ -1,9 +1,9 @@
|
||||
using Titano.App.DesignTime;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Data.Repositories;
|
||||
using Chronos.App.DesignTime;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Data.Repositories;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>
|
||||
/// Capture and smoke-test data ONLY: maintenance reports, rebuild counts and trash rows over the sample archive's sequences
|
||||
+7
-7
@@ -1,12 +1,12 @@
|
||||
using System.IO;
|
||||
using Titano.App.Shell;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Archiving;
|
||||
using Chronos.App.Shell;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Archiving;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>What Delete (<see cref="DeleteDialogViewModel"/>) and its Undo share in the Library and the Archive manager.</summary>
|
||||
public static class SequenceDeletion
|
||||
+8
-8
@@ -1,14 +1,14 @@
|
||||
using System.IO;
|
||||
using System.Windows.Input;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Archiving;
|
||||
namespace Chronos.App.Archiving;
|
||||
|
||||
/// <summary>One deleted sequence in the trash: what it was, when it went, and Restore.</summary>
|
||||
public sealed class TrashRowViewModel(TrashEntry entry, ICommand restore)
|
||||
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<RootNamespace>Chronos.App</RootNamespace>
|
||||
<AssemblyName>Chronos</AssemblyName>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<ChronosIconVariant>chronos</ChronosIconVariant>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Chronos.Core\Chronos.Core.csproj" />
|
||||
<ProjectReference Include="..\Chronos.Core.Windows\Chronos.Core.Windows.csproj" />
|
||||
<ProjectReference Include="..\Chronos.Data\Chronos.Data.csproj" />
|
||||
<ProjectReference Include="..\Chronos.Protocol\Chronos.Protocol.csproj" />
|
||||
<ProjectReference Include="..\Chronos.Ui\Chronos.Ui.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InternalsVisibleTo Include="Chronos.App.Tests" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+41
-41
@@ -1,34 +1,34 @@
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using Titano.App.About;
|
||||
using Titano.App.Editor;
|
||||
using Titano.App.Import;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Jobs;
|
||||
using Titano.App.Library;
|
||||
using Titano.App.Server;
|
||||
using Titano.App.Settings;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Analysis;
|
||||
using Titano.Core.Analysis.Deep;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Codecs.Jpeg;
|
||||
using Titano.Core.Diagnostics.Synthetic;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Core.Imaging.Decoders;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Metadata;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Core.Video;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Data.Jobs;
|
||||
using Titano.Data.Sync;
|
||||
using Titano.Protocol;
|
||||
using Titano.Protocol.Client;
|
||||
using Chronos.App.About;
|
||||
using Chronos.App.Editor;
|
||||
using Chronos.App.Import;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Jobs;
|
||||
using Chronos.App.Library;
|
||||
using Chronos.App.Server;
|
||||
using Chronos.App.Settings;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Analysis;
|
||||
using Chronos.Core.Analysis.Deep;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Codecs.Jpeg;
|
||||
using Chronos.Core.Diagnostics.Synthetic;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.Imaging.Decoders;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Metadata;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Video;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Data.Jobs;
|
||||
using Chronos.Data.Sync;
|
||||
using Chronos.Protocol;
|
||||
using Chronos.Protocol.Client;
|
||||
|
||||
namespace Titano.App.DesignTime;
|
||||
namespace Chronos.App.DesignTime;
|
||||
|
||||
/// <summary>
|
||||
/// Synthetic content for <c>--capture</c> screenshots and the screen smoke tests ONLY: a temporary SQLite index
|
||||
@@ -52,7 +52,7 @@ public sealed class SampleData
|
||||
|
||||
private readonly AppServices _services;
|
||||
private readonly SampleSyncRemote _remote = new();
|
||||
private TitanoDatabase? _db;
|
||||
private ChronosDatabase? _db;
|
||||
private Guid _sunrise;
|
||||
private Guid _lakeComo;
|
||||
private Permissions _permissions = RolePermissions.Default(UserRole.Editor);
|
||||
@@ -83,7 +83,7 @@ public sealed class SampleData
|
||||
/// <summary>Opens the empty temporary index (first run: no archive, nothing indexed).</summary>
|
||||
public async Task OpenEmptyAsync()
|
||||
{
|
||||
_db = await TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(_services.Environment.DatabasePath));
|
||||
_db = await ChronosDatabase.OpenAsync(DatabaseOptions.Sqlite(_services.Environment.DatabasePath));
|
||||
await _services.AttachAsync(_db, startEngine: false);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public sealed class SampleData
|
||||
var settings = _services.Settings;
|
||||
var root = Path.Combine(_services.Environment.DataDirectory, "archive");
|
||||
Directory.CreateDirectory(root);
|
||||
var archive = new Archive { Id = Guid.CreateVersion7(), Name = "TitanoArchive", RootPath = root, Created = Now.AddYears(-2) };
|
||||
var archive = new Archive { Id = Guid.CreateVersion7(), Name = "ChronosArchive", RootPath = root, Created = Now.AddYears(-2) };
|
||||
await db.Archives.UpsertAsync(archive);
|
||||
var paths = new ArchivePaths(root);
|
||||
Directory.CreateDirectory(paths.MetaDirectory);
|
||||
@@ -114,7 +114,7 @@ public sealed class SampleData
|
||||
await SampleCards.InsertAsync(db, (SampleDeviceMonitor)_services.Devices, _services.Environment.DataDirectory);
|
||||
await FillViewsAsync(db);
|
||||
|
||||
settings.LastArchivePath = @"D:\TitanoArchive";
|
||||
settings.LastArchivePath = @"D:\ChronosArchive";
|
||||
settings.ServerUrl = "https://nas.local:8443";
|
||||
settings.ServerUsername = "alberto";
|
||||
settings.ProtectedToken = "sample-token";
|
||||
@@ -127,7 +127,7 @@ public sealed class SampleData
|
||||
}
|
||||
|
||||
/// <summary>Two saved views of the Library ("Not analysed, largest" and one camera), BRIEF §12.2.</summary>
|
||||
private static async Task FillViewsAsync(TitanoDatabase db)
|
||||
private static async Task FillViewsAsync(ChronosDatabase db)
|
||||
{
|
||||
var views = new SavedViewStore(db.Settings);
|
||||
await views.SaveAsync(SavedView.Of(Guid.CreateVersion7(), "Not analysed, largest",
|
||||
@@ -218,7 +218,7 @@ public sealed class SampleData
|
||||
|
||||
/// <summary>
|
||||
/// The editor's sample as a sequence the sample server also has (so its Export "Sync" applies), with two copies of
|
||||
/// this PC's settings kept by "Save both" in its <c>.titano</c> folder.
|
||||
/// this PC's settings kept by "Save both" in its <c>.chronos</c> folder.
|
||||
/// </summary>
|
||||
public async Task KeepEditorCopiesAsync(Guid sequenceId)
|
||||
{
|
||||
@@ -232,7 +232,7 @@ public sealed class SampleData
|
||||
foreach (var (saved, offset) in copies)
|
||||
{
|
||||
var copy = project with { Exposure = project.Exposure with { ExposureOffsetEv = offset } };
|
||||
Titano.Core.IO.AtomicFile.WriteAllText(Path.Combine(meta, SyncService.SavedCopyName(saved)), copy.ToJson());
|
||||
Chronos.Core.IO.AtomicFile.WriteAllText(Path.Combine(meta, SyncService.SavedCopyName(saved)), copy.ToJson());
|
||||
}
|
||||
var remote = _remote.Add(SampleSyncRemote.Dto(sequence), sequence.SettingsJson, sequence.FrameCount);
|
||||
await _services.Sync.Service!.LinkAsync(ServerAddress, remote, sequence.Id);
|
||||
@@ -244,7 +244,7 @@ public sealed class SampleData
|
||||
/// (captured in the months the local sample spans, so they join the Library's year choices and timeline);
|
||||
/// the others are only here.
|
||||
/// </summary>
|
||||
private async Task FillServerAsync(TitanoDatabase db, IReadOnlyList<Sequence> local)
|
||||
private async Task FillServerAsync(ChronosDatabase db, IReadOnlyList<Sequence> local)
|
||||
{
|
||||
Guid Id(string title) => local.First(s => s.Title == title).Id;
|
||||
await db.Sequences.EditAsync(Id("Holy grail · Monviso"), new Data.Repositories.SequenceEdit { SettingsJson = DeflickerWindow(41) }, null);
|
||||
@@ -391,7 +391,7 @@ public sealed class SampleData
|
||||
}
|
||||
|
||||
/// <summary>Puts the jobs this PC runs back in the queue, so the job a scene starts is the one running (owner review 1).</summary>
|
||||
private async Task RequeueLocalJobsAsync(TitanoDatabase db)
|
||||
private async Task RequeueLocalJobsAsync(ChronosDatabase db)
|
||||
{
|
||||
foreach (var running in (await db.Jobs.ListAsync(JobState.Running, 50)).Items.Where(j => j.NodeId is { } node && JobText.IsLocal(node, _services.WorkerId)))
|
||||
await db.Jobs.RequeueAsync(running.Id, running.NodeId!);
|
||||
@@ -712,7 +712,7 @@ public sealed class SampleData
|
||||
}
|
||||
|
||||
public Task<UserDto> MeAsync(CancellationToken ct) =>
|
||||
Token == "sample-token" ? Task.FromResult(User) : throw new TitanoApiException(HttpStatusCode.Unauthorized, new ApiError("unauthorized", "Sign in"));
|
||||
Token == "sample-token" ? Task.FromResult(User) : throw new ChronosApiException(HttpStatusCode.Unauthorized, new ApiError("unauthorized", "Sign in"));
|
||||
|
||||
public Task LogoutAsync(CancellationToken ct) => Task.CompletedTask;
|
||||
|
||||
@@ -886,8 +886,8 @@ public sealed class SampleData
|
||||
new("H.264", "NVIDIA H.264 Encoder MFT", "NVIDIA", EncoderSource.MediaFoundation, true, false, 4096, 4096, VideoCodec.H264),
|
||||
new("AV1", "NVIDIA AV1 Encoder MFT", "NVIDIA", EncoderSource.MediaFoundation, true, true, 8192, 8192, VideoCodec.Av1),
|
||||
new("H.264", "H264 Encoder MFT", "Microsoft", EncoderSource.MediaFoundation, false, false, 4096, 2304, VideoCodec.H264),
|
||||
new("MJPEG · AVI", "Titano", null, EncoderSource.BuiltInMjpeg, false, false, 0, 0, VideoCodec.Mjpeg),
|
||||
new("GIF · APNG", "Titano", null, EncoderSource.BuiltInAnimation, false, false, 0, 0, null),
|
||||
new("MJPEG · AVI", "Chronos", null, EncoderSource.BuiltInMjpeg, false, false, 0, 0, VideoCodec.Mjpeg),
|
||||
new("GIF · APNG", "Chronos", null, EncoderSource.BuiltInAnimation, false, false, 0, 0, null),
|
||||
];
|
||||
|
||||
public Task<SelfTestResult> SelfTestAsync(EncoderRow row, CancellationToken ct) => Task.FromResult(row.Codec switch
|
||||
@@ -901,7 +901,7 @@ public sealed class SampleData
|
||||
}
|
||||
|
||||
/// <summary>A PC with the HEVC Video Extensions but without the Raw Image and HEIF extensions: RAW files decode through
|
||||
/// Titano's own developers or their previews, HEIF only through its preview (Settings › Formats and its notice).</summary>
|
||||
/// Chronos's own developers or their previews, HEIF only through its preview (Settings › Formats and its notice).</summary>
|
||||
private sealed class SampleFormats : IFormatInventory
|
||||
{
|
||||
private static readonly Core.Windows.Codecs.StoreExtension Raw = Core.Windows.Codecs.StoreExtension.Get(Core.Windows.Codecs.StoreExtensionKind.RawImage);
|
||||
@@ -1,9 +1,9 @@
|
||||
using Titano.Core.Analysis;
|
||||
using Titano.Core.Analysis.Deep;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Ui.Controls;
|
||||
using Chronos.Core.Analysis;
|
||||
using Chronos.Core.Analysis.Deep;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Ui.Controls;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>A finding of the analyses on the Analysis step: what it says, the frame it starts at and the step that deals with it.</summary>
|
||||
public sealed class AnalysisFinding
|
||||
@@ -1,16 +1,16 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Export;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Mathematics;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Titano.Ui.Visuals;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Mathematics;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Ui.Mvvm;
|
||||
using Chronos.Ui.Visuals;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// Camera (BRIEF §12.3): the free crop of the frame (margins), the output aspect and its placement inside the crop, and
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>Columns of the Export tab's preset grid: as many as fit at <see cref="MinCardWidth"/> (four at 1440 px, three at 1200 px).</summary>
|
||||
public sealed class CardColumns : IValueConverter
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>Margins of the free crop, in the order of <see cref="CropMargins.Of"/> (opposites differ in the lowest bit).</summary>
|
||||
public enum CropSide
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using Titano.Ui.Visuals;
|
||||
using Chronos.Ui.Visuals;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>Runs a command after every finished edit of a <see cref="CurveEditor"/> (add, move, delete, nudge).</summary>
|
||||
public static class CurveCommit
|
||||
@@ -1,15 +1,15 @@
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using Titano.App.Jobs;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Analysis;
|
||||
using Titano.Core.Analysis.Deep;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Chronos.App.Jobs;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Analysis;
|
||||
using Chronos.Core.Analysis.Deep;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// Where a step of the Edit path stands (owner review 1, R7). Each status has its own badge glyph, so colour never
|
||||
@@ -278,7 +278,7 @@ public sealed class RenderedSettings
|
||||
}
|
||||
catch (Exception ex) when (ex is JsonException or InvalidDataException)
|
||||
{
|
||||
// Settings no longer readable (or written by a newer Titano) say nothing either way, like none.
|
||||
// Settings no longer readable (or written by a newer Chronos) say nothing either way, like none.
|
||||
}
|
||||
}
|
||||
// A render that keeps no settings (a server's, or one fetched from it) cannot be compared: it counts as current.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// A sequence the editor could not read or store, for a reason the editor words itself in one localized sentence (the
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Ui.Visuals;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Ui.Visuals;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>Linear-light frames as frozen sRGB bitmaps the UI thread can show (created on any thread).</summary>
|
||||
public static class EditorImages
|
||||
+5
-5
@@ -1,16 +1,16 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:v="clr-namespace:Titano.Ui.Visuals;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
|
||||
xmlns:e="clr-namespace:Titano.App.Editor">
|
||||
xmlns:ui="clr-namespace:Chronos.Ui.Controls;assembly=Chronos.Ui"
|
||||
xmlns:v="clr-namespace:Chronos.Ui.Visuals;assembly=Chronos.Ui"
|
||||
xmlns:l="clr-namespace:Chronos.Ui.Localization;assembly=Chronos.Ui"
|
||||
xmlns:e="clr-namespace:Chronos.App.Editor">
|
||||
<!--
|
||||
The measuring tool of each step, below the filmstrip (BRIEF §12.3): the Analysis step's findings, luminance, flicker
|
||||
and waveform, camera path and sky charts, the frame table, the keyframe and time-remap curve editors with the plan
|
||||
chart, and the Export step's preset cards. Clicking a chart seeks the preview.
|
||||
-->
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Titano;component/Editor/EditorStyles.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/Chronos;component/Editor/EditorStyles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!-- One choice of a vertical segment group (the Exposure chart switch): text, accent when chosen. -->
|
||||
@@ -1,16 +1,16 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:v="clr-namespace:Titano.Ui.Visuals;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
|
||||
xmlns:shell="clr-namespace:Titano.App.Shell"
|
||||
xmlns:e="clr-namespace:Titano.App.Editor">
|
||||
xmlns:ui="clr-namespace:Chronos.Ui.Controls;assembly=Chronos.Ui"
|
||||
xmlns:v="clr-namespace:Chronos.Ui.Visuals;assembly=Chronos.Ui"
|
||||
xmlns:l="clr-namespace:Chronos.Ui.Localization;assembly=Chronos.Ui"
|
||||
xmlns:shell="clr-namespace:Chronos.App.Shell"
|
||||
xmlns:e="clr-namespace:Chronos.App.Editor">
|
||||
<!--
|
||||
The column of each step (BRIEF §12.3, Editor.html aside, Export.html Output panel): the setting rows by type, the
|
||||
common section frame (title, rows, Optimise section, Reset) and the panels with their own content.
|
||||
-->
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Titano;component/Editor/EditorStyles.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/Chronos;component/Editor/EditorStyles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<!-- ===================== Setting rows ===================== -->
|
||||
@@ -330,7 +330,7 @@
|
||||
<TextBlock Text="{Binding HistoryText}" Style="{StaticResource Text.Faint}" FontSize="{StaticResource Size.Chip}" TextTrimming="CharacterEllipsis" VerticalAlignment="Center"
|
||||
ToolTip="{Binding HistoryText}" />
|
||||
</DockPanel>
|
||||
<!-- A .titano project file that opens this sequence with these settings (BRIEF §18). -->
|
||||
<!-- A .chronos project file that opens this sequence with these settings (BRIEF §18). -->
|
||||
<Button Style="{StaticResource Button.Link}" HorizontalAlignment="Left" Margin="0,8,0,0" Content="{l:Loc Editor.ProjectFile.Save}"
|
||||
Command="{Binding SaveProjectCommand}" ToolTip="{Binding SaveProjectToolTip}" ToolTipService.ShowOnDisabled="True" />
|
||||
<!-- This PC's settings kept by "Save both" (sync conflicts): the newest, or another from the menu, becomes the project as one undo step. -->
|
||||
@@ -1,12 +1,12 @@
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Export;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Core.Video;
|
||||
using Titano.Data.Archiving.Jobs;
|
||||
using Titano.Data.Processing;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Video;
|
||||
using Chronos.Data.Archiving.Jobs;
|
||||
using Chronos.Data.Processing;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// One sequence open in the editor (BRIEF §12.3): its content, the advisor's view of it (§10.3), the project with undo
|
||||
@@ -1,11 +1,11 @@
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Analysis;
|
||||
using Titano.Core.Analysis.Deep;
|
||||
using Titano.Core.Export;
|
||||
using Titano.Core.Motion;
|
||||
using Titano.Core.Project;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Analysis;
|
||||
using Chronos.Core.Analysis.Deep;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Motion;
|
||||
using Chronos.Core.Project;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>An advisor-decided setting of the editor, whatever its value type.</summary>
|
||||
public interface IAutoSetting
|
||||
@@ -1,9 +1,9 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:e="clr-namespace:Titano.App.Editor">
|
||||
xmlns:ui="clr-namespace:Chronos.Ui.Controls;assembly=Chronos.Ui"
|
||||
xmlns:e="clr-namespace:Chronos.App.Editor">
|
||||
<!--
|
||||
Styles of the sequence editor (Editor.html, Export.html) on the kit of Titano.Ui and the client styles. Brushes are
|
||||
Styles of the sequence editor (Editor.html, Export.html) on the kit of Chronos.Ui and the client styles. Brushes are
|
||||
DynamicResource; sizes and the kit's styles StaticResource.
|
||||
-->
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Windows.Input;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// One step of the Edit path (BRIEF §12.3, owner review 1 R7): its measuring tool below the filmstrip and its column
|
||||
@@ -1,15 +1,15 @@
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Jobs;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Export;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Core.Video;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Jobs;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Video;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>The editor's composed texts (header summary, shot data, preset card lines), in the current UI language.</summary>
|
||||
public static class EditorText
|
||||
@@ -112,7 +112,7 @@ public static class EditorText
|
||||
return string.Join(Separator, parts);
|
||||
}
|
||||
|
||||
/// <summary>"120 Mb/s · 0.07 bpp · NVENC" for video, "Quality 95 · Titano" for frames.</summary>
|
||||
/// <summary>"120 Mb/s · 0.07 bpp · NVENC" for video, "Quality 95 · Chronos" for frames.</summary>
|
||||
public static string Encoding(ResolvedExport export, long bitRate, string? encoder)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(export);
|
||||
+19
-19
@@ -3,25 +3,25 @@ using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using Titano.App.Archiving;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Jobs;
|
||||
using Titano.App.Server;
|
||||
using Titano.App.Shell;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Analysis;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Export;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Core.Render;
|
||||
using Titano.Core.Video;
|
||||
using Titano.Ui.Controls;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Titano.Ui.Visuals;
|
||||
using Chronos.App.Archiving;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Jobs;
|
||||
using Chronos.App.Server;
|
||||
using Chronos.App.Shell;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Analysis;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Render;
|
||||
using Chronos.Core.Video;
|
||||
using Chronos.Ui.Controls;
|
||||
using Chronos.Ui.Mvvm;
|
||||
using Chronos.Ui.Visuals;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// The editor of one open sequence (BRIEF §12.3, Editor.html): header actions, the preview with its tools (wipe
|
||||
@@ -1218,7 +1218,7 @@ public sealed class EditorViewModel : LocalizedViewModel, IAsyncDisposable
|
||||
reloaded = true;
|
||||
}
|
||||
catch (Exception ex) when (ex is System.IO.IOException or System.IO.InvalidDataException or InvalidOperationException or UnauthorizedAccessException
|
||||
or System.Net.Http.HttpRequestException or Protocol.Client.TitanoApiException or OperationCanceledException
|
||||
or System.Net.Http.HttpRequestException or Protocol.Client.ChronosApiException or OperationCanceledException
|
||||
or Data.DatabaseException)
|
||||
{
|
||||
// A server that does not answer in time cancels the request (OperationCanceledException).
|
||||
@@ -1,13 +1,13 @@
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Export;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Core.Render;
|
||||
using Titano.Core.Video;
|
||||
using Titano.Data.Processing;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Render;
|
||||
using Chronos.Core.Video;
|
||||
using Chronos.Data.Processing;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>A choice of the Export tab: a built-in export preset, or a sequence preset (full settings plus an export preset).</summary>
|
||||
/// <param name="ExportPresetId">The export preset the card renders.</param>
|
||||
@@ -1,11 +1,11 @@
|
||||
using System.IO;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Jobs;
|
||||
using Titano.Data.Processing;
|
||||
using Titano.Data.Sync;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Jobs;
|
||||
using Chronos.Data.Processing;
|
||||
using Chronos.Data.Sync;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>Whether the Export "Sync" option can be used, or why not (its tooltip says which).</summary>
|
||||
public enum ExportSyncGate
|
||||
@@ -37,7 +37,7 @@ public sealed record ExportSyncResult(ExportSyncGate Gate, Job? Send);
|
||||
/// holds after the editor closes; a render that ends while the session is down is queued for the last session's server
|
||||
/// and its send waits for the session (and fails visibly on the Jobs screen when it does not come back).
|
||||
/// </summary>
|
||||
public sealed class ExportSync(TitanoDatabase db, SyncService sync, JobEngine engine)
|
||||
public sealed class ExportSync(ChronosDatabase db, SyncService sync, JobEngine engine)
|
||||
{
|
||||
/// <summary>The option's state for a sequence.</summary>
|
||||
/// <param name="server">Key of the signed-in server; null while signed out.</param>
|
||||
@@ -1,19 +1,19 @@
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Windows.Input;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Settings;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Export;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Core.Video;
|
||||
using Titano.Data.Processing;
|
||||
using Titano.Ui.Controls;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Settings;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Video;
|
||||
using Chronos.Data.Processing;
|
||||
using Chronos.Ui.Controls;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>A preset card of the Export tab (Export.html): what it renders and what it will cost on this machine.</summary>
|
||||
public sealed class PresetCard(ExportTab owner, ExportChoice choice) : ObservableObject
|
||||
@@ -180,7 +180,7 @@ public sealed class ExportTab : EditorTab
|
||||
public bool CanReveal => Editor.Session.Content.Renders is [{ OutputPath.Length: > 0 }, ..];
|
||||
|
||||
/// <summary>
|
||||
/// Saves a <c>.titano</c> project file of this sequence and its settings (BRIEF §18); a server sequence has no
|
||||
/// Saves a <c>.chronos</c> project file of this sequence and its settings (BRIEF §18); a server sequence has no
|
||||
/// archive on this PC for the file to name.
|
||||
/// </summary>
|
||||
public ICommand SaveProjectCommand { get; }
|
||||
@@ -1,10 +1,10 @@
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Core.Render;
|
||||
using Titano.Ui.Visuals;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Render;
|
||||
using Chronos.Ui.Visuals;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>The measuring tools of the Exposure tab (BRIEF §12.3 "luminance/waveform charts").</summary>
|
||||
public enum ExposureChart
|
||||
@@ -1,12 +1,12 @@
|
||||
using System.Windows.Input;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Analysis;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Ui.Controls;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Analysis;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Ui.Controls;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>Columns of the Frames table, each sortable (DESIGN §4 tables).</summary>
|
||||
public enum FrameSort
|
||||
+5
-5
@@ -1,15 +1,15 @@
|
||||
<Window x:Class="Titano.App.Editor.FullScreenPreview"
|
||||
<Window x:Class="Chronos.App.Editor.FullScreenPreview"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
|
||||
xmlns:v="clr-namespace:Titano.Ui.Visuals;assembly=Titano.Ui"
|
||||
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
|
||||
xmlns:ui="clr-namespace:Chronos.Ui.Controls;assembly=Chronos.Ui"
|
||||
xmlns:v="clr-namespace:Chronos.Ui.Visuals;assembly=Chronos.Ui"
|
||||
xmlns:l="clr-namespace:Chronos.Ui.Localization;assembly=Chronos.Ui"
|
||||
Title="{Binding Title}" WindowStyle="None" ResizeMode="NoResize" WindowState="Maximized" ShowInTaskbar="False"
|
||||
Background="{DynamicResource Brush.Preview}" KeyDown="OnKeyDown">
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Titano;component/Editor/EditorStyles.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/Chronos;component/Editor/EditorStyles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
+2
-2
@@ -2,9 +2,9 @@ using System.Windows;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
using Titano.Ui.Visuals;
|
||||
using Chronos.Ui.Visuals;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>The preview full screen at native resolution (BRIEF §12.3): the editor keeps rendering into it at screen size.</summary>
|
||||
public partial class FullScreenPreview : Window
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
using Titano.Protocol;
|
||||
using Titano.Protocol.Client;
|
||||
using Chronos.Protocol;
|
||||
using Chronos.Protocol.Client;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// The server calls the editor of a server sequence makes (BRIEF §14.3): the sequence and its settings with their
|
||||
/// version, the analysis report, jobs and events. Failures are <see cref="TitanoApiException"/>s (404 gone, 409 settings
|
||||
/// version, the analysis report, jobs and events. Failures are <see cref="ChronosApiException"/>s (404 gone, 409 settings
|
||||
/// changed meanwhile) or network exceptions. The editor disposes its connection when it closes.
|
||||
/// </summary>
|
||||
public interface IRemoteSequenceApi : IDisposable
|
||||
@@ -15,7 +15,7 @@ public interface IRemoteSequenceApi : IDisposable
|
||||
/// <summary>The settings JSON and its version, the frames and the renders.</summary>
|
||||
Task<SequenceManifest> GetManifestAsync(Guid id, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>A 409 <see cref="TitanoApiException"/> means the settings version moved on the server.</summary>
|
||||
/// <summary>A 409 <see cref="ChronosApiException"/> means the settings version moved on the server.</summary>
|
||||
Task<SequenceDto> UpdateSequenceAsync(Guid id, UpdateSequenceRequest request, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>The full deep-analysis report (<c>analysis.json</c>); null when the sequence was never deep-analysed.</summary>
|
||||
+8
-8
@@ -1,11 +1,11 @@
|
||||
using Titano.Core.Analysis;
|
||||
using Titano.Core.Analysis.Deep;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Data.Archiving.Jobs;
|
||||
using Chronos.Core.Analysis;
|
||||
using Chronos.Core.Analysis.Deep;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Data.Archiving.Jobs;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// Where the sequence open in the editor lives: the local archive (<see cref="LocalSequenceSource"/>) or a server the
|
||||
@@ -41,7 +41,7 @@ public interface ISequenceSource : IAsyncDisposable
|
||||
event Action<Job>? JobChanged;
|
||||
|
||||
/// <summary>Everything the editor shows of the sequence; read off the UI thread.</summary>
|
||||
/// <exception cref="EditorException">The sequence is gone, or its project cannot be read (corrupt, or written by a newer Titano).</exception>
|
||||
/// <exception cref="EditorException">The sequence is gone, or its project cannot be read (corrupt, or written by a newer Chronos).</exception>
|
||||
Task<SequenceContent> LoadAsync(CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// Runs only the latest of a stream of requests (preview frames, estimates): scheduling cancels the request pending or
|
||||
+20
-20
@@ -1,26 +1,26 @@
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Analysis;
|
||||
using Titano.Core.Analysis.Deep;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Core.IO;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Data.Archiving.Jobs;
|
||||
using Titano.Data.Jobs;
|
||||
using Titano.Data.Repositories;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Analysis;
|
||||
using Chronos.Core.Analysis.Deep;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.IO;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Data.Archiving.Jobs;
|
||||
using Chronos.Data.Jobs;
|
||||
using Chronos.Data.Repositories;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// A sequence of an archive on this PC: rows from the index, originals decoded by the client's decoder chain, the
|
||||
/// project in <c>.titano/project.json</c> mirrored in the index's settings column (with its hero frame, which the
|
||||
/// project in <c>.chronos/project.json</c> mirrored in the index's settings column (with its hero frame, which the
|
||||
/// Library shows), jobs on this PC's engine. Project writes follow the archive engine's protocol: under the sequence's
|
||||
/// lease file (so the server and the job engine wait for it), file first (atomically), then the index with its settings
|
||||
/// version as an optimistic check. Project settings name frames by position, and frames inserted while the sequence is
|
||||
@@ -37,7 +37,7 @@ public sealed class LocalSequenceSource : ISequenceSource
|
||||
/// <summary>Times the frames are listed again when an insertion lands while they are read.</summary>
|
||||
private const int ReadAttempts = 3;
|
||||
|
||||
private readonly TitanoDatabase _db;
|
||||
private readonly ChronosDatabase _db;
|
||||
private readonly Guid _sequenceId;
|
||||
private readonly ImageDecoder _decoder;
|
||||
private readonly JobEngine? _engine;
|
||||
@@ -54,7 +54,7 @@ public sealed class LocalSequenceSource : ISequenceSource
|
||||
private ArchivePaths? _paths;
|
||||
private SequencePaths? _folder;
|
||||
|
||||
public LocalSequenceSource(TitanoDatabase db, Guid sequenceId, ImageDecoder decoder, JobEngine? engine, ArchiveServiceOptions? lease = null)
|
||||
public LocalSequenceSource(ChronosDatabase db, Guid sequenceId, ImageDecoder decoder, JobEngine? engine, ArchiveServiceOptions? lease = null)
|
||||
{
|
||||
_db = db;
|
||||
_sequenceId = sequenceId;
|
||||
@@ -240,7 +240,7 @@ public sealed class LocalSequenceSource : ISequenceSource
|
||||
}
|
||||
|
||||
/// <summary>The settings in force: the index copy, else <c>project.json</c>, else defaults.</summary>
|
||||
/// <exception cref="EditorException">The settings are not a project or come from a newer Titano.</exception>
|
||||
/// <exception cref="EditorException">The settings are not a project or come from a newer Chronos.</exception>
|
||||
internal static ProjectSettings ReadProject(Sequence sequence, SequencePaths folder)
|
||||
{
|
||||
var json = sequence.SettingsJson ?? (File.Exists(folder.ProjectPath) ? File.ReadAllText(folder.ProjectPath) : null);
|
||||
@@ -1,6 +1,6 @@
|
||||
using Titano.Core.Imaging;
|
||||
using Chronos.Core.Imaging;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// A video waveform monitor of one picture (BRIEF §12.3 Exposure "waveform"): for each column band, how many pixels
|
||||
@@ -1,9 +1,9 @@
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Ui.Visuals;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Ui.Visuals;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>Motion (BRIEF §12.3): motion blur, flow quality and stabilisation, with the measured camera path (shake) chart.</summary>
|
||||
public sealed class MotionTab : EditorTab
|
||||
+8
-8
@@ -1,13 +1,13 @@
|
||||
using System.Globalization;
|
||||
using Titano.Core.Analysis;
|
||||
using Titano.Core.Export;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Core.Imaging.Geometry;
|
||||
using Titano.Core.Motion;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Core.Render;
|
||||
using Chronos.Core.Analysis;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.Imaging.Geometry;
|
||||
using Chronos.Core.Motion;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Render;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>What the preview shows of the frame: the output picture, or the whole source frame with the crop marked.</summary>
|
||||
public enum PreviewFraming
|
||||
@@ -1,16 +1,16 @@
|
||||
using System.IO;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Shell;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Data.Processing;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Shell;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Data.Processing;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// <c>.titano</c> project files (BRIEF §18): the editor saves one for the open sequence of this PC's archive, and
|
||||
/// opening one (a double-click, which Windows passes to Titano.exe) opens its sequence in the editor and gives it the
|
||||
/// <c>.chronos</c> project files (BRIEF §18): the editor saves one for the open sequence of this PC's archive, and
|
||||
/// opening one (a double-click, which Windows passes to Chronos.exe) opens its sequence in the editor and gives it the
|
||||
/// file's settings as one undoable step.
|
||||
/// </summary>
|
||||
public sealed class ProjectFiles(ShellViewModel shell)
|
||||
@@ -1,6 +1,6 @@
|
||||
using Titano.Core.Project;
|
||||
using Chronos.Core.Project;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// Undo and redo of the editor's project (Ctrl+Z / Ctrl+Y). Projects are immutable, so each step is a snapshot.
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Text.Json.Nodes;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Data.Sync;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Data.Sync;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// Three-way merge of projects: the editor's edit (<c>ours</c>) and a change stored meanwhile by someone else
|
||||
@@ -1,6 +1,6 @@
|
||||
using Titano.Core.Project;
|
||||
using Chronos.Core.Project;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// Writes the editor's project shortly after the last change: one write at a time, always the newest project, never
|
||||
+21
-21
@@ -3,22 +3,22 @@ using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text.Json;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Analysis;
|
||||
using Titano.Core.Analysis.Deep;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Core.Render;
|
||||
using Titano.Data.Archiving.Jobs;
|
||||
using Titano.Data.Jobs;
|
||||
using Titano.Data.Sync;
|
||||
using Titano.Protocol;
|
||||
using Titano.Protocol.Client;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Analysis;
|
||||
using Chronos.Core.Analysis.Deep;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Core.Render;
|
||||
using Chronos.Data.Archiving.Jobs;
|
||||
using Chronos.Data.Jobs;
|
||||
using Chronos.Data.Sync;
|
||||
using Chronos.Protocol;
|
||||
using Chronos.Protocol.Client;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// A server sequence opened with proxies (BRIEF §4.4, §14.5 "edit with proxies, render where the originals are"):
|
||||
@@ -171,7 +171,7 @@ public sealed class RemoteSequenceSource : ISequenceSource
|
||||
Volatile.Write(ref _stored, new Stored(merged, updated.SettingsVersion));
|
||||
return merged;
|
||||
}
|
||||
catch (TitanoApiException ex) when (ex.Status == HttpStatusCode.Conflict)
|
||||
catch (ChronosApiException ex) when (ex.Status == HttpStatusCode.Conflict)
|
||||
{
|
||||
// Changed on the server since this editor read it, its settings or its frames: other frames make the
|
||||
// editor outdated (its proxies are not the server's), otherwise the edit merges again on top of the
|
||||
@@ -304,7 +304,7 @@ public sealed class RemoteSequenceSource : ISequenceSource
|
||||
if (JobWire.FromDto(await _api.GetJobAsync(jobId, cancellationToken).ConfigureAwait(false)) is { } job && Concerns(job)) Publish(job);
|
||||
else _foreign[jobId] = 0;
|
||||
}
|
||||
catch (Exception ex) when (ex is TitanoApiException or HttpRequestException or JsonException
|
||||
catch (Exception ex) when (ex is ChronosApiException or HttpRequestException or JsonException
|
||||
|| (ex is OperationCanceledException && !cancellationToken.IsCancellationRequested))
|
||||
{
|
||||
Log.Info("editor", $"Job {jobId} could not be read: {ex.Message}");
|
||||
@@ -318,7 +318,7 @@ public sealed class RemoteSequenceSource : ISequenceSource
|
||||
{
|
||||
Compare(await _api.GetManifestAsync(Id, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
catch (Exception ex) when (ex is TitanoApiException or HttpRequestException or JsonException
|
||||
catch (Exception ex) when (ex is ChronosApiException or HttpRequestException or JsonException
|
||||
|| (ex is OperationCanceledException && !cancellationToken.IsCancellationRequested))
|
||||
{
|
||||
Log.Info("editor", $"The frames of {_remote.Sequence.DisplayTitle} could not be compared: {ex.Message}");
|
||||
@@ -332,7 +332,7 @@ public sealed class RemoteSequenceSource : ISequenceSource
|
||||
{
|
||||
return await _api.SetJobPriorityAsync(dto.Id, JobWire.Priority(priority), cancellationToken);
|
||||
}
|
||||
catch (Exception ex) when (ex is TitanoApiException or HttpRequestException)
|
||||
catch (Exception ex) when (ex is ChronosApiException or HttpRequestException)
|
||||
{
|
||||
// Already claimed (409) or refused: the job runs at the user's priority, which is never later than asked.
|
||||
Log.Info("editor", $"Job {dto.Id} keeps the user's priority on the server: {ex.Message}");
|
||||
@@ -392,7 +392,7 @@ public sealed class RemoteSequenceSource : ISequenceSource
|
||||
private Guid HeroFrameId(ProjectSettings project) =>
|
||||
project.HeroFrame is { } hero && (uint)hero < (uint)_remote.Frames.Count ? _remote.Frames[hero].Id : Guid.Empty;
|
||||
|
||||
/// <exception cref="EditorException">The settings are not a project or come from a newer Titano.</exception>
|
||||
/// <exception cref="EditorException">The settings are not a project or come from a newer Chronos.</exception>
|
||||
private static ProjectSettings Parse(string? json)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(json)) return new ProjectSettings();
|
||||
@@ -429,7 +429,7 @@ public sealed class RemoteSequenceSource : ISequenceSource
|
||||
{
|
||||
return await call();
|
||||
}
|
||||
catch (TitanoApiException ex) when (ex.Status == HttpStatusCode.NotFound)
|
||||
catch (ChronosApiException ex) when (ex.Status == HttpStatusCode.NotFound)
|
||||
{
|
||||
throw new EditorException(Loc.L("Editor.Error.Missing"), ex);
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Data.Sync;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Data.Sync;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>This PC's project kept by "Save both" when a sync conflict was settled (BRIEF §12.7), local time of the choice.</summary>
|
||||
public sealed record SavedCopy(string Path, DateTime SavedAt)
|
||||
@@ -14,10 +14,10 @@ public sealed record SavedCopy(string Path, DateTime SavedAt)
|
||||
public string Label => SavedAt.ToString("g", Loc.Culture);
|
||||
}
|
||||
|
||||
/// <summary>The "Save both" copies of a sequence: <c>.titano/project.this-pc-<time>.json</c> beside <c>project.json</c>.</summary>
|
||||
/// <summary>The "Save both" copies of a sequence: <c>.chronos/project.this-pc-<time>.json</c> beside <c>project.json</c>.</summary>
|
||||
public static class SavedCopies
|
||||
{
|
||||
/// <summary>The copies in a sequence's <c>.titano</c> folder, newest first; none when the folder cannot be read.</summary>
|
||||
/// <summary>The copies in a sequence's <c>.chronos</c> folder, newest first; none when the folder cannot be read.</summary>
|
||||
public static IReadOnlyList<SavedCopy> List(string metaDirectory)
|
||||
{
|
||||
try
|
||||
@@ -35,7 +35,7 @@ public static class SavedCopies
|
||||
}
|
||||
|
||||
/// <summary>The project of a copy.</summary>
|
||||
/// <exception cref="InvalidDataException">The copy is gone, unreadable, or not a project of this Titano.</exception>
|
||||
/// <exception cref="InvalidDataException">The copy is gone, unreadable, or not a project of this Chronos.</exception>
|
||||
public static ProjectSettings Read(SavedCopy copy)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(copy);
|
||||
@@ -1,6 +1,6 @@
|
||||
using Titano.Core.Model;
|
||||
using Chronos.Core.Model;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// The analyses and renders of the open sequence that wait, run or are paused, as the source reports them (BRIEF §12.3
|
||||
@@ -1,11 +1,11 @@
|
||||
using System.Numerics;
|
||||
using System.Windows.Input;
|
||||
using Titano.Core.Advice;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Project;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.Core.Advice;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Editor;
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>One row of a section's settings column; <see cref="Refresh"/> re-reads the project after any change.</summary>
|
||||
public abstract class SettingRow(string headerKey, string toolTipKey) : LocalizedViewModel
|
||||
+5
-5
@@ -1,8 +1,8 @@
|
||||
using Titano.Core.Import;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Data;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// The verification result of an archive import job (BRIEF §12.4): every planned copy matched to its own committed frame,
|
||||
@@ -11,7 +11,7 @@ namespace Titano.App.Import;
|
||||
public static class ArchiveImportCheck
|
||||
{
|
||||
/// <param name="cardId">The card the job recorded its history for; null for a folder source.</param>
|
||||
public static async Task<ImportOutcome> CheckAsync(TitanoDatabase db, Guid archiveId, ImportPlan plan, Job job, Guid? cardId, bool verified,
|
||||
public static async Task<ImportOutcome> CheckAsync(ChronosDatabase db, Guid archiveId, ImportPlan plan, Job job, Guid? cardId, bool verified,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var errors = ImportOutcome.JobErrors(job.LogTail);
|
||||
@@ -1,6 +1,6 @@
|
||||
using Titano.Core.Localization;
|
||||
using Chronos.Core.Localization;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// Paths, volume serials and other left-to-right fragments inside a sentence of a right-to-left language (BRIEF §16):
|
||||
@@ -1,10 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Data.Repositories;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Data.Repositories;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// A camera profile (BRIEF §13): import settings shared by every card of one camera model. The cards in
|
||||
@@ -37,7 +37,7 @@ public static class CameraProfiles
|
||||
}
|
||||
|
||||
/// <summary>Camera profiles in the index's application settings, one per camera model.</summary>
|
||||
public sealed class CameraProfileStore(TitanoDatabase db)
|
||||
public sealed class CameraProfileStore(ChronosDatabase db)
|
||||
{
|
||||
private const string KeyPrefix = "import.cameraProfile.";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Import;
|
||||
using Titano.Core.Localization;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.Localization;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// What may be done to the card after an import (BRIEF §0.2 rule 8, §12.4, §13). Deleting needs a recorded,
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Globalization;
|
||||
using Titano.Data.Archiving;
|
||||
using Chronos.Data.Archiving;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// A volume the Import screen offers (BRIEF §12.4, §13): a removable volume, or any volume with a <c>DCIM</c> folder.
|
||||
@@ -1,14 +1,14 @@
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Import;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Metadata;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Naming;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Metadata;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Naming;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
public enum SourceKind
|
||||
{
|
||||
@@ -97,7 +97,7 @@ public sealed record ImportSource(string Key, SourceKind Kind, CardDevice? Devic
|
||||
/// </summary>
|
||||
public string ToolTip => Kind == SourceKind.Drive ? Subtitle : string.Join(Loc.Separator, new[] { StateText, Subtitle }.Where(t => t.Length > 0));
|
||||
|
||||
/// <summary>"Canon EOS R5 · 4,812 photos": the insertion toast's line; "not yet known to Titano" for a new card.</summary>
|
||||
/// <summary>"Canon EOS R5 · 4,812 photos": the insertion toast's line; "not yet known to Chronos" for a new card.</summary>
|
||||
public string ToastText
|
||||
{
|
||||
get
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.IO;
|
||||
using Titano.Core.Archiving;
|
||||
using Chronos.Core.Archiving;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>A card file's size and write time.</summary>
|
||||
public readonly record struct CardFileStamp(long Size, DateTime ModifiedUtc);
|
||||
@@ -1,9 +1,9 @@
|
||||
using Titano.Core.Import;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Naming;
|
||||
using Titano.Data.Archiving;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Naming;
|
||||
using Chronos.Data.Archiving;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>Where the photos go (BRIEF §12.4): this PC's archive, a plain folder, or the signed-in server.</summary>
|
||||
public enum ImportDestinationKind
|
||||
+8
-8
@@ -1,14 +1,14 @@
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Text.RegularExpressions;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Import;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Protocol.Client;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Protocol.Client;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>Plans an import into one destination (BRIEF §12.4); nothing is written.</summary>
|
||||
public interface IImportDestination
|
||||
@@ -240,6 +240,6 @@ public static class LocalImport
|
||||
|
||||
/// <summary>The card left, or the destination as a whole failed: its disk, the connection, the sign-in or the server (a timeout too).</summary>
|
||||
private static bool Stops(Exception ex) =>
|
||||
ex is IOException or UnauthorizedAccessException or HttpRequestException or TitanoApiException or UntrustedCertificateException
|
||||
ex is IOException or UnauthorizedAccessException or HttpRequestException or ChronosApiException or UntrustedCertificateException
|
||||
or InvalidOperationException or OperationCanceledException;
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Text.RegularExpressions;
|
||||
using Titano.App.Shell;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Import;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Data;
|
||||
using Titano.Protocol.Client;
|
||||
using Chronos.App.Shell;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Data;
|
||||
using Chronos.Protocol.Client;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// What the Import screen says when an import or its plan stops (BRIEF §0.2 rule 6: one sentence saying what
|
||||
@@ -34,7 +34,7 @@ public static class ImportFailures
|
||||
ImportSourceUnavailableException => Loc.L("Import.Failed.SourceGone", source),
|
||||
IOException { HResult: DiskFull or HandleDiskFull } => Loc.L("Import.Failed.Full"),
|
||||
UnauthorizedAccessException => Loc.L("Import.Failed.Access"),
|
||||
TitanoApiException or HttpRequestException or UntrustedCertificateException => Loc.L("Import.Failed.Server"),
|
||||
ChronosApiException or HttpRequestException or UntrustedCertificateException => Loc.L("Import.Failed.Server"),
|
||||
_ => Loc.L("Import.Failed.Other"),
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ public static class ImportFailures
|
||||
/// </summary>
|
||||
public static string Stop(Exception ex, string source, bool stagesOnThisPc = false) => ex switch
|
||||
{
|
||||
TitanoApiException or HttpRequestException or UntrustedCertificateException or OperationCanceledException => ErrorText.ForServer(ex),
|
||||
ChronosApiException or HttpRequestException or UntrustedCertificateException or OperationCanceledException => ErrorText.ForServer(ex),
|
||||
IOException { HResult: DiskFull or HandleDiskFull } when stagesOnThisPc => Loc.L("Import.Failed.CacheFull"),
|
||||
UnauthorizedAccessException when stagesOnThisPc => Loc.L("Import.Failed.CacheAccess"),
|
||||
_ => Import(ex, source),
|
||||
@@ -1,10 +1,10 @@
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Import;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Naming;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Naming;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>Figures of a plan for the Plan panel header and the Import button (Import.html).</summary>
|
||||
public sealed record PlanTotals(int Sessions, int Photos, int CopyCount, long CopyBytes, int Duplicates, int ImportedBefore, int Problems,
|
||||
+11
-11
@@ -1,17 +1,17 @@
|
||||
using System.IO;
|
||||
using System.Windows.Input;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Shell;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Import;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Ui.Controls;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Shell;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Ui.Controls;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// The end of an import (BRIEF §12.4, §13): the verification result and the after-import actions — check the card
|
||||
@@ -1,9 +1,9 @@
|
||||
using Titano.App.Sections;
|
||||
using Titano.App.Shell;
|
||||
using Titano.Core.Import;
|
||||
using Titano.Data;
|
||||
using Chronos.App.Sections;
|
||||
using Chronos.App.Shell;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Data;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// The Import states that <c>--capture</c> renders (<c>import-<state>-<theme>.png</c>) and the screen smoke
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
using System.Windows.Input;
|
||||
using Titano.App.Settings;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.App.Settings;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// A session of the plan with its editable title (the sequence title; empty keeps the folder name) and its merge into
|
||||
@@ -1,15 +1,15 @@
|
||||
using System.IO;
|
||||
using Titano.App.DesignTime;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Codecs.Jpeg;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Core.Import;
|
||||
using Titano.Core.Metadata;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Repositories;
|
||||
using Chronos.App.DesignTime;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Codecs.Jpeg;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.Metadata;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Repositories;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// Capture and smoke-test data ONLY (<c>--capture</c>, never the user's data): a simulated Canon EOS R5 card in the
|
||||
@@ -38,13 +38,13 @@ public static class SampleCards
|
||||
new(Path.Combine(dataDirectory, "card") + Path.DirectorySeparatorChar, "EOS_DIGITAL", Serial, 127_865_454_592, 31_665_454_592, IsRemovable: true,
|
||||
HasDcim: true);
|
||||
|
||||
/// <summary>A Sony card Titano has never seen (the nickname field and the "new card" toast).</summary>
|
||||
/// <summary>A Sony card Chronos has never seen (the nickname field and the "new card" toast).</summary>
|
||||
public static CardDevice NewCard(string dataDirectory) =>
|
||||
new(Path.Combine(dataDirectory, "newcard") + Path.DirectorySeparatorChar, "SONY", 0x2B7E1A09, 63_864_569_856, 60_120_000_000, IsRemovable: true,
|
||||
HasDcim: true);
|
||||
|
||||
/// <summary>Writes the cards' photos, remembers two cards (the inserted one with its last import) and inserts both cards and a USB drive.</summary>
|
||||
public static async Task InsertAsync(TitanoDatabase db, SampleDeviceMonitor devices, string dataDirectory)
|
||||
public static async Task InsertAsync(ChronosDatabase db, SampleDeviceMonitor devices, string dataDirectory)
|
||||
{
|
||||
var card = Card(dataDirectory);
|
||||
WritePhotos(Path.Combine(card.Root, "DCIM", "100CANON"), "IMG_", Sessions, "Canon", "Canon EOS R5", "0431");
|
||||
+12
-12
@@ -1,12 +1,12 @@
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using Titano.App.Shell;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Import;
|
||||
using Titano.Protocol;
|
||||
using Titano.Protocol.Client;
|
||||
using Chronos.App.Shell;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Protocol;
|
||||
using Chronos.Protocol.Client;
|
||||
|
||||
namespace Titano.App.Import;
|
||||
namespace Chronos.App.Import;
|
||||
|
||||
/// <summary>
|
||||
/// Import destination "Server" (BRIEF §12.4, §14.4): each verified copy staged on this PC is uploaded with the
|
||||
@@ -18,7 +18,7 @@ namespace Titano.App.Import;
|
||||
/// stops it. A file the server already held counts as a duplicate: the server answers so only for a copy that is not
|
||||
/// flagged missing or damaged, and a server import never deletes anything from the card.
|
||||
/// </summary>
|
||||
public sealed class ServerImportSink(TitanoClient client, string stagingDirectory) : IImportSink
|
||||
public sealed class ServerImportSink(ChronosClient client, string stagingDirectory) : IImportSink
|
||||
{
|
||||
private readonly HashSet<Guid> _titled = [];
|
||||
|
||||
@@ -71,7 +71,7 @@ public sealed class ServerImportSink(TitanoClient client, string stagingDirector
|
||||
Report.Committed[file.Item.SourcePath] = result;
|
||||
results.Add(result);
|
||||
}
|
||||
catch (TitanoApiException ex) when (IsRefusal(ex))
|
||||
catch (ChronosApiException ex) when (IsRefusal(ex))
|
||||
{
|
||||
// The executor has no failed commit: the refusal travels in the report, which turns this result into a failure. The
|
||||
// server words its refusal in the client's language; one without words reads as the catalog's sentence.
|
||||
@@ -97,14 +97,14 @@ public sealed class ServerImportSink(TitanoClient client, string stagingDirector
|
||||
{
|
||||
await client.UpdateSequenceAsync(sequenceId, new UpdateSequenceRequest(title, null, null, null, null, null), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (TitanoApiException ex) when (IsRefusal(ex))
|
||||
catch (ChronosApiException ex) when (IsRefusal(ex))
|
||||
{
|
||||
Log.Warning("import", $"The server refused the title of sequence {sequenceId}", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The server refused this file; other files may still go through (unlike a busy server or a lost sign-in).</summary>
|
||||
private static bool IsRefusal(TitanoApiException ex) =>
|
||||
private static bool IsRefusal(ChronosApiException ex) =>
|
||||
!ex.IsTransient && ex.Status is not (HttpStatusCode.Unauthorized or HttpStatusCode.Forbidden) && (int)ex.Status is >= 400 and < 500;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public sealed class ServerImportSink(TitanoClient client, string stagingDirector
|
||||
/// whatever is still on its way is given up.
|
||||
/// </summary>
|
||||
/// <param name="total">Photos of the plan, skipped ones included (like <see cref="ImportProgress.ItemsTotal"/>).</param>
|
||||
public sealed class CardImportReporter(TitanoClient client, Guid importId, string card, int total, TimeProvider? time = null)
|
||||
public sealed class CardImportReporter(ChronosClient client, Guid importId, string card, int total, TimeProvider? time = null)
|
||||
{
|
||||
private static readonly TimeSpan ProgressInterval = TimeSpan.FromSeconds(1);
|
||||
private static readonly TimeSpan SendTimeout = TimeSpan.FromSeconds(10);
|
||||
@@ -228,7 +228,7 @@ public sealed class CardImportReporter(TitanoClient client, Guid importId, strin
|
||||
{
|
||||
// The import is over and did not wait for this one.
|
||||
}
|
||||
catch (TitanoApiException ex) when (ex.Status is HttpStatusCode.NotFound or HttpStatusCode.MethodNotAllowed)
|
||||
catch (ChronosApiException ex) when (ex.Status is HttpStatusCode.NotFound or HttpStatusCode.MethodNotAllowed)
|
||||
{
|
||||
// A server from before card events.
|
||||
lock (_gate) _unsupported = true;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// Today's date for screens that lay themselves out around it (the Library timeline's years, the months of the
|
||||
+7
-7
@@ -1,14 +1,14 @@
|
||||
using System.IO;
|
||||
using Titano.Core.Windows.Shell;
|
||||
using Chronos.Core.Windows.Shell;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// Where the client keeps its data (BRIEF §6.2, <see cref="AppPaths"/>): <c>%LOCALAPPDATA%\Titano</c>, or <c>.\data</c>
|
||||
/// Where the client keeps its data (BRIEF §6.2, <see cref="AppPaths"/>): <c>%LOCALAPPDATA%\Chronos</c>, or <c>.\data</c>
|
||||
/// next to the executable when <c>portable.txt</c> exists. Never inside a folder OneDrive synchronises (SQLite corrupts
|
||||
/// there): a portable copy in one keeps its data in <c>%LOCALAPPDATA%\Titano</c>, and Settings tells the user so
|
||||
/// there): a portable copy in one keeps its data in <c>%LOCALAPPDATA%\Chronos</c>, and Settings tells the user so
|
||||
/// (<see cref="PortableSyncRoot"/>, <see cref="EarlierPortableData"/>). When that folder itself lies in one, nowhere
|
||||
/// is safe: Titano starts all the same and Settings warns (<see cref="SyncedFolder"/>).
|
||||
/// is safe: Chronos starts all the same and Settings warns (<see cref="SyncedFolder"/>).
|
||||
/// </summary>
|
||||
public sealed class AppEnvironment
|
||||
{
|
||||
@@ -35,7 +35,7 @@ public sealed class AppEnvironment
|
||||
/// <summary>The OneDrive folder <see cref="DataDirectory"/> itself lies in, where the index may be damaged; null when it is safe.</summary>
|
||||
public string? SyncedFolder { get; }
|
||||
|
||||
/// <summary>The OneDrive folder this portable copy runs from; its data is in <c>%LOCALAPPDATA%\Titano</c> instead of <c>.\data</c>. Null otherwise.</summary>
|
||||
/// <summary>The OneDrive folder this portable copy runs from; its data is in <c>%LOCALAPPDATA%\Chronos</c> instead of <c>.\data</c>. Null otherwise.</summary>
|
||||
public string? PortableSyncRoot { get; }
|
||||
|
||||
/// <summary>The <c>.\data</c> folder this portable copy used before it ran from OneDrive, left as it was; null when there is none.</summary>
|
||||
@@ -59,7 +59,7 @@ public sealed class AppEnvironment
|
||||
|
||||
/// <summary>A fresh temporary data folder for screenshots and smoke tests; delete it with <see cref="DeleteCaptureData"/>.</summary>
|
||||
public static AppEnvironment ForCapture() =>
|
||||
new(Path.Combine(Path.GetTempPath(), "titano-capture-" + Guid.CreateVersion7().ToString("N")), portable: false, isCapture: true);
|
||||
new(Path.Combine(Path.GetTempPath(), "chronos-capture-" + Guid.CreateVersion7().ToString("N")), portable: false, isCapture: true);
|
||||
|
||||
/// <summary>Removes the temporary data folder of a capture environment (never a real one).</summary>
|
||||
public void DeleteCaptureData()
|
||||
+31
-31
@@ -2,29 +2,29 @@ using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using Titano.App.About;
|
||||
using Titano.App.Archiving;
|
||||
using Titano.App.Import;
|
||||
using Titano.App.Jobs;
|
||||
using Titano.App.Library;
|
||||
using Titano.App.Server;
|
||||
using Titano.App.Settings;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Export;
|
||||
using Titano.Core.Imaging;
|
||||
using Titano.Core.Imaging.Decoders;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Video.Managed;
|
||||
using Titano.Core.Windows.MediaFoundation;
|
||||
using Titano.Core.Windows.Wic;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Data.Jobs;
|
||||
using Titano.Data.Processing;
|
||||
using Titano.Protocol.Client;
|
||||
using Chronos.App.About;
|
||||
using Chronos.App.Archiving;
|
||||
using Chronos.App.Import;
|
||||
using Chronos.App.Jobs;
|
||||
using Chronos.App.Library;
|
||||
using Chronos.App.Server;
|
||||
using Chronos.App.Settings;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Imaging;
|
||||
using Chronos.Core.Imaging.Decoders;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Video.Managed;
|
||||
using Chronos.Core.Windows.MediaFoundation;
|
||||
using Chronos.Core.Windows.Wic;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Data.Jobs;
|
||||
using Chronos.Data.Processing;
|
||||
using Chronos.Protocol.Client;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// Composition root of local mode (BRIEF §4.4): the SQLite index under the data folder (migrated on open, a restore
|
||||
@@ -68,10 +68,10 @@ public sealed class AppServices : IAsyncDisposable
|
||||
_renderNode = new RenderNodeHost(StartRenderNode);
|
||||
ArchiveSetup = new EngineArchiveSetup(this);
|
||||
Sync = new SyncHost(this);
|
||||
Server = new ServerSession(settings, saveSettings, new TitanoServerApiFactory(), new DpapiTokenProtector());
|
||||
Server = new ServerSession(settings, saveSettings, new ChronosServerApiFactory(), new DpapiTokenProtector());
|
||||
Encoders = new MediaFoundationInventory();
|
||||
Formats = new WicFormatInventory(() => _wic);
|
||||
CheckForUpdateAsync = ct => UpdateCheck.FetchAsync(Http.Value, ProductLinks.LatestReleaseApi, VersionText, ct);
|
||||
CheckForUpdateAsync = ct => UpdateCheck.FetchAsync(Http.Value, ProductLinks.StableReleasesApi, VersionText, ct);
|
||||
DownloadUpdateAsync = (release, progress, ct) =>
|
||||
UpdateDownload.DownloadAsync(DownloadHttp.Value, release, environment.IsPortable, UpdateDownload.Root(Path.GetTempPath()), VersionText, progress,
|
||||
UpdateDownload.IdleTimeout, ct);
|
||||
@@ -122,14 +122,14 @@ public sealed class AppServices : IAsyncDisposable
|
||||
/// <summary>Card detection, eject and format (BRIEF §13); started with the index, replaced by a fake in capture.</summary>
|
||||
public IDeviceMonitor Devices { get; set; } = new WindowsDeviceMonitor();
|
||||
|
||||
/// <summary>Latest public release (GitHub Releases API of the releases repository, BRIEF §18).</summary>
|
||||
/// <summary>Latest public release (Gitea releases API of the releases repository, BRIEF §18).</summary>
|
||||
public Func<CancellationToken, Task<ReleaseInfo?>> CheckForUpdateAsync { get; set; }
|
||||
|
||||
/// <summary>Downloads and verifies the package of a release for this copy (setup, or portable zip; BRIEF §18 P1) and returns its path.</summary>
|
||||
public Func<ReleaseInfo, IProgress<double>?, CancellationToken, Task<string>> DownloadUpdateAsync { get; set; }
|
||||
|
||||
/// <summary>The index; null until <see cref="OpenAsync"/> succeeded.</summary>
|
||||
public TitanoDatabase? Database { get; private set; }
|
||||
public ChronosDatabase? Database { get; private set; }
|
||||
|
||||
public JobEngine? Engine { get; private set; }
|
||||
|
||||
@@ -224,7 +224,7 @@ public sealed class AppServices : IAsyncDisposable
|
||||
await RestoreStagedAsync(databasePath, ct);
|
||||
try
|
||||
{
|
||||
Database = await Task.Run(() => TitanoDatabase.OpenAsync(DatabaseOptions.Sqlite(databasePath), ct), ct);
|
||||
Database = await Task.Run(() => ChronosDatabase.OpenAsync(DatabaseOptions.Sqlite(databasePath), ct), ct);
|
||||
Log.Info("app", $"Index open (schema {Database.SchemaVersion}) at {databasePath}");
|
||||
}
|
||||
catch (Exception ex) when (ex is DatabaseException or System.IO.IOException or UnauthorizedAccessException or DllNotFoundException)
|
||||
@@ -242,7 +242,7 @@ public sealed class AppServices : IAsyncDisposable
|
||||
}
|
||||
|
||||
/// <summary>Uses an already open index (capture, tests) instead of opening one; sample data keeps the engine stopped.</summary>
|
||||
public async Task AttachAsync(TitanoDatabase database, bool startEngine = true, CancellationToken ct = default)
|
||||
public async Task AttachAsync(ChronosDatabase database, bool startEngine = true, CancellationToken ct = default)
|
||||
{
|
||||
Database = database;
|
||||
await StartJobsAsync(database, startEngine, ct);
|
||||
@@ -377,7 +377,7 @@ public sealed class AppServices : IAsyncDisposable
|
||||
}
|
||||
}
|
||||
|
||||
private async Task StartJobsAsync(TitanoDatabase database, bool startEngine, CancellationToken ct)
|
||||
private async Task StartJobsAsync(ChronosDatabase database, bool startEngine, CancellationToken ct)
|
||||
{
|
||||
_wic = new WicDecoderProvider();
|
||||
var archive = new ArchiveServiceOptions
|
||||
@@ -432,7 +432,7 @@ public sealed class AppServices : IAsyncDisposable
|
||||
var processing = Processing ?? throw new InvalidOperationException("The index is not open.");
|
||||
var cache = CacheStore.Folder(Environment, Settings);
|
||||
CacheStore.Prepare(cache);
|
||||
var client = new TitanoClient(session.Address, new CertificatePinning(session.TrustedFingerprints), $"Titano ({System.Environment.MachineName})")
|
||||
var client = new ChronosClient(session.Address, new CertificatePinning(session.TrustedFingerprints), $"Chronos ({System.Environment.MachineName})")
|
||||
{
|
||||
Token = session.Token,
|
||||
};
|
||||
@@ -447,7 +447,7 @@ public sealed class AppServices : IAsyncDisposable
|
||||
}
|
||||
|
||||
/// <summary>A started node and the client it owns.</summary>
|
||||
private sealed class RunningNode(RenderNodeClient node, TitanoClient client) : IRenderNode
|
||||
private sealed class RunningNode(RenderNodeClient node, ChronosClient client) : IRenderNode
|
||||
{
|
||||
public Task Completion => node.Completion;
|
||||
|
||||
+9
-9
@@ -1,16 +1,16 @@
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Titano.Core.Analysis.Deep;
|
||||
using Titano.Core.Archiving;
|
||||
using Titano.Core.Import;
|
||||
using Titano.Core.IO;
|
||||
using Titano.Core.Naming;
|
||||
using Titano.Data.Archiving;
|
||||
using Titano.Data.Repositories;
|
||||
using Titano.Ui.Theming;
|
||||
using Chronos.Core.Analysis.Deep;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.IO;
|
||||
using Chronos.Core.Naming;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Data.Repositories;
|
||||
using Chronos.Ui.Theming;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>Library presentation (BRIEF §12.2).</summary>
|
||||
public enum LibraryLayout
|
||||
+7
-7
@@ -1,9 +1,9 @@
|
||||
using System.IO;
|
||||
using Titano.App.Archiving;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Data.Archiving;
|
||||
using Chronos.App.Archiving;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Data.Archiving;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// First-run and Library archive choices (BRIEF §12.1): create a local archive or adopt an existing folder tree.
|
||||
@@ -13,7 +13,7 @@ public interface IArchiveSetup
|
||||
/// <summary>Creates (or opens) the local archive rooted at <paramref name="root"/>.</summary>
|
||||
Task CreateAsync(string root, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>Indexes the photos under <paramref name="folder"/> in place, or opens a previous Titano archive there.</summary>
|
||||
/// <summary>Indexes the photos under <paramref name="folder"/> in place, or opens a previous Chronos archive there.</summary>
|
||||
Task AdoptAsync(string folder, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
@@ -79,9 +79,9 @@ public static class ArchiveActions
|
||||
/// <summary>Archive roots offered by default and their free space.</summary>
|
||||
public static class ArchiveLocations
|
||||
{
|
||||
public const string DefaultFolderName = "TitanoArchive";
|
||||
public const string DefaultFolderName = "ChronosArchive";
|
||||
|
||||
/// <summary>"<fixed drive with the most free space>\TitanoArchive".</summary>
|
||||
/// <summary>"<fixed drive with the most free space>\ChronosArchive".</summary>
|
||||
public static string SuggestRoot()
|
||||
{
|
||||
try
|
||||
+19
-19
@@ -2,15 +2,15 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Titano.App.Settings;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Export;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Core.Windows.Codecs;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Sqlite;
|
||||
using Chronos.App.Settings;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Export;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Core.Windows.Codecs;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Sqlite;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// The diagnostics bundle of About and Settings › Advanced (BRIEF §12.9, §22 Phase 8): an environment report, the codec
|
||||
@@ -24,7 +24,7 @@ public static class DiagnosticsBundle
|
||||
public const int FailedJobs = 50;
|
||||
|
||||
/// <summary>
|
||||
/// Writes "Titano diagnostics yyyy-MM-dd HHmm.zip" (" (2)", " (3)"… when that name is taken) into
|
||||
/// Writes "Chronos diagnostics yyyy-MM-dd HHmm.zip" (" (2)", " (3)"… when that name is taken) into
|
||||
/// <paramref name="folder"/> and returns its path; a bundle that fails half-way leaves no file behind. Call on the UI
|
||||
/// thread: the settings are captured there; detection and writing run in the background.
|
||||
/// </summary>
|
||||
@@ -36,7 +36,7 @@ public static class DiagnosticsBundle
|
||||
{
|
||||
var failures = services.Database is { } db ? (await db.Jobs.ListAsync(JobState.Failed, FailedJobs, null, ct).ConfigureAwait(false)).Items : [];
|
||||
var codecs = Codecs(services.Encoders);
|
||||
var path = ExportNaming.Unique(folder, $"Titano diagnostics {DateTime.Now.ToString("yyyy-MM-dd HHmm", CultureInfo.InvariantCulture)}", ".zip");
|
||||
var path = ExportNaming.Unique(folder, $"Chronos diagnostics {DateTime.Now.ToString("yyyy-MM-dd HHmm", CultureInfo.InvariantCulture)}", ".zip");
|
||||
var temp = path + ".tmp";
|
||||
try
|
||||
{
|
||||
@@ -64,7 +64,7 @@ public static class DiagnosticsBundle
|
||||
public static string Report(AppEnvironment environment, IEnumerable<string>? extraLines = null)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"Titano {AppServices.VersionText}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"Chronos {AppServices.VersionText}");
|
||||
sb.Append(DiagnosticsArchive.SystemReport());
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"Data {environment.DataDirectory} (portable: {environment.IsPortable})");
|
||||
if (extraLines is not null)
|
||||
@@ -74,7 +74,7 @@ public static class DiagnosticsBundle
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static string DatabaseLine(TitanoDatabase? database)
|
||||
private static string DatabaseLine(ChronosDatabase? database)
|
||||
{
|
||||
if (database is null) return "Index not open\n";
|
||||
var line = string.Create(CultureInfo.InvariantCulture, $"Index schema {database.SchemaVersion}\n");
|
||||
@@ -115,26 +115,26 @@ public static class DiagnosticsBundle
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The disk cache (spilled frames, thumbnails): its folder, its size and clearing it. Only a folder Titano created
|
||||
/// The disk cache (spilled frames, thumbnails): its folder, its size and clearing it. Only a folder Chronos created
|
||||
/// (it carries a marker file) is ever emptied, so pointing the cache at a folder with user files cannot delete them.
|
||||
/// </summary>
|
||||
public static class CacheStore
|
||||
{
|
||||
public const string MarkerFile = ".titano-cache";
|
||||
public const string MarkerFile = ".chronos-cache";
|
||||
|
||||
/// <summary>The cache folder in effect.</summary>
|
||||
public static string Folder(AppEnvironment environment, AppSettings settings) =>
|
||||
string.IsNullOrWhiteSpace(settings.CacheFolder) ? environment.CacheDirectory : settings.CacheFolder!;
|
||||
|
||||
/// <summary>Creates the folder (if needed) and marks it as Titano's.</summary>
|
||||
/// <summary>Creates the folder (if needed) and marks it as Chronos's.</summary>
|
||||
public static void Prepare(string folder)
|
||||
{
|
||||
Directory.CreateDirectory(folder);
|
||||
var marker = Path.Combine(folder, MarkerFile);
|
||||
if (!File.Exists(marker)) File.WriteAllText(marker, "Titano cache folder. Its contents can be deleted at any time.");
|
||||
if (!File.Exists(marker)) File.WriteAllText(marker, "Chronos cache folder. Its contents can be deleted at any time.");
|
||||
}
|
||||
|
||||
/// <summary>True when <paramref name="folder"/> is a Titano cache folder (safe to empty).</summary>
|
||||
/// <summary>True when <paramref name="folder"/> is a Chronos cache folder (safe to empty).</summary>
|
||||
public static bool IsOwned(string folder) => File.Exists(Path.Combine(folder, MarkerFile));
|
||||
|
||||
/// <summary>Total bytes of the files in the cache (0 when missing).</summary>
|
||||
@@ -148,11 +148,11 @@ public static class CacheStore
|
||||
}
|
||||
|
||||
/// <summary>Deletes everything inside an owned cache folder except the marker; returns the bytes freed.</summary>
|
||||
/// <exception cref="InvalidOperationException">The folder is not a Titano cache folder.</exception>
|
||||
/// <exception cref="InvalidOperationException">The folder is not a Chronos cache folder.</exception>
|
||||
public static long Clear(string folder)
|
||||
{
|
||||
if (!Directory.Exists(folder)) return 0;
|
||||
if (!IsOwned(folder)) throw new InvalidOperationException("Not a Titano cache folder: " + folder);
|
||||
if (!IsOwned(folder)) throw new InvalidOperationException("Not a Chronos cache folder: " + folder);
|
||||
long freed = 0;
|
||||
var root = new DirectoryInfo(folder);
|
||||
foreach (var file in root.EnumerateFiles())
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using Titano.Core.Localization;
|
||||
using Chronos.Core.Localization;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>Culture-aware number, size and duration formatting for the UI.</summary>
|
||||
public static class Formatting
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>Texts of a confirmation dialog (DESIGN §4: two buttons, safe action left and default).</summary>
|
||||
public sealed record ConfirmRequest
|
||||
+2
-2
@@ -3,9 +3,9 @@ using System.Windows;
|
||||
using System.Windows.Automation;
|
||||
using System.Windows.Automation.Peers;
|
||||
using System.Windows.Threading;
|
||||
using Titano.Core.Localization;
|
||||
using Chronos.Core.Localization;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// A status line screen readers announce when it changes (a live region): <c>LiveRegion.Text</c> becomes the element's
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>Features a build switches on through MSBuild properties (Directory.Build.props), read from the assembly metadata.</summary>
|
||||
public static class ProductFeatures
|
||||
{
|
||||
/// <summary>
|
||||
/// Monetization (BRIEF §21: ads, the anonymous usage counts consent, the licence) ships disabled until a build sets
|
||||
/// <c>TitanoAdsEnabled=true</c>; until then nothing of it shows.
|
||||
/// <c>ChronosAdsEnabled=true</c>; until then nothing of it shows.
|
||||
/// </summary>
|
||||
public static bool AdsEnabled { get; } = Flag("TitanoAdsEnabled");
|
||||
public static bool AdsEnabled { get; } = Flag("ChronosAdsEnabled");
|
||||
|
||||
private static bool Flag(string key) =>
|
||||
typeof(ProductFeatures).Assembly.GetCustomAttributes<AssemblyMetadataAttribute>().FirstOrDefault(a => a.Key == key)?.Value is { } value
|
||||
@@ -0,0 +1,51 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// Public links (BRIEF §19.4, amended 2026-10-23, R2): the Gitea repository that publishes the releases. Release
|
||||
/// builds pass the repository they publish to as the ChronosReleasesUrl property.
|
||||
/// </summary>
|
||||
public static class ProductLinks
|
||||
{
|
||||
/// <summary>The repository of local builds, as Directory.Build.props sets it.</summary>
|
||||
public const string DefaultRepository = "https://gitea.encke-hake.ts.net/BalboSoft/Chronos";
|
||||
|
||||
/// <summary>"https://host/owner/name" of the releases repository.</summary>
|
||||
public static string Repository { get; } = Normalise(
|
||||
typeof(ProductLinks).Assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
|
||||
.FirstOrDefault(a => a.Key == "ChronosReleasesUrl")?.Value) ?? DefaultRepository;
|
||||
|
||||
public static string Releases => $"{Repository}/releases";
|
||||
|
||||
/// <summary>The published stable releases, from which the update check takes the newest (BRIEF §18).</summary>
|
||||
public static string StableReleasesApi => StableReleasesApiOf(Repository);
|
||||
|
||||
/// <summary>The licence (EULA) at the root of the releases repository (BRIEF §12.9).</summary>
|
||||
public static string Licence => $"{Repository}/src/branch/main/EULA.md";
|
||||
|
||||
/// <summary>Where translations are reviewed by the community (BRIEF §16).</summary>
|
||||
public static string Issues => $"{Repository}/issues";
|
||||
|
||||
/// <summary>
|
||||
/// The Gitea API address of a repository's published stable releases: "https://host[/prefix]/owner/name" →
|
||||
/// "https://host[/prefix]/api/v1/repos/owner/name/releases?draft=false&pre-release=false&limit=50" (Gitea may
|
||||
/// be served under a path prefix).
|
||||
/// </summary>
|
||||
public static string StableReleasesApiOf(string repository)
|
||||
{
|
||||
var uri = new Uri(repository, UriKind.Absolute);
|
||||
var segments = uri.AbsolutePath.Trim('/').Split('/', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (segments.Length < 2) throw new ArgumentException($"Not a repository address: {repository}", nameof(repository));
|
||||
var prefix = string.Concat(segments[..^2].Select(s => "/" + s));
|
||||
return $"{uri.GetLeftPart(UriPartial.Authority)}{prefix}/api/v1/repos/{segments[^2]}/{segments[^1]}/releases?draft=false&pre-release=false&limit=50";
|
||||
}
|
||||
|
||||
/// <summary>The address without surrounding spaces, trailing slashes or ".git"; null when empty.</summary>
|
||||
internal static string? Normalise(string? repository)
|
||||
{
|
||||
var text = repository?.Trim().TrimEnd('/');
|
||||
if (text is not null && text.EndsWith(".git", StringComparison.OrdinalIgnoreCase)) text = text[..^4];
|
||||
return string.IsNullOrEmpty(text) ? null : text;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using Titano.Core.Diagnostics;
|
||||
using Chronos.Core.Diagnostics;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// What a render node runs with: the server session (address and token), the certificates it may trust and whether it
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
using System.IO;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Windows.Shell;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Windows.Shell;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>The only shell launches the product performs (BRIEF §8.6): open a web or Store link, reveal a folder or file.</summary>
|
||||
public static class ShellActions
|
||||
+17
-17
@@ -4,13 +4,13 @@ using System.IO.Pipes;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Chronos.Core.Diagnostics;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// One Titano per data folder in a Windows session (two would share one index and job engine): a named mutex marks
|
||||
/// the running instance, and a later launch (a double-clicked <c>.titano</c> file, the Start menu) hands its file
|
||||
/// One Chronos per data folder in a Windows session (two would share one index and job engine): a named mutex marks
|
||||
/// the running instance, and a later launch (a double-clicked <c>.chronos</c> file, the Start menu) hands its file
|
||||
/// arguments over a named pipe (current user only), lets the running window come to the front and exits. The running
|
||||
/// instance listens from the moment it holds the mutex, keeping what arrives until its window can take it, and stops
|
||||
/// listening as soon as it starts closing; a launch that gets no answer waits for it to exit and starts in its place.
|
||||
@@ -18,7 +18,7 @@ namespace Titano.App.Infrastructure;
|
||||
/// </summary>
|
||||
public sealed partial class SingleInstance : IDisposable
|
||||
{
|
||||
private const string Header = "TITANO/1";
|
||||
private const string Header = "CHRONOS/1";
|
||||
private const int MaxMessageBytes = 1 << 20;
|
||||
private const int AnyProcess = -1;
|
||||
|
||||
@@ -38,7 +38,7 @@ public sealed partial class SingleInstance : IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The instance guard for <paramref name="dataDirectory"/>, or null when another Titano already uses it in this
|
||||
/// The instance guard for <paramref name="dataDirectory"/>, or null when another Chronos already uses it in this
|
||||
/// session (also one running with administrator rights, whose mutex this launch may not even open).
|
||||
/// </summary>
|
||||
public static SingleInstance? TryAcquire(string dataDirectory)
|
||||
@@ -51,7 +51,7 @@ public sealed partial class SingleInstance : IDisposable
|
||||
}
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
Log.Info("instance", $"Titano runs with administrator rights on this data folder: {ex.Message}");
|
||||
Log.Info("instance", $"Chronos runs with administrator rights on this data folder: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
if (createdNew) return new SingleInstance(mutex, PipeName(dataDirectory));
|
||||
@@ -60,7 +60,7 @@ public sealed partial class SingleInstance : IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Waits up to <paramref name="timeout"/> for the Titano running on <paramref name="dataDirectory"/> to exit (while
|
||||
/// Waits up to <paramref name="timeout"/> for the Chronos running on <paramref name="dataDirectory"/> to exit (while
|
||||
/// it closes it no longer answers hand-overs), then becomes the running instance; null when it still runs, or runs
|
||||
/// with administrator rights.
|
||||
/// </summary>
|
||||
@@ -73,7 +73,7 @@ public sealed partial class SingleInstance : IDisposable
|
||||
}
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
Log.Info("instance", $"Titano runs with administrator rights on this data folder: {ex.Message}");
|
||||
Log.Info("instance", $"Chronos runs with administrator rights on this data folder: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
try
|
||||
@@ -82,8 +82,8 @@ public sealed partial class SingleInstance : IDisposable
|
||||
}
|
||||
catch (AbandonedMutexException)
|
||||
{
|
||||
// The other Titano ended without releasing it (it crashed): this thread owns it now.
|
||||
Log.Warning("instance", "The previous Titano ended without closing");
|
||||
// The other Chronos ended without releasing it (it crashed): this thread owns it now.
|
||||
Log.Warning("instance", "The previous Chronos ended without closing");
|
||||
return new SingleInstance(mutex, PipeName(dataDirectory));
|
||||
}
|
||||
mutex.Dispose();
|
||||
@@ -91,7 +91,7 @@ public sealed partial class SingleInstance : IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends <paramref name="args"/> (absolute paths; empty = just show the window) to the Titano running on
|
||||
/// Sends <paramref name="args"/> (absolute paths; empty = just show the window) to the Chronos running on
|
||||
/// <paramref name="dataDirectory"/>; false when it could not be reached.
|
||||
/// </summary>
|
||||
public static bool HandOver(string dataDirectory, IReadOnlyList<string> args)
|
||||
@@ -108,7 +108,7 @@ public sealed partial class SingleInstance : IDisposable
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or TimeoutException or UnauthorizedAccessException)
|
||||
{
|
||||
Log.Warning("instance", "Could not reach the running Titano", ex);
|
||||
Log.Warning("instance", "Could not reach the running Chronos", ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -199,12 +199,12 @@ public sealed partial class SingleInstance : IDisposable
|
||||
private static string Key(string dataDirectory) =>
|
||||
Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(Path.GetFullPath(dataDirectory).TrimEnd('\\', '/').ToUpperInvariant())))[..16];
|
||||
|
||||
private static string MutexName(string dataDirectory) => @"Local\Titano.App." + Key(dataDirectory);
|
||||
private static string MutexName(string dataDirectory) => @"Local\Chronos.App." + Key(dataDirectory);
|
||||
|
||||
private static string PipeName(string dataDirectory)
|
||||
{
|
||||
using var process = Process.GetCurrentProcess();
|
||||
return $"Titano.App.{process.SessionId}.{Environment.UserName}.{Key(dataDirectory)}";
|
||||
return $"Chronos.App.{process.SessionId}.{Environment.UserName}.{Key(dataDirectory)}";
|
||||
}
|
||||
|
||||
private static async Task ListenAsync(string pipeName, Action<IReadOnlyList<string>> received, CancellationToken ct)
|
||||
@@ -226,13 +226,13 @@ public sealed partial class SingleInstance : IDisposable
|
||||
}
|
||||
catch (UnauthorizedAccessException ex)
|
||||
{
|
||||
// The pipe name belongs to a Titano running with administrator rights: later launches wait instead.
|
||||
// The pipe name belongs to a Chronos running with administrator rights: later launches wait instead.
|
||||
Log.Warning("instance", "Hand-over pipe not available", ex);
|
||||
return;
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
// A pipe of the same name still held by a Titano that is exiting, or a broken connection: try again shortly.
|
||||
// A pipe of the same name still held by a Chronos that is exiting, or a broken connection: try again shortly.
|
||||
Log.Warning("instance", "Hand-over pipe failed; listening again", ex);
|
||||
try
|
||||
{
|
||||
+6
-6
@@ -1,12 +1,12 @@
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
using Microsoft.Win32;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.IO;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.IO;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>Settings › General › Startup: Titano starts when the user signs in to Windows.</summary>
|
||||
/// <summary>Settings › General › Startup: Chronos starts when the user signs in to Windows.</summary>
|
||||
public interface IStartWithWindows
|
||||
{
|
||||
bool IsEnabled { get; }
|
||||
@@ -18,10 +18,10 @@ public interface IStartWithWindows
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <c>HKCU\Software\Microsoft\Windows\CurrentVersion\Run</c> value that starts Titano minimised at sign-in, so inserted
|
||||
/// <c>HKCU\Software\Microsoft\Windows\CurrentVersion\Run</c> value that starts Chronos minimised at sign-in, so inserted
|
||||
/// cards are noticed (BRIEF §12.4) without a window in the way. The registry stays the source of truth because Task
|
||||
/// Manager can turn it off: an entry it turned off (<see cref="StartupApproval"/>) shows as off, and ticking the box
|
||||
/// turns it on again. There is one value for every copy of Titano: a copy shows it as on only when it starts that
|
||||
/// turns it on again. There is one value for every copy of Chronos: a copy shows it as on only when it starts that
|
||||
/// copy, and never takes it over or removes it unless the user ticks or unticks the box there. The uninstaller removes
|
||||
/// it with the Uploader's when it starts a program of the folder it removes.
|
||||
/// </summary>
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Ui.Controls;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Ui.Controls;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// Switches the UI language at run time without restart (BRIEF §16). A <see cref="TitanoWindow"/> takes the
|
||||
/// Switches the UI language at run time without restart (BRIEF §16). A <see cref="ChronosWindow"/> takes the
|
||||
/// language's direction when it is created and follows each switch, so right-to-left languages mirror windows opened
|
||||
/// before and after this call alike; plain windows (the full-screen preview) take it when they load.
|
||||
/// </summary>
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Interop;
|
||||
using Titano.App.Import;
|
||||
using Titano.Core.Diagnostics;
|
||||
using Titano.Core.Windows.Devices;
|
||||
using Chronos.App.Import;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Windows.Devices;
|
||||
|
||||
namespace Titano.App.Infrastructure;
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// Card detection on this PC (BRIEF §13): <see cref="RemovableVolumeWatcher"/> (WM_DEVICECHANGE plus a 3-second poll),
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Titano.App.Interop;
|
||||
namespace Chronos.App.Interop;
|
||||
|
||||
/// <summary>A filter of the Open dialog: display name and patterns such as <c>*.jpg;*.cr2</c>.</summary>
|
||||
public readonly record struct FileFilter(string Name, string Patterns);
|
||||
@@ -1,7 +1,7 @@
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data.Jobs;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Data.Jobs;
|
||||
|
||||
namespace Titano.App.Jobs;
|
||||
namespace Chronos.App.Jobs;
|
||||
|
||||
/// <summary>Filter chips of the Jobs screen (BRIEF §12.6).</summary>
|
||||
public enum JobFilter
|
||||
@@ -1,6 +1,6 @@
|
||||
using Titano.Core.Model;
|
||||
using Chronos.Core.Model;
|
||||
|
||||
namespace Titano.App.Jobs;
|
||||
namespace Chronos.App.Jobs;
|
||||
|
||||
/// <summary>What the shell says when a job of this PC ends.</summary>
|
||||
public enum JobNotice
|
||||
@@ -1,9 +1,9 @@
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data;
|
||||
using Titano.Data.Jobs;
|
||||
using Titano.Data.Repositories;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Data;
|
||||
using Chronos.Data.Jobs;
|
||||
using Chronos.Data.Repositories;
|
||||
|
||||
namespace Titano.App.Jobs;
|
||||
namespace Chronos.App.Jobs;
|
||||
|
||||
/// <summary>What the Jobs screen, the job bar and the Library need from the job system.</summary>
|
||||
public interface IJobQueue
|
||||
@@ -44,11 +44,11 @@ public interface IJobQueue
|
||||
/// <summary><see cref="IJobQueue"/> over the local <see cref="JobEngine"/> and the job table.</summary>
|
||||
public sealed class EngineJobQueue : IJobQueue, IDisposable
|
||||
{
|
||||
private readonly TitanoDatabase _db;
|
||||
private readonly ChronosDatabase _db;
|
||||
private readonly JobEngine _engine;
|
||||
private readonly bool _started;
|
||||
|
||||
public EngineJobQueue(TitanoDatabase db, JobEngine engine, bool started)
|
||||
public EngineJobQueue(ChronosDatabase db, JobEngine engine, bool started)
|
||||
{
|
||||
_db = db;
|
||||
_engine = engine;
|
||||
@@ -1,12 +1,12 @@
|
||||
using System.Windows.Input;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.App.Sections;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Titano.Ui.Controls;
|
||||
using Titano.Ui.Mvvm;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Sections;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Ui.Controls;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Jobs;
|
||||
namespace Chronos.App.Jobs;
|
||||
|
||||
/// <summary>A row action: label, tooltip, the name screen readers hear (label and row) and command (26-px row buttons, DESIGN §4 tables).</summary>
|
||||
public sealed record JobAction(string Text, string ToolTip, string AccessibleName, ICommand Command);
|
||||
@@ -1,8 +1,8 @@
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Core.Model;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Model;
|
||||
|
||||
namespace Titano.App.Jobs;
|
||||
namespace Chronos.App.Jobs;
|
||||
|
||||
/// <summary>Localized texts of jobs: kind, speed, time left, place in the queue, state (Jobs screen and job bar).</summary>
|
||||
public static class JobText
|
||||
@@ -1,7 +1,7 @@
|
||||
using Titano.Core.Model;
|
||||
using Titano.Data.Jobs;
|
||||
using Chronos.Core.Model;
|
||||
using Chronos.Data.Jobs;
|
||||
|
||||
namespace Titano.App.Jobs;
|
||||
namespace Chronos.App.Jobs;
|
||||
|
||||
/// <summary>
|
||||
/// Collects job events from worker threads and hands them to the UI in batches: per job only the newest snapshot
|
||||
Loaded 100 of 1801 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user