mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-04-05 17:39:39 -04:00
* Add speech rate setting * Add volume slider * New speech manager skeleton * User API key from resx * Implement voice list retrieve via new api * Rewrite to use ObAPI, remove all dependancies * Use volume setting * Clean up using statements * Volume and timing adjustments * Lookup rate value * Use numeric rates for tighter spread * Manage plugin data folder via core interface * Add check that nullable settings are not null. * Get file size before it's deleted. * Improve old settings migration. * Ignore cache sizes below 1MB * Re-index orphaned files in cache, purge legacy wav files. * Call top level error logging for native voice exception. * Async title and detail requests to remove pause * Remove NetCoreAudio use of temp files. * Remove orphan using.
62 lines
2.1 KiB
C#
62 lines
2.1 KiB
C#
using System;
|
|
using Avalonia;
|
|
using Avalonia.ReactiveUI;
|
|
|
|
namespace Observatory
|
|
{
|
|
class ObservatoryCore
|
|
{
|
|
[STAThread]
|
|
static void Main(string[] args)
|
|
{
|
|
string version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString();
|
|
try
|
|
{
|
|
if (Properties.Core.Default.CoreVersion != version)
|
|
{
|
|
Properties.Core.Default.Upgrade();
|
|
Properties.Core.Default.CoreVersion = version;
|
|
Properties.Core.Default.Save();
|
|
}
|
|
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogError(ex, version);
|
|
}
|
|
}
|
|
|
|
internal static void LogError(Exception ex, string context)
|
|
{
|
|
var docPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
|
|
var errorMessage = new System.Text.StringBuilder();
|
|
errorMessage
|
|
.AppendLine($"Error encountered in Elite Observatory {context}.")
|
|
.AppendLine(FormatExceptionMessage(ex))
|
|
.AppendLine();
|
|
System.IO.File.AppendAllText(docPath + System.IO.Path.DirectorySeparatorChar + "ObservatoryErrorLog.txt", errorMessage.ToString());
|
|
}
|
|
|
|
static string FormatExceptionMessage(Exception ex, bool inner = false)
|
|
{
|
|
var errorMessage = new System.Text.StringBuilder();
|
|
errorMessage
|
|
.AppendLine($"{(inner ? "Inner e" : "E")}xception message: {ex.Message}")
|
|
.AppendLine($"Stack trace:")
|
|
.AppendLine(ex.StackTrace);
|
|
if (ex.InnerException != null)
|
|
errorMessage.AppendLine(FormatExceptionMessage(ex.InnerException, true));
|
|
|
|
return errorMessage.ToString();
|
|
}
|
|
|
|
public static AppBuilder BuildAvaloniaApp()
|
|
{
|
|
return AppBuilder.Configure<UI.MainApplication>()
|
|
.UsePlatformDetect()
|
|
.LogToTrace()
|
|
.UseReactiveUI();
|
|
}
|
|
}
|
|
}
|