Interface IRgbService
A service that allows you to manage the RGB.NET.Core.RGBSurface and its contents
Inherited Members
Namespace: Artemis.Core.Services
Assembly: Artemis.Core.dll
Syntax
public interface IRgbService : IDisposable
Properties
Devices
Gets a read-only collection containing all registered devices
Declaration
IReadOnlyCollection<ArtemisDevice> Devices { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<ArtemisDevice> |
EnabledDevices
Gets a read-only collection containing all enabled devices
Declaration
IReadOnlyCollection<ArtemisDevice> EnabledDevices { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<ArtemisDevice> |
FlushLeds
Gets or sets a boolean indicating whether to flush the RGB.NET LEDs during next update
Declaration
bool FlushLeds { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsRenderPaused
Gets or sets whether rendering should be paused
Declaration
bool IsRenderPaused { get; }
Property Value
Type | Description |
---|---|
bool |
LedMap
Gets a dictionary containing all ArtemisLeds on the surface with their corresponding RGB.NET RGB.NET.Core.Led as key
Declaration
IReadOnlyDictionary<Led, ArtemisLed> LedMap { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<Led, ArtemisLed> |
RenderOpen
Gets a boolean indicating whether the render pipeline is open
Declaration
bool RenderOpen { get; }
Property Value
Type | Description |
---|---|
bool |
Surface
Gets or sets the RGB surface rendering is performed on
Declaration
RGBSurface Surface { get; set; }
Property Value
Type | Description |
---|---|
RGBSurface |
Methods
AddDeviceProvider(IRGBDeviceProvider)
Adds the given device provider to the Surface
Declaration
void AddDeviceProvider(IRGBDeviceProvider deviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IRGBDeviceProvider | deviceProvider |
ApplyBestDeviceLayout(ArtemisDevice)
Applies the best available layout for the given ArtemisDevice
Declaration
ArtemisLayout? ApplyBestDeviceLayout(ArtemisDevice device)
Parameters
Type | Name | Description |
---|---|---|
ArtemisDevice | device | The device to apply the best available layout to |
Returns
Type | Description |
---|---|
ArtemisLayout | The layout that was applied to the device |
ApplyDeviceLayout(ArtemisDevice, ArtemisLayout)
Apples the provided ArtemisLayout to the provided ArtemisDevice
Declaration
void ApplyDeviceLayout(ArtemisDevice device, ArtemisLayout layout)
Parameters
Type | Name | Description |
---|---|---|
ArtemisDevice | device | |
ArtemisLayout | layout |
ApplyPreferredGraphicsContext(bool)
Applies the current value of the Core.PreferredGraphicsContext
setting to the graphics context.
Declaration
void ApplyPreferredGraphicsContext(bool forceSoftware)
Parameters
Type | Name | Description |
---|---|---|
bool | forceSoftware | A boolean to indicate whether or not to force the graphics context to software mode. |
AutoArrangeDevices()
Applies auto-arranging logic to the surface
Declaration
void AutoArrangeDevices()
CloseRender()
Closes the render pipeline
Declaration
void CloseRender()
DisableDevice(ArtemisDevice)
Disables the provided device
Declaration
void DisableDevice(ArtemisDevice device)
Parameters
Type | Name | Description |
---|---|---|
ArtemisDevice | device | The device to disable |
EnableDevice(ArtemisDevice)
Enables the provided device
Declaration
void EnableDevice(ArtemisDevice device)
Parameters
Type | Name | Description |
---|---|---|
ArtemisDevice | device | The device to enable |
GetDevice(IRGBDevice)
Attempts to retrieve the ArtemisDevice that corresponds the provided RGB.NET RGB.NET.Core.IRGBDevice
Declaration
ArtemisDevice? GetDevice(IRGBDevice rgbDevice)
Parameters
Type | Name | Description |
---|---|---|
IRGBDevice | rgbDevice | The RGB.NET RGB.NET.Core.IRGBDevice to find the corresponding ArtemisDevice for |
Returns
Type | Description |
---|---|
ArtemisDevice | If found, the corresponding ArtemisDevice; otherwise null. |
GetLed(Led)
Attempts to retrieve the ArtemisLed that corresponds the provided RGB.NET RGB.NET.Core.Led
Declaration
ArtemisLed? GetLed(Led led)
Parameters
Type | Name | Description |
---|---|---|
Led | led | The RGB.NET RGB.NET.Core.Led to find the corresponding ArtemisLed for |
Returns
Type | Description |
---|---|
ArtemisLed | If found, the corresponding ArtemisLed; otherwise null. |
OpenRender()
Opens the render pipeline
Declaration
SKTexture OpenRender()
Returns
Type | Description |
---|---|
SKTexture |
RemoveDeviceProvider(IRGBDeviceProvider)
Removes the given device provider from the Surface
Declaration
void RemoveDeviceProvider(IRGBDeviceProvider deviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IRGBDeviceProvider | deviceProvider |
SaveDevice(ArtemisDevice)
Saves the configuration of the provided device to persistent storage
Declaration
void SaveDevice(ArtemisDevice artemisDevice)
Parameters
Type | Name | Description |
---|---|---|
ArtemisDevice | artemisDevice |
SaveDevices()
Saves the configuration of all current devices to persistent storage
Declaration
void SaveDevices()
SetRenderPaused(bool)
Pauses or resumes rendering, method won't return until the current frame finished rendering
Declaration
bool SetRenderPaused(bool paused)
Parameters
Type | Name | Description |
---|---|---|
bool | paused |
Returns
Type | Description |
---|---|
bool |
UpdateGraphicsContext(IManagedGraphicsContext?)
Updates the graphics context to the provided managedGraphicsContext
.
Note: The old graphics context will be used until the next frame starts rendering and is disposed afterwards.
Declaration
void UpdateGraphicsContext(IManagedGraphicsContext? managedGraphicsContext)
Parameters
Type | Name | Description |
---|---|---|
IManagedGraphicsContext | managedGraphicsContext | The new managed graphics context. If null, software rendering is used. |
Events
DeviceAdded
Occurs when a single device was added
Declaration
event EventHandler<DeviceEventArgs> DeviceAdded
Event Type
Type | Description |
---|---|
EventHandler<DeviceEventArgs> |
DeviceRemoved
Occurs when a single device was removed
Declaration
event EventHandler<DeviceEventArgs> DeviceRemoved
Event Type
Type | Description |
---|---|
EventHandler<DeviceEventArgs> |
LedsChanged
Occurs when the surface has had modifications to its LED collection
Declaration
event EventHandler LedsChanged
Event Type
Type | Description |
---|---|
EventHandler |