mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-31 17:53:32 +00:00
Added a general-setting to tune the rate of screen-captures
This commit is contained in:
parent
e9cc4ad22c
commit
fabab2755b
@ -20,7 +20,7 @@ namespace Artemis.Profiles.Layers.Types.AmbientLight.ScreenCapturing
|
|||||||
private static IScreenCapture _screenCapture;
|
private static IScreenCapture _screenCapture;
|
||||||
|
|
||||||
public static double StandByTime { get; set; } = 3;
|
public static double StandByTime { get; set; } = 3;
|
||||||
public static double UpdateRate { get; set; } = 1f / 20f; // DarthAffe 29.10.2016: I think 20 FPS should be enough as default
|
public static double UpdateRate { get; set; } = 1.0 / 20.0; // DarthAffe 29.10.2016: I think 20 FPS should be enough as default
|
||||||
public static ScreenCaptureMode ScreenCaptureMode { get; set; } = ScreenCaptureMode.DirectX9;
|
public static ScreenCaptureMode ScreenCaptureMode { get; set; } = ScreenCaptureMode.DirectX9;
|
||||||
|
|
||||||
public static int LastCaptureWidth { get; private set; }
|
public static int LastCaptureWidth { get; private set; }
|
||||||
@ -33,7 +33,7 @@ namespace Artemis.Profiles.Layers.Types.AmbientLight.ScreenCapturing
|
|||||||
|
|
||||||
private static IScreenCapture GetScreenCapture()
|
private static IScreenCapture GetScreenCapture()
|
||||||
{
|
{
|
||||||
if (_lastScreenCaptureMode == ScreenCaptureMode)
|
if (_lastScreenCaptureMode == ScreenCaptureMode && _screenCapture != null)
|
||||||
return _screenCapture;
|
return _screenCapture;
|
||||||
|
|
||||||
DisposeScreenCapture();
|
DisposeScreenCapture();
|
||||||
|
|||||||
@ -3,6 +3,7 @@ using System.ComponentModel;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using Artemis.DAL;
|
using Artemis.DAL;
|
||||||
|
using Artemis.Profiles.Layers.Types.AmbientLight.ScreenCapturing;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
using MahApps.Metro;
|
using MahApps.Metro;
|
||||||
@ -59,6 +60,10 @@ namespace Artemis.Settings
|
|||||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||||
public string Theme { get; set; }
|
public string Theme { get; set; }
|
||||||
|
|
||||||
|
[DefaultValue(20)]
|
||||||
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||||
|
public int ScreenCaptureFPS { get; set; }
|
||||||
|
|
||||||
[DefaultValue("Info")]
|
[DefaultValue("Info")]
|
||||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||||
public string LogLevel { get; set; }
|
public string LogLevel { get; set; }
|
||||||
@ -71,6 +76,7 @@ namespace Artemis.Settings
|
|||||||
ApplyAutorun();
|
ApplyAutorun();
|
||||||
ApplyTheme();
|
ApplyTheme();
|
||||||
ApplyGamestatePort();
|
ApplyGamestatePort();
|
||||||
|
ApplyScreenCaptureFPS();
|
||||||
Logging.SetupLogging(LogLevel);
|
Logging.SetupLogging(LogLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,7 +115,7 @@ namespace Artemis.Settings
|
|||||||
{
|
{
|
||||||
// Ignored, only happens when running from VS
|
// Ignored, only happens when running from VS
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,5 +144,10 @@ namespace Artemis.Settings
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ApplyScreenCaptureFPS()
|
||||||
|
{
|
||||||
|
ScreenCaptureManager.UpdateRate = 1.0 / ScreenCaptureFPS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6,8 +6,7 @@
|
|||||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||||
xmlns:cal="http://www.caliburnproject.org"
|
xmlns:cal="http://www.caliburnproject.org"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="600" d:DesignWidth="300"
|
d:DesignHeight="600" d:DesignWidth="300">
|
||||||
Width="270">
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
@ -25,6 +24,7 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
@ -89,27 +89,33 @@
|
|||||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}"
|
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}"
|
||||||
HorizontalAlignment="Right" />
|
HorizontalAlignment="Right" />
|
||||||
|
|
||||||
|
<!-- Screen capturing -->
|
||||||
|
<Label Grid.Row="8" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
|
Content="Screen-Capture FPS:" />
|
||||||
|
<controls:NumericUpDown Grid.Row="8" Grid.Column="1" Margin="10" VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Right" Width="140" Minimum="1" Maximum="60"
|
||||||
|
Value="{Binding Path=GeneralSettings.ScreenCaptureFPS, Mode=TwoWay}" />
|
||||||
|
|
||||||
<!-- Logging -->
|
<!-- Logging -->
|
||||||
<Label Grid.Row="8" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
<Label Grid.Row="9" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
Content="Log level:" />
|
Content="Log level:" />
|
||||||
<ComboBox Grid.Row="8" Grid.Column="1" x:Name="LogLevels" Margin="10" VerticalAlignment="Center"
|
<ComboBox Grid.Row="9" Grid.Column="1" x:Name="LogLevels" Margin="10" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Width="140" />
|
Width="140" />
|
||||||
<Button Grid.Row="9" Grid.Column="1" Margin="10" x:Name="ShowDebug" Content="Show debugger"
|
<Button Grid.Row="10" Grid.Column="1" Margin="10" x:Name="ShowDebug" Content="Show debugger"
|
||||||
VerticalAlignment="Center" Width="90" HorizontalAlignment="Right"
|
VerticalAlignment="Center" Width="90" HorizontalAlignment="Right"
|
||||||
Style="{DynamicResource SquareButtonStyle}" />
|
Style="{DynamicResource SquareButtonStyle}" />
|
||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
<Button Grid.Row="10" Grid.Column="0" Margin="10" x:Name="ResetSettings" Content="Reset settings"
|
<Button Grid.Row="11" Grid.Column="0" Margin="10" x:Name="ResetSettings" Content="Reset settings"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Left" Width="90"
|
VerticalAlignment="Center" HorizontalAlignment="Left" Width="90"
|
||||||
Style="{DynamicResource SquareButtonStyle}" />
|
Style="{DynamicResource SquareButtonStyle}" />
|
||||||
<Button Grid.Row="10" Grid.Column="1" Margin="11" x:Name="SaveSettings" Content="Save changes"
|
<Button Grid.Row="11" Grid.Column="1" Margin="11" x:Name="SaveSettings" Content="Save changes"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Right" Width="90"
|
VerticalAlignment="Center" HorizontalAlignment="Right" Width="90"
|
||||||
Style="{DynamicResource SquareButtonStyle}" />
|
Style="{DynamicResource SquareButtonStyle}" />
|
||||||
|
|
||||||
<!-- Version -->
|
<!-- Version -->
|
||||||
<Grid Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="2" Margin="10" VerticalAlignment="Bottom">
|
<Grid Grid.Row="12" Grid.Column="0" Grid.ColumnSpan="2" Margin="10" VerticalAlignment="Bottom">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user