mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 20:06:33 +00:00
Implemented basic keyframes
This commit is contained in:
1 parent
b734fa2f8f
commit
8a1759a575
41 files changed
+951
-123
No files matched your search
@@ -70,6 +70,7 @@ namespace Artemis.Core.Services.Storage
|
||||
|
||||
if (_surfaceService.ActiveSurface != null)
|
||||
profile.PopulateLeds(_surfaceService.ActiveSurface);
|
||||
|
||||
return profile;
|
||||
}
|
||||
|
||||
@@ -78,7 +79,10 @@ namespace Artemis.Core.Services.Storage
|
||||
{
|
||||
module.ChangeActiveProfile(profile, _surfaceService.ActiveSurface);
|
||||
if (profile != null)
|
||||
{
|
||||
InstantiateProfileLayerBrushes(profile);
|
||||
InstantiateProfileKeyframeEngines(profile);
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteProfile(Profile profile)
|
||||
@@ -118,6 +122,15 @@ namespace Artemis.Core.Services.Storage
|
||||
}
|
||||
}
|
||||
|
||||
private void InstantiateProfileKeyframeEngines(Profile profile)
|
||||
{
|
||||
// Only instantiate engines for properties without an existing engine instance
|
||||
foreach (var layerProperty in profile.GetAllLayers().SelectMany(l => l.Properties).Where(p => p.KeyframeEngine == null))
|
||||
{
|
||||
_layerService.InstantiateKeyframeEngine(layerProperty);
|
||||
}
|
||||
}
|
||||
|
||||
private void ActiveProfilesPopulateLeds(ArtemisSurface surface)
|
||||
{
|
||||
var profileModules = _pluginService.GetPluginsOfType<ProfileModule>();
|
||||
@@ -132,6 +145,13 @@ namespace Artemis.Core.Services.Storage
|
||||
InstantiateProfileLayerBrushes(profileModule.ActiveProfile);
|
||||
}
|
||||
|
||||
private void ActiveProfilesInstantiateKeyframeEngines()
|
||||
{
|
||||
var profileModules = _pluginService.GetPluginsOfType<ProfileModule>();
|
||||
foreach (var profileModule in profileModules.Where(p => p.ActiveProfile != null).ToList())
|
||||
InstantiateProfileKeyframeEngines(profileModule.ActiveProfile);
|
||||
}
|
||||
|
||||
#region Event handlers
|
||||
|
||||
private void OnActiveSurfaceConfigurationChanged(object sender, SurfaceConfigurationEventArgs e)
|
||||
@@ -148,7 +168,10 @@ namespace Artemis.Core.Services.Storage
|
||||
private void OnPluginLoaded(object sender, PluginEventArgs e)
|
||||
{
|
||||
if (e.PluginInfo.Instance is LayerBrushProvider)
|
||||
{
|
||||
ActiveProfilesInstantiateProfileLayerBrushes();
|
||||
ActiveProfilesInstantiateKeyframeEngines();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in new issue
Block a user