You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.1 KiB

using Colore;
using Colore.Data;
using Colore.Effects.Keyboard;
using System;
using System.Threading;
namespace ChromaEffectsImporter
{
internal class ColoreOutput
{
private IChroma chroma;
private string ChromaEffectPath;
public ColoreOutput(string chromaEffectPath)
{
ChromaEffectPath = chromaEffectPath;
}
public void Start()
{
Setup();
LoadChromaEffect(ChromaEffectPath);
Thread.Sleep(1000);
Loop();
}
private void LoadChromaEffect(string path)
{
ChromaEffectsReader reader = new ChromaEffectsReader();
EffectRegion[] regions = reader.ReadFirstStatic(path);
Array.ForEach(regions, x => x.Show(chroma));
}
private async void Setup()
{
chroma = await ColoreProvider.CreateNativeAsync();
}
private void Loop()
{
while (true)
{
Thread.Sleep(100);
}
chroma.UninitializeAsync();
}
}
}