// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global // ReSharper disable UnusedMember.Global // ReSharper disable MemberCanBePrivate.Global using System; using System.Collections.Generic; using System.Linq; using RGB.NET.Core; namespace RGB.NET.Devices.DMX.E131; /// /// Represents the data used to create a E1.31 DMX-device. /// public class E131DMXDeviceDefinition : IDMXDeviceDefinition { #region Properties & Fields /// /// Gets or sets the hostname of the device. /// public string Hostname { get; set; } /// /// Gets or sets the port to device is listening to. /// public int Port { get; set; } = 5568; /// /// Gets or sets the of the device. /// public RGBDeviceType DeviceType { get; set; } = RGBDeviceType.Unknown; /// /// Gets or sets the manufacturer of the device. /// public string Manufacturer { get; set; } = "Unknown"; /// /// Gets or sets the model name of the device. /// public string Model { get; set; } = "Generic DMX-Device"; /// /// Gets or sets the CID of the device (null will generate a random CID) /// // ReSharper disable once InconsistentNaming public byte[]? CID { get; set; } /// /// Gets or sets the universe the device belongs to. /// public short Universe { get; set; } = 1; /// /// Gets or sets the led-mappings used to create the device. /// public Dictionary getValueFunc)>> Leds { get; } = new(); /// /// The time in ms after which the device is updated even if no changes are made in the meantime to prevent the target from timing out or similar problems. /// To disable heartbeats leave it at 0. /// public int HeartbeatTimer { get; set; } = 0; #endregion #region Constructors /// /// Initializes a new instance of the class. /// /// The hostname of the device. public E131DMXDeviceDefinition(string hostname) { this.Hostname = hostname; } #endregion #region Methods /// /// Adds a led-mapping to the device. /// /// The used to identify the led. /// The channels the led is using and a function mapping parts of the color to them. public void AddLed(LedId id, params (int channel, Func getValueFunc)[] channels) => Leds[id] = channels.ToList(); #endregion #region Factory //TODO DarthAffe 18.02.2018: Add factory-methods. #endregion }