using System; using System.Collections.Generic; using Artemis.Core.SkiaSharp; using RGB.NET.Core; namespace Artemis.Core.Services { /// /// A service that allows you to manage the and its contents /// public interface IRgbService : IArtemisService, IDisposable { /// /// Gets a read-only collection containing all enabled devices /// IReadOnlyCollection EnabledDevices { get; } /// /// Gets a read-only collection containing all registered devices /// IReadOnlyCollection Devices { get; } /// /// Gets a dictionary containing all s on the surface with their corresponding RGB.NET /// as key /// IReadOnlyDictionary LedMap { get; } /// /// Gets or sets the RGB surface rendering is performed on /// RGBSurface Surface { get; set; } /// /// Gets or sets whether rendering should be paused /// bool IsRenderPaused { get; set; } /// /// Gets a boolean indicating whether the render pipeline is open /// bool RenderOpen { get; } /// /// Opens the render pipeline /// SKTexture OpenRender(); /// /// Closes the render pipeline /// void CloseRender(); /// /// Updates the graphics context to the provided . /// Note: The old graphics context will be used until the next frame starts rendering and is disposed afterwards. /// /// /// The new managed graphics context. If , software rendering /// is used. /// void UpdateGraphicsContext(IManagedGraphicsContext? managedGraphicsContext); /// /// Adds the given device provider to the /// /// void AddDeviceProvider(IRGBDeviceProvider deviceProvider); /// /// Removes the given device provider from the /// /// void RemoveDeviceProvider(IRGBDeviceProvider deviceProvider); /// /// Applies auto-arranging logic to the surface /// void AutoArrangeDevices(); /// /// Applies the best available layout for the given /// /// The device to apply the best available layout to /// The layout that was applied to the device ArtemisLayout ApplyBestDeviceLayout(ArtemisDevice device); /// /// Apples the provided to the provided /// /// /// void ApplyDeviceLayout(ArtemisDevice device, ArtemisLayout layout); /// /// Attempts to retrieve the that corresponds the provided RGB.NET /// /// /// /// The RGB.NET to find the corresponding /// for /// /// If found, the corresponding ; otherwise . ArtemisDevice? GetDevice(IRGBDevice rgbDevice); /// /// Attempts to retrieve the that corresponds the provided RGB.NET /// /// The RGB.NET to find the corresponding for /// If found, the corresponding ; otherwise . ArtemisLed? GetLed(Led led); /// /// Saves the configuration of the provided device to persistent storage /// /// void SaveDevice(ArtemisDevice artemisDevice); /// /// Saves the configuration of all current devices to persistent storage /// void SaveDevices(); /// /// Enables the provided device /// /// The device to enable void EnableDevice(ArtemisDevice device); /// /// Disables the provided device /// /// The device to disable void DisableDevice(ArtemisDevice device); /// /// Occurs when a single device was added /// event EventHandler DeviceAdded; /// /// Occurs when a single device was removed /// event EventHandler DeviceRemoved; /// /// Occurs when the surface has had modifications to its LED collection /// event EventHandler LedsChanged; } }