Example #1
0
 /// <summary>
 /// Tests if the given <see cref="NovationLedIds"/> is custom-button.
 /// </summary>
 /// <param name="ledId">the <see cref="NovationLedIds"/> to test.</param>
 /// <returns><c>true</c> if <paramref name="ledId" /> is a custom-button; otherwise, <c>false</c>.</returns>
 public static bool IsCustom(this NovationLedIds ledId) => (ledId.GetStatus() == 0xB0) && ((ledId.GetId() / 0x10) == 0x06) && ((ledId.GetId() % 0x10) > 0x07);
Example #2
0
 /// <summary>
 /// Tests if the given <see cref="NovationLedIds"/> is a scene-button.
 /// </summary>
 /// <param name="ledId">the <see cref="NovationLedIds"/> to test.</param>
 /// <returns><c>true</c> if <paramref name="ledId" /> is a scene-button; otherwise, <c>false</c>.</returns>
 public static bool IsScene(this NovationLedIds ledId) => (ledId.GetStatus() == 0x90) && ((ledId.GetId() / 0x10) < 0x08) && ((ledId.GetId() % 0x10) == 0x09);
Example #3
0
 /// <summary>
 /// Gets the status-flag associated with the id.
 /// </summary>
 /// <param name="ledId">The <see cref="NovationLedIds"/> whose status-flag should be determinated.</param>
 /// <returns>The status-flag of the <see cref="NovationLedIds"/>.</returns>
 public static int GetStatus(this NovationLedIds ledId) => ((int)ledId & 0xFF00) >> 8;
Example #4
0
 /// <summary>
 /// Gets the id associated with the id.
 /// </summary>
 /// <param name="ledId">The <see cref="NovationLedIds"/> whose idshould be determinated.</param>
 /// <returns>The id of the <see cref="NovationLedIds"/>.</returns>
 public static int GetId(this NovationLedIds ledId) => (int)ledId & 0x00FF;
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NovationLedId"/> class.
 /// </summary>
 /// <param name="device">The <see cref="IRGBDevice"/> the <see cref="ILedId"/> belongs to.</param>
 /// <param name="ledId">The <see cref="NovationLedId"/> of the represented <see cref="Led"/>.</param>
 public NovationLedId(IRGBDevice device, NovationLedIds ledId)
 {
     this.Device = device;
     this.LedId  = ledId;
 }