mirror of
https://github.com/aaru-dps/RedBookPlayer.git
synced 2025-12-16 19:24:41 +00:00
Subchannel interpretation code (nw)
This commit is contained in:
25
RedBookPlayer.Models/Hardware/Karaoke/LoadCLUT.cs
Normal file
25
RedBookPlayer.Models/Hardware/Karaoke/LoadCLUT.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace RedBookPlayer.Models.Hardware.Karaoke
|
||||
{
|
||||
/// <see cref="https://jbum.com/cdg_revealed.html"/>
|
||||
internal class LoadCLUT
|
||||
{
|
||||
// AND with 0x3F3F to clear P and Q channel
|
||||
public short[] ColorSpec { get; private set; } = new short[8];
|
||||
|
||||
/// <summary>
|
||||
/// Interpret subchannel packet data as Load Color Lookup Table
|
||||
/// </summary>
|
||||
public LoadCLUT(byte[] bytes)
|
||||
{
|
||||
if(bytes == null || bytes.Length != 16)
|
||||
return;
|
||||
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
this.ColorSpec[i] = (short)(BitConverter.ToInt16(bytes, 2 * i) & 0x3F3F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user