mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-01-02 10:43:31 +00:00
Merge branch 'development'
This commit is contained in:
commit
61419a5390
@ -15,11 +15,9 @@ resources:
|
|||||||
name: Artemis-RGB/Artemis.Plugins
|
name: Artemis-RGB/Artemis.Plugins
|
||||||
ref: master
|
ref: master
|
||||||
|
|
||||||
pool:
|
|
||||||
vmImage: "windows-latest"
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
windowsProject: "**/Artemis.UI.Windows/Artemis.UI.Windows.csproj"
|
windowsProject: "**/Artemis.UI.Windows/Artemis.UI.Windows.csproj"
|
||||||
|
linuxProject: "**/Artemis.UI.Linux/Artemis.UI.Linux.csproj"
|
||||||
pluginProjects: "**/Artemis.Plugins.*.csproj"
|
pluginProjects: "**/Artemis.Plugins.*.csproj"
|
||||||
BuildId: $(Build.BuildId)
|
BuildId: $(Build.BuildId)
|
||||||
BuildNumber: $(Build.BuildNumber)
|
BuildNumber: $(Build.BuildNumber)
|
||||||
@ -28,6 +26,8 @@ variables:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job: Windows
|
- job: Windows
|
||||||
|
pool:
|
||||||
|
vmImage: "windows-latest"
|
||||||
steps:
|
steps:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
path: s/Artemis
|
path: s/Artemis
|
||||||
@ -119,3 +119,98 @@ jobs:
|
|||||||
clean: false
|
clean: false
|
||||||
preservePaths: true
|
preservePaths: true
|
||||||
trustSSL: false
|
trustSSL: false
|
||||||
|
|
||||||
|
- job: Linux
|
||||||
|
pool:
|
||||||
|
vmImage: "ubuntu-latest"
|
||||||
|
steps:
|
||||||
|
- checkout: self
|
||||||
|
path: s/Artemis
|
||||||
|
- checkout: Plugins
|
||||||
|
path: s/Artemis.Plugins
|
||||||
|
|
||||||
|
- task: DotNetCoreCLI@2
|
||||||
|
displayName: "Artemis - Publish"
|
||||||
|
inputs:
|
||||||
|
command: "publish"
|
||||||
|
publishWebProjects: false
|
||||||
|
projects: "$(linuxProject)"
|
||||||
|
arguments: '--configuration Release --runtime linux-x64 --output $(Build.ArtifactStagingDirectory)/linux-build /nowarn:cs1591'
|
||||||
|
zipAfterPublish: false
|
||||||
|
modifyOutputPath: false
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: "Artemis - Create buildinfo.json"
|
||||||
|
inputs:
|
||||||
|
targetType: "inline"
|
||||||
|
script: |
|
||||||
|
$OFS = "`r`n"
|
||||||
|
SET-Content -Path 'buildinfo.json' -Value ('{' + $OFS + ' "BuildId": 0,' + $OFS + ' "BuildNumber": 0.0,' + $OFS + ' "SourceBranch": "",' + $OFS + ' "SourceVersion": ""' + $OFS + '}')
|
||||||
|
workingDirectory: "$(Build.ArtifactStagingDirectory)/linux-build"
|
||||||
|
|
||||||
|
- task: FileTransform@1
|
||||||
|
displayName: "Artemis - Populate buildinfo.json"
|
||||||
|
inputs:
|
||||||
|
folderPath: "$(Build.ArtifactStagingDirectory)/linux-build"
|
||||||
|
fileType: "json"
|
||||||
|
targetFiles: "**/buildinfo.json"
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: "Plugins - Insert build number into plugin.json"
|
||||||
|
inputs:
|
||||||
|
targetType: "inline"
|
||||||
|
script: |
|
||||||
|
Get-ChildItem -Recurse -Filter plugin.json |
|
||||||
|
Foreach-Object {
|
||||||
|
$buidNumber = "1.0.1." + $Env:BUILD_BUILDID;
|
||||||
|
$a = Get-Content $_.FullName | ConvertFrom-Json
|
||||||
|
$a.Version = $buidNumber;
|
||||||
|
$a | ConvertTo-Json | Set-Content $_.FullName
|
||||||
|
}
|
||||||
|
workingDirectory: "Artemis.Plugins"
|
||||||
|
|
||||||
|
- task: DotNetCoreCLI@2
|
||||||
|
displayName: "Plugins - Publish"
|
||||||
|
inputs:
|
||||||
|
command: "publish"
|
||||||
|
publishWebProjects: false
|
||||||
|
arguments: "--configuration Release --runtime linux-x64 --output $(Build.ArtifactStagingDirectory)/linux-build/Plugins"
|
||||||
|
projects: "$(pluginProjects)"
|
||||||
|
zipAfterPublish: true
|
||||||
|
|
||||||
|
- task: PublishPipelineArtifact@1
|
||||||
|
displayName: "Upload build to Azure Pipelines"
|
||||||
|
inputs:
|
||||||
|
targetPath: "$(Build.ArtifactStagingDirectory)/linux-build"
|
||||||
|
artifact: "Artemis build"
|
||||||
|
publishLocation: "pipeline"
|
||||||
|
|
||||||
|
- task: ArchiveFiles@2
|
||||||
|
displayName: "ZIP binaries"
|
||||||
|
inputs:
|
||||||
|
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/linux-build"
|
||||||
|
includeRootFolder: false
|
||||||
|
archiveType: "zip"
|
||||||
|
archiveFile: "$(Build.ArtifactStagingDirectory)/archive/artemis-build-linux.zip"
|
||||||
|
replaceExistingArchive: true
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: "Calculate ZIP hash"
|
||||||
|
inputs:
|
||||||
|
targetType: "inline"
|
||||||
|
script: '(Get-FileHash .\artemis-build-linux.zip).Hash | Out-File -FilePath .\hash-linux.txt'
|
||||||
|
workingDirectory: "$(Build.ArtifactStagingDirectory)/archive"
|
||||||
|
|
||||||
|
- task: FtpUpload@2
|
||||||
|
displayName: "Upload binaries to FTP"
|
||||||
|
inputs:
|
||||||
|
credentialsOption: "inputs"
|
||||||
|
serverUrl: "ftp://artemis-rgb.com"
|
||||||
|
username: "devops"
|
||||||
|
password: "$(ftp_password)"
|
||||||
|
rootDirectory: "$(Build.ArtifactStagingDirectory)/archive"
|
||||||
|
filePatterns: "**"
|
||||||
|
remoteDirectory: "/builds.artemis-rgb.com/binaries/$(Build.SourceBranchName)/$(Build.BuildNumber)"
|
||||||
|
clean: false
|
||||||
|
preservePaths: true
|
||||||
|
trustSSL: false
|
||||||
|
|||||||
@ -32,13 +32,13 @@ internal class ProcessMonitorService : IProcessMonitorService
|
|||||||
foreach (Process startedProcess in newProcesses.Except(_lastScannedProcesses, _comparer))
|
foreach (Process startedProcess in newProcesses.Except(_lastScannedProcesses, _comparer))
|
||||||
{
|
{
|
||||||
ProcessStarted?.Invoke(this, new ProcessEventArgs(startedProcess));
|
ProcessStarted?.Invoke(this, new ProcessEventArgs(startedProcess));
|
||||||
_logger.Verbose("Started Process: {startedProcess}", startedProcess.ProcessName);
|
//_logger.Verbose("Started Process: {startedProcess}", startedProcess.ProcessName);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Process stoppedProcess in _lastScannedProcesses.Except(newProcesses, _comparer))
|
foreach (Process stoppedProcess in _lastScannedProcesses.Except(newProcesses, _comparer))
|
||||||
{
|
{
|
||||||
ProcessStopped?.Invoke(this, new ProcessEventArgs(stoppedProcess));
|
ProcessStopped?.Invoke(this, new ProcessEventArgs(stoppedProcess));
|
||||||
_logger.Verbose("Stopped Process: {stoppedProcess}", stoppedProcess.ProcessName);
|
//_logger.Verbose("Stopped Process: {stoppedProcess}", stoppedProcess.ProcessName);
|
||||||
}
|
}
|
||||||
|
|
||||||
_lastScannedProcesses = newProcesses;
|
_lastScannedProcesses = newProcesses;
|
||||||
|
|||||||
@ -121,9 +121,9 @@ internal class ScriptingService : IScriptingService
|
|||||||
throw new ArtemisCoreException("Scripts must have exactly one constructor");
|
throw new ArtemisCoreException("Scripts must have exactly one constructor");
|
||||||
|
|
||||||
// Find the ScriptConfiguration parameter, it is required by the base constructor so its there for sure
|
// Find the ScriptConfiguration parameter, it is required by the base constructor so its there for sure
|
||||||
ParameterInfo configurationParameter = constructors.First().GetParameters().First(p => value.GetType().IsAssignableFrom(p.ParameterType));
|
ParameterInfo? configurationParameter = constructors.First().GetParameters().FirstOrDefault(p => value.GetType().IsAssignableFrom(p.ParameterType));
|
||||||
|
|
||||||
if (configurationParameter.Name == null)
|
if (configurationParameter?.Name == null)
|
||||||
throw new ArtemisCoreException($"Couldn't find a valid constructor argument on {scriptType.Name} with type {value.GetType().Name}");
|
throw new ArtemisCoreException($"Couldn't find a valid constructor argument on {scriptType.Name} with type {value.GetType().Name}");
|
||||||
return new ConstructorArgument(configurationParameter.Name, value);
|
return new ConstructorArgument(configurationParameter.Name, value);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using Ninject.Parameters;
|
using Ninject.Parameters;
|
||||||
|
|
||||||
@ -447,7 +448,17 @@ public abstract class Node<TStorage, TViewModel> : Node<TStorage> where TViewMod
|
|||||||
/// <param name="nodeScript"></param>
|
/// <param name="nodeScript"></param>
|
||||||
public virtual TViewModel GetViewModel(NodeScript nodeScript)
|
public virtual TViewModel GetViewModel(NodeScript nodeScript)
|
||||||
{
|
{
|
||||||
return Kernel.Get<TViewModel>(new ConstructorArgument("node", this), new ConstructorArgument("script", nodeScript));
|
// Limit to one constructor, there's no need to have more and it complicates things anyway
|
||||||
|
ConstructorInfo[] constructors = typeof(TViewModel).GetConstructors();
|
||||||
|
if (constructors.Length != 1)
|
||||||
|
throw new ArtemisCoreException("Node VMs must have exactly one constructor");
|
||||||
|
|
||||||
|
// Find the ScriptConfiguration parameter, it is required by the base constructor so its there for sure
|
||||||
|
ParameterInfo? configurationParameter = constructors.First().GetParameters().FirstOrDefault(p => GetType().IsAssignableFrom(p.ParameterType));
|
||||||
|
|
||||||
|
if (configurationParameter?.Name == null)
|
||||||
|
throw new ArtemisCoreException($"Couldn't find a valid constructor argument on {typeof(TViewModel).Name} with type {GetType().Name}");
|
||||||
|
return Kernel.Get<TViewModel>(new ConstructorArgument(configurationParameter.Name, this), new ConstructorArgument("script", nodeScript));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <param name="nodeScript"></param>
|
/// <param name="nodeScript"></param>
|
||||||
|
|||||||
@ -45,12 +45,12 @@ public abstract class PinCollection : CorePropertyChanged, IPinCollection
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public abstract Type Type { get; }
|
public abstract Type Type { get; }
|
||||||
|
|
||||||
private readonly ObservableCollection<IPin> _pins = new();
|
private readonly List<IPin> _pins = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a read only observable collection of the pins
|
/// Gets a read only observable collection of the pins
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ReadOnlyObservableCollection<IPin> Pins => new(_pins);
|
public ReadOnlyCollection<IPin> Pins => new(_pins);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@ -112,7 +112,18 @@ public class LinuxInputProvider : InputProvider
|
|||||||
switch (args.Type)
|
switch (args.Type)
|
||||||
{
|
{
|
||||||
case LinuxInputEventType.KEY:
|
case LinuxInputEventType.KEY:
|
||||||
bool isDown = args.Value != 0;
|
var key = (LinuxKeyboardKeyCodes)args.Code;
|
||||||
|
if (key == LinuxKeyboardKeyCodes.BTN_TOUCH ||
|
||||||
|
(key >= LinuxKeyboardKeyCodes.BTN_TOOL_PEN && key <= LinuxKeyboardKeyCodes.BTN_TOOL_QUADTAP))
|
||||||
|
{
|
||||||
|
//trackpad input, ignore.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//0 - up
|
||||||
|
//1 - down
|
||||||
|
//2 - repeat input
|
||||||
|
bool isDown = args.Value == 1;
|
||||||
MouseButton button = InputUtilities.MouseButtonFromButtonCode((LinuxKeyboardKeyCodes) args.Code);
|
MouseButton button = InputUtilities.MouseButtonFromButtonCode((LinuxKeyboardKeyCodes) args.Code);
|
||||||
|
|
||||||
//_logger.Verbose($"Mouse Button: {(LinuxKeyboardKeyCodes)args.Code} | Down: {isDown}");
|
//_logger.Verbose($"Mouse Button: {(LinuxKeyboardKeyCodes)args.Code} | Down: {isDown}");
|
||||||
|
|||||||
@ -107,7 +107,7 @@ public static class InputUtilities
|
|||||||
LinuxKeyboardKeyCodes.KEY_KPENTER => KeyboardKey.NumPadEnter,
|
LinuxKeyboardKeyCodes.KEY_KPENTER => KeyboardKey.NumPadEnter,
|
||||||
LinuxKeyboardKeyCodes.KEY_RIGHTCTRL => KeyboardKey.RightCtrl,
|
LinuxKeyboardKeyCodes.KEY_RIGHTCTRL => KeyboardKey.RightCtrl,
|
||||||
LinuxKeyboardKeyCodes.KEY_KPSLASH => KeyboardKey.Divide,
|
LinuxKeyboardKeyCodes.KEY_KPSLASH => KeyboardKey.Divide,
|
||||||
LinuxKeyboardKeyCodes.KEY_SYSRQ => KeyboardKey.System, //TODO:?
|
LinuxKeyboardKeyCodes.KEY_SYSRQ => KeyboardKey.PrintScreen,
|
||||||
LinuxKeyboardKeyCodes.KEY_RIGHTALT => KeyboardKey.RightAlt,
|
LinuxKeyboardKeyCodes.KEY_RIGHTALT => KeyboardKey.RightAlt,
|
||||||
LinuxKeyboardKeyCodes.KEY_LINEFEED => KeyboardKey.LineFeed,
|
LinuxKeyboardKeyCodes.KEY_LINEFEED => KeyboardKey.LineFeed,
|
||||||
LinuxKeyboardKeyCodes.KEY_HOME => KeyboardKey.Home,
|
LinuxKeyboardKeyCodes.KEY_HOME => KeyboardKey.Home,
|
||||||
@ -135,7 +135,7 @@ public static class InputUtilities
|
|||||||
// LinuxKeyboardKeyCodes.KEY_YEN => expr,
|
// LinuxKeyboardKeyCodes.KEY_YEN => expr,
|
||||||
LinuxKeyboardKeyCodes.KEY_LEFTMETA => KeyboardKey.LWin,
|
LinuxKeyboardKeyCodes.KEY_LEFTMETA => KeyboardKey.LWin,
|
||||||
LinuxKeyboardKeyCodes.KEY_RIGHTMETA => KeyboardKey.RWin,
|
LinuxKeyboardKeyCodes.KEY_RIGHTMETA => KeyboardKey.RWin,
|
||||||
// LinuxKeyboardKeyCodes.KEY_COMPOSE => ,
|
LinuxKeyboardKeyCodes.KEY_COMPOSE => KeyboardKey.Apps,
|
||||||
LinuxKeyboardKeyCodes.KEY_STOP => KeyboardKey.MediaStop,
|
LinuxKeyboardKeyCodes.KEY_STOP => KeyboardKey.MediaStop,
|
||||||
// LinuxKeyboardKeyCodes.KEY_AGAIN => ,
|
// LinuxKeyboardKeyCodes.KEY_AGAIN => ,
|
||||||
// LinuxKeyboardKeyCodes.KEY_PROPS => expr,
|
// LinuxKeyboardKeyCodes.KEY_PROPS => expr,
|
||||||
|
|||||||
@ -287,6 +287,12 @@ public abstract class TreeItemViewModel : ActivatableViewModelBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
string[] formats = await Application.Current.Clipboard.GetFormatsAsync();
|
string[] formats = await Application.Current.Clipboard.GetFormatsAsync();
|
||||||
|
//diogotr7: This can be null on Linux sometimes. I'm not sure why.
|
||||||
|
if (formats == null)
|
||||||
|
{
|
||||||
|
CanPaste = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
CanPaste = formats.Contains(ProfileElementExtensions.ClipboardDataFormat);
|
CanPaste = formats.Contains(ProfileElementExtensions.ClipboardDataFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,9 +29,10 @@ public class NumericEasingNode : Node
|
|||||||
public override void Evaluate()
|
public override void Evaluate()
|
||||||
{
|
{
|
||||||
DateTime now = DateTime.Now;
|
DateTime now = DateTime.Now;
|
||||||
|
float inputValue = Input.Value;
|
||||||
|
|
||||||
// If the value changed reset progress
|
// If the value changed reset progress
|
||||||
if (Math.Abs(_targetValue - Input.Value) > 0.001f)
|
if (Math.Abs(_targetValue - inputValue) > 0.001f)
|
||||||
{
|
{
|
||||||
_sourceValue = _currentValue;
|
_sourceValue = _currentValue;
|
||||||
_targetValue = Input.Value;
|
_targetValue = Input.Value;
|
||||||
@ -55,10 +56,11 @@ public class NumericEasingNode : Node
|
|||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
|
float easingTime = EasingTime.Value != 0f ? EasingTime.Value : 1f;
|
||||||
TimeSpan delta = DateTime.Now - _lastEvaluate;
|
TimeSpan delta = DateTime.Now - _lastEvaluate;
|
||||||
|
|
||||||
// In case of odd delta's, keep progress between 0f and 1f
|
// In case of odd delta's, keep progress between 0f and 1f
|
||||||
_progress = Math.Clamp(_progress + (float) delta.TotalMilliseconds / EasingTime.Value, 0f, 1f);
|
_progress = Math.Clamp(_progress + (float) delta.TotalMilliseconds / easingTime, 0f, 1f);
|
||||||
|
|
||||||
double eased = _sourceValue + (_targetValue - _sourceValue) * Easings.Interpolate(_progress, EasingFunction.Value);
|
double eased = _sourceValue + (_targetValue - _sourceValue) * Easings.Interpolate(_progress, EasingFunction.Value);
|
||||||
_currentValue = (float) eased;
|
_currentValue = (float) eased;
|
||||||
|
|||||||
@ -56,10 +56,11 @@ public class SKColorEasingNode : Node
|
|||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
|
float easingTime = EasingTime.Value != 0f ? EasingTime.Value : 1f;
|
||||||
TimeSpan delta = DateTime.Now - _lastEvaluate;
|
TimeSpan delta = DateTime.Now - _lastEvaluate;
|
||||||
|
|
||||||
// In case of odd delta's, keep progress between 0f and 1f
|
// In case of odd delta's, keep progress between 0f and 1f
|
||||||
_progress = Math.Clamp(_progress + (float) delta.TotalMilliseconds / EasingTime.Value, 0f, 1f);
|
_progress = Math.Clamp(_progress + (float) delta.TotalMilliseconds / easingTime, 0f, 1f);
|
||||||
_currentValue = _sourceValue.Interpolate(_targetValue, (float) Easings.Interpolate(_progress, EasingFunction.Value));
|
_currentValue = _sourceValue.Interpolate(_targetValue, (float) Easings.Interpolate(_progress, EasingFunction.Value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user