mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-31 09:43:46 +00:00
Added UI elements borrowed from DarthAffe
Added a WIP of profile classes
This commit is contained in:
parent
7d4c5dbae6
commit
0c47b9a2fb
@ -68,39 +68,6 @@
|
|||||||
<Reference Include="Ninject.Extensions.Factory, Version=3.3.2.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
|
<Reference Include="Ninject.Extensions.Factory, Version=3.3.2.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Ninject.Extensions.Factory.3.3.2\lib\net45\Ninject.Extensions.Factory.dll</HintPath>
|
<HintPath>..\packages\Ninject.Extensions.Factory.3.3.2\lib\net45\Ninject.Extensions.Factory.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="RGB.NET.Brushes, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\RGB.NET.Brushes.0.0.1.20\lib\net45\RGB.NET.Brushes.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="RGB.NET.Core, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\RGB.NET.Core.0.0.1.20\lib\net45\RGB.NET.Core.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="RGB.NET.Decorators, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\RGB.NET.Decorators.0.0.1.20\lib\net45\RGB.NET.Decorators.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="RGB.NET.Devices.Asus, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\RGB.NET.Devices.Asus.0.0.1.20\lib\net45\RGB.NET.Devices.Asus.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="RGB.NET.Devices.CoolerMaster, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.20\lib\net45\RGB.NET.Devices.CoolerMaster.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="RGB.NET.Devices.Corsair, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\RGB.NET.Devices.Corsair.0.0.1.20\lib\net45\RGB.NET.Devices.Corsair.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="RGB.NET.Devices.Logitech, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\RGB.NET.Devices.Logitech.0.0.1.20\lib\net45\RGB.NET.Devices.Logitech.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="RGB.NET.Devices.Msi, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\RGB.NET.Devices.Msi.0.0.1.20\lib\net45\RGB.NET.Devices.Msi.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="RGB.NET.Devices.Novation, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\RGB.NET.Devices.Novation.0.0.1.20\lib\net45\RGB.NET.Devices.Novation.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="RGB.NET.Devices.Razer, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\RGB.NET.Devices.Razer.0.0.1.20\lib\net45\RGB.NET.Devices.Razer.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="RGB.NET.Groups, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\RGB.NET.Groups.0.0.1.20\lib\net45\RGB.NET.Groups.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Sanford.Multimedia.Midi, Version=6.4.2.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Sanford.Multimedia.Midi, Version=6.4.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Sanford.Multimedia.Midi.6.4.2\lib\net20\Sanford.Multimedia.Midi.dll</HintPath>
|
<HintPath>..\packages\Sanford.Multimedia.Midi.6.4.2\lib\net20\Sanford.Multimedia.Midi.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@ -188,10 +155,14 @@
|
|||||||
<Compile Include="Events\DeviceEventArgs.cs" />
|
<Compile Include="Events\DeviceEventArgs.cs" />
|
||||||
<Compile Include="Exceptions\ArtemisCoreException.cs" />
|
<Compile Include="Exceptions\ArtemisCoreException.cs" />
|
||||||
<Compile Include="Exceptions\ArtemisPluginException.cs" />
|
<Compile Include="Exceptions\ArtemisPluginException.cs" />
|
||||||
|
<Compile Include="ProfileElements\Folder.cs" />
|
||||||
|
<Compile Include="ProfileElements\Interfaces\IProfileElement.cs" />
|
||||||
|
<Compile Include="ProfileElements\Profile.cs" />
|
||||||
<Compile Include="Ninject\CoreModule.cs" />
|
<Compile Include="Ninject\CoreModule.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Services\CoreService.cs" />
|
<Compile Include="Services\CoreService.cs" />
|
||||||
<Compile Include="Services\DeviceService.cs" />
|
<Compile Include="Services\RgbService.cs" />
|
||||||
|
<Compile Include="Services\Interfaces\IRgbService.cs" />
|
||||||
<Compile Include="Services\Interfaces\IArtemisService.cs" />
|
<Compile Include="Services\Interfaces\IArtemisService.cs" />
|
||||||
<Compile Include="Services\Interfaces\ICoreService.cs" />
|
<Compile Include="Services\Interfaces\ICoreService.cs" />
|
||||||
<Compile Include="Services\Interfaces\IPluginService.cs" />
|
<Compile Include="Services\Interfaces\IPluginService.cs" />
|
||||||
@ -207,27 +178,65 @@
|
|||||||
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
|
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Brushes\RGB.NET.Brushes.csproj">
|
||||||
|
<Project>{347c5f0f-f490-4dec-9c1c-6e84750d838d}</Project>
|
||||||
|
<Name>RGB.NET.Brushes</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Core\RGB.NET.Core.csproj">
|
||||||
|
<Project>{5a4f9a75-75fe-47cd-90e5-914d5b20d232}</Project>
|
||||||
|
<Name>RGB.NET.Core</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Decorators\RGB.NET.Decorators.csproj">
|
||||||
|
<Project>{7012c431-244a-453f-b7fd-59e030cdbc44}</Project>
|
||||||
|
<Name>RGB.NET.Decorators</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Asus\RGB.NET.Devices.Asus.csproj">
|
||||||
|
<Project>{4f2f3fbd-a1e4-4968-a2ad-0514959e5e59}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Asus</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.CoolerMaster\RGB.NET.Devices.CoolerMaster.csproj">
|
||||||
|
<Project>{85609427-d433-44e2-a249-ce890b66d845}</Project>
|
||||||
|
<Name>RGB.NET.Devices.CoolerMaster</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Corsair\RGB.NET.Devices.Corsair.csproj">
|
||||||
|
<Project>{dda8c4c2-8abf-4fa0-9af9-c47ad0bfe47d}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Corsair</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Logitech\RGB.NET.Devices.Logitech.csproj">
|
||||||
|
<Project>{e7b2f174-fcc6-4fc7-9970-3138b5f4c921}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Logitech</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Msi\RGB.NET.Devices.Msi.csproj">
|
||||||
|
<Project>{4efd77c7-fdb4-4c6b-970c-0ef66d24be09}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Msi</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Novation\RGB.NET.Devices.Novation.csproj">
|
||||||
|
<Project>{db2911f6-404c-4bc8-b35f-232a7450755f}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Novation</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Razer\RGB.NET.Devices.Razer.csproj">
|
||||||
|
<Project>{24ff4acb-d679-4b2d-86d4-50ab6c02d816}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Razer</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Groups\RGB.NET.Groups.csproj">
|
||||||
|
<Project>{2a39f859-aad0-4c16-94f8-78057820b376}</Project>
|
||||||
|
<Name>RGB.NET.Groups</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Input.Corsair\RGB.NET.Input.Corsair.csproj">
|
||||||
|
<Project>{f905c418-76bb-4ba6-88ab-0793bc2681d3}</Project>
|
||||||
|
<Name>RGB.NET.Input.Corsair</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Input\RGB.NET.Input.csproj">
|
||||||
|
<Project>{e60c3c6f-903f-4d80-99d0-7a1e50af5a9d}</Project>
|
||||||
|
<Name>RGB.NET.Input</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\Artemis.Plugins\Artemis.Plugins.csproj">
|
<ProjectReference Include="..\Artemis.Plugins\Artemis.Plugins.csproj">
|
||||||
<Project>{cd23bc5e-57f0-46ce-a007-24d031146219}</Project>
|
<Project>{cd23bc5e-57f0-46ce-a007-24d031146219}</Project>
|
||||||
<Name>Artemis.Plugins</Name>
|
<Name>Artemis.Plugins</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Models\" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="..\packages\RGB.NET.Devices.Asus.0.0.1.20\build\net45\RGB.NET.Devices.Asus.targets" Condition="Exists('..\packages\RGB.NET.Devices.Asus.0.0.1.20\build\net45\RGB.NET.Devices.Asus.targets')" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Asus.0.0.1.20\build\net45\RGB.NET.Devices.Asus.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Asus.0.0.1.20\build\net45\RGB.NET.Devices.Asus.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.20\build\net45\RGB.NET.Devices.CoolerMaster.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.20\build\net45\RGB.NET.Devices.CoolerMaster.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Corsair.0.0.1.20\build\net45\RGB.NET.Devices.Corsair.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Corsair.0.0.1.20\build\net45\RGB.NET.Devices.Corsair.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Logitech.0.0.1.20\build\net45\RGB.NET.Devices.Logitech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Logitech.0.0.1.20\build\net45\RGB.NET.Devices.Logitech.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.20\build\net45\RGB.NET.Devices.Msi.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Msi.0.0.1.20\build\net45\RGB.NET.Devices.Msi.targets'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Razer.0.0.1.20\build\net45\RGB.NET.Devices.Razer.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Razer.0.0.1.20\build\net45\RGB.NET.Devices.Razer.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.20\build\net45\RGB.NET.Devices.CoolerMaster.targets" Condition="Exists('..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.20\build\net45\RGB.NET.Devices.CoolerMaster.targets')" />
|
|
||||||
<Import Project="..\packages\RGB.NET.Devices.Corsair.0.0.1.20\build\net45\RGB.NET.Devices.Corsair.targets" Condition="Exists('..\packages\RGB.NET.Devices.Corsair.0.0.1.20\build\net45\RGB.NET.Devices.Corsair.targets')" />
|
|
||||||
<Import Project="..\packages\RGB.NET.Devices.Logitech.0.0.1.20\build\net45\RGB.NET.Devices.Logitech.targets" Condition="Exists('..\packages\RGB.NET.Devices.Logitech.0.0.1.20\build\net45\RGB.NET.Devices.Logitech.targets')" />
|
|
||||||
<Import Project="..\packages\RGB.NET.Devices.Msi.0.0.1.20\build\net45\RGB.NET.Devices.Msi.targets" Condition="Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.20\build\net45\RGB.NET.Devices.Msi.targets')" />
|
|
||||||
<Import Project="..\packages\RGB.NET.Devices.Razer.0.0.1.20\build\net45\RGB.NET.Devices.Razer.targets" Condition="Exists('..\packages\RGB.NET.Devices.Razer.0.0.1.20\build\net45\RGB.NET.Devices.Razer.targets')" />
|
|
||||||
</Project>
|
</Project>
|
||||||
23
src/Artemis.Core/ProfileElements/Folder.cs
Normal file
23
src/Artemis.Core/ProfileElements/Folder.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Artemis.Core.ProfileElements.Interfaces;
|
||||||
|
using RGB.NET.Core;
|
||||||
|
|
||||||
|
namespace Artemis.Core.ProfileElements
|
||||||
|
{
|
||||||
|
public class Folder : IProfileElement
|
||||||
|
{
|
||||||
|
public List<IProfileElement> Children { get; set; }
|
||||||
|
|
||||||
|
public void Update()
|
||||||
|
{
|
||||||
|
foreach (var profileElement in Children)
|
||||||
|
profileElement.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Render(IRGBDevice rgbDevice)
|
||||||
|
{
|
||||||
|
foreach (var profileElement in Children)
|
||||||
|
profileElement.Render(rgbDevice);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using RGB.NET.Core;
|
||||||
|
|
||||||
|
namespace Artemis.Core.ProfileElements.Interfaces
|
||||||
|
{
|
||||||
|
public interface IProfileElement
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The element's children
|
||||||
|
/// </summary>
|
||||||
|
List<IProfileElement> Children { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates the element
|
||||||
|
/// </summary>
|
||||||
|
void Update();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Renders the element
|
||||||
|
/// </summary>
|
||||||
|
void Render(IRGBDevice rgbDevice);
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/Artemis.Core/ProfileElements/Profile.cs
Normal file
21
src/Artemis.Core/ProfileElements/Profile.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Artemis.Core.ProfileElements.Interfaces;
|
||||||
|
using RGB.NET.Core;
|
||||||
|
|
||||||
|
namespace Artemis.Core.ProfileElements
|
||||||
|
{
|
||||||
|
public class Profile : IProfileElement
|
||||||
|
{
|
||||||
|
public List<IProfileElement> Children { get; set; }
|
||||||
|
|
||||||
|
public void Update()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Render(IRGBDevice rgbDevice)
|
||||||
|
{
|
||||||
|
foreach (var profileElement in Children)
|
||||||
|
profileElement.Render(rgbDevice);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,22 +1,26 @@
|
|||||||
using System.Threading.Tasks;
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Artemis.Core.Exceptions;
|
||||||
using Artemis.Core.Services.Interfaces;
|
using Artemis.Core.Services.Interfaces;
|
||||||
|
|
||||||
namespace Artemis.Core.Services
|
namespace Artemis.Core.Services
|
||||||
{
|
{
|
||||||
public class CoreService : ICoreService
|
public class CoreService : ICoreService
|
||||||
{
|
{
|
||||||
|
private readonly IRgbService _rgbService;
|
||||||
private readonly IPluginService _pluginService;
|
private readonly IPluginService _pluginService;
|
||||||
private readonly IDeviceService _deviceService;
|
|
||||||
|
|
||||||
public CoreService(IPluginService pluginService, IDeviceService deviceService)
|
public CoreService(IPluginService pluginService, IRgbService rgbService)
|
||||||
{
|
{
|
||||||
_pluginService = pluginService;
|
_pluginService = pluginService;
|
||||||
_deviceService = deviceService;
|
_rgbService = rgbService;
|
||||||
|
|
||||||
Task.Run(Initialize);
|
Task.Run(Initialize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
// Dispose services
|
||||||
_pluginService.Dispose();
|
_pluginService.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,9 +28,26 @@ namespace Artemis.Core.Services
|
|||||||
|
|
||||||
private async Task Initialize()
|
private async Task Initialize()
|
||||||
{
|
{
|
||||||
|
if (IsInitialized)
|
||||||
|
throw new ArtemisCoreException("Cannot initialize the core as it is already initialized.");
|
||||||
|
|
||||||
|
// Initialize the services
|
||||||
await _pluginService.LoadPlugins();
|
await _pluginService.LoadPlugins();
|
||||||
await _deviceService.LoadDevices();
|
await _rgbService.LoadDevices();
|
||||||
IsInitialized = true;
|
|
||||||
|
OnInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Events
|
||||||
|
|
||||||
|
public event EventHandler Initialized;
|
||||||
|
|
||||||
|
private void OnInitialized()
|
||||||
|
{
|
||||||
|
IsInitialized = true;
|
||||||
|
Initialized?.Invoke(this, EventArgs.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,9 +1,15 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using Artemis.Core.Events;
|
||||||
|
|
||||||
namespace Artemis.Core.Services.Interfaces
|
namespace Artemis.Core.Services.Interfaces
|
||||||
{
|
{
|
||||||
public interface ICoreService: IArtemisService, IDisposable
|
public interface ICoreService: IArtemisService, IDisposable
|
||||||
{
|
{
|
||||||
bool IsInitialized { get; set; }
|
bool IsInitialized { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs the core has finished initializing
|
||||||
|
/// </summary>
|
||||||
|
event EventHandler Initialized;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
35
src/Artemis.Core/Services/Interfaces/IRgbService.cs
Normal file
35
src/Artemis.Core/Services/Interfaces/IRgbService.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Artemis.Core.Events;
|
||||||
|
using RGB.NET.Core;
|
||||||
|
|
||||||
|
namespace Artemis.Core.Services.Interfaces
|
||||||
|
{
|
||||||
|
public interface IRgbService : IArtemisService
|
||||||
|
{
|
||||||
|
bool LoadingDevices { get; }
|
||||||
|
RGBSurface Surface { get; set; }
|
||||||
|
Task LoadDevices();
|
||||||
|
void Dispose();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs when a single device has loaded
|
||||||
|
/// </summary>
|
||||||
|
event EventHandler<DeviceEventArgs> DeviceLoaded;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs when a single device has reloaded
|
||||||
|
/// </summary>
|
||||||
|
event EventHandler<DeviceEventArgs> DeviceReloaded;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs when loading all devices has started
|
||||||
|
/// </summary>
|
||||||
|
event EventHandler StartingLoadingDevices;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs when loading all devices has finished
|
||||||
|
/// </summary>
|
||||||
|
event EventHandler FinishedLoadedDevices;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -32,6 +32,7 @@ namespace Artemis.Core.Services
|
|||||||
public bool LoadingPlugins { get; private set; }
|
public bool LoadingPlugins { get; private set; }
|
||||||
public ReadOnlyCollection<PluginInfo> Plugins => _plugins.AsReadOnly();
|
public ReadOnlyCollection<PluginInfo> Plugins => _plugins.AsReadOnly();
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads all installed plugins. If plugins already loaded this will reload them all
|
/// Loads all installed plugins. If plugins already loaded this will reload them all
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -11,21 +11,25 @@ using RGB.NET.Groups;
|
|||||||
|
|
||||||
namespace Artemis.Core.Services
|
namespace Artemis.Core.Services
|
||||||
{
|
{
|
||||||
public class DeviceService : IDeviceService, IDisposable
|
public class RgbService : IRgbService, IDisposable
|
||||||
{
|
{
|
||||||
public DeviceService()
|
public RgbService()
|
||||||
{
|
{
|
||||||
Surface = RGBSurface.Instance;
|
Surface = RGBSurface.Instance;
|
||||||
LoadingDevices = false;
|
LoadingDevices = false;
|
||||||
|
|
||||||
// Let's throw these for now
|
// Let's throw these for now
|
||||||
Surface.Exception += SurfaceOnException;
|
Surface.Exception += SurfaceOnException;
|
||||||
|
Surface.UpdateMode = UpdateMode.Continuous;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public bool LoadingDevices { get; private set; }
|
public bool LoadingDevices { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public RGBSurface Surface { get; set; }
|
public RGBSurface Surface { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public async Task LoadDevices()
|
public async Task LoadDevices()
|
||||||
{
|
{
|
||||||
OnStartedLoadingDevices();
|
OnStartedLoadingDevices();
|
||||||
@ -33,19 +37,19 @@ namespace Artemis.Core.Services
|
|||||||
await Task.Run(() =>
|
await Task.Run(() =>
|
||||||
{
|
{
|
||||||
// TODO SpoinkyNL 8-1-18: Keep settings into account
|
// TODO SpoinkyNL 8-1-18: Keep settings into account
|
||||||
// Surface.LoadDevices(AsusDeviceProvider.Instance);
|
// Surface.LoadDevices(AsusDeviceProvider.Instance);
|
||||||
Surface.LoadDevices(CorsairDeviceProvider.Instance);
|
Surface.LoadDevices(CorsairDeviceProvider.Instance);
|
||||||
Surface.LoadDevices(LogitechDeviceProvider.Instance);
|
Surface.LoadDevices(LogitechDeviceProvider.Instance);
|
||||||
Surface.LoadDevices(CoolerMasterDeviceProvider.Instance);
|
Surface.LoadDevices(CoolerMasterDeviceProvider.Instance);
|
||||||
// Surface.LoadDevices(NovationDeviceProvider.Instance);
|
// Surface.LoadDevices(NovationDeviceProvider.Instance);
|
||||||
|
|
||||||
// TODO SpoinkyNL 8-1-18: Load alignment
|
// TODO SpoinkyNL 8-1-18: Load alignment
|
||||||
Surface.AlignDevies();
|
Surface.AlignDevies();
|
||||||
|
|
||||||
// Do some testing, why does this work, how does it know I want to target the surface? Check source!
|
// Do some testing, why does this work, how does it know I want to target the surface? Check source!
|
||||||
var ledGroup = new RectangleLedGroup(Surface.SurfaceRectangle)
|
var ledGroup = new RectangleLedGroup(Surface.SurfaceRectangle)
|
||||||
{
|
{
|
||||||
Brush = new SolidColorBrush(new Color(255, 0, 0)) {BrushCalculationMode = BrushCalculationMode.Absolute}
|
Brush = new SolidColorBrush(new Color(255, 0, 0)) { BrushCalculationMode = BrushCalculationMode.Absolute }
|
||||||
};
|
};
|
||||||
Surface.UpdateMode = UpdateMode.Continuous;
|
Surface.UpdateMode = UpdateMode.Continuous;
|
||||||
});
|
});
|
||||||
@ -65,24 +69,9 @@ namespace Artemis.Core.Services
|
|||||||
|
|
||||||
#region Events
|
#region Events
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Occurs when a single device has loaded
|
|
||||||
/// </summary>
|
|
||||||
public event EventHandler<DeviceEventArgs> DeviceLoaded;
|
public event EventHandler<DeviceEventArgs> DeviceLoaded;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Occurs when a single device has reloaded
|
|
||||||
/// </summary>
|
|
||||||
public event EventHandler<DeviceEventArgs> DeviceReloaded;
|
public event EventHandler<DeviceEventArgs> DeviceReloaded;
|
||||||
|
public event EventHandler StartingLoadingDevices;
|
||||||
/// <summary>
|
|
||||||
/// Occurs when loading all devices has started
|
|
||||||
/// </summary>
|
|
||||||
public event EventHandler StartedLoadingDevices;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Occurs when loading all devices has finished
|
|
||||||
/// </summary>
|
|
||||||
public event EventHandler FinishedLoadedDevices;
|
public event EventHandler FinishedLoadedDevices;
|
||||||
|
|
||||||
private void OnDeviceLoaded(DeviceEventArgs e)
|
private void OnDeviceLoaded(DeviceEventArgs e)
|
||||||
@ -98,7 +87,7 @@ namespace Artemis.Core.Services
|
|||||||
private void OnStartedLoadingDevices()
|
private void OnStartedLoadingDevices()
|
||||||
{
|
{
|
||||||
LoadingDevices = true;
|
LoadingDevices = true;
|
||||||
StartedLoadingDevices?.Invoke(this, EventArgs.Empty);
|
StartingLoadingDevices?.Invoke(this, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnFinishedLoadedDevices()
|
private void OnFinishedLoadedDevices()
|
||||||
@ -109,9 +98,4 @@ namespace Artemis.Core.Services
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IDeviceService : IArtemisService
|
|
||||||
{
|
|
||||||
Task LoadDevices();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -13,20 +13,6 @@
|
|||||||
<package id="Ninject" version="3.3.4" targetFramework="net46" />
|
<package id="Ninject" version="3.3.4" targetFramework="net46" />
|
||||||
<package id="Ninject.Extensions.Conventions" version="3.3.0" targetFramework="net46" />
|
<package id="Ninject.Extensions.Conventions" version="3.3.0" targetFramework="net46" />
|
||||||
<package id="Ninject.Extensions.Factory" version="3.3.2" targetFramework="net46" />
|
<package id="Ninject.Extensions.Factory" version="3.3.2" targetFramework="net46" />
|
||||||
<package id="RGB.NET" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Brushes" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Core" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Decorators" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Devices" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Devices.Asus" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Devices.CoolerMaster" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Devices.Corsair" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Devices.Logitech" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Devices.Msi" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Devices.Novation" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Devices.Razer" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Groups" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="RGB.NET.Presets" version="0.0.1.20" targetFramework="net46" />
|
|
||||||
<package id="Sanford.Multimedia.Midi" version="6.4.2" targetFramework="net46" />
|
<package id="Sanford.Multimedia.Midi" version="6.4.2" targetFramework="net46" />
|
||||||
<package id="Stylet" version="1.1.21" targetFramework="net46" />
|
<package id="Stylet" version="1.1.21" targetFramework="net46" />
|
||||||
<package id="System.AppContext" version="4.3.0" targetFramework="net46" />
|
<package id="System.AppContext" version="4.3.0" targetFramework="net46" />
|
||||||
|
|||||||
@ -36,6 +36,10 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Flyout.xaml" />
|
Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Flyout.xaml" />
|
||||||
|
|
||||||
|
<!-- Artemis -->
|
||||||
|
<ResourceDictionary Source="Styles/Visualizers/RGBSurfaceVisualizer.xaml"></ResourceDictionary>
|
||||||
|
<ResourceDictionary Source="Styles/Visualizers/RGBDeviceVisualizer.xaml"></ResourceDictionary>
|
||||||
|
<ResourceDictionary Source="Styles/Visualizers/LedVisualizer.xaml"></ResourceDictionary>
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
<!-- MahApps Brushes -->
|
<!-- MahApps Brushes -->
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
<Reference Include="Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Castle.Core.4.2.0\lib\net45\Castle.Core.dll</HintPath>
|
<HintPath>..\packages\Castle.Core.4.2.1\lib\net45\Castle.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
|
<Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath>
|
<HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath>
|
||||||
@ -92,6 +92,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Compile Include="Bootstrapper.cs" />
|
<Compile Include="Bootstrapper.cs" />
|
||||||
|
<Compile Include="Controls\Visualizers\LedVisualizer.cs" />
|
||||||
|
<Compile Include="Controls\Visualizers\RGBDeviceVisualizer.cs" />
|
||||||
|
<Compile Include="Controls\Visualizers\RGBSurfaceVisualizer.cs" />
|
||||||
|
<Compile Include="Converters\ColorToSolidColorBrushConverter.cs" />
|
||||||
<Compile Include="Ninject\UIModule.cs" />
|
<Compile Include="Ninject\UIModule.cs" />
|
||||||
<Compile Include="Services\Interfaces\IArtemisUIService.cs" />
|
<Compile Include="Services\Interfaces\IArtemisUIService.cs" />
|
||||||
<Compile Include="Stylet\ArtemisViewManager.cs" />
|
<Compile Include="Stylet\ArtemisViewManager.cs" />
|
||||||
@ -106,6 +110,18 @@
|
|||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="ViewModels\SettingsViewModel.cs" />
|
<Compile Include="ViewModels\SettingsViewModel.cs" />
|
||||||
|
<Page Include="Styles\Visualizers\LedVisualizer.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Styles\Visualizers\RGBDeviceVisualizer.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="Styles\Visualizers\RGBSurfaceVisualizer.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="Views\HomeView.xaml">
|
<Page Include="Views\HomeView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@ -149,6 +165,58 @@
|
|||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Brushes\RGB.NET.Brushes.csproj">
|
||||||
|
<Project>{347c5f0f-f490-4dec-9c1c-6e84750d838d}</Project>
|
||||||
|
<Name>RGB.NET.Brushes</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Core\RGB.NET.Core.csproj">
|
||||||
|
<Project>{5a4f9a75-75fe-47cd-90e5-914d5b20d232}</Project>
|
||||||
|
<Name>RGB.NET.Core</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Decorators\RGB.NET.Decorators.csproj">
|
||||||
|
<Project>{7012c431-244a-453f-b7fd-59e030cdbc44}</Project>
|
||||||
|
<Name>RGB.NET.Decorators</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Asus\RGB.NET.Devices.Asus.csproj">
|
||||||
|
<Project>{4f2f3fbd-a1e4-4968-a2ad-0514959e5e59}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Asus</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.CoolerMaster\RGB.NET.Devices.CoolerMaster.csproj">
|
||||||
|
<Project>{85609427-d433-44e2-a249-ce890b66d845}</Project>
|
||||||
|
<Name>RGB.NET.Devices.CoolerMaster</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Corsair\RGB.NET.Devices.Corsair.csproj">
|
||||||
|
<Project>{dda8c4c2-8abf-4fa0-9af9-c47ad0bfe47d}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Corsair</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Logitech\RGB.NET.Devices.Logitech.csproj">
|
||||||
|
<Project>{e7b2f174-fcc6-4fc7-9970-3138b5f4c921}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Logitech</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Msi\RGB.NET.Devices.Msi.csproj">
|
||||||
|
<Project>{4efd77c7-fdb4-4c6b-970c-0ef66d24be09}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Msi</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Novation\RGB.NET.Devices.Novation.csproj">
|
||||||
|
<Project>{db2911f6-404c-4bc8-b35f-232a7450755f}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Novation</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Devices.Razer\RGB.NET.Devices.Razer.csproj">
|
||||||
|
<Project>{24ff4acb-d679-4b2d-86d4-50ab6c02d816}</Project>
|
||||||
|
<Name>RGB.NET.Devices.Razer</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Groups\RGB.NET.Groups.csproj">
|
||||||
|
<Project>{2a39f859-aad0-4c16-94f8-78057820b376}</Project>
|
||||||
|
<Name>RGB.NET.Groups</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Input.Corsair\RGB.NET.Input.Corsair.csproj">
|
||||||
|
<Project>{f905c418-76bb-4ba6-88ab-0793bc2681d3}</Project>
|
||||||
|
<Name>RGB.NET.Input.Corsair</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\RGB.NET\RGB.NET.Input\RGB.NET.Input.csproj">
|
||||||
|
<Project>{e60c3c6f-903f-4d80-99d0-7a1e50af5a9d}</Project>
|
||||||
|
<Name>RGB.NET.Input</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj">
|
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj">
|
||||||
<Project>{9b811f9b-86b9-4771-87af-72bae7078a36}</Project>
|
<Project>{9b811f9b-86b9-4771-87af-72bae7078a36}</Project>
|
||||||
<Name>Artemis.Core</Name>
|
<Name>Artemis.Core</Name>
|
||||||
@ -171,17 +239,16 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Controls\ColorPicker\" />
|
<Folder Include="Controls\ColorPicker\" />
|
||||||
<Folder Include="Controls\GradientPicker\" />
|
<Folder Include="Controls\GradientPicker\" />
|
||||||
<Folder Include="Controls\RgbDevice\" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="FodyWeavers.xml" />
|
<Resource Include="FodyWeavers.xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="..\packages\Fody.2.3.8\build\net452\Fody.targets" Condition="Exists('..\packages\Fody.2.3.8\build\net452\Fody.targets')" />
|
<Import Project="..\packages\Fody.2.3.17\build\net452\Fody.targets" Condition="Exists('..\packages\Fody.2.3.17\build\net452\Fody.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\packages\Fody.2.3.8\build\net452\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.2.3.8\build\net452\Fody.targets'))" />
|
<Error Condition="!Exists('..\packages\Fody.2.3.17\build\net452\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.2.3.17\build\net452\Fody.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
36
src/Artemis.UI/Controls/Visualizers/LedVisualizer.cs
Normal file
36
src/Artemis.UI/Controls/Visualizers/LedVisualizer.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using RGB.NET.Core;
|
||||||
|
|
||||||
|
namespace Artemis.UI.Controls.Visualizers
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <summary>
|
||||||
|
/// Visualizes a <see cref="T:RGB.NET.Core.Led" /> in an wpf-application.
|
||||||
|
/// </summary>
|
||||||
|
public class LedVisualizer : Control
|
||||||
|
{
|
||||||
|
#region DependencyProperties
|
||||||
|
|
||||||
|
// ReSharper disable InconsistentNaming
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Backing-property for the <see cref="Led" />-property.
|
||||||
|
/// </summary>
|
||||||
|
public static readonly DependencyProperty LedProperty = DependencyProperty.Register(
|
||||||
|
"Led", typeof(Led), typeof(LedVisualizer), new PropertyMetadata(default(Led)));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the <see cref="RGB.NET.Core.Led" /> to visualize.
|
||||||
|
/// </summary>
|
||||||
|
public Led Led
|
||||||
|
{
|
||||||
|
get => (Led) GetValue(LedProperty);
|
||||||
|
set => SetValue(LedProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReSharper restore InconsistentNaming
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
78
src/Artemis.UI/Controls/Visualizers/RGBDeviceVisualizer.cs
Normal file
78
src/Artemis.UI/Controls/Visualizers/RGBDeviceVisualizer.cs
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using RGB.NET.Core;
|
||||||
|
|
||||||
|
namespace Artemis.UI.Controls.Visualizers
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <summary>
|
||||||
|
/// Visualizes a <see cref="T:RGB.NET.Core.IRGBDevice" /> in an wpf-application.
|
||||||
|
/// </summary>
|
||||||
|
[TemplatePart(Name = PART_CANVAS, Type = typeof(Canvas))]
|
||||||
|
public class RGBDeviceVisualizer : Control
|
||||||
|
{
|
||||||
|
#region Constants
|
||||||
|
|
||||||
|
private const string PART_CANVAS = "PART_Canvas";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Properties & Fields
|
||||||
|
|
||||||
|
private Canvas _canvas;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region DependencyProperties
|
||||||
|
|
||||||
|
// ReSharper disable InconsistentNaming
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Backing-property for the <see cref="Device"/>-property.
|
||||||
|
/// </summary>
|
||||||
|
public static readonly DependencyProperty DeviceProperty = DependencyProperty.Register(
|
||||||
|
"Device", typeof(IRGBDevice), typeof(RGBDeviceVisualizer), new PropertyMetadata(default(IRGBDevice), DeviceChanged));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the <see cref="IRGBDevice"/> to visualize.
|
||||||
|
/// </summary>
|
||||||
|
public IRGBDevice Device
|
||||||
|
{
|
||||||
|
get => (IRGBDevice) GetValue(DeviceProperty);
|
||||||
|
set => SetValue(DeviceProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReSharper restore InconsistentNaming
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnApplyTemplate()
|
||||||
|
{
|
||||||
|
_canvas = (Canvas) GetTemplateChild(PART_CANVAS);
|
||||||
|
|
||||||
|
LayoutLeds();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void DeviceChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
|
||||||
|
{
|
||||||
|
((RGBDeviceVisualizer) dependencyObject).LayoutLeds();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LayoutLeds()
|
||||||
|
{
|
||||||
|
if (_canvas == null) return;
|
||||||
|
|
||||||
|
_canvas.Children.Clear();
|
||||||
|
|
||||||
|
if (Device == null) return;
|
||||||
|
|
||||||
|
foreach (Led led in Device)
|
||||||
|
_canvas.Children.Add(new LedVisualizer {Led = led});
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
99
src/Artemis.UI/Controls/Visualizers/RGBSurfaceVisualizer.cs
Normal file
99
src/Artemis.UI/Controls/Visualizers/RGBSurfaceVisualizer.cs
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using RGB.NET.Core;
|
||||||
|
|
||||||
|
namespace Artemis.UI.Controls.Visualizers
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <summary>
|
||||||
|
/// Visualizes the <see cref="T:RGB.NET.Core.RGBSurface" /> in an wpf-application.
|
||||||
|
/// </summary>
|
||||||
|
[TemplatePart(Name = PART_CANVAS, Type = typeof(Canvas))]
|
||||||
|
public class RGBSurfaceVisualizer : Control
|
||||||
|
{
|
||||||
|
#region Constants
|
||||||
|
|
||||||
|
private const string PART_CANVAS = "PART_Canvas";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Properties & Fields
|
||||||
|
|
||||||
|
private RGBSurface _surface;
|
||||||
|
private Canvas _canvas;
|
||||||
|
|
||||||
|
//TODO DarthAffe 17.06.2017: This is ugly - redesign how device connect/disconnect is generally handled!
|
||||||
|
private readonly List<IRGBDevice> _newDevices = new List<IRGBDevice>();
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="T:RGB.NET.WPF.Controls.RGBSurfaceVisualizer" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public RGBSurfaceVisualizer()
|
||||||
|
{
|
||||||
|
this.Loaded += OnLoaded;
|
||||||
|
this.Unloaded += OnUnloaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
|
||||||
|
{
|
||||||
|
_surface = RGBSurface.Instance;
|
||||||
|
|
||||||
|
_surface.SurfaceLayoutChanged += RGBSurfaceOnSurfaceLayoutChanged;
|
||||||
|
foreach (IRGBDevice device in _surface.Devices)
|
||||||
|
_newDevices.Add(device);
|
||||||
|
|
||||||
|
UpdateSurface();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnUnloaded(object sender, RoutedEventArgs routedEventArgs)
|
||||||
|
{
|
||||||
|
_surface.SurfaceLayoutChanged -= RGBSurfaceOnSurfaceLayoutChanged;
|
||||||
|
_canvas?.Children.Clear();
|
||||||
|
_newDevices.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RGBSurfaceOnSurfaceLayoutChanged(SurfaceLayoutChangedEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.DeviceAdded)
|
||||||
|
foreach (IRGBDevice device in args.Devices)
|
||||||
|
_newDevices.Add(device);
|
||||||
|
|
||||||
|
UpdateSurface();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnApplyTemplate()
|
||||||
|
{
|
||||||
|
_canvas?.Children.Clear();
|
||||||
|
_canvas = (Canvas)GetTemplateChild(PART_CANVAS);
|
||||||
|
UpdateSurface();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateSurface()
|
||||||
|
{
|
||||||
|
if ((_canvas == null) || (_surface == null)) return;
|
||||||
|
|
||||||
|
if (_newDevices.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (IRGBDevice device in _newDevices)
|
||||||
|
_canvas.Children.Add(new RGBDeviceVisualizer { Device = device });
|
||||||
|
_newDevices.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
_canvas.Width = _surface.SurfaceRectangle.Size.Width;
|
||||||
|
_canvas.Height = _surface.SurfaceRectangle.Size.Height;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
31
src/Artemis.UI/Converters/ColorToSolidColorBrushConverter.cs
Normal file
31
src/Artemis.UI/Converters/ColorToSolidColorBrushConverter.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace Artemis.UI.Converters
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <summary>
|
||||||
|
/// Converts <see cref="T:RGB.NET.Core.Color" /> into <see cref="T:System.Windows.Media.SolidColorBrush" />.
|
||||||
|
/// </summary>
|
||||||
|
[ValueConversion(typeof(RGB.NET.Core.Color), typeof(SolidColorBrush))]
|
||||||
|
public class ColorToSolidColorBrushConverter : IValueConverter
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
return new SolidColorBrush(!(value is RGB.NET.Core.Color color)
|
||||||
|
? Color.FromArgb(0, 0, 0, 0)
|
||||||
|
: Color.FromArgb(color.A, color.R, color.G, color.B));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
return !(value is SolidColorBrush brush)
|
||||||
|
? RGB.NET.Core.Color.Transparent
|
||||||
|
: new RGB.NET.Core.Color(brush.Color.A, brush.Color.R, brush.Color.G, brush.Color.B);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
95
src/Artemis.UI/Styles/Visualizers/LedVisualizer.xaml
Normal file
95
src/Artemis.UI/Styles/Visualizers/LedVisualizer.xaml
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="clr-namespace:Artemis.UI.Controls.Visualizers"
|
||||||
|
xmlns:converters="clr-namespace:Artemis.UI.Converters">
|
||||||
|
|
||||||
|
<converters:ColorToSolidColorBrushConverter x:Key="ConverterColorToSolidColorBrush" />
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="ControlTemplateLedRectangle" TargetType="{x:Type controls:LedVisualizer}">
|
||||||
|
<Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||||
|
<Border.Background>
|
||||||
|
<ImageBrush AlignmentX="Center" AlignmentY="Center"
|
||||||
|
Stretch="Fill"
|
||||||
|
ImageSource="{Binding Led.Image, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
|
</Border.Background>
|
||||||
|
|
||||||
|
<Rectangle VerticalAlignment="Stretch"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Opacity="0.5"
|
||||||
|
Stroke="{TemplateBinding BorderBrush}"
|
||||||
|
StrokeThickness="1"
|
||||||
|
Fill="{TemplateBinding Background}" />
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="ControlTemplateLedCircle" TargetType="{x:Type controls:LedVisualizer}">
|
||||||
|
<Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||||
|
<Border.Background>
|
||||||
|
<ImageBrush AlignmentX="Center" AlignmentY="Center"
|
||||||
|
Stretch="Fill"
|
||||||
|
ImageSource="{Binding Led.Image, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
|
</Border.Background>
|
||||||
|
|
||||||
|
<Ellipse VerticalAlignment="Stretch"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Opacity="0.5"
|
||||||
|
Stroke="{TemplateBinding BorderBrush}"
|
||||||
|
StrokeThickness="1"
|
||||||
|
Fill="{TemplateBinding Background}" />
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<ControlTemplate x:Key="ControlTemplateLedCustom" TargetType="{x:Type controls:LedVisualizer}">
|
||||||
|
<Border x:Name="Border" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||||
|
<Border.Background>
|
||||||
|
<ImageBrush AlignmentX="Center" AlignmentY="Center"
|
||||||
|
Stretch="Fill"
|
||||||
|
ImageSource="{Binding Led.Image, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
|
</Border.Background>
|
||||||
|
|
||||||
|
<Path Opacity="0.5"
|
||||||
|
Clip="{Binding Data, RelativeSource={RelativeSource Self}}"
|
||||||
|
Stroke="{TemplateBinding BorderBrush}"
|
||||||
|
StrokeThickness="2"
|
||||||
|
Fill="{TemplateBinding Background}">
|
||||||
|
<Path.Data>
|
||||||
|
<PathGeometry Figures="{Binding Led.ShapeData, RelativeSource={RelativeSource TemplatedParent}}">
|
||||||
|
<PathGeometry.Transform>
|
||||||
|
<ScaleTransform ScaleX="{Binding ActualWidth, ElementName=Border}"
|
||||||
|
ScaleY="{Binding ActualHeight, ElementName=Border}" />
|
||||||
|
</PathGeometry.Transform>
|
||||||
|
</PathGeometry>
|
||||||
|
</Path.Data>
|
||||||
|
</Path>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
|
||||||
|
<Style x:Key="StyleLedVisualizer" TargetType="{x:Type controls:LedVisualizer}">
|
||||||
|
<Setter Property="Width" Value="{Binding Led.LedRectangle.Size.Width, RelativeSource={RelativeSource Self}}" />
|
||||||
|
<Setter Property="Height" Value="{Binding Led.LedRectangle.Size.Height, RelativeSource={RelativeSource Self}}" />
|
||||||
|
<Setter Property="Canvas.Left" Value="{Binding Led.LedRectangle.Location.X, RelativeSource={RelativeSource Self}}" />
|
||||||
|
<Setter Property="Canvas.Top" Value="{Binding Led.LedRectangle.Location.Y, RelativeSource={RelativeSource Self}}" />
|
||||||
|
|
||||||
|
<Setter Property="BorderBrush" Value="#000000" />
|
||||||
|
<Setter Property="Background" Value="{Binding Led.Color, RelativeSource={RelativeSource Self},
|
||||||
|
Converter={StaticResource ConverterColorToSolidColorBrush}}" />
|
||||||
|
|
||||||
|
<Setter Property="Template" Value="{StaticResource ControlTemplateLedRectangle}" />
|
||||||
|
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="BorderBrush" Value="#FFFFFF" />
|
||||||
|
</Trigger>
|
||||||
|
|
||||||
|
<DataTrigger Binding="{Binding Led.Shape, RelativeSource={RelativeSource Self}}" Value="Circle">
|
||||||
|
<Setter Property="Template" Value="{StaticResource ControlTemplateLedCircle}" />
|
||||||
|
</DataTrigger>
|
||||||
|
|
||||||
|
<DataTrigger Binding="{Binding Led.Shape, RelativeSource={RelativeSource Self}}" Value="Custom">
|
||||||
|
<Setter Property="Template" Value="{StaticResource ControlTemplateLedCustom}" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="{x:Type controls:LedVisualizer}" BasedOn="{StaticResource StyleLedVisualizer}" />
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
43
src/Artemis.UI/Styles/Visualizers/RGBDeviceVisualizer.xaml
Normal file
43
src/Artemis.UI/Styles/Visualizers/RGBDeviceVisualizer.xaml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="clr-namespace:Artemis.UI.Controls.Visualizers">
|
||||||
|
|
||||||
|
<Style x:Key="StyleRGBDeviceVisualizer" TargetType="{x:Type controls:RGBDeviceVisualizer}">
|
||||||
|
<Setter Property="Width" Value="{Binding Device.Size.Width, RelativeSource={RelativeSource Self}}" />
|
||||||
|
<Setter Property="Height" Value="{Binding Device.Size.Height, RelativeSource={RelativeSource Self}}" />
|
||||||
|
<Setter Property="Canvas.Left" Value="{Binding Device.Location.X, RelativeSource={RelativeSource Self}}" />
|
||||||
|
<Setter Property="Canvas.Top" Value="{Binding Device.Location.Y, RelativeSource={RelativeSource Self}}" />
|
||||||
|
|
||||||
|
<Setter Property="BorderThickness" Value="2" />
|
||||||
|
<Setter Property="BorderBrush" Value="#202020" />
|
||||||
|
<!--<Setter Property="Background" Value="#3A3A3A" />-->
|
||||||
|
<Setter Property="Background">
|
||||||
|
<Setter.Value>
|
||||||
|
<ImageBrush AlignmentX="Left" AlignmentY="Top"
|
||||||
|
Stretch="Uniform"
|
||||||
|
ImageSource="{Binding Device.DeviceInfo.Image, RelativeSource={RelativeSource AncestorType=controls:RGBDeviceVisualizer}}" />
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type controls:RGBDeviceVisualizer}">
|
||||||
|
<Grid VerticalAlignment="Stretch"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Background="{TemplateBinding Background}">
|
||||||
|
<Canvas x:Name="PART_Canvas"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
HorizontalAlignment="Stretch" />
|
||||||
|
|
||||||
|
<Border VerticalAlignment="Stretch"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
Background="{x:Null}" />
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="{x:Type controls:RGBDeviceVisualizer}" BasedOn="{StaticResource StyleRGBDeviceVisualizer}" />
|
||||||
|
</ResourceDictionary>
|
||||||
44
src/Artemis.UI/Styles/Visualizers/RGBSurfaceVisualizer.xaml
Normal file
44
src/Artemis.UI/Styles/Visualizers/RGBSurfaceVisualizer.xaml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:visualizers="clr-namespace:Artemis.UI.Controls.Visualizers">
|
||||||
|
|
||||||
|
<Style x:Key="StyleRGBSurfaceVisualizer" TargetType="{x:Type visualizers:RGBSurfaceVisualizer}">
|
||||||
|
<Setter Property="VerticalAlignment"
|
||||||
|
Value="Stretch" />
|
||||||
|
<Setter Property="HorizontalAlignment"
|
||||||
|
Value="Stretch" />
|
||||||
|
<Setter Property="VerticalContentAlignment"
|
||||||
|
Value="Top" />
|
||||||
|
<Setter Property="HorizontalContentAlignment"
|
||||||
|
Value="Left" />
|
||||||
|
|
||||||
|
<Setter Property="Background"
|
||||||
|
Value="{x:Null}" />
|
||||||
|
<Setter Property="BorderThickness"
|
||||||
|
Value="0" />
|
||||||
|
<Setter Property="BorderBrush"
|
||||||
|
Value="{x:Null}" />
|
||||||
|
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type visualizers:RGBSurfaceVisualizer}">
|
||||||
|
<ScrollViewer VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||||
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||||
|
VerticalScrollBarVisibility="Auto"
|
||||||
|
HorizontalScrollBarVisibility="Auto">
|
||||||
|
<Border VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
Background="{TemplateBinding Background}">
|
||||||
|
<Canvas x:Name="PART_Canvas"
|
||||||
|
Background="Transparent" />
|
||||||
|
</Border>
|
||||||
|
</ScrollViewer>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="{x:Type visualizers:RGBSurfaceVisualizer}" BasedOn="{StaticResource StyleRGBSurfaceVisualizer}" />
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
@ -1,10 +1,37 @@
|
|||||||
using Artemis.UI.ViewModels.Interfaces;
|
using System.Linq;
|
||||||
|
using Artemis.Core.Services.Interfaces;
|
||||||
|
using Artemis.UI.ViewModels.Interfaces;
|
||||||
|
using RGB.NET.Core;
|
||||||
using Stylet;
|
using Stylet;
|
||||||
|
|
||||||
namespace Artemis.UI.ViewModels
|
namespace Artemis.UI.ViewModels
|
||||||
{
|
{
|
||||||
public class SettingsViewModel : Screen, ISettingsViewModel
|
public class SettingsViewModel : Screen, ISettingsViewModel
|
||||||
{
|
{
|
||||||
|
private readonly IRgbService _rgbService;
|
||||||
|
|
||||||
|
public SettingsViewModel(IRgbService rgbService)
|
||||||
|
{
|
||||||
|
_rgbService = rgbService;
|
||||||
|
_rgbService.FinishedLoadedDevices += (sender, args) => SetTestDevice();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnActivate()
|
||||||
|
{
|
||||||
|
SetTestDevice();
|
||||||
|
base.OnActivate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetTestDevice()
|
||||||
|
{
|
||||||
|
if (!IsActive)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!_rgbService.LoadingDevices)
|
||||||
|
TestDevice = _rgbService.Surface.Devices.FirstOrDefault(d => d.DeviceInfo.DeviceType == RGBDeviceType.Keyboard);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IRGBDevice TestDevice { get; set; }
|
||||||
public string Title => "Settings";
|
public string Title => "Settings";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4,7 +4,10 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:Artemis.UI.Views"
|
xmlns:local="clr-namespace:Artemis.UI.Views"
|
||||||
|
xmlns:visualizers="clr-namespace:Artemis.UI.Controls.Visualizers"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="300" d:DesignWidth="300">
|
d:DesignHeight="300" d:DesignWidth="300">
|
||||||
<Grid />
|
<Grid>
|
||||||
|
<visualizers:RGBSurfaceVisualizer></visualizers:RGBSurfaceVisualizer>
|
||||||
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -1,8 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Castle.Core" version="4.2.0" targetFramework="net461" />
|
<package id="Castle.Core" version="4.2.1" targetFramework="net461" />
|
||||||
<package id="Fody" version="2.3.8" targetFramework="net461" developmentDependency="true" />
|
<package id="Fody" version="2.3.17" targetFramework="net461" developmentDependency="true" />
|
||||||
<package id="MahApps.Metro" version="1.5.0" targetFramework="net461" />
|
<package id="MahApps.Metro" version="1.5.0" targetFramework="net461" />
|
||||||
<package id="MaterialDesignColors" version="1.1.3" targetFramework="net461" />
|
<package id="MaterialDesignColors" version="1.1.3" targetFramework="net461" />
|
||||||
<package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net461" />
|
<package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net461" />
|
||||||
|
|||||||
104
src/Artemis.sln
104
src/Artemis.sln
@ -11,6 +11,40 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Core", "Artemis.Cor
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Plugins", "Artemis.Plugins\Artemis.Plugins.csproj", "{CD23BC5E-57F0-46CE-A007-24D031146219}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Plugins", "Artemis.Plugins\Artemis.Plugins.csproj", "{CD23BC5E-57F0-46CE-A007-24D031146219}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RGB.NET", "RGB.NET", "{9E919613-35F5-410D-80B3-F4FB69BE327B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Core", "..\..\RGB.NET\RGB.NET.Core\RGB.NET.Core.csproj", "{5A4F9A75-75FE-47CD-90E5-914D5B20D232}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Input", "..\..\RGB.NET\RGB.NET.Input\RGB.NET.Input.csproj", "{E60C3C6F-903F-4D80-99D0-7A1E50AF5A9D}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Devices", "Devices", "{03DD6C1C-B39B-4D1E-A905-EBDA94FCEBFA}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Presets", "Presets", "{87F6ED2F-10C1-43BB-B5CE-E95DF6C8ADCE}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.Asus", "..\..\RGB.NET\RGB.NET.Devices.Asus\RGB.NET.Devices.Asus.csproj", "{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.CoolerMaster", "..\..\RGB.NET\RGB.NET.Devices.CoolerMaster\RGB.NET.Devices.CoolerMaster.csproj", "{85609427-D433-44E2-A249-CE890B66D845}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.Corsair", "..\..\RGB.NET\RGB.NET.Devices.Corsair\RGB.NET.Devices.Corsair.csproj", "{DDA8C4C2-8ABF-4FA0-9AF9-C47AD0BFE47D}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.Logitech", "..\..\RGB.NET\RGB.NET.Devices.Logitech\RGB.NET.Devices.Logitech.csproj", "{E7B2F174-FCC6-4FC7-9970-3138B5F4C921}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.Msi", "..\..\RGB.NET\RGB.NET.Devices.Msi\RGB.NET.Devices.Msi.csproj", "{4EFD77C7-FDB4-4C6B-970C-0EF66D24BE09}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.Novation", "..\..\RGB.NET\RGB.NET.Devices.Novation\RGB.NET.Devices.Novation.csproj", "{DB2911F6-404C-4BC8-B35F-232A7450755F}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Devices.Razer", "..\..\RGB.NET\RGB.NET.Devices.Razer\RGB.NET.Devices.Razer.csproj", "{24FF4ACB-D679-4B2D-86D4-50AB6C02D816}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Input", "Input", "{F1DE1C8B-E8B1-45EF-9FE8-47EF3B2E4D6E}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Input.Corsair", "..\..\RGB.NET\RGB.NET.Input.Corsair\RGB.NET.Input.Corsair.csproj", "{F905C418-76BB-4BA6-88AB-0793BC2681D3}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Brushes", "..\..\RGB.NET\RGB.NET.Brushes\RGB.NET.Brushes.csproj", "{347C5F0F-F490-4DEC-9C1C-6E84750D838D}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Decorators", "..\..\RGB.NET\RGB.NET.Decorators\RGB.NET.Decorators.csproj", "{7012C431-244A-453F-B7FD-59E030CDBC44}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RGB.NET.Groups", "..\..\RGB.NET\RGB.NET.Groups\RGB.NET.Groups.csproj", "{2A39F859-AAD0-4C16-94F8-78057820B376}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -33,10 +67,80 @@ Global
|
|||||||
{CD23BC5E-57F0-46CE-A007-24D031146219}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{CD23BC5E-57F0-46CE-A007-24D031146219}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{CD23BC5E-57F0-46CE-A007-24D031146219}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{CD23BC5E-57F0-46CE-A007-24D031146219}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{CD23BC5E-57F0-46CE-A007-24D031146219}.Release|Any CPU.Build.0 = Release|Any CPU
|
{CD23BC5E-57F0-46CE-A007-24D031146219}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{5A4F9A75-75FE-47CD-90E5-914D5B20D232}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{5A4F9A75-75FE-47CD-90E5-914D5B20D232}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{5A4F9A75-75FE-47CD-90E5-914D5B20D232}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{5A4F9A75-75FE-47CD-90E5-914D5B20D232}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{E60C3C6F-903F-4D80-99D0-7A1E50AF5A9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{E60C3C6F-903F-4D80-99D0-7A1E50AF5A9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{E60C3C6F-903F-4D80-99D0-7A1E50AF5A9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{E60C3C6F-903F-4D80-99D0-7A1E50AF5A9D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{85609427-D433-44E2-A249-CE890B66D845}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{85609427-D433-44E2-A249-CE890B66D845}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{85609427-D433-44E2-A249-CE890B66D845}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{85609427-D433-44E2-A249-CE890B66D845}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{DDA8C4C2-8ABF-4FA0-9AF9-C47AD0BFE47D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{DDA8C4C2-8ABF-4FA0-9AF9-C47AD0BFE47D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{DDA8C4C2-8ABF-4FA0-9AF9-C47AD0BFE47D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{DDA8C4C2-8ABF-4FA0-9AF9-C47AD0BFE47D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{E7B2F174-FCC6-4FC7-9970-3138B5F4C921}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{E7B2F174-FCC6-4FC7-9970-3138B5F4C921}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{E7B2F174-FCC6-4FC7-9970-3138B5F4C921}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{E7B2F174-FCC6-4FC7-9970-3138B5F4C921}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{4EFD77C7-FDB4-4C6B-970C-0EF66D24BE09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{4EFD77C7-FDB4-4C6B-970C-0EF66D24BE09}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{4EFD77C7-FDB4-4C6B-970C-0EF66D24BE09}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{4EFD77C7-FDB4-4C6B-970C-0EF66D24BE09}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{DB2911F6-404C-4BC8-B35F-232A7450755F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{DB2911F6-404C-4BC8-B35F-232A7450755F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{DB2911F6-404C-4BC8-B35F-232A7450755F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{DB2911F6-404C-4BC8-B35F-232A7450755F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{24FF4ACB-D679-4B2D-86D4-50AB6C02D816}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{24FF4ACB-D679-4B2D-86D4-50AB6C02D816}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{24FF4ACB-D679-4B2D-86D4-50AB6C02D816}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{24FF4ACB-D679-4B2D-86D4-50AB6C02D816}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{F905C418-76BB-4BA6-88AB-0793BC2681D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{F905C418-76BB-4BA6-88AB-0793BC2681D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{F905C418-76BB-4BA6-88AB-0793BC2681D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{F905C418-76BB-4BA6-88AB-0793BC2681D3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{347C5F0F-F490-4DEC-9C1C-6E84750D838D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{347C5F0F-F490-4DEC-9C1C-6E84750D838D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{347C5F0F-F490-4DEC-9C1C-6E84750D838D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{347C5F0F-F490-4DEC-9C1C-6E84750D838D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{7012C431-244A-453F-B7FD-59E030CDBC44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{7012C431-244A-453F-B7FD-59E030CDBC44}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{7012C431-244A-453F-B7FD-59E030CDBC44}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{7012C431-244A-453F-B7FD-59E030CDBC44}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{2A39F859-AAD0-4C16-94F8-78057820B376}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{2A39F859-AAD0-4C16-94F8-78057820B376}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{2A39F859-AAD0-4C16-94F8-78057820B376}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{2A39F859-AAD0-4C16-94F8-78057820B376}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{5A4F9A75-75FE-47CD-90E5-914D5B20D232} = {9E919613-35F5-410D-80B3-F4FB69BE327B}
|
||||||
|
{E60C3C6F-903F-4D80-99D0-7A1E50AF5A9D} = {9E919613-35F5-410D-80B3-F4FB69BE327B}
|
||||||
|
{03DD6C1C-B39B-4D1E-A905-EBDA94FCEBFA} = {9E919613-35F5-410D-80B3-F4FB69BE327B}
|
||||||
|
{87F6ED2F-10C1-43BB-B5CE-E95DF6C8ADCE} = {9E919613-35F5-410D-80B3-F4FB69BE327B}
|
||||||
|
{4F2F3FBD-A1E4-4968-A2AD-0514959E5E59} = {03DD6C1C-B39B-4D1E-A905-EBDA94FCEBFA}
|
||||||
|
{85609427-D433-44E2-A249-CE890B66D845} = {03DD6C1C-B39B-4D1E-A905-EBDA94FCEBFA}
|
||||||
|
{DDA8C4C2-8ABF-4FA0-9AF9-C47AD0BFE47D} = {03DD6C1C-B39B-4D1E-A905-EBDA94FCEBFA}
|
||||||
|
{E7B2F174-FCC6-4FC7-9970-3138B5F4C921} = {03DD6C1C-B39B-4D1E-A905-EBDA94FCEBFA}
|
||||||
|
{4EFD77C7-FDB4-4C6B-970C-0EF66D24BE09} = {03DD6C1C-B39B-4D1E-A905-EBDA94FCEBFA}
|
||||||
|
{DB2911F6-404C-4BC8-B35F-232A7450755F} = {03DD6C1C-B39B-4D1E-A905-EBDA94FCEBFA}
|
||||||
|
{24FF4ACB-D679-4B2D-86D4-50AB6C02D816} = {03DD6C1C-B39B-4D1E-A905-EBDA94FCEBFA}
|
||||||
|
{F1DE1C8B-E8B1-45EF-9FE8-47EF3B2E4D6E} = {03DD6C1C-B39B-4D1E-A905-EBDA94FCEBFA}
|
||||||
|
{F905C418-76BB-4BA6-88AB-0793BC2681D3} = {F1DE1C8B-E8B1-45EF-9FE8-47EF3B2E4D6E}
|
||||||
|
{347C5F0F-F490-4DEC-9C1C-6E84750D838D} = {87F6ED2F-10C1-43BB-B5CE-E95DF6C8ADCE}
|
||||||
|
{7012C431-244A-453F-B7FD-59E030CDBC44} = {87F6ED2F-10C1-43BB-B5CE-E95DF6C8ADCE}
|
||||||
|
{2A39F859-AAD0-4C16-94F8-78057820B376} = {87F6ED2F-10C1-43BB-B5CE-E95DF6C8ADCE}
|
||||||
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {C203080A-4473-4CC2-844B-F552EA43D66A}
|
SolutionGuid = {C203080A-4473-4CC2-844B-F552EA43D66A}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user