mirror of
https://github.com/Ellpeck/Illumilib.git
synced 2024-11-26 05:38:35 +01:00
Compare commits
3 commits
01575ed42d
...
887eb922e9
Author | SHA1 | Date | |
---|---|---|---|
887eb922e9 | |||
e3cc7e30f0 | |||
acffc054bf |
4 changed files with 16 additions and 24 deletions
|
@ -11,7 +11,7 @@
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
<PackageIcon>Logo.png</PackageIcon>
|
<PackageIcon>Logo.png</PackageIcon>
|
||||||
<VersionPrefix>1.2.6</VersionPrefix>
|
<VersionPrefix>1.2.7</VersionPrefix>
|
||||||
<NoWarn>NU1701</NoWarn>
|
<NoWarn>NU1701</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,6 @@ namespace Illumilib.System {
|
||||||
|
|
||||||
public abstract LightingType Type { get; }
|
public abstract LightingType Type { get; }
|
||||||
|
|
||||||
~LightingSystem() {
|
|
||||||
this.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract bool Initialize();
|
public abstract bool Initialize();
|
||||||
|
|
||||||
public abstract void SetAllLighting(float r, float g, float b);
|
public abstract void SetAllLighting(float r, float g, float b);
|
||||||
|
@ -23,9 +19,7 @@ namespace Illumilib.System {
|
||||||
|
|
||||||
public abstract void SetMouseLighting(float r, float g, float b);
|
public abstract void SetMouseLighting(float r, float g, float b);
|
||||||
|
|
||||||
public virtual void Dispose() {
|
public virtual void Dispose() {}
|
||||||
GC.SuppressFinalize(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -18,7 +18,6 @@ namespace Illumilib.System {
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose() {
|
public override void Dispose() {
|
||||||
base.Dispose();
|
|
||||||
this.ClearBitmap();
|
this.ClearBitmap();
|
||||||
try {
|
try {
|
||||||
LogitechGsdk.LogiLedShutdown();
|
LogitechGsdk.LogiLedShutdown();
|
||||||
|
|
|
@ -20,32 +20,31 @@ namespace Illumilib.System {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose() {
|
public override async void Dispose() {
|
||||||
base.Dispose();
|
|
||||||
try {
|
try {
|
||||||
this.chroma?.UninitializeAsync();
|
await this.chroma?.UninitializeAsync();
|
||||||
} catch {
|
} catch {
|
||||||
// ignored
|
// ignored
|
||||||
}
|
}
|
||||||
this.effectOutdated = true;
|
this.effectOutdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetAllLighting(float r, float g, float b) {
|
public override async void SetAllLighting(float r, float g, float b) {
|
||||||
this.chroma.SetAllAsync(new Color(r, g, b));
|
await this.chroma.SetAllAsync(new Color(r, g, b));
|
||||||
this.effectOutdated = true;
|
this.effectOutdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetKeyboardLighting(float r, float g, float b) {
|
public override async void SetKeyboardLighting(float r, float g, float b) {
|
||||||
this.chroma.Keyboard?.SetAllAsync(new Color(r, g, b));
|
await this.chroma.Keyboard?.SetAllAsync(new Color(r, g, b));
|
||||||
this.effectOutdated = true;
|
this.effectOutdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetKeyboardLighting(int x, int y, float r, float g, float b) {
|
public override async void SetKeyboardLighting(int x, int y, float r, float g, float b) {
|
||||||
this.chroma.Keyboard?.SetPositionAsync(y, x, new Color(r, g, b));
|
await this.chroma.Keyboard?.SetPositionAsync(y, x, new Color(r, g, b));
|
||||||
this.effectOutdated = true;
|
this.effectOutdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetKeyboardLighting(int x, int y, int width, int height, float r, float g, float b) {
|
public override async void SetKeyboardLighting(int x, int y, int width, int height, float r, float g, float b) {
|
||||||
if (this.chroma.Keyboard == null)
|
if (this.chroma.Keyboard == null)
|
||||||
return;
|
return;
|
||||||
if (this.effectOutdated) {
|
if (this.effectOutdated) {
|
||||||
|
@ -59,16 +58,16 @@ namespace Illumilib.System {
|
||||||
for (var yAdd = 0; yAdd < height; yAdd++)
|
for (var yAdd = 0; yAdd < height; yAdd++)
|
||||||
this.effect[y + yAdd, x + xAdd] = new Color(r, g, b);
|
this.effect[y + yAdd, x + xAdd] = new Color(r, g, b);
|
||||||
}
|
}
|
||||||
this.chroma.Keyboard.SetCustomAsync(this.effect);
|
await this.chroma.Keyboard.SetCustomAsync(this.effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetKeyboardLighting(KeyboardKeys key, float r, float g, float b) {
|
public override async void SetKeyboardLighting(KeyboardKeys key, float r, float g, float b) {
|
||||||
this.chroma.Keyboard?.SetKeyAsync(RazerLighting.ConvertKey(key), new Color(r, g, b));
|
await this.chroma.Keyboard?.SetKeyAsync(RazerLighting.ConvertKey(key), new Color(r, g, b));
|
||||||
this.effectOutdated = true;
|
this.effectOutdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetMouseLighting(float r, float g, float b) {
|
public override async void SetMouseLighting(float r, float g, float b) {
|
||||||
this.chroma.Mouse?.SetAllAsync(new Color(r, g, b));
|
await this.chroma.Mouse?.SetAllAsync(new Color(r, g, b));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Key ConvertKey(KeyboardKeys key) {
|
private static Key ConvertKey(KeyboardKeys key) {
|
||||||
|
|
Loading…
Reference in a new issue