mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
commit
9a922bb2f3
@ -13,6 +13,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LogiLed2Artemis", "LogiLed2
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis86Wrapper", "Artemis86Wrapper\Artemis86Wrapper.csproj", "{47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LightFX2Artemis", "LightFX2Artemis\LightFX2Artemis.vcxproj", "{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
CD_ROM|Any CPU = CD_ROM|Any CPU
|
||||
@ -178,6 +180,34 @@ Global
|
||||
{47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.SingleImage|x64.Build.0 = Release|Any CPU
|
||||
{47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.SingleImage|x86.ActiveCfg = Release|Any CPU
|
||||
{47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.SingleImage|x86.Build.0 = Release|Any CPU
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|Any CPU.ActiveCfg = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|Any CPU.Build.0 = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|x64.ActiveCfg = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|x64.Build.0 = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|x86.ActiveCfg = Release|Win32
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|x86.Build.0 = Release|Win32
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Debug|x64.Build.0 = Debug|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Debug|x86.Build.0 = Debug|Win32
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|Any CPU.ActiveCfg = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|Any CPU.Build.0 = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|x64.ActiveCfg = Debug|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|x64.Build.0 = Debug|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|x86.ActiveCfg = Debug|Win32
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|x86.Build.0 = Debug|Win32
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Release|x64.ActiveCfg = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Release|x64.Build.0 = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Release|x86.ActiveCfg = Release|Win32
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Release|x86.Build.0 = Release|Win32
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|Any CPU.ActiveCfg = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|Any CPU.Build.0 = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|x64.ActiveCfg = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|x64.Build.0 = Release|x64
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|x86.ActiveCfg = Release|Win32
|
||||
{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@ -321,6 +321,7 @@
|
||||
<Compile Include="Controls\Log\MemoryEventTarget.cs" />
|
||||
<Compile Include="DAL\ProfileProvider.cs" />
|
||||
<Compile Include="DAL\SettingsProvider.cs" />
|
||||
<Compile Include="DeviceProviders\Artemis\NoneKeyboard.cs" />
|
||||
<Compile Include="DeviceProviders\CoolerMaster\MasterkeysProL.cs" />
|
||||
<Compile Include="DeviceProviders\CoolerMaster\MasterkeysProS.cs" />
|
||||
<Compile Include="DeviceProviders\CoolerMaster\Utilities\CmSdk.cs" />
|
||||
|
||||
42
Artemis/Artemis/DeviceProviders/Artemis/NoneKeyboard.cs
Normal file
42
Artemis/Artemis/DeviceProviders/Artemis/NoneKeyboard.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using System.Drawing;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
using Artemis.Properties;
|
||||
|
||||
namespace Artemis.DeviceProviders.Artemis
|
||||
{
|
||||
public class NoneKeyboard : KeyboardProvider
|
||||
{
|
||||
public NoneKeyboard()
|
||||
{
|
||||
Name = "None";
|
||||
Slug = "none";
|
||||
CantEnableText = "Waaaaah, this should not be happening!";
|
||||
Height = 1;
|
||||
Width = 1;
|
||||
PreviewSettings = new PreviewSettings(984, 375, new Thickness(0, 0, 0, 0), Resources.none);
|
||||
}
|
||||
|
||||
public override void Disable()
|
||||
{
|
||||
}
|
||||
|
||||
public override bool CanEnable()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
}
|
||||
|
||||
public override void DrawBitmap(Bitmap bitmap)
|
||||
{
|
||||
}
|
||||
|
||||
public override KeyMatch? GetKeyPosition(Keys keyCode)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -46,20 +46,19 @@ namespace Artemis.DeviceProviders.Corsair
|
||||
|
||||
var leds = CueSDK.HeadsetSDK.Leds.Count();
|
||||
var step = (double) bitmap.Width/leds;
|
||||
using (bitmap)
|
||||
{
|
||||
var ledIndex = 0;
|
||||
// Color each LED according to one of the pixels
|
||||
foreach (var corsairLed in CueSDK.HeadsetSDK.Leds)
|
||||
{
|
||||
var col = ledIndex == 0
|
||||
? bitmap.GetPixel(0, 0)
|
||||
: bitmap.GetPixel((int) ((ledIndex + 1)*step - 1), (int) ((ledIndex + 1)*step - 1));
|
||||
|
||||
corsairLed.Color = col;
|
||||
ledIndex++;
|
||||
}
|
||||
var ledIndex = 0;
|
||||
// Color each LED according to one of the pixels
|
||||
foreach (var corsairLed in CueSDK.HeadsetSDK.Leds)
|
||||
{
|
||||
var col = ledIndex == 0
|
||||
? bitmap.GetPixel(0, 0)
|
||||
: bitmap.GetPixel((int) ((ledIndex + 1)*step - 1), (int) ((ledIndex + 1)*step - 1));
|
||||
|
||||
corsairLed.Color = col;
|
||||
ledIndex++;
|
||||
}
|
||||
|
||||
CueSDK.HeadsetSDK.Update();
|
||||
}
|
||||
|
||||
|
||||
@ -46,20 +46,19 @@ namespace Artemis.DeviceProviders.Corsair
|
||||
|
||||
var leds = CueSDK.MouseSDK.Leds.Count();
|
||||
var step = (double) bitmap.Width/leds;
|
||||
using (bitmap)
|
||||
{
|
||||
var ledIndex = 0;
|
||||
// Color each LED according to one of the pixels
|
||||
foreach (var corsairLed in CueSDK.MouseSDK.Leds)
|
||||
{
|
||||
var col = ledIndex == 0
|
||||
? bitmap.GetPixel(0, 0)
|
||||
: bitmap.GetPixel((int) ((ledIndex + 1)*step - 1), (int) ((ledIndex + 1)*step - 1));
|
||||
|
||||
corsairLed.Color = col;
|
||||
ledIndex++;
|
||||
}
|
||||
var ledIndex = 0;
|
||||
// Color each LED according to one of the pixels
|
||||
foreach (var corsairLed in CueSDK.MouseSDK.Leds)
|
||||
{
|
||||
var col = ledIndex == 0
|
||||
? bitmap.GetPixel(0, 0)
|
||||
: bitmap.GetPixel((int) ((ledIndex + 1)*step - 1), (int) ((ledIndex + 1)*step - 1));
|
||||
|
||||
corsairLed.Color = col;
|
||||
ledIndex++;
|
||||
}
|
||||
|
||||
CueSDK.MouseSDK.Update();
|
||||
}
|
||||
|
||||
|
||||
@ -48,39 +48,36 @@ namespace Artemis.DeviceProviders.Corsair
|
||||
var xStep = (double) bitmap.Width/6;
|
||||
|
||||
// This approach will break if any mousemats with different LED amounts are released, for now it will do.
|
||||
using (bitmap)
|
||||
var ledIndex = 0;
|
||||
// Color each LED according to one of the pixels
|
||||
foreach (var corsairLed in CueSDK.MousematSDK.Leds.OrderBy(l => l.ToString()))
|
||||
{
|
||||
var ledIndex = 0;
|
||||
// Color each LED according to one of the pixels
|
||||
foreach (var corsairLed in CueSDK.MousematSDK.Leds.OrderBy(l => l.ToString()))
|
||||
Color col;
|
||||
// Left side
|
||||
if (ledIndex < 5)
|
||||
{
|
||||
Color col;
|
||||
// Left side
|
||||
if (ledIndex < 5)
|
||||
{
|
||||
col = ledIndex == 0
|
||||
? bitmap.GetPixel(0, (int) (ledIndex*yStep))
|
||||
: bitmap.GetPixel(0, (int) (ledIndex*yStep) - 1);
|
||||
}
|
||||
// Bottom
|
||||
else if (ledIndex < 10)
|
||||
{
|
||||
// Start at index 1 because the corner belongs to the left side
|
||||
var zoneIndex = ledIndex - 4;
|
||||
col = bitmap.GetPixel((int) (zoneIndex*xStep), bitmap.Height - 1);
|
||||
}
|
||||
// Right side
|
||||
else
|
||||
{
|
||||
var zoneIndex = ledIndex - 10;
|
||||
col = zoneIndex == 4
|
||||
? bitmap.GetPixel(bitmap.Height - 1, bitmap.Height - (int) (zoneIndex*yStep))
|
||||
: bitmap.GetPixel(bitmap.Height - 1, bitmap.Height - 1 - (int) (zoneIndex*yStep));
|
||||
}
|
||||
|
||||
corsairLed.Color = col;
|
||||
ledIndex++;
|
||||
col = ledIndex == 0
|
||||
? bitmap.GetPixel(0, (int) (ledIndex*yStep))
|
||||
: bitmap.GetPixel(0, (int) (ledIndex*yStep) - 1);
|
||||
}
|
||||
// Bottom
|
||||
else if (ledIndex < 10)
|
||||
{
|
||||
// Start at index 1 because the corner belongs to the left side
|
||||
var zoneIndex = ledIndex - 4;
|
||||
col = bitmap.GetPixel((int) (zoneIndex*xStep), bitmap.Height - 1);
|
||||
}
|
||||
// Right side
|
||||
else
|
||||
{
|
||||
var zoneIndex = ledIndex - 10;
|
||||
col = zoneIndex == 4
|
||||
? bitmap.GetPixel(bitmap.Height - 1, bitmap.Height - (int) (zoneIndex*yStep))
|
||||
: bitmap.GetPixel(bitmap.Height - 1, bitmap.Height - 1 - (int) (zoneIndex*yStep));
|
||||
}
|
||||
|
||||
corsairLed.Color = col;
|
||||
ledIndex++;
|
||||
}
|
||||
CueSDK.MousematSDK.Update();
|
||||
}
|
||||
|
||||
@ -25,12 +25,9 @@ namespace Artemis.DeviceProviders.Logitech
|
||||
if (!CanUse || bitmap == null)
|
||||
return;
|
||||
|
||||
using (bitmap)
|
||||
{
|
||||
var col = bitmap.GetPixel(bitmap.Width/2, bitmap.Height/2);
|
||||
LogitechGSDK.LogiLedSetTargetDevice(LogitechGSDK.LOGI_DEVICETYPE_RGB);
|
||||
LogitechGSDK.LogiLedSetLighting((int) (col.R/2.55), (int) (col.G/2.55), (int) (col.B/2.55));
|
||||
}
|
||||
var col = bitmap.GetPixel(bitmap.Width/2, bitmap.Height/2);
|
||||
LogitechGSDK.LogiLedSetTargetDevice(LogitechGSDK.LOGI_DEVICETYPE_RGB);
|
||||
LogitechGSDK.LogiLedSetLighting((int) (col.R/2.55), (int) (col.G/2.55), (int) (col.B/2.55));
|
||||
}
|
||||
|
||||
public override bool TryEnable()
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using Artemis.DeviceProviders;
|
||||
using Artemis.DeviceProviders.Artemis;
|
||||
using Artemis.DeviceProviders.CoolerMaster;
|
||||
using Artemis.DeviceProviders.Corsair;
|
||||
using Artemis.DeviceProviders.Logitech;
|
||||
@ -12,6 +13,7 @@ namespace Artemis.InjectionModules
|
||||
public override void Load()
|
||||
{
|
||||
// Keyboards
|
||||
Bind<DeviceProvider>().To<NoneKeyboard>().InSingletonScope();
|
||||
Bind<DeviceProvider>().To<CorsairKeyboard>().InSingletonScope();
|
||||
Bind<DeviceProvider>().To<G910>().InSingletonScope();
|
||||
Bind<DeviceProvider>().To<G810>().InSingletonScope();
|
||||
|
||||
@ -4,9 +4,9 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using Artemis.DeviceProviders;
|
||||
using Artemis.ViewModels;
|
||||
using Caliburn.Micro;
|
||||
using Ninject.Extensions.Logging;
|
||||
using Timer = System.Timers.Timer;
|
||||
|
||||
@ -17,17 +17,20 @@ namespace Artemis.Managers
|
||||
/// </summary>
|
||||
public class LoopManager : IDisposable
|
||||
{
|
||||
private readonly DebugViewModel _debugViewModel;
|
||||
private readonly DeviceManager _deviceManager;
|
||||
private readonly EffectManager _effectManager;
|
||||
private readonly ILogger _logger;
|
||||
private readonly Timer _loopTimer;
|
||||
private bool _canShowException;
|
||||
|
||||
public LoopManager(ILogger logger, EffectManager effectManager, DeviceManager deviceManager)
|
||||
public LoopManager(ILogger logger, EffectManager effectManager, DeviceManager deviceManager,
|
||||
DebugViewModel debugViewModel)
|
||||
{
|
||||
_logger = logger;
|
||||
_effectManager = effectManager;
|
||||
_deviceManager = deviceManager;
|
||||
_debugViewModel = debugViewModel;
|
||||
_canShowException = true;
|
||||
|
||||
// Setup timers
|
||||
@ -38,6 +41,19 @@ namespace Artemis.Managers
|
||||
_logger.Info("Intialized LoopManager");
|
||||
}
|
||||
|
||||
public DebugViewModel DebugViewModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the loop is running
|
||||
/// </summary>
|
||||
public bool Running { get; private set; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_loopTimer.Stop();
|
||||
_loopTimer.Dispose();
|
||||
}
|
||||
|
||||
private void LoopTimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
|
||||
{
|
||||
try
|
||||
@ -48,7 +64,7 @@ namespace Artemis.Managers
|
||||
{
|
||||
if (_canShowException)
|
||||
{
|
||||
Caliburn.Micro.Execute.OnUIThread(delegate
|
||||
Execute.OnUIThread(delegate
|
||||
{
|
||||
_canShowException = false;
|
||||
_loopTimer.Stop();
|
||||
@ -59,17 +75,6 @@ namespace Artemis.Managers
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the loop is running
|
||||
/// </summary>
|
||||
public bool Running { get; private set; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_loopTimer.Stop();
|
||||
_loopTimer.Dispose();
|
||||
}
|
||||
|
||||
public Task StartAsync()
|
||||
{
|
||||
return Task.Run(() => Start());
|
||||
@ -185,6 +190,8 @@ namespace Artemis.Managers
|
||||
foreach (var mousemat in mousemats)
|
||||
mousemat.UpdateDevice(frame.MousematBitmap);
|
||||
|
||||
_debugViewModel.DrawFrame(frame);
|
||||
|
||||
OnRenderCompleted();
|
||||
}
|
||||
}
|
||||
@ -254,6 +261,7 @@ namespace Artemis.Managers
|
||||
MouseBitmap?.Dispose();
|
||||
HeadsetBitmap?.Dispose();
|
||||
GenericBitmap?.Dispose();
|
||||
MousematBitmap?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -36,12 +36,6 @@ namespace Artemis.Models
|
||||
DeviceManager.OnKeyboardChangedEvent += DeviceManagerOnOnKeyboardChangedEvent;
|
||||
}
|
||||
|
||||
private void DeviceManagerOnOnKeyboardChangedEvent(object sender, KeyboardChangedEventArgs args)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Settings?.LastProfile))
|
||||
Profile = ProfileProvider.GetProfile(DeviceManager.ActiveKeyboard, this, Settings.LastProfile);
|
||||
}
|
||||
|
||||
public bool Initialized { get; set; }
|
||||
public DeviceManager DeviceManager { get; set; }
|
||||
public EffectSettings Settings { get; set; }
|
||||
@ -59,6 +53,12 @@ namespace Artemis.Models
|
||||
Profile?.Deactivate();
|
||||
}
|
||||
|
||||
private void DeviceManagerOnOnKeyboardChangedEvent(object sender, KeyboardChangedEventArgs args)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Settings?.LastProfile))
|
||||
Profile = ProfileProvider.GetProfile(DeviceManager.ActiveKeyboard, this, Settings.LastProfile);
|
||||
}
|
||||
|
||||
// Called on creation
|
||||
public abstract void Enable();
|
||||
|
||||
@ -89,15 +89,15 @@ namespace Artemis.Models
|
||||
var keyboardRect = DeviceManager.ActiveKeyboard.KeyboardRectangle(KeyboardScale);
|
||||
using (var g = Graphics.FromImage(frame.KeyboardBitmap))
|
||||
{
|
||||
Profile?.DrawLayers(g, renderLayers.Where(rl => rl.LayerType.DrawType == DrawType.Keyboard),
|
||||
DataModel, keyboardRect, false, true, "keyboard");
|
||||
Profile?.DrawLayers(g, renderLayers.Where(rl => rl.LayerType.DrawType == DrawType.Keyboard),
|
||||
DataModel, keyboardRect, false, true, "keyboard");
|
||||
}
|
||||
// Render mice layer-by-layer
|
||||
var devRec = new Rect(0, 0, 40, 40);
|
||||
using (var g = Graphics.FromImage(frame.MouseBitmap))
|
||||
{
|
||||
Profile?.DrawLayers(g, renderLayers.Where(rl => rl.LayerType.DrawType == DrawType.Mouse), DataModel,
|
||||
devRec, false, true, "mouse");
|
||||
Profile?.DrawLayers(g, renderLayers.Where(rl => rl.LayerType.DrawType == DrawType.Mouse),
|
||||
DataModel, devRec, false, true, "mouse");
|
||||
}
|
||||
// Render headsets layer-by-layer
|
||||
using (var g = Graphics.FromImage(frame.HeadsetBitmap))
|
||||
|
||||
@ -62,7 +62,7 @@ namespace Artemis.Modules.Effects.ProfilePreview
|
||||
var keyboardRect = DeviceManager.ActiveKeyboard.KeyboardRectangle(KeyboardScale);
|
||||
using (var g = Graphics.FromImage(frame.KeyboardBitmap))
|
||||
{
|
||||
Profile.DrawLayers(g, renderLayers.Where(rl => rl.LayerType.DrawType == DrawType.Keyboard),
|
||||
Profile?.DrawLayers(g, renderLayers.Where(rl => rl.LayerType.DrawType == DrawType.Keyboard),
|
||||
DataModel, keyboardRect, true, true, "keyboard");
|
||||
}
|
||||
// Render mice layer-by-layer
|
||||
|
||||
@ -13,9 +13,9 @@ namespace Artemis.Profiles.Layers.Types.Folder
|
||||
public class FolderType : ILayerType
|
||||
{
|
||||
public string Name => "Folder";
|
||||
public bool ShowInEdtor { get; } = false;
|
||||
public bool ShowInEdtor => false;
|
||||
// FolderType pretents to be a keyboard so it's children get drawn
|
||||
public DrawType DrawType { get; } = DrawType.Keyboard;
|
||||
public DrawType DrawType => DrawType.Keyboard;
|
||||
|
||||
public ImageSource DrawThumbnail(LayerModel layer)
|
||||
{
|
||||
|
||||
@ -1,16 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using Artemis.Profiles.Layers.Abstract;
|
||||
using Artemis.Profiles.Layers.Interfaces;
|
||||
using Artemis.ViewModels.Profiles;
|
||||
using Caliburn.Micro;
|
||||
using ColorBox;
|
||||
|
||||
namespace Artemis.Profiles.Layers.Types.Generic
|
||||
{
|
||||
public class GenericPropertiesViewModel : LayerPropertiesViewModel
|
||||
{
|
||||
private IEnumerable<BrushTypes> _availableBrushTypes;
|
||||
private ILayerAnimation _selectedLayerAnimation;
|
||||
|
||||
public GenericPropertiesViewModel(LayerEditorViewModel editorVm) : base(editorVm)
|
||||
|
||||
@ -15,17 +15,15 @@ namespace Artemis.Profiles.Layers.Types.Generic
|
||||
public class GenericType : ILayerType
|
||||
{
|
||||
public string Name => "Generic (Logitech)";
|
||||
public bool ShowInEdtor { get; } = false;
|
||||
public DrawType DrawType { get; } = DrawType.Generic;
|
||||
public bool ShowInEdtor => false;
|
||||
public DrawType DrawType => DrawType.Generic;
|
||||
|
||||
public ImageSource DrawThumbnail(LayerModel layer)
|
||||
{
|
||||
var thumbnailRect = new Rect(0, 0, 18, 18);
|
||||
var visual = new DrawingVisual();
|
||||
using (var c = visual.RenderOpen())
|
||||
{
|
||||
c.DrawImage(ImageUtilities.BitmapToBitmapImage(Resources.generic), thumbnailRect);
|
||||
}
|
||||
|
||||
var image = new DrawingImage(visual.Drawing);
|
||||
return image;
|
||||
@ -61,7 +59,7 @@ namespace Artemis.Profiles.Layers.Types.Generic
|
||||
layerModel.Properties.Y = 0;
|
||||
layerModel.Properties.Contain = true;
|
||||
|
||||
layerModel.ApplyProperties(false);
|
||||
layerModel.ApplyProperties(true);
|
||||
|
||||
if (isPreview || dataModel == null)
|
||||
return;
|
||||
|
||||
@ -15,8 +15,8 @@ namespace Artemis.Profiles.Layers.Types.Headset
|
||||
public class HeadsetType : ILayerType
|
||||
{
|
||||
public string Name => "Headset";
|
||||
public bool ShowInEdtor { get; } = false;
|
||||
public DrawType DrawType { get; } = DrawType.Headset;
|
||||
public bool ShowInEdtor => false;
|
||||
public DrawType DrawType => DrawType.Headset;
|
||||
|
||||
public ImageSource DrawThumbnail(LayerModel layer)
|
||||
{
|
||||
|
||||
@ -20,12 +20,14 @@ namespace Artemis.Profiles.Layers.Types.KeyPress
|
||||
internal class KeyPressType : ILayerType
|
||||
{
|
||||
private readonly DeviceManager _deviceManager;
|
||||
private List<LayerModel> _keyPressLayers = new List<LayerModel>();
|
||||
private List<LayerModel> _keyPressLayers;
|
||||
private LayerModel _layerModel;
|
||||
|
||||
public KeyPressType(DeviceManager deviceManager)
|
||||
{
|
||||
_deviceManager = deviceManager;
|
||||
_keyPressLayers = new List<LayerModel>();
|
||||
|
||||
KeyboardHook.KeyDownCallback += KeyboardHookOnKeyDownCallback;
|
||||
}
|
||||
|
||||
@ -33,8 +35,8 @@ namespace Artemis.Profiles.Layers.Types.KeyPress
|
||||
|
||||
|
||||
public string Name => "Keyboard - Key press";
|
||||
public bool ShowInEdtor { get; } = false;
|
||||
public DrawType DrawType { get; } = DrawType.Keyboard;
|
||||
public bool ShowInEdtor => false;
|
||||
public DrawType DrawType => DrawType.Keyboard;
|
||||
|
||||
public ImageSource DrawThumbnail(LayerModel layer)
|
||||
{
|
||||
@ -77,10 +79,12 @@ namespace Artemis.Profiles.Layers.Types.KeyPress
|
||||
lock (_keyPressLayers)
|
||||
{
|
||||
// Remove expired key presses
|
||||
_keyPressLayers = _keyPressLayers.Where(k => !k.LayerAnimation.MustExpire(k)).ToList();
|
||||
var updateLayers = _keyPressLayers.Where(k => !k.LayerAnimation.MustExpire(k)).ToList();
|
||||
// Update the ones that are still active
|
||||
foreach (var keyPressLayer in _keyPressLayers)
|
||||
keyPressLayer.Update(null, false, true);
|
||||
foreach (var updateLayer in updateLayers)
|
||||
updateLayer.Update(null, false, true);
|
||||
|
||||
_keyPressLayers = updateLayers;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -12,8 +12,8 @@ namespace Artemis.Profiles.Layers.Types.Keyboard
|
||||
public class KeyboardType : ILayerType
|
||||
{
|
||||
public string Name => "Keyboard";
|
||||
public bool ShowInEdtor { get; } = true;
|
||||
public DrawType DrawType { get; } = DrawType.Keyboard;
|
||||
public bool ShowInEdtor => true;
|
||||
public DrawType DrawType => DrawType.Keyboard;
|
||||
|
||||
public ImageSource DrawThumbnail(LayerModel layer)
|
||||
{
|
||||
|
||||
@ -16,8 +16,8 @@ namespace Artemis.Profiles.Layers.Types.KeyboardGif
|
||||
internal class KeyboardGifType : ILayerType
|
||||
{
|
||||
public string Name => "Keyboard - GIF";
|
||||
public bool ShowInEdtor { get; } = true;
|
||||
public DrawType DrawType { get; } = DrawType.Keyboard;
|
||||
public bool ShowInEdtor => true;
|
||||
public DrawType DrawType => DrawType.Keyboard;
|
||||
|
||||
public ImageSource DrawThumbnail(LayerModel layer)
|
||||
{
|
||||
|
||||
@ -15,8 +15,8 @@ namespace Artemis.Profiles.Layers.Types.Mouse
|
||||
public class MouseType : ILayerType
|
||||
{
|
||||
public string Name => "Mouse";
|
||||
public bool ShowInEdtor { get; } = false;
|
||||
public DrawType DrawType { get; } = DrawType.Mouse;
|
||||
public bool ShowInEdtor => false;
|
||||
public DrawType DrawType => DrawType.Mouse;
|
||||
|
||||
public ImageSource DrawThumbnail(LayerModel layer)
|
||||
{
|
||||
|
||||
@ -15,8 +15,8 @@ namespace Artemis.Profiles.Layers.Types.Mousemat
|
||||
public class MousematType : ILayerType
|
||||
{
|
||||
public string Name => "Mousemat";
|
||||
public bool ShowInEdtor { get; } = false;
|
||||
public DrawType DrawType { get; } = DrawType.Mousemat;
|
||||
public bool ShowInEdtor => false;
|
||||
public DrawType DrawType => DrawType.Mousemat;
|
||||
|
||||
public ImageSource DrawThumbnail(LayerModel layer)
|
||||
{
|
||||
|
||||
@ -53,7 +53,7 @@ using System.Windows;
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyVersion("1.6.0.1")]
|
||||
[assembly: AssemblyFileVersion("1.6.0.1")]
|
||||
[assembly: AssemblyVersion("1.6.1.0")]
|
||||
[assembly: AssemblyFileVersion("1.6.1.0")]
|
||||
[assembly: InternalsVisibleTo("Artemis.Explorables")]
|
||||
|
||||
|
||||
Binary file not shown.
@ -90,5 +90,21 @@ namespace Artemis.Utilities
|
||||
bitmap.Render(iconImage);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public static DrawingImage BitmapToDrawingImage(Bitmap b, Rect rect)
|
||||
{
|
||||
if (b == null)
|
||||
return new DrawingImage();
|
||||
|
||||
var visual = new DrawingVisual();
|
||||
using (var c = visual.RenderOpen())
|
||||
{
|
||||
c.DrawImage(BitmapToBitmapImage(b), rect);
|
||||
}
|
||||
|
||||
var image = new DrawingImage(visual.Drawing);
|
||||
image.Freeze();
|
||||
return image;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,13 +3,28 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Utilities;
|
||||
using Caliburn.Micro;
|
||||
using Action = System.Action;
|
||||
|
||||
namespace Artemis.ViewModels
|
||||
{
|
||||
public class DebugViewModel : Screen
|
||||
{
|
||||
private readonly DeviceManager _deviceManager;
|
||||
|
||||
private DrawingImage _razerDisplay;
|
||||
private DrawingImage _keyboard;
|
||||
private DrawingImage _mouse;
|
||||
private DrawingImage _headset;
|
||||
private DrawingImage _mousemat;
|
||||
private DrawingImage _generic;
|
||||
|
||||
public DebugViewModel(DeviceManager deviceManager)
|
||||
{
|
||||
_deviceManager = deviceManager;
|
||||
}
|
||||
|
||||
public DrawingImage RazerDisplay
|
||||
{
|
||||
@ -22,6 +37,62 @@ namespace Artemis.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public DrawingImage Keyboard
|
||||
{
|
||||
get { return _keyboard; }
|
||||
set
|
||||
{
|
||||
if (Equals(value, _keyboard)) return;
|
||||
_keyboard = value;
|
||||
NotifyOfPropertyChange(() => Keyboard);
|
||||
}
|
||||
}
|
||||
|
||||
public DrawingImage Mouse
|
||||
{
|
||||
get { return _mouse; }
|
||||
set
|
||||
{
|
||||
if (Equals(value, _mouse)) return;
|
||||
_mouse = value;
|
||||
NotifyOfPropertyChange(() => Mouse);
|
||||
}
|
||||
}
|
||||
|
||||
public DrawingImage Headset
|
||||
{
|
||||
get { return _headset; }
|
||||
set
|
||||
{
|
||||
if (Equals(value, _headset)) return;
|
||||
_headset = value;
|
||||
NotifyOfPropertyChange(() => Headset);
|
||||
}
|
||||
}
|
||||
|
||||
public DrawingImage Mousemat
|
||||
{
|
||||
get { return _mousemat; }
|
||||
set
|
||||
{
|
||||
if (Equals(value, _mousemat)) return;
|
||||
_mousemat = value;
|
||||
NotifyOfPropertyChange(() => Mousemat);
|
||||
}
|
||||
}
|
||||
|
||||
public DrawingImage Generic
|
||||
{
|
||||
get { return _generic; }
|
||||
set
|
||||
{
|
||||
if (Equals(value, _generic)) return;
|
||||
_generic = value;
|
||||
NotifyOfPropertyChange(() => Generic);
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenLog()
|
||||
{
|
||||
// Get the logging directory
|
||||
@ -52,5 +123,24 @@ namespace Artemis.ViewModels
|
||||
drawnDisplay.Freeze();
|
||||
RazerDisplay = drawnDisplay;
|
||||
}
|
||||
|
||||
public void DrawFrame(RenderFrame frame)
|
||||
{
|
||||
// No point updating the display if the view isn't visible
|
||||
if (!IsActive)
|
||||
return;
|
||||
|
||||
// Only update keyboard if there is an active keyboard
|
||||
if (_deviceManager.ActiveKeyboard != null)
|
||||
{
|
||||
var rect = _deviceManager.ActiveKeyboard.KeyboardRectangle(1);
|
||||
Keyboard = ImageUtilities.BitmapToDrawingImage(frame.KeyboardBitmap, rect);
|
||||
}
|
||||
|
||||
Mouse = ImageUtilities.BitmapToDrawingImage(frame.MouseBitmap, new Rect(0, 0, 10, 10));
|
||||
Headset = ImageUtilities.BitmapToDrawingImage(frame.HeadsetBitmap, new Rect(0, 0, 10, 10));
|
||||
Mousemat = ImageUtilities.BitmapToDrawingImage(frame.MousematBitmap, new Rect(0, 0, 10, 10));
|
||||
Generic = ImageUtilities.BitmapToDrawingImage(frame.GenericBitmap, new Rect(0, 0, 10, 10));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -70,11 +70,7 @@ namespace Artemis.ViewModels.Flyouts
|
||||
{
|
||||
get
|
||||
{
|
||||
var collection = new BindableCollection<string>
|
||||
(MainManager.DeviceManager.KeyboardProviders.Select(k => k.Name));
|
||||
|
||||
collection.Insert(0, "None");
|
||||
return collection;
|
||||
return new BindableCollection<string>(MainManager.DeviceManager.KeyboardProviders.Select(k => k.Name));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
@ -45,6 +44,57 @@ namespace Artemis.ViewModels.Profiles
|
||||
deviceManager.OnKeyboardChangedEvent += DeviceManagerOnOnKeyboardChangedEvent;
|
||||
}
|
||||
|
||||
public ProfileModel SelectedProfile { get; set; }
|
||||
|
||||
public LayerModel SelectedLayer
|
||||
{
|
||||
get { return _selectedLayer; }
|
||||
set
|
||||
{
|
||||
if (Equals(value, _selectedLayer)) return;
|
||||
_selectedLayer = value;
|
||||
NotifyOfPropertyChange(() => SelectedLayer);
|
||||
}
|
||||
}
|
||||
|
||||
public DrawingImage KeyboardPreview
|
||||
{
|
||||
get { return _keyboardPreview; }
|
||||
set
|
||||
{
|
||||
if (Equals(value, _keyboardPreview)) return;
|
||||
_keyboardPreview = value;
|
||||
NotifyOfPropertyChange(() => KeyboardPreview);
|
||||
}
|
||||
}
|
||||
|
||||
public double BlurRadius
|
||||
{
|
||||
get { return _blurRadius; }
|
||||
set
|
||||
{
|
||||
if (value.Equals(_blurRadius)) return;
|
||||
_blurRadius = value;
|
||||
NotifyOfPropertyChange(() => BlurRadius);
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowAll
|
||||
{
|
||||
get { return _showAll; }
|
||||
set
|
||||
{
|
||||
if (value == _showAll) return;
|
||||
_showAll = value;
|
||||
NotifyOfPropertyChange(() => ShowAll);
|
||||
}
|
||||
}
|
||||
|
||||
public ImageSource KeyboardImage => ImageUtilities
|
||||
.BitmapToBitmapImage(_deviceManager.ActiveKeyboard?.PreviewSettings.Image ?? Resources.none);
|
||||
|
||||
public bool Activated { get; set; }
|
||||
|
||||
private void LoopManagerOnRenderCompleted(object sender, EventArgs eventArgs)
|
||||
{
|
||||
if (!Activated)
|
||||
@ -55,7 +105,8 @@ namespace Artemis.ViewModels.Profiles
|
||||
_blurProgress = _blurProgress + 0.025;
|
||||
BlurRadius = (Math.Sin(_blurProgress*Math.PI) + 1)*10 + 10;
|
||||
|
||||
if (SelectedProfile == null || _deviceManager.ActiveKeyboard == null)
|
||||
// Besides the usual checks, also check if the ActiveKeyboard isn't the NoneKeyboard
|
||||
if (SelectedProfile == null || _deviceManager.ActiveKeyboard == null || _deviceManager.ActiveKeyboard.Slug == "none")
|
||||
{
|
||||
var preview = new DrawingImage();
|
||||
preview.Freeze();
|
||||
@ -127,57 +178,6 @@ namespace Artemis.ViewModels.Profiles
|
||||
KeyboardPreview = drawnPreview;
|
||||
}
|
||||
|
||||
public ProfileModel SelectedProfile { get; set; }
|
||||
|
||||
public LayerModel SelectedLayer
|
||||
{
|
||||
get { return _selectedLayer; }
|
||||
set
|
||||
{
|
||||
if (Equals(value, _selectedLayer)) return;
|
||||
_selectedLayer = value;
|
||||
NotifyOfPropertyChange(() => SelectedLayer);
|
||||
}
|
||||
}
|
||||
|
||||
public DrawingImage KeyboardPreview
|
||||
{
|
||||
get { return _keyboardPreview; }
|
||||
set
|
||||
{
|
||||
if (Equals(value, _keyboardPreview)) return;
|
||||
_keyboardPreview = value;
|
||||
NotifyOfPropertyChange(() => KeyboardPreview);
|
||||
}
|
||||
}
|
||||
|
||||
public double BlurRadius
|
||||
{
|
||||
get { return _blurRadius; }
|
||||
set
|
||||
{
|
||||
if (value.Equals(_blurRadius)) return;
|
||||
_blurRadius = value;
|
||||
NotifyOfPropertyChange(() => BlurRadius);
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowAll
|
||||
{
|
||||
get { return _showAll; }
|
||||
set
|
||||
{
|
||||
if (value == _showAll) return;
|
||||
_showAll = value;
|
||||
NotifyOfPropertyChange(() => ShowAll);
|
||||
}
|
||||
}
|
||||
|
||||
public ImageSource KeyboardImage => ImageUtilities
|
||||
.BitmapToBitmapImage(_deviceManager.ActiveKeyboard?.PreviewSettings.Image ?? Resources.none);
|
||||
|
||||
public bool Activated { get; set; }
|
||||
|
||||
private void DeviceManagerOnOnKeyboardChangedEvent(object sender, KeyboardChangedEventArgs e)
|
||||
{
|
||||
NotifyOfPropertyChange(() => KeyboardImage);
|
||||
|
||||
@ -12,27 +12,71 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="32" />
|
||||
<RowDefinition Height="80" />
|
||||
<RowDefinition Height="32" />
|
||||
<RowDefinition Height="80" />
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Keyboard output -->
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="16" Content="Keyboard" HorizontalAlignment="Center" />
|
||||
<Border Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Height="75" Width="300" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top" BorderThickness="1" BorderBrush="{StaticResource GrayBrush7}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Image Source="{Binding Path=Keyboard}" />
|
||||
</Border>
|
||||
|
||||
<!-- Razer output -->
|
||||
<Label Grid.Row="0" Grid.Column="0" FontSize="20" Content="Razer display" />
|
||||
<Border Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Height="75" Width="300" HorizontalAlignment="Left"
|
||||
<Label Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" FontSize="16" Content="Razer SDK feed" HorizontalAlignment="Center" />
|
||||
<Border Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" Height="75" Width="300" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top" BorderThickness="1" BorderBrush="{StaticResource GrayBrush7}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Image Source="{Binding Path=RazerDisplay}" />
|
||||
</Border>
|
||||
|
||||
<!-- Mouse output -->
|
||||
<Label Grid.Row="2" Grid.Column="0" FontSize="16" Content="Mouse" HorizontalAlignment="Center" />
|
||||
<Border Grid.Row="3" Grid.Column="0" Height="75" Width="75" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top" BorderThickness="1" BorderBrush="{StaticResource GrayBrush7}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Image Source="{Binding Path=Mouse}" />
|
||||
</Border>
|
||||
|
||||
<!-- Headset output -->
|
||||
<Label Grid.Row="2" Grid.Column="1" FontSize="16" Content="Headset" HorizontalAlignment="Center" />
|
||||
<Border Grid.Row="3" Grid.Column="1" Height="75" Width="75" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top" BorderThickness="1" BorderBrush="{StaticResource GrayBrush7}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Image Source="{Binding Path=Headset}" />
|
||||
</Border>
|
||||
|
||||
<!-- Mousemat output -->
|
||||
<Label Grid.Row="2" Grid.Column="2" FontSize="16" Content="Mousemat" HorizontalAlignment="Center" />
|
||||
<Border Grid.Row="3" Grid.Column="2" Height="75" Width="75" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top" BorderThickness="1" BorderBrush="{StaticResource GrayBrush7}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Image Source="{Binding Path=Mousemat}" />
|
||||
</Border>
|
||||
|
||||
<!-- Generic output -->
|
||||
<Label Grid.Row="2" Grid.Column="3" FontSize="16" Content="Generic" HorizontalAlignment="Center" />
|
||||
<Border Grid.Row="3" Grid.Column="3" Height="75" Width="75" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top" BorderThickness="1" BorderBrush="{StaticResource GrayBrush7}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Image Source="{Binding Path=Generic}" />
|
||||
</Border>
|
||||
|
||||
<!-- Log -->
|
||||
<Label Grid.Row="2" Grid.Column="0" FontSize="20" Content="Log" />
|
||||
<Button x:Name="OpenLog" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right"
|
||||
<Label Grid.Row="4" Grid.Column="0" FontSize="20" Content="Log" />
|
||||
<Button x:Name="OpenLog" Grid.Row="4" Grid.Column="3" HorizontalAlignment="Right"
|
||||
Style="{DynamicResource SquareButtonStyle}" Content="Open log file" VerticalAlignment="Center" />
|
||||
<Border Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" BorderThickness="1"
|
||||
<Border Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4" BorderThickness="1"
|
||||
BorderBrush="{StaticResource GrayBrush7}" SnapsToDevicePixels="True">
|
||||
<log:LoggingControl />
|
||||
</Border>
|
||||
|
||||
23
Artemis/LightFX2Artemis/LightFX2Artemis.def
Normal file
23
Artemis/LightFX2Artemis/LightFX2Artemis.def
Normal file
@ -0,0 +1,23 @@
|
||||
LIBRARY
|
||||
|
||||
EXPORTS
|
||||
|
||||
LFX_Initialize
|
||||
LFX_Release
|
||||
LFX_Reset
|
||||
LFX_Update
|
||||
LFX_UpdateDefault
|
||||
LFX_GetNumDevices
|
||||
LFX_GetDeviceDescription
|
||||
LFX_GetNumLights
|
||||
LFX_GetLightDescription
|
||||
LFX_GetLightLocation
|
||||
LFX_GetLightColor
|
||||
LFX_SetLightColor
|
||||
LFX_Light
|
||||
LFX_SetLightActionColor
|
||||
LFX_SetLightActionColorEx
|
||||
LFX_ActionColor
|
||||
LFX_ActionColorEx
|
||||
LFX_SetTiming
|
||||
LFX_GetVersion
|
||||
167
Artemis/LightFX2Artemis/LightFX2Artemis.vcxproj
Normal file
167
Artemis/LightFX2Artemis/LightFX2Artemis.vcxproj
Normal file
@ -0,0 +1,167 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>LightFX2Artemis</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIGHTFX2ARTEMIS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>LightFX2Artemis.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;LIGHTFX2ARTEMIS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>LightFX2Artemis.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIGHTFX2ARTEMIS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>LightFX2Artemis.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;LIGHTFX2ARTEMIS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>LightFX2Artemis.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="LightFX2Artemis.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\LogiLed2Artemis\main.cpp" />
|
||||
<ClCompile Include="LightFxState.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="LightFxState.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
35
Artemis/LightFX2Artemis/LightFX2Artemis.vcxproj.filters
Normal file
35
Artemis/LightFX2Artemis/LightFX2Artemis.vcxproj.filters
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="LightFX2Artemis.def">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\LogiLed2Artemis\main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="LightFxState.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="LightFxState.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
13
Artemis/LightFX2Artemis/LightFxState.cpp
Normal file
13
Artemis/LightFX2Artemis/LightFxState.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include "LightFxState.h"
|
||||
|
||||
|
||||
|
||||
LightFxState::LightFxState(char* game)
|
||||
{
|
||||
Game = game;
|
||||
}
|
||||
|
||||
|
||||
LightFxState::~LightFxState()
|
||||
{
|
||||
}
|
||||
8
Artemis/LightFX2Artemis/LightFxState.h
Normal file
8
Artemis/LightFX2Artemis/LightFxState.h
Normal file
@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
class LightFxState
|
||||
{
|
||||
public:
|
||||
LightFxState(char* game);
|
||||
~LightFxState();
|
||||
char* Game;
|
||||
};
|
||||
439
Artemis/LightFX2Artemis/includes/LFX2.h
Normal file
439
Artemis/LightFX2Artemis/includes/LFX2.h
Normal file
@ -0,0 +1,439 @@
|
||||
/*********************************************************
|
||||
|
||||
LFX2.h - Defines the exports for the LightFX 2.0 DLL
|
||||
|
||||
Purpose: Provide library exports for communicating with
|
||||
the LightFX 2.0 API
|
||||
|
||||
Copyright (c) 2007 Dell, Inc. All rights reserved.
|
||||
Date: 8/7/2007
|
||||
|
||||
Dell, Inc. makes no warranty of any kind with regard
|
||||
to this material, including, but not limited to, the
|
||||
implied warranties of merchantability and fitness for
|
||||
a particular purpose. Dell, Inc. shall not be liable
|
||||
for any errors contained herein, or for incidental or
|
||||
consequential damages in connection with the furnishing,
|
||||
performance or use of this material.
|
||||
|
||||
This document contains proprietary information which
|
||||
is protected by copyright. All rights reserved.
|
||||
Reproduction without the written permission of Dell
|
||||
is strictly forbidden.
|
||||
|
||||
**********************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "LFXDecl.h"
|
||||
#define _EXPORTING
|
||||
|
||||
#ifdef _EXPORTING // To be used by SDK developer
|
||||
#define FN_DECLSPEC __declspec(dllexport)
|
||||
|
||||
#elif _IMPORTING // To be used for dynamic linking to dll
|
||||
#define FN_DECLSPEC __declspec(dllimport)
|
||||
|
||||
#else // To be used for linking using static library
|
||||
#define FN_DECLSPEC
|
||||
#endif
|
||||
|
||||
#ifdef _STDCALL_SUPPORTED
|
||||
#define STDCALL __stdcall // Declare our calling convention
|
||||
#else
|
||||
#define STDCALL
|
||||
#endif // STDCALL_SUPPORTED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// LightFX 2.0 DLL export function declarations
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_Initialize
|
||||
Description:
|
||||
Initializes the LightFX 2.0 system.
|
||||
This function must be called prior to any other library calls being made. If this
|
||||
function is not called, the system will not be initialized and the other functions
|
||||
will return LFX_ERROR_NOINIT or LFX_FAILURE.
|
||||
Inputs: None
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_SUCCESS if the system is successfully initialized, or was already initialized.
|
||||
LFX_ERROR_NODEVS if the system is initialized, but no devices are available.
|
||||
LFX_FAILURE if initialization fails.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_Initialize();
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_Release
|
||||
Description:
|
||||
Release the LightFX 2.0 system.
|
||||
This function may be called when the system is no longer needed. If this
|
||||
function is not called, release will still occur on process detach.
|
||||
PnP Note:
|
||||
An application may want to release the system and initialize it again in
|
||||
response to a device arrival notification, to account for new devices added
|
||||
while the application is running.
|
||||
Inputs: None
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_SUCCESS
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_Release();
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_Reset
|
||||
Description:
|
||||
Reset the state of the system to 'off' for any lights attached to any devices.
|
||||
Note that the change(s) to the physical light(s) do not occur immediately, rather
|
||||
only after an LFX_Update() call is made.
|
||||
To disable all lights, call LFX_Reset(), immediately followed by LFX_Update().
|
||||
Inputs: None
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NODEVS if there are no devices available to reset.
|
||||
LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_Reset();
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_Update
|
||||
Description:
|
||||
Update the entire system, submitting any state changes to hardware
|
||||
made since the last LFX_Reset() call.
|
||||
Inputs: None
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NODEVS if the system is initialized but no devices are available.
|
||||
LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_Update();
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_UpdateDefault
|
||||
Description:
|
||||
Update the entire system, submitting any state changes made since the last LFX_Reset()
|
||||
call to the hardware, and set the appropriate flags to make the new state the
|
||||
power-on default.
|
||||
Note: Not all devices will support this functionality.
|
||||
Inputs: None
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NODEVS if the system is initialized but no devices are available.
|
||||
LFX_FAILURE or LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_UpdateDefault();
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_GetNumDevices
|
||||
Description:
|
||||
Get the number of devices attached to the LightFX system
|
||||
Inputs: None
|
||||
Outputs: Populates a uint with the current number of attached devices.
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NODEVS if the system is initialized but no devices are available, leaving the param untouched.
|
||||
LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetNumDevices(unsigned int* const);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_GetDeviceDescription
|
||||
Description:
|
||||
Get the description of a device attached to the system
|
||||
Inputs: Accepts an index to the device
|
||||
Outputs:
|
||||
Populates a character string with the device's description
|
||||
Populates a ushort with the device type (see LFXDecl.h for device types)
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NODEVS if the system is initialized but no devices are available.
|
||||
LFX_ERROR_BUFFSIZE if the buffer provided is too small.
|
||||
LFX_FAILURE or LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetDeviceDescription(const unsigned int, char* const, const unsigned int, unsigned char* const);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_GetNumLights
|
||||
Description:
|
||||
Get the number of lights attached to a device in the LightFX system
|
||||
Inputs: Accepts an index to the device
|
||||
Outputs: Populates a uint with the current number of attached lights for the device index.
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NODEVS if the system is initialized but no devices are available at the index provided.
|
||||
LFX_ERROR_NOLIGHTS if no lights are available at the device index provided.
|
||||
LFX_FAILURE or LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetNumLights(const unsigned int, unsigned int* const);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_GetLightDescription
|
||||
Description:
|
||||
Get the description of a light attached to a device
|
||||
Inputs: Accepts an index to the device and an index to the light
|
||||
Outputs: Populates a character string with the light's description
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NODEVS if the system is initialized but no devices are available at the index provided.
|
||||
LFX_ERROR_NOLIGHTS if no lights are available at the device and light index provided.
|
||||
LFX_ERROR_BUFFSIZE if the buffer provided is too small in size.
|
||||
LFX_FAILURE or LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetLightDescription(const unsigned int, const unsigned int, char* const, const unsigned int);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_GetLightLocation
|
||||
Description:
|
||||
Get the location of a light attached to a device
|
||||
Inputs: Accepts an index to the device and an index to the light
|
||||
Outputs: Populates a LFX_POSITION structure with the light's position (see LFXDecl.h
|
||||
for more information).
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NODEVS if the system is initialized but no devices are available at the index provided.
|
||||
LFX_ERROR_NOLIGHTS if no lights are available at the device and light index provided.
|
||||
LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetLightLocation(const unsigned int, const unsigned int, PLFX_POSITION const);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_GetLightColor
|
||||
Description:
|
||||
Get the current color of a light attached to a device
|
||||
Important:
|
||||
This function provides the current color stored in the active state
|
||||
since the last LFX_Reset() call, it does not necessarily reflect the color of the
|
||||
physical light. To ensure that the returned value represents the state of the
|
||||
physical light, call LFX_GetLightColor immediately after a call to LFX_Update() and
|
||||
before the next call to LFX_Reset().
|
||||
Inputs: Accepts an index to the device and an index to the light
|
||||
Outputs: Populates a LFX_COLOR structure with the light's description
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NODEVS if the system is initialized but no devices are available at the index provided.
|
||||
LFX_ERROR_NOLIGHTS if no lights are available at the device and light index provided.
|
||||
LFX_FAILURE or LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetLightColor(const unsigned int, const unsigned int, PLFX_COLOR const);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_SetLightColor
|
||||
Description:
|
||||
Sets the current color of a light attached to a device
|
||||
Important:
|
||||
This function changes the current color stored in the active state
|
||||
since the last LFX_Reset() call. It does NOT immediately update the physical light
|
||||
settings, until a call to LFX_Update() is made.
|
||||
Inputs: Accepts an index to the device, an index to the light, and a new LFX_COLOR value
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_FAILURE or LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_SetLightColor(const unsigned int, const unsigned int, const PLFX_COLOR);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_Light
|
||||
Description:
|
||||
Sets the color of a location for any devices with lights in that
|
||||
corresponding location.
|
||||
Important:
|
||||
This function changes the current color stored in the active state
|
||||
since the last LFX_Reset() call. It does NOT immediately update the physical light
|
||||
settings, until a call to LFX_Update() is made.
|
||||
Location Mask Note:
|
||||
Location mask is a 32-bit field, where each of the first 27 bits represent
|
||||
a zone in the virtual cube representing the system (see LFXDecl.h)
|
||||
Color Packing Note:
|
||||
Color is packed into a 32-bit value, as follows:
|
||||
Bits 0-7: Blue
|
||||
Bits 8-15: Green
|
||||
Bits 16-23: Red
|
||||
Bits 24-32: Brightness
|
||||
Inputs: Accepts a 32-bit location mask and a packed color value
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NOLIGHTS if no lights were found at the location mask specified.
|
||||
LFX_FAILURE if some other error occurred
|
||||
LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_Light(const unsigned int, const unsigned int);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_SetLightActionColor
|
||||
Description:
|
||||
Sets the primary color and an action type to a light
|
||||
Important:
|
||||
This function changes the current color and action type stored in the active state
|
||||
since the last LFX_Reset() call. It does NOT immediately update the physical light
|
||||
settings, until a call to LFX_Update() is made. If the action type is a morph, then
|
||||
the secondary color for the action is black.
|
||||
Inputs: Accepts an index to the device, an index to the light, an action type, and a new primary LFX_COLOR value
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_FAILURE or LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_SetLightActionColor(const unsigned int, const unsigned int, const unsigned int, const PLFX_COLOR);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_SetLightActionColorEx
|
||||
Description:
|
||||
Sets the primary and secondary colors and an action type to a light
|
||||
Important:
|
||||
This function changes the current color and action type stored in the active state
|
||||
since the last LFX_Reset() call. It does NOT immediately update the physical light
|
||||
settings, until a call to LFX_Update() is made. If the action type is not a morph,
|
||||
then the secondary color is ignored.
|
||||
Inputs: Accepts an index to the device, an index to the light, an action type, and two LFX_COLOR values
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_FAILURE or LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_SetLightActionColorEx(const unsigned int, const unsigned int, const unsigned int, const PLFX_COLOR, const PLFX_COLOR);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_ActionColor
|
||||
Description:
|
||||
Sets the primary color and an action type for any devices with lights in a location.
|
||||
Important:
|
||||
This function changes the current primary color and action type stored in the active state
|
||||
since the last LFX_Reset() call. It does NOT immediately update the physical light
|
||||
settings, until a call to LFX_Update() is made. If the action type is a morph, then
|
||||
the secondary color for the action is black.
|
||||
Location Mask Note:
|
||||
Location mask is a 32-bit field, where each of the first 27 bits represent
|
||||
a zone in the virtual cube representing the system (see LFXDecl.h)
|
||||
Color Packing Note:
|
||||
Color is packed into a 32-bit value, as follows:
|
||||
Bits 0-7: Blue
|
||||
Bits 8-15: Green
|
||||
Bits 16-23: Red
|
||||
Bits 24-32: Brightness
|
||||
Inputs: Accepts a 32-bit location mask and a packed color value
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NOLIGHTS if no lights were found at the location mask specified.
|
||||
LFX_FAILURE if some other error occurred
|
||||
LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_ActionColor(const unsigned int, const unsigned int, const unsigned int);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_ActionColorEx
|
||||
Description:
|
||||
Sets the primary and secondary color and an action type for any devices with lights in a location.
|
||||
Important:
|
||||
This function changes the current primary and secondary color and action type stored in the active state
|
||||
since the last LFX_Reset() call. It does NOT immediately update the physical light
|
||||
settings, until a call to LFX_Update() is made. If the action type is not a morph,
|
||||
then the secondary color is ignored.
|
||||
Location Mask Note:
|
||||
Location mask is a 32-bit field, where each of the first 27 bits represent
|
||||
a zone in the virtual cube representing the system (see LFXDecl.h)
|
||||
Color Packing Note:
|
||||
Color is packed into a 32-bit value, as follows:
|
||||
Bits 0-7: Blue
|
||||
Bits 8-15: Green
|
||||
Bits 16-23: Red
|
||||
Bits 24-32: Brightness
|
||||
Inputs: Accepts a 32-bit location mask and a packed color value
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_ERROR_NOINIT if the system is not yet initialized.
|
||||
LFX_ERROR_NOLIGHTS if no lights were found at the location mask specified.
|
||||
LFX_FAILURE if some other error occurred
|
||||
LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_ActionColorEx(const unsigned int, const unsigned int, const unsigned int, const unsigned int);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_SetTiming
|
||||
Description:
|
||||
Sets the tempo for actions.
|
||||
Important:
|
||||
This function changes the current tempo or timing to be used for the
|
||||
next actions. It does NOT immediately update the physical light
|
||||
settings, until a call to LFX_Update() is made.
|
||||
Timing Note:
|
||||
Is a value between min and max tempo allowed for the main device.
|
||||
If a value lower than min or a value greather than max is entered,
|
||||
the value is readjusted to those extremes.
|
||||
Inputs: Accepts a 32-bit timing value
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_FAILURE if changing tempo is not supported or LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_SetTiming(const int);
|
||||
|
||||
/*********************************************************
|
||||
Function: LFX_GetVersion
|
||||
Description:
|
||||
Get API Version
|
||||
Inputs: Accepts the buffer and buffer size
|
||||
Outputs:
|
||||
Populates a character string with the API version
|
||||
Returns:
|
||||
LFX_ERROR_BUFFSIZE if the buffer provided is too small.
|
||||
LFX_FAILURE or LFX_SUCCESS otherwise.
|
||||
*********************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetVersion(char* const, const unsigned int);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
// The remaining defines and typedefs are useful for explicitly linking to
|
||||
// the DLL, and can be ignored if using the static lib, or implicitely linking.
|
||||
#define LFX_DLL_NAME "LightFX.dll"
|
||||
|
||||
// LightFX 2.0 DLL export function names
|
||||
#define LFX_DLL_INITIALIZE "LFX_Initialize"
|
||||
#define LFX_DLL_RELEASE "LFX_Release"
|
||||
#define LFX_DLL_RESET "LFX_Reset"
|
||||
#define LFX_DLL_UPDATE "LFX_Update"
|
||||
#define LFX_DLL_UPDATEDEFAULT "LFX_UpdateDefault"
|
||||
#define LFX_DLL_GETNUMDEVICES "LFX_GetNumDevices"
|
||||
#define LFX_DLL_GETDEVDESC "LFX_GetDeviceDescription"
|
||||
#define LFX_DLL_GETNUMLIGHTS "LFX_GetNumLights"
|
||||
#define LFX_DLL_GETLIGHTDESC "LFX_GetLightDescription"
|
||||
#define LFX_DLL_GETLIGHTLOC "LFX_GetLightLocation"
|
||||
#define LFX_DLL_GETLIGHTCOL "LFX_GetLightColor"
|
||||
#define LFX_DLL_SETLIGHTCOL "LFX_SetLightColor"
|
||||
#define LFX_DLL_LIGHT "LFX_Light"
|
||||
#define LFX_DLL_SETLIGHTACTIONCOLOR "LFX_SetLightActionColor"
|
||||
#define LFX_DLL_SETLIGHTACTIONCOLOREX "LFX_SetLightActionColorEx"
|
||||
#define LFX_DLL_ACTIONCOLOR "LFX_ActionColor"
|
||||
#define LFX_DLL_ACTIONCOLOREX "LFX_ActionColorEx"
|
||||
#define LFX_DLL_SETTIMING "LFX_SetTiming"
|
||||
#define LFX_DLL_GETVERSION "LFX_GetVersion"
|
||||
|
||||
// LightFX 2.0 function pointer declarations
|
||||
typedef LFX_RESULT (*LFX2INITIALIZE)();
|
||||
typedef LFX_RESULT (*LFX2RELEASE)();
|
||||
typedef LFX_RESULT (*LFX2RESET)();
|
||||
typedef LFX_RESULT (*LFX2UPDATE)();
|
||||
typedef LFX_RESULT (*LFX2UPDATEDEFAULT)();
|
||||
typedef LFX_RESULT (*LFX2GETNUMDEVICES)(unsigned int* const);
|
||||
typedef LFX_RESULT (*LFX2GETDEVDESC)(const unsigned int, char* const, const unsigned int, unsigned char* const);
|
||||
typedef LFX_RESULT (*LFX2GETNUMLIGHTS)(const unsigned int, unsigned int* const);
|
||||
typedef LFX_RESULT (*LFX2GETLIGHTDESC)(const unsigned int, const unsigned int, char* const, const unsigned int);
|
||||
typedef LFX_RESULT (*LFX2GETLIGHTLOC)(const unsigned int, const unsigned int, PLFX_POSITION const);
|
||||
typedef LFX_RESULT (*LFX2GETLIGHTCOL)(const unsigned int, const unsigned int, PLFX_COLOR const);
|
||||
typedef LFX_RESULT (*LFX2SETLIGHTCOL)(const unsigned int, const unsigned int, const PLFX_COLOR);
|
||||
typedef LFX_RESULT (*LFX2LIGHT)(const unsigned int, const unsigned int);
|
||||
typedef LFX_RESULT (*LFX2SETLIGHTACTIONCOLOR)(const unsigned int, const unsigned int, const unsigned int, const PLFX_COLOR);
|
||||
typedef LFX_RESULT (*LFX2SETLIGHTACTIONCOLOREX)(const unsigned int, const unsigned int, const unsigned int, const PLFX_COLOR, const PLFX_COLOR);
|
||||
typedef LFX_RESULT (*LFX2ACTIONCOLOR)(const unsigned int, const unsigned int, const unsigned int);
|
||||
typedef LFX_RESULT (*LFX2ACTIONCOLOREX)(const unsigned int, const unsigned int, const unsigned int, const unsigned int);
|
||||
typedef LFX_RESULT (*LFX2SETTIMING)(const int);
|
||||
typedef LFX_RESULT (*LFX2GETVERSION)(char* const, const unsigned int);
|
||||
205
Artemis/LightFX2Artemis/includes/LFXConfigurator.h
Normal file
205
Artemis/LightFX2Artemis/includes/LFXConfigurator.h
Normal file
@ -0,0 +1,205 @@
|
||||
/***************************************************************
|
||||
|
||||
LFXConfigurator.h - Defines the exports for the LightFX
|
||||
Config 1.0 DLL
|
||||
|
||||
Purpose: Provide library exports for communicating with
|
||||
the LightFX Config 1.0 API
|
||||
|
||||
Copyright (c) 2007 Dell, Inc. All rights reserved.
|
||||
|
||||
Dell, Inc. makes no warranty of any kind with regard
|
||||
to this material, including, but not limited to, the
|
||||
implied warranties of merchantability and fitness for
|
||||
a particular purpose. Dell, Inc. shall not be liable
|
||||
for any errors contained herein, or for incidental or
|
||||
consequential damages in connection with the furnishing,
|
||||
performance or use of this material.
|
||||
|
||||
This document contains proprietary information which
|
||||
is protected by copyright. All rights reserved.
|
||||
Reproduction without the written permission of Dell
|
||||
is strictly forbidden.
|
||||
|
||||
***************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define _EXPORTING
|
||||
|
||||
#ifdef _EXPORTING // To be used by SDK developer
|
||||
#define FN_DECLSPEC __declspec(dllexport)
|
||||
|
||||
#elif _IMPORTING // To be used for dynamic linking to dll
|
||||
#define FN_DECLSPEC __declspec(dllimport)
|
||||
|
||||
#else // To be used for linking using static library
|
||||
#define FN_DECLSPEC
|
||||
#endif
|
||||
|
||||
#ifdef _STDCALL_SUPPORTED
|
||||
#define STDCALL __stdcall // Declare our calling convention
|
||||
#else
|
||||
#define STDCALL
|
||||
#endif // STDCALL_SUPPORTED
|
||||
|
||||
// Return values
|
||||
#define LFX_RESULT unsigned int
|
||||
#define LFX_SUCCESS 0 // Success
|
||||
#define LFX_FAILURE 1 // Generic failure
|
||||
#define LFX_ERROR_NOINIT 2 // System not initialized yet
|
||||
#define LFX_ERROR_NODEVS 3 // No devices available
|
||||
#define LFX_ERROR_NOLIGHTS 4 // No lights available
|
||||
#define LFX_ERROR_BUFFSIZE 5 // Buffer size too small
|
||||
|
||||
//event position
|
||||
#define LFX_EVENTPOSITION unsigned int
|
||||
#define LFX_FIRSTEVENT 0 // First event
|
||||
#define LFX_NEXTEVENT 1 // Next event
|
||||
|
||||
//event position
|
||||
#define LFX_APPTYPE unsigned int
|
||||
#define LFX_GAME 0 // The application is a game
|
||||
#define LFX_GENERALUSEAPP 1 // It is a general use application
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// LightFX Config 1.0 DLL export function declarations
|
||||
|
||||
/***************************************************************
|
||||
Function: LFX_CONFIGURATOR_Initialize
|
||||
Description:
|
||||
Initializes the LightFX Config 1.0 system.
|
||||
This function must be called prior to any other library calls being made. If this
|
||||
function is not called, the system will not be initialized and the other functions
|
||||
will return LFX_ERROR_NOINIT.
|
||||
Inputs: None
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_SUCCESS if the system is successfully initialized, or was already initialized.
|
||||
LFX_FAILURE if initialization fails.
|
||||
***************************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_CONFIGURATOR_Initialize();
|
||||
|
||||
/***************************************************************
|
||||
Function: LFX_CONFIGURATOR_Release
|
||||
Description:
|
||||
Release the LightFX Config 1.0 system.
|
||||
This function may be called when the system is no longer needed. If this
|
||||
function is not called, release will still occur on process detach.
|
||||
Inputs: None
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_SUCCESS
|
||||
***************************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_CONFIGURATOR_Release();
|
||||
|
||||
/***************************************************************
|
||||
Function: LFX_CONFIGURATOR_RegisterConfigurationFile
|
||||
Description:
|
||||
Register an app in order to be read by the AlienFX Editor.
|
||||
Inputs: Application name and full path to the config file
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_SUCCESS if the application is successfully registered.
|
||||
LFX_FAILURE if the registration fails.
|
||||
LFX_ERROR_NOINIT if the LFX_CONFIGURATOR_Initialize
|
||||
function was not called before
|
||||
***************************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_CONFIGURATOR_RegisterConfigurationFile(char* const appFXName, char* const configurationFileFullPath, const LFX_APPTYPE appType);
|
||||
|
||||
/***************************************************************
|
||||
Function: LFX_CONFIGURATOR_UnregisterConfigurationFile
|
||||
Description:
|
||||
Unregister an app. Once this function is called, the app
|
||||
will not appear in AlienFX Editor and cannot be configured
|
||||
Inputs: Application name
|
||||
Outputs: None
|
||||
Returns:
|
||||
LFX_SUCCESS if the application is successfully unregistered.
|
||||
LFX_FAILURE if the registration fails.
|
||||
LFX_ERROR_NOINIT if the LFX_CONFIGURATOR_Initialize
|
||||
function was not called before
|
||||
***************************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_CONFIGURATOR_UnregisterConfigurationFile(char* const appFXName);
|
||||
|
||||
/***************************************************************
|
||||
Function: LFX_CONFIGURATOR_GetUserConfigurationFilePath
|
||||
Description:
|
||||
Get the user's configuration file for an application
|
||||
Inputs: Application name and the size of the buffer where the
|
||||
user's configuration filename is going to be returned
|
||||
Outputs:
|
||||
Populates a character string with the user's configuration file
|
||||
Returns:
|
||||
LFX_SUCCESS if the user configuration file is returned.
|
||||
LFX_FAILURE if the user's configuration file cannot be returned.
|
||||
LFX_ERROR_BUFFSIZE if the buffer provided is too small.
|
||||
LFX_ERROR_NOINIT if the LFX_CONFIGURATOR_Initialize
|
||||
function was not called before
|
||||
***************************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_CONFIGURATOR_GetUserConfigurationFilePath(char* const appFXName, char* const userConfigurationFilename, const unsigned int userConfigurationFilenameSize);
|
||||
|
||||
/***************************************************************
|
||||
Function: LFX_CONFIGURATOR_GetConfigurationEvent
|
||||
Description:
|
||||
Get the color configuration for an event
|
||||
Inputs: Application name and event id
|
||||
Outputs:
|
||||
Populates a color array and the amount of colors for that event
|
||||
Returns:
|
||||
LFX_SUCCESS if the colors for the event is returned.
|
||||
LFX_FAILURE if the colors for the event cannot be returned.
|
||||
LFX_ERROR_NOINIT if the LFX_CONFIGURATOR_Initialize
|
||||
function was not called before
|
||||
***************************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_CONFIGURATOR_GetConfigurationEvent(char* const appFXName, const unsigned int eventID, unsigned int* &colors, unsigned int &colorCount);
|
||||
|
||||
/***************************************************************
|
||||
Function: LFX_CONFIGURATOR_GetConfigurationEventAt
|
||||
Description:
|
||||
Get the color configuration for an event
|
||||
Inputs: Application name and event position
|
||||
Outputs:
|
||||
Returns the event in that position and data related
|
||||
Populates a character string with the event name
|
||||
Populates a color array and the amount of colors for that event
|
||||
Returns:
|
||||
LFX_SUCCESS if there is an event to be returned.
|
||||
LFX_FAILURE if the event cannot be returned.
|
||||
LFX_ERROR_BUFFSIZE if the buffer provided is too small.
|
||||
LFX_ERROR_NOINIT if the LFX_CONFIGURATOR_Initialize
|
||||
function was not called before
|
||||
***************************************************************/
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_CONFIGURATOR_GetConfigurationEventAt(char* const appFXName, unsigned int position,
|
||||
int &eventID, char* const eventName, const unsigned int eventNameSize, unsigned int* &colors, unsigned int &colorCount);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
// The remaining defines and typedefs are useful for explicitly linking to
|
||||
// the DLL, and can be ignored if using the static lib, or implicitely linking.
|
||||
#define LFX_CONFIGURATOR_DLL_NAME "LightFXConfigurator64.dll"
|
||||
|
||||
// LightFX Config 1.0 DLL export function names
|
||||
#define LFX_CONFIGURATOR_DLL_INITIALIZE "LFX_CONFIGURATOR_Initialize"
|
||||
#define LFX_CONFIGURATOR_DLL_RELEASE "LFX_CONFIGURATOR_Release"
|
||||
#define LFX_CONFIGURATOR_DLL_REGISTERCONFIGURATIONFILE "LFX_CONFIGURATOR_RegisterConfigurationFile"
|
||||
#define LFX_CONFIGURATOR_DLL_UNREGISTERCONFIGURATIONFILE "LFX_CONFIGURATOR_UnregisterConfigurationFile"
|
||||
#define LFX_CONFIGURATOR_DLL_GETUSERCONFIGURATIONFILEPATH "LFX_CONFIGURATOR_GetUserConfigurationFilePath"
|
||||
#define LFX_CONFIGURATOR_DLL_GETCONFIGURATIONEVENT "LFX_CONFIGURATOR_GetConfigurationEvent"
|
||||
#define LFX_CONFIGURATOR_DLL_GETCONFIGURATIONEVENTFROMPOSITION "LFX_CONFIGURATOR_GetConfigurationEventAt"
|
||||
|
||||
|
||||
// LightFX Config 1.0 function pointer declarations
|
||||
typedef LFX_RESULT (*LFXCONFIGURATORINITIALIZE)();
|
||||
typedef LFX_RESULT (*LFXCONFIGURATORRELEASE)();
|
||||
typedef LFX_RESULT (*LFXCONFIGURATORREGISTERCONFIGURATIONFILE)(char* const, char* const, const LFX_APPTYPE);
|
||||
typedef LFX_RESULT (*LFXCONFIGURATORUNREGISTERCONFIGURATIONFILE)(char* const);
|
||||
typedef LFX_RESULT (*LFXCONFIGURATORGETUSERCONFIGURATIONFILEPATH)(char* const, char* const, const unsigned int);
|
||||
typedef LFX_RESULT (*LFXCONFIGURATORGETCONFIGURATIONEVENT)(char* const, const unsigned int, unsigned int*&, unsigned int&);
|
||||
typedef LFX_RESULT (*LFXCONFIGURATORGETCONFIGURATIONEVENTFROMPOSITION)(char* const, unsigned int, int&, char* const, const unsigned int, unsigned int*&, unsigned int&);
|
||||
|
||||
238
Artemis/LightFX2Artemis/includes/LFXDecl.h
Normal file
238
Artemis/LightFX2Artemis/includes/LFXDecl.h
Normal file
@ -0,0 +1,238 @@
|
||||
/*********************************************************
|
||||
|
||||
LFXDecl.h - definitions for Dell LightFX 2.0
|
||||
|
||||
Purpose: Provide definitions for communicating with
|
||||
the LightFX 2.0 API
|
||||
|
||||
Copyright (c) 2007 Dell, Inc. All rights reserved.
|
||||
Date: 6/21/2007
|
||||
|
||||
Dell, Inc. makes no warranty of any kind with regard
|
||||
to this material, including, but not limited to, the
|
||||
implied warranties of merchantability and fitness for
|
||||
a particular purpose. Dell, Inc. shall not be liable
|
||||
for any errors contained herein, or for incidental or
|
||||
consequential damages in connection with the furnishing,
|
||||
performance or use of this material.
|
||||
|
||||
This document contains proprietary information which
|
||||
is protected by copyright. All rights reserved.
|
||||
Reproduction without the written permission of Dell
|
||||
is strictly forbidden.
|
||||
|
||||
**********************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Helper release and delete functions, used in cleanup routines
|
||||
#define LFX_SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
|
||||
#define LFX_SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
|
||||
#define LFX_SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
|
||||
|
||||
#define LFX_DEF_STRING_SIZE 255 // Default string size
|
||||
#define LFX_MAX_STRING_SIZE 255 // Maximum string size
|
||||
#define LFX_MAX_COLOR_VALUE 255 // Maximum color value
|
||||
|
||||
#define LFX_MINIMUM_DEVICE_SIZE 3 // Min device physical size/bounds in cm
|
||||
#define LFX_SEGMENTS_PER_AXIS 3 // Each location axis (x,y,z) has 3 segments (e.g. left,center,right), resulting in 27 possible locations
|
||||
|
||||
// LightFX 1.x legacy support
|
||||
#define LFX_INTENSITY_CONV 36 // Brightness/intensity conversion factor
|
||||
#define LFX_INDEX_COLOR_COUNT 17 // 16 colors, plus 0 for "off"
|
||||
|
||||
// Type definitions
|
||||
#define LFX_PROTOCOL_UNKNOWN 0x00
|
||||
#define LFX_PROTOCOL_LFX1 0x01
|
||||
#define LFX_PROTOCOL_ESA 0x28
|
||||
#define LFX_PROTOCOL_OTHER 0xFF
|
||||
|
||||
#define LFX_CATEGORY_UNKNOWN 0x00
|
||||
#define LFX_CATEGORY_SYSTEM 0x01
|
||||
#define LFX_CATEGORY_PERIPH 0x02
|
||||
#define LFX_CATEGORY_OTHER 0xFF
|
||||
|
||||
#define LFX_DEVTYPE_UNKNOWN 0x00
|
||||
#define LFX_DEVTYPE_NOTEBOOK 0x01
|
||||
#define LFX_DEVTYPE_DESKTOP 0x02
|
||||
#define LFX_DEVTYPE_SERVER 0x03
|
||||
#define LFX_DEVTYPE_DISPLAY 0x04
|
||||
#define LFX_DEVTYPE_MOUSE 0x05
|
||||
#define LFX_DEVTYPE_KEYBOARD 0x06
|
||||
#define LFX_DEVTYPE_GAMEPAD 0x07
|
||||
#define LFX_DEVTYPE_SPEAKER 0x08
|
||||
#define LFX_DEVTYPE_OTHER 0xFF
|
||||
|
||||
// Return values
|
||||
#define LFX_RESULT unsigned int
|
||||
#define LFX_SUCCESS 0 // Success
|
||||
#define LFX_FAILURE 1 // Generic failure
|
||||
#define LFX_ERROR_NOINIT 2 // System not initialized yet
|
||||
#define LFX_ERROR_NODEVS 3 // No devices available
|
||||
#define LFX_ERROR_NOLIGHTS 4 // No lights available
|
||||
#define LFX_ERROR_BUFFSIZE 5 // Buffer size too small
|
||||
|
||||
// Translation layer position/location encoding
|
||||
// Note: This is a bit mask, with 27 zones encoded into 32 bits
|
||||
// Bits 0 through 8 are all part of the front-most plane (closest to the user)
|
||||
// Bits 9 through 17 are all part of the middle plane (mid-way from the user)
|
||||
// Bits 18 through 27 are all part of the back-most plane (furthest from the user)
|
||||
// Bits 28 through 32 are reserved
|
||||
//
|
||||
// Bits 0 through 8 are split into lower, middle and upper sections (relative to the floor & ceiling)
|
||||
//
|
||||
// Bit 0: [ FRONT, LOWER, LEFT ]
|
||||
// Bit 1: [ FRONT, LOWER, CENTER ]
|
||||
// Bit 2: [ FRONT, LOWER, RIGHT ]
|
||||
//
|
||||
// Bit 3: [ FRONT, MIDDLE, LEFT ]
|
||||
// Bit 4: [ FRONT, MIDDLE, CENTER ]
|
||||
// Bit 5: [ FRONT, MIDDLE, RIGHT ]
|
||||
//
|
||||
// Bit 6: [ FRONT, UPPER, LEFT ]
|
||||
// Bit 7: [ FRONT, UPPER, CENTER ]
|
||||
// Bit 8: [ FRONT, UPPER, RIGHT ]
|
||||
//
|
||||
// Bits 9 through 17 are split into lower, middle and upper sections as well
|
||||
//
|
||||
// Bit 9: [ MIDDLE, LOWER, LEFT ]
|
||||
// Bit 10: [ MIDDLE, LOWER, CENTER ]
|
||||
// Bit 11: [ MIDDLE, LOWER, RIGHT ]
|
||||
//
|
||||
// Bit 12: [ MIDDLE, MIDDLE, LEFT ]
|
||||
// Bit 13: [ MIDDLE, MIDDLE, CENTER ]
|
||||
// Bit 14: [ MIDDLE, MIDDLE, RIGHT ]
|
||||
//
|
||||
// Bit 15: [ MIDDLE, UPPER, LEFT ]
|
||||
// Bit 16: [ MIDDLE, UPPER, CENTER ]
|
||||
// Bit 17: [ MIDDLE, UPPER, RIGHT ]
|
||||
//
|
||||
// Similar with bits 18 through 26
|
||||
//
|
||||
// Bit 18: [ BACK, LOWER, LEFT ]
|
||||
// Bit 19: [ BACK, LOWER, CENTER ]
|
||||
// Bit 20: [ BACK, LOWER, RIGHT ]
|
||||
//
|
||||
// Bit 21: [ BACK, MIDDLE, LEFT ]
|
||||
// Bit 22: [ BACK, MIDDLE, CENTER ]
|
||||
// Bit 23: [ BACK, MIDDLE, RIGHT ]
|
||||
//
|
||||
// Bit 24: [ BACK, UPPER, LEFT ]
|
||||
// Bit 25: [ BACK, UPPER, CENTER ]
|
||||
// Bit 26: [ BACK, UPPER, RIGHT ]
|
||||
//
|
||||
// Bits 27 through 32 are reserved
|
||||
|
||||
// Near Z-plane light definitions
|
||||
#define LFX_FRONT_LOWER_LEFT 0x00000001
|
||||
#define LFX_FRONT_LOWER_CENTER 0x00000002
|
||||
#define LFX_FRONT_LOWER_RIGHT 0x00000004
|
||||
|
||||
#define LFX_FRONT_MIDDLE_LEFT 0x00000008
|
||||
#define LFX_FRONT_MIDDLE_CENTER 0x00000010
|
||||
#define LFX_FRONT_MIDDLE_RIGHT 0x00000020
|
||||
|
||||
#define LFX_FRONT_UPPER_LEFT 0x00000040
|
||||
#define LFX_FRONT_UPPER_CENTER 0x00000080
|
||||
#define LFX_FRONT_UPPER_RIGHT 0x00000100
|
||||
|
||||
// Mid Z-plane light definitions
|
||||
#define LFX_MIDDLE_LOWER_LEFT 0x00000200
|
||||
#define LFX_MIDDLE_LOWER_CENTER 0x00000400
|
||||
#define LFX_MIDDLE_LOWER_RIGHT 0x00000800
|
||||
|
||||
#define LFX_MIDDLE_MIDDLE_LEFT 0x00001000
|
||||
#define LFX_MIDDLE_MIDDLE_CENTER 0x00002000
|
||||
#define LFX_MIDDLE_MIDDLE_RIGHT 0x00004000
|
||||
|
||||
#define LFX_MIDDLE_UPPER_LEFT 0x00008000
|
||||
#define LFX_MIDDLE_UPPER_CENTER 0x00010000
|
||||
#define LFX_MIDDLE_UPPER_RIGHT 0x00020000
|
||||
|
||||
// Far Z-plane light definitions
|
||||
#define LFX_REAR_LOWER_LEFT 0x00040000
|
||||
#define LFX_REAR_LOWER_CENTER 0x00080000
|
||||
#define LFX_REAR_LOWER_RIGHT 0x00100000
|
||||
|
||||
#define LFX_REAR_MIDDLE_LEFT 0x00200000
|
||||
#define LFX_REAR_MIDDLE_CENTER 0x00400000
|
||||
#define LFX_REAR_MIDDLE_RIGHT 0x00800000
|
||||
|
||||
#define LFX_REAR_UPPER_LEFT 0x01000000
|
||||
#define LFX_REAR_UPPER_CENTER 0x02000000
|
||||
#define LFX_REAR_UPPER_RIGHT 0x04000000
|
||||
|
||||
// Combination bit masks
|
||||
#define LFX_ALL 0x07FFFFFF
|
||||
#define LFX_ALL_RIGHT 0x04924924
|
||||
#define LFX_ALL_LEFT 0x01249249
|
||||
#define LFX_ALL_UPPER 0x070381C0
|
||||
#define LFX_ALL_LOWER 0x001C0E07
|
||||
#define LFX_ALL_FRONT 0x000001FF
|
||||
#define LFX_ALL_REAR 0x07FC0000
|
||||
|
||||
// Translation layer color encoding
|
||||
#define LFX_OFF 0x00000000
|
||||
#define LFX_BLACK 0x00000000
|
||||
#define LFX_RED 0x00FF0000
|
||||
#define LFX_GREEN 0x0000FF00
|
||||
#define LFX_BLUE 0x000000FF
|
||||
#define LFX_WHITE 0x00FFFFFF
|
||||
#define LFX_YELLOW 0x00FFFF00
|
||||
#define LFX_ORANGE 0x00FF8000
|
||||
#define LFX_PINK 0x00FF80FF
|
||||
#define LFX_CYAN 0x0000FFFF
|
||||
|
||||
// Translation layer brightness encoding
|
||||
#define LFX_FULL_BRIGHTNESS 0xFF000000
|
||||
#define LFX_HALF_BRIGHTNESS 0x80000000
|
||||
#define LFX_MIN_BRIGHTNESS 0x00000000
|
||||
|
||||
// Predifined kinds of actions
|
||||
#define LFX_ACTION_MORPH 0x00000001
|
||||
#define LFX_ACTION_PULSE 0x00000002
|
||||
#define LFX_ACTION_COLOR 0x00000003
|
||||
|
||||
// Color, encoded into 4 unsigned chars
|
||||
typedef struct _LFX_COLOR
|
||||
{
|
||||
unsigned char red;
|
||||
unsigned char green;
|
||||
unsigned char blue;
|
||||
unsigned char brightness;
|
||||
|
||||
}LFX_COLOR, *PLFX_COLOR;
|
||||
|
||||
/**************************************************************************************
|
||||
IMPORTANT NOTE:
|
||||
|
||||
The semantics of LightFX position, location mask, and bounds are defined as follows:
|
||||
|
||||
BOUNDS are the physical bounds, in centimeters, of any given device/enclosure,
|
||||
relative to an anchor point at the lower, left, rear corner
|
||||
POSITION is a physical position, in centimeters, of any given light relative to
|
||||
the lower, left, rear corner of the device's bounding box.
|
||||
LOCATION (or "location mask") is a 32-bit mask that denotes one or more light positions
|
||||
in terms of the device's bounding box. There are 27 bits for each smaller cube
|
||||
within this bounding box, divided evenly. (Imagine a Rubick's cube...)
|
||||
|
||||
BOUNDS or POSITION may be encoded into a LFX_POSITION structure, so it is important to
|
||||
examine the context of the usage to determine what the data inside the structure refers to.
|
||||
|
||||
LOCATION should always be encoded into a 32-bit (or larger) value; see the bit field
|
||||
declarations above.
|
||||
***************************************************************************************/
|
||||
|
||||
/* Position, encoded into a 3-axis value.
|
||||
Note that these are relative to the lower, left, rear
|
||||
corner of the device's bounding box.
|
||||
X increases from left to right.
|
||||
Y increases from bottom to top.
|
||||
Z increases from back to front. */
|
||||
typedef struct _LFX_POSITION
|
||||
{
|
||||
unsigned char x;
|
||||
unsigned char y;
|
||||
unsigned char z;
|
||||
|
||||
} LFX_POSITION, *PLFX_POSITION;
|
||||
@ -1,109 +1,45 @@
|
||||
// Original work by VRocker https://github.com/VRocker/LogiLed2Corsair
|
||||
// I'm mainly a C# developer, and these modification aren't a piece of art, but it suits our needs.
|
||||
|
||||
// The MIT License (MIT)
|
||||
//
|
||||
// Copyright (c) 2015 VRocker
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include "main.h"
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
#include <thread>
|
||||
#include "LogiLedDefs.h"
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#include <complex>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include "../LightFX2Artemis/LightFxState.h"
|
||||
#include "LFX2.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
static bool g_hasInitialised = false;
|
||||
|
||||
static bool mustLog = false;
|
||||
static int throttle = 0;
|
||||
const char* game = "";
|
||||
LightFxState* lightFxState;
|
||||
|
||||
|
||||
const char* GetGame()
|
||||
char* GetGame()
|
||||
{
|
||||
CHAR divisionFind[] = ("Division");
|
||||
CHAR gtaFind[] = ("GTA");
|
||||
CHAR szPath[MAX_PATH];
|
||||
|
||||
GetModuleFileNameA(NULL, szPath, MAX_PATH);
|
||||
char *output;
|
||||
|
||||
output = strstr(szPath, divisionFind);
|
||||
if (output)
|
||||
return "division";
|
||||
output = strstr(szPath, gtaFind);
|
||||
if (output)
|
||||
return "gta";
|
||||
|
||||
return "bf1";
|
||||
return szPath;
|
||||
};
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hInst, DWORD fdwReason, LPVOID)
|
||||
{
|
||||
if (fdwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
game = GetGame();
|
||||
|
||||
{
|
||||
lightFxState = new LightFxState(GetGame());
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "Main called, DLL loaded into " << game << "\n";
|
||||
myfile << "Main called, DLL loaded into " << lightFxState->Game << "\n";
|
||||
myfile.close();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LogiLedInit()
|
||||
{
|
||||
g_hasInitialised = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LogiLedGetSdkVersion(int* majorNum, int* minorNum, int* buildNum)
|
||||
{
|
||||
// Mimic the SDK version
|
||||
*majorNum = 8;
|
||||
*minorNum = 81;
|
||||
*buildNum = 15;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LogiLedSetTargetDevice(int targetDevice)
|
||||
{
|
||||
// Logitech SDK says this function returns false if LogiLedInit hasn't been called
|
||||
return g_hasInitialised;
|
||||
}
|
||||
|
||||
bool LogiLedSaveCurrentLighting()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Transmit(const char* msg)
|
||||
{
|
||||
//Pipe Init Data
|
||||
@ -128,245 +64,97 @@ void Transmit(const char* msg)
|
||||
WriteFile(hPipe1, msg, strlen(msg), &cbWritten, NULL);
|
||||
}
|
||||
|
||||
// LogiLedSetLighting appears to have an undocumented extra argument
|
||||
bool LogiLedSetLighting(int redPercentage, int greenPercentage, int bluePercentage, int custom = 0)
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_Initialize()
|
||||
{
|
||||
// GTA goes mental on the SetLighting calls, lets only send one in every 20
|
||||
if (game == "gta")
|
||||
{
|
||||
throttle++;
|
||||
if (throttle > 20)
|
||||
throttle = 0;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
if (custom == 0)
|
||||
{
|
||||
myfile << "LogiLedSetLighting called\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
myfile << "LogiLedSetLighting called with custom " << custom << "\n";
|
||||
}
|
||||
myfile.close();
|
||||
}
|
||||
ostringstream os;
|
||||
os << "0 " << hex << custom << " " << dec << redPercentage << " " << greenPercentage << " " << bluePercentage;
|
||||
Transmit(os.str().c_str());
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedRestoreLighting()
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_Release()
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedRestoreLighting called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedFlashLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval)
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_Reset()
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedFlashLighting called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedPulseLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval)
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_Update()
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedPulseLighting called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedStopEffects()
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_UpdateDefault()
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedStopEffects called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedSetLightingFromBitmap(unsigned char bitmap[])
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetNumDevices(unsigned int* const)
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedSetLightingFromBitmap called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedSetLightingForKeyWithScanCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage)
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetDeviceDescription(const unsigned int, char* const, const unsigned int, unsigned char* const)
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedSetLightingForKeyWithScanCode called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedSetLightingForKeyWithHidCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage)
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetNumLights(const unsigned int, unsigned int* const)
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedSetLightingForKeyWithHidCode called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedSetLightingForKeyWithQuartzCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage)
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetLightDescription(const unsigned int, const unsigned int, char* const, const unsigned int)
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedSetLightingForKeyWithQuartzCode called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedSetLightingForKeyWithKeyName(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage)
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetLightLocation(const unsigned int, const unsigned int, PLFX_POSITION const)
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedSetLightingForKeyWithKeyName called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
// Only transmit interesting keys. This can most likely be done prettier, but I'm no C++ dev.
|
||||
if (game == "division" && (keyName == LogiLed::F1 || keyName == LogiLed::F2 || keyName == LogiLed::F3 || keyName == LogiLed::F4 || keyName == LogiLed::R || keyName == LogiLed::G || keyName == LogiLed::V))
|
||||
{
|
||||
ostringstream os;
|
||||
os << "1 " << keyName << " " << redPercentage << " " << greenPercentage << " " << bluePercentage;
|
||||
string s = os.str();
|
||||
Transmit(os.str().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
ostringstream os;
|
||||
os << "1 " << keyName << " " << redPercentage << " " << greenPercentage << " " << bluePercentage;
|
||||
string s = os.str();
|
||||
Transmit(os.str().c_str());
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedSaveLightingForKey(LogiLed::KeyName keyName)
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetLightColor(const unsigned int, const unsigned int, PLFX_COLOR const)
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedSaveLightingForKey called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedRestoreLightingForKey(LogiLed::KeyName keyName)
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_SetLightColor(const unsigned int, const unsigned int, const PLFX_COLOR)
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedRestoreLightingForKey called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedFlashSingleKey(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage, int msDuration, int msInterval)
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_Light(const unsigned int, const unsigned int)
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedFlashSingleKey called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedPulseSingleKey(LogiLed::KeyName keyName, int startRedPercentage, int startGreenPercentage, int startBluePercentage, int finishRedPercentage, int finishGreenPercentage, int finishBluePercentage, int msDuration, bool isInfinite)
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_SetLightActionColor(const unsigned int, const unsigned int, const unsigned int, const PLFX_COLOR)
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedPulseSingleKey called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
bool LogiLedStopEffectsOnKey(LogiLed::KeyName keyName)
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedStopEffectsOnKey called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_SetLightActionColorEx(const unsigned int, const unsigned int, const unsigned int, const PLFX_COLOR, const PLFX_COLOR)
|
||||
{
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
void LogiLedShutdown()
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_ActionColor(const unsigned int, const unsigned int, const unsigned int)
|
||||
{
|
||||
if (mustLog)
|
||||
{
|
||||
ofstream myfile;
|
||||
myfile.open("log.txt", ios::out | ios::app);
|
||||
myfile << "LogiLedShutdown called\n";
|
||||
myfile.close();
|
||||
}
|
||||
|
||||
g_hasInitialised = false;
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_ActionColorEx(const unsigned int, const unsigned int, const unsigned int, const unsigned int)
|
||||
{
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_SetTiming(const int)
|
||||
{
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
FN_DECLSPEC LFX_RESULT STDCALL LFX_GetVersion(char* const, const unsigned int)
|
||||
{
|
||||
return LFX_SUCCESS;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user