using System.Collections.Generic;
using OwlCore.AbstractStorage;
using OwlCore.Services;
using StrixMusic.Sdk.AdapterModels;
using StrixMusic.Sdk.CoreModels;
using StrixMusic.Sdk.Services;
using StrixMusic.Shells.Default;
namespace StrixMusic.Services
{
///
/// A container for keys of all settings throughout the main app.
///
public class AppSettings : SettingsBase
{
private static bool _isDebug =
#if DEBUG
true;
#else
false;
#endif
///
/// Initializes a new instance of the class.
///
/// The folder where app settings are stored.
public AppSettings(IFolderData folder)
: base(folder, NewtonsoftStreamSerializer.Singleton)
{
}
///
/// Stored information about all core instances that the user has configured.
///
public Dictionary CoreInstanceRegistry
{
get => GetSetting(() => new Dictionary());
set => SetSetting(value);
}
///
/// The user's preferred ranking for each core, stored as the core's instance ID. Highest ranking first.
///
public List CoreRanking
{
get => GetSetting(() => new List());
set => SetSetting(value);
}
///
/// If true, the app will log information about the app while its running.
///
public bool IsLoggingEnabled
{
get => GetSetting(() => _isDebug);
set => SetSetting(value);
}
///
public SiblingCollectionPlaybackPreferences PlayCollectionBehavior
{
get => GetSetting(() => new SiblingCollectionPlaybackPreferences());
set => SetSetting(value);
}
///
/// Stores the registry id of the user's preferred shell.
///
public string PreferredShell
{
get => GetSetting(() => DefaultShell.Metadata.Id);
set => SetSetting(value);
}
///
/// The registry id of the user's current fallback shell. Used to cover display sizes that the doesn't support.
///
public string FallbackShell
{
get => GetSetting(() => DefaultShell.Metadata.Id);
set => SetSetting(value);
}
///
/// The user's preference for how items in a collection from multiple sources are sorted.
///
public MergedCollectionSorting MergedCollectionSorting
{
get => GetSetting(() => MergedCollectionSorting.Ranked);
set => SetSetting(value);
}
}
}