mirror of https://github.com/logchan/chuni-hands
add freeze button
parent
20e50491d7
commit
209980ab50
|
@ -1,4 +1,6 @@
|
|||
namespace chuni_hands {
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace chuni_hands {
|
||||
public sealed class Config : Helpers.PropertyChangedInvoker {
|
||||
static Config() {
|
||||
Helpers.PatchNotifyPropertyChanged<Config>();
|
||||
|
@ -19,5 +21,8 @@
|
|||
public string SendKeyMode { get; set; } = "be";
|
||||
public string EndPoint { get; set; } = "http://10.233.3.22:4420/update_air";
|
||||
public bool ShowVideo { get; set; } = true;
|
||||
|
||||
[JsonIgnore]
|
||||
public bool FreezeVideo { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
</DockPanel>
|
||||
<Button x:Name="CenterButton" Click="CenterButton_Click">Center</Button>
|
||||
<CheckBox IsChecked="{Binding Path=LogDiff, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">Log diff</CheckBox>
|
||||
<ToggleButton IsChecked="{Binding Path=FreezeVideo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">Freeze</ToggleButton>
|
||||
</StackPanel>
|
||||
|
||||
<RichTextBox DockPanel.Dock="Bottom" x:Name="LogBox">
|
||||
|
|
|
@ -118,11 +118,15 @@ namespace chuni_hands {
|
|||
var bootstrapFrames = _config.BootstrapSeconds * _config.Fps;
|
||||
|
||||
while (!_closing) {
|
||||
_capture.Read(_mat);
|
||||
if (bootstrapFrames > 0) {
|
||||
_capture.Read(_mat);
|
||||
--bootstrapFrames;
|
||||
}
|
||||
else {
|
||||
if (!_config.FreezeVideo) {
|
||||
_capture.Read(_mat);
|
||||
}
|
||||
|
||||
Dispatcher?.BeginInvoke(new Action(FrameUpdate));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue