/// <inheritdoc /> /// <summary> /// Internal constructor of managed <see cref="T:RGB.NET.Devices.Novation.NovationLaunchpadRGBDeviceInfo" />. /// </summary> /// <param name="model">The represented device model.</param> /// <param name="deviceId"></param> /// <param name="colorCapabilities">The <see cref="T:RGB.NET.Devices.Novation.NovationColorCapabilities" /> of the <see cref="T:RGB.NET.Core.IRGBDevice" />.</param> internal NovationLaunchpadRGBDeviceInfo(string model, int deviceId, NovationColorCapabilities colorCapabilities, LedIdMappings ledIdMapping) : base(RGBDeviceType.LedMatrix, model, deviceId, colorCapabilities) { this.LedIdMapping = ledIdMapping; }
/// <summary> /// Internal constructor of managed <see cref="NovationRGBDeviceInfo"/>. /// </summary> /// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param> /// <param name="model">The represented device model.</param> /// <param name="deviceId">The (midi)-id of the <see cref="IRGBDevice"/>.</param> /// <param name="colorCapabilities">The <see cref="NovationColorCapabilities"/> of the <see cref="IRGBDevice"/>.</param> internal NovationRGBDeviceInfo(RGBDeviceType deviceType, string model, int deviceId, NovationColorCapabilities colorCapabilities) { this.DeviceType = deviceType; this.Model = model; this.DeviceId = deviceId; this.ColorCapabilities = colorCapabilities; DeviceName = $"{Manufacturer} {Model}"; }
/// <inheritdoc /> public bool Initialize(RGBDeviceType loadFilter = RGBDeviceType.All, bool exclusiveAccessIfPossible = false, bool throwExceptions = false) { IsInitialized = false; try { UpdateTrigger?.Stop(); IList <IRGBDevice> devices = new List <IRGBDevice>(); if (loadFilter.HasFlag(RGBDeviceType.LedMatrix)) { for (int index = 0; index < OutputDeviceBase.DeviceCount; index++) { try { MidiOutCaps outCaps = OutputDeviceBase.GetDeviceCapabilities(index); if (outCaps.name == null) { continue; } NovationDevices?deviceId = (NovationDevices?)Enum.GetValues(typeof(NovationDevices)) .Cast <Enum>() .FirstOrDefault(x => x.GetDeviceId().ToUpperInvariant().Contains(outCaps.name.ToUpperInvariant())); if (deviceId == null) { continue; } NovationColorCapabilities colorCapability = deviceId.GetColorCapability(); if (colorCapability == NovationColorCapabilities.None) { continue; } INovationRGBDevice device = new NovationLaunchpadRGBDevice(new NovationLaunchpadRGBDeviceInfo(outCaps.name, index, colorCapability, deviceId.GetLedIdMapping())); device.Initialize(UpdateTrigger); devices.Add(device); } catch { if (throwExceptions) { throw; } } } } UpdateTrigger?.Start(); Devices = new ReadOnlyCollection <IRGBDevice>(devices); IsInitialized = true; } catch { if (throwExceptions) { throw; } return(false); } return(true); }
/// <inheritdoc /> /// <summary> /// Internal constructor of managed <see cref="T:RGB.NET.Devices.Novation.NovationLaunchpadRGBDeviceInfo" />. /// </summary> /// <param name="model">The represented device model.</param> /// <param name="deviceId"></param> /// <param name="colorCapabilities">The <see cref="T:RGB.NET.Devices.Novation.NovationColorCapabilities" /> of the <see cref="T:RGB.NET.Core.IRGBDevice" />.</param> internal NovationLaunchpadRGBDeviceInfo(string model, int deviceId, NovationColorCapabilities colorCapabilities) : base(RGBDeviceType.LedMatrix, model, deviceId, colorCapabilities) { Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Novation\Launchpads\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute); }
/// <summary> /// Internal constructor of managed <see cref="NovationRGBDeviceInfo"/>. /// </summary> /// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param> /// <param name="model">The represented device model.</param> /// <param name="deviceId">The (midi)-id of the <see cref="IRGBDevice"/>.</param> /// <param name="colorCapabilities">The <see cref="NovationColorCapabilities"/> of the <see cref="IRGBDevice"/>.</param> internal NovationRGBDeviceInfo(RGBDeviceType deviceType, string model, int deviceId, NovationColorCapabilities colorCapabilities) { this.DeviceType = deviceType; this.Model = model; this.DeviceId = deviceId; this.ColorCapabilities = colorCapabilities; }
/// <inheritdoc /> /// <summary> /// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Novation.Attributes.ColorCapabilityAttribute" /> class. /// </summary> /// <param name="capability">The capability.</param> public ColorCapabilityAttribute(NovationColorCapabilities capability) { this.Capability = capability; }
/// <inheritdoc /> /// <summary> /// Internal constructor of managed <see cref="T:RGB.NET.Devices.Novation.NovationLaunchpadRGBDeviceInfo" />. /// </summary> /// <param name="model">The represented device model.</param> /// <param name="deviceId"></param> /// <param name="colorCapabilities">The <see cref="T:RGB.NET.Devices.Novation.NovationColorCapabilities" /> of the <see cref="T:RGB.NET.Core.IRGBDevice" />.</param> internal NovationLaunchpadRGBDeviceInfo(string model, int deviceId, NovationColorCapabilities colorCapabilities) : base(RGBDeviceType.LedMatrix, model, deviceId, colorCapabilities) { }