Burathar
5 years ago
1 changed files with 48 additions and 49 deletions
@ -1,50 +1,49 @@
@@ -1,50 +1,49 @@
|
||||
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); |
||||
chroma.Keyboard.SetKeyAsync(Key.End, Color.Red, false); |
||||
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(); |
||||
} |
||||
} |
||||
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(); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue