Browse Source

项目初始化

王育民 5 năm trước cách đây
commit
89801f0527

+ 5 - 0
.gitignore

@@ -0,0 +1,5 @@
+################################################################################
+# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。
+################################################################################
+
+/FireDrill/bin/Debug/FireDrill.exe

+ 22 - 0
FireDrill.sln

@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FireDrill", "FireDrill\FireDrill.csproj", "{90328737-CFBA-4A35-A9EC-35C04C01338C}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{90328737-CFBA-4A35-A9EC-35C04C01338C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{90328737-CFBA-4A35-A9EC-35C04C01338C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{90328737-CFBA-4A35-A9EC-35C04C01338C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{90328737-CFBA-4A35-A9EC-35C04C01338C}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 21 - 0
FireDrill/App.config

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <configSections>
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+            <section name="FireDrill.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+    <userSettings>
+        <FireDrill.Properties.Settings>
+            <setting name="Video" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="Audio" serializeAs="String">
+                <value />
+            </setting>
+        </FireDrill.Properties.Settings>
+    </userSettings>
+</configuration>

+ 13 - 0
FireDrill/App.xaml

@@ -0,0 +1,13 @@
+<Application x:Class="FireDrill.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:FireDrill"
+             StartupUri="MainWindow.xaml">
+    <Application.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="FontAwesome.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </Application.Resources>
+</Application>

+ 17 - 0
FireDrill/App.xaml.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace FireDrill
+{
+    /// <summary>
+    /// App.xaml 的交互逻辑
+    /// </summary>
+    public partial class App : Application
+    {
+    }
+}

+ 135 - 0
FireDrill/FireDrill.csproj

@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{90328737-CFBA-4A35-A9EC-35C04C01338C}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>FireDrill</RootNamespace>
+    <AssemblyName>FireDrill</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <WarningLevel>4</WarningLevel>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Kinect, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xaml">
+      <RequiredTargetFramework>4.0</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="WindowsBase" />
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
+  </ItemGroup>
+  <ItemGroup>
+    <ApplicationDefinition Include="App.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </ApplicationDefinition>
+    <Compile Include="Windows\AboutWindow.xaml.cs">
+      <DependentUpon>AboutWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Windows\HelpWindow.xaml.cs">
+      <DependentUpon>HelpWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Windows\SettingsWindow.xaml.cs">
+      <DependentUpon>SettingsWindow.xaml</DependentUpon>
+    </Compile>
+    <Page Include="FontAwesome.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="MainWindow.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Compile Include="App.xaml.cs">
+      <DependentUpon>App.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="MainWindow.xaml.cs">
+      <DependentUpon>MainWindow.xaml</DependentUpon>
+      <SubType>Code</SubType>
+    </Compile>
+    <Page Include="Windows\AboutWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Windows\HelpWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Windows\SettingsWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <AppDesigner Include="Properties\" />
+    <Resource Include="Resources\fa-solid-900.ttf" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 8 - 0
FireDrill/FontAwesome.xaml

@@ -0,0 +1,8 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:local="clr-namespace:FireDrill">
+    <Style x:Key="FontAwesome">
+        <Setter Property="TextElement.FontFamily" Value="/FireDrill;component/Resources/#Font Awesome 5 Free Solid"/>
+        <Setter Property="TextElement.FontSize" Value="12"/>
+    </Style>
+</ResourceDictionary>

+ 34 - 0
FireDrill/MainWindow.xaml

@@ -0,0 +1,34 @@
+<Window x:Class="FireDrill.MainWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:FireDrill"
+        mc:Ignorable="d"
+        Title="火灾演练" Height="400" Width="600" ResizeMode="CanMinimize" Loaded="Window_Loaded" KeyDown="Window_KeyDown" Closing="Window_Closing">
+    <Grid>
+        <ToolBar x:Name="ToolBar" VerticalAlignment="Top" Padding="0,0" Margin="0,0" Height="32">
+            <Button x:Name="Settings" Content="&#xF013; 设置" ToolTip="设置" Style="{StaticResource FontAwesome}" Click="Settings_Click" VerticalAlignment="Stretch"/>
+            <Separator/>
+            <Button x:Name="FullScreen" Content="&#xF31E; 全屏" ToolTip="全屏" Style="{StaticResource FontAwesome}" Click="FullScreen_Click" VerticalAlignment="Stretch"/>
+            <Separator/>
+            <Button x:Name="Help" Content="&#xF128; 帮助" ToolTip="帮助" Style="{StaticResource FontAwesome}" Click="Help_Click" VerticalAlignment="Stretch"/>
+            <Separator/>
+            <Button x:Name="About" Content="&#xF12a; 关于" ToolTip="关于" Style="{StaticResource FontAwesome}" Click="About_Click" VerticalAlignment="Stretch"/>
+            <Separator/>
+            <Button x:Name="Music" Content="&#xF001;" ToolTip="背景音乐" Style="{StaticResource FontAwesome}" Click="Music_Click" VerticalAlignment="Stretch" Foreground="Green"/>
+            <Separator/>
+            <Label x:Name="Status" Content="{Binding StatusText}" ToolTip="状态" Foreground="Gray"/>
+            <Separator/>
+            <Label x:Name="Tip" Content="{Binding TipText}" Foreground="Gray"/>
+            <Separator/>
+            <Label x:Name="Tip2" Foreground="Gray"/>
+        </ToolBar>
+
+        <MediaElement x:Name="VideoPlayer" Margin="0,32,0,0"/>
+
+        <Viewbox x:Name="ViewBox" Margin="0,32,0,0" HorizontalAlignment="Center">
+            <Image Name="Image" Source="{Binding ImageSource}" Stretch="UniformToFill" />
+        </Viewbox>
+    </Grid>
+</Window>

+ 204 - 0
FireDrill/MainWindow.xaml.cs

@@ -0,0 +1,204 @@
+using FireDrill.Windows;
+using Microsoft.Kinect;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Media;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace FireDrill
+{
+    /// <summary>
+    /// MainWindow.xaml 的交互逻辑
+    /// </summary>
+    public partial class MainWindow : Window
+    {
+        // 活动的 Kinect 传感器
+        private KinectSensor _kinectSensor = null;
+        // 坐标映射器将一种类型的点映射到另一种
+        private CoordinateMapper _coordinateMapper = null;
+        // 身体框架渲染器
+        private BodyFrameReader _bodyFrameReader = null;
+        // 颜色框架渲染器
+        private ColorFrameReader _colorFrameReader = null;
+        // 身体的数组
+        private Body[] _bodies = null;
+        // 骨骼的定义
+        private List<Tuple<JointType, JointType>> _bones;
+        // 追踪的每个身体的颜色列表
+        private List<Pen> _bodyColors;
+        // 用于体绘制输出的绘图组
+        private DrawingGroup _drawingGroup;
+        // 显示的绘图图像
+        private DrawingImage _imageSource;
+        // 显示宽度,高度(深度空间)
+        private int _displayWidth, _displayHeight;
+        // 绘制的手圆半径
+        private const double HandSize = 30;
+        // 绘制接合线的厚度
+        private const double JointThickness = 3;
+        // 夹边矩形的厚度
+        private const double ClipBoundsThickness = 10;
+        // 将相机空间点的Z值从负值夹持的常量
+        private const float InferredZPositionClamp = 0.1f;
+        // 用于绘制当前跟踪为闭合的手的画笔
+        private readonly Brush _handClosedBrush = new SolidColorBrush(Color.FromArgb(128, 255, 0, 0));
+        // 用于绘制当前跟踪为打开状态的手的画笔
+        private readonly Brush _handOpenBrush = new SolidColorBrush(Color.FromArgb(128, 0, 255, 0));
+        // 用于绘制当前在套索(指针)位置跟踪的手的画笔
+        private readonly Brush _handLassoBrush = new SolidColorBrush(Color.FromArgb(128, 0, 0, 255));
+        // 用于绘制当前跟踪的关节的画笔
+        private readonly Brush _trackedJointBrush = new SolidColorBrush(Color.FromArgb(255, 68, 192, 68));
+        // 用于绘制当前推断的关节的画笔     
+        private readonly Brush _inferredJointBrush = Brushes.Yellow;
+        // 用于绘制当前推断的骨骼的笔      
+        private readonly Pen _inferredBonePen = new Pen(Brushes.Gray, 1);
+        // 要显示的当前设备名称
+        private string _deviceName;
+        // 要显示的当前状态文本
+        private string _statusText;
+        // 要显示的提示文本
+        private string _tipText;
+        // 阈值(1/2框)(单位:米)
+        private const float Threshold = 0.15f;
+        // 当前状态
+        private int _gesture = -1;
+        // Bitmap to display
+        private WriteableBitmap _colorBitmap;
+        private SoundPlayer soundPlayer = new SoundPlayer();
+        private Boolean isAudioPlaying = false;
+
+        public MainWindow()
+        {
+            InitializeComponent();
+        }
+
+        private void Window_Loaded(object sender, RoutedEventArgs e)
+        {
+            Assembly assembly = Assembly.GetExecutingAssembly();
+            string videoContent = Properties.Settings.Default.Video;
+            string audioContent = Properties.Settings.Default.Audio;
+            if (string.IsNullOrEmpty(videoContent))
+            {
+                MessageBox.Show("请到设置页面配置视频!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
+            }
+            else
+            {
+
+            }
+            if (string.IsNullOrEmpty(audioContent))
+            {
+                MessageBox.Show("请到设置页面配置音频!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
+            }
+            else
+            {
+                soundPlayer.SoundLocation = audioContent;
+            }
+        }
+
+        private void Window_Closing(object sender, CancelEventArgs e)
+        {
+            var messageBoxResult = MessageBox.Show("确定退出吗?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question);
+            if (messageBoxResult == MessageBoxResult.Cancel)
+            {
+                e.Cancel = true;
+            }
+            else
+            {
+                if (_bodyFrameReader != null)
+                {
+                    _bodyFrameReader.Dispose();
+                    _bodyFrameReader = null;
+                }
+
+                if (_colorFrameReader != null)
+                {
+                    _colorFrameReader.Dispose();
+                    _colorFrameReader = null;
+                }
+
+                if (_kinectSensor != null)
+                {
+                    _kinectSensor.Close();
+                    _kinectSensor = null;
+                }
+                Application.Current.Shutdown();
+            }
+        }
+
+        private void Window_KeyDown(object sender, KeyEventArgs e)
+        {
+            switch (e.Key)
+            {
+                case Key.Escape:
+                    ToolBar.Visibility = Visibility.Visible;
+                    ViewBox.Margin = new Thickness { Left = 0, Top = 32, Right = 0, Bottom = 0 };
+                    WindowState = WindowState.Normal;
+                    WindowStyle = WindowStyle.SingleBorderWindow;
+                    break;
+                case Key.Space:
+                    //var bitmapImage = new BitmapImage(new Uri("I:\\图片\\background.jpg", UriKind.Absolute));
+                    //_colorBitmap = new WriteableBitmap(bitmapImage);
+                    //StatusText = DateTime.Now.ToLongTimeString();
+                    break;
+            }
+        }
+
+        private void Settings_Click(object sender, RoutedEventArgs e)
+        {
+            var dialog = new SettingsWindow();
+            dialog.ShowDialog();
+            if (dialog.DialogResult.Value)
+            {
+                soundPlayer.SoundLocation = Properties.Settings.Default.Audio;
+            }
+        }
+
+        private void FullScreen_Click(object sender, RoutedEventArgs e)
+        {
+            ToolBar.Visibility = Visibility.Hidden;
+            // ViewBox.Margin = new Thickness { Left = 0, Top = 0, Right = 0, Bottom = 0 };
+            Topmost = false;
+            WindowStyle = WindowStyle.None;
+            WindowState = WindowState.Maximized;
+        }
+
+        private void Help_Click(object sender, RoutedEventArgs e)
+        {
+            new HelpWindow().ShowDialog();
+        }
+
+        private void About_Click(object sender, RoutedEventArgs e)
+        {
+            new AboutWindow().ShowDialog();
+        }
+
+        private void Music_Click(object sender, RoutedEventArgs e)
+        {
+            if (isAudioPlaying)
+            {
+                soundPlayer.Stop();
+            }
+            else
+            {
+                // 同步加载声音
+                soundPlayer.Load();
+                // 循环播放音频
+                soundPlayer.PlayLooping();
+            }
+            isAudioPlaying = !isAudioPlaying;
+        }
+    }
+}

+ 55 - 0
FireDrill/Properties/AssemblyInfo.cs

@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("FireDrill")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("FireDrill")]
+[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+//若要开始生成可本地化的应用程序,请
+//<PropertyGroup> 中的 .csproj 文件中
+//例如,如果您在源文件中使用的是美国英语,
+//使用的是美国英语,请将 <UICulture> 设置为 en-US。  然后取消
+//对以下 NeutralResourceLanguage 特性的注释。  更新
+//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+    ResourceDictionaryLocation.None, //主题特定资源词典所处位置
+                                     //(当资源未在页面
+                                     //或应用程序资源字典中找到时使用)
+    ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
+                                              //(当资源未在页面
+                                              //、应用程序或任何主题专用资源字典中找到时使用)
+)]
+
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 108 - 0
FireDrill/Properties/Resources.Designer.cs

@@ -0,0 +1,108 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace FireDrill.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FireDrill.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   使用此强类型资源类,为所有资源查找
+        ///   重写当前线程的 CurrentUICulture 属性。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 未连接 Kinect! 的本地化字符串。
+        /// </summary>
+        internal static string NoSensorStatusText {
+            get {
+                return ResourceManager.GetString("NoSensorStatusText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 运行中 的本地化字符串。
+        /// </summary>
+        internal static string RunningStatusText {
+            get {
+                return ResourceManager.GetString("RunningStatusText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Kinect 不可用! 的本地化字符串。
+        /// </summary>
+        internal static string SensorNotAvailableStatusText {
+            get {
+                return ResourceManager.GetString("SensorNotAvailableStatusText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 音频资源(wav类型)|*.wav|所有文件|*.* 的本地化字符串。
+        /// </summary>
+        internal static string SettingsWindow_Audio_Filter {
+            get {
+                return ResourceManager.GetString("SettingsWindow_Audio_Filter", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 音频资源(mp4类型)|*.mp4|所有文件|*.* 的本地化字符串。
+        /// </summary>
+        internal static string SettingsWindow_Video_Filter {
+            get {
+                return ResourceManager.GetString("SettingsWindow_Video_Filter", resourceCulture);
+            }
+        }
+    }
+}

+ 135 - 0
FireDrill/Properties/Resources.resx

@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="NoSensorStatusText" xml:space="preserve">
+    <value>未连接 Kinect!</value>
+  </data>
+  <data name="RunningStatusText" xml:space="preserve">
+    <value>运行中</value>
+  </data>
+  <data name="SensorNotAvailableStatusText" xml:space="preserve">
+    <value>Kinect 不可用!</value>
+  </data>
+  <data name="SettingsWindow_Audio_Filter" xml:space="preserve">
+    <value>音频资源(wav类型)|*.wav|所有文件|*.*</value>
+  </data>
+  <data name="SettingsWindow_Video_Filter" xml:space="preserve">
+    <value>音频资源(mp4类型)|*.mp4|所有文件|*.*</value>
+  </data>
+</root>

+ 50 - 0
FireDrill/Properties/Settings.Designer.cs

@@ -0,0 +1,50 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace FireDrill.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string Video {
+            get {
+                return ((string)(this["Video"]));
+            }
+            set {
+                this["Video"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string Audio {
+            get {
+                return ((string)(this["Audio"]));
+            }
+            set {
+                this["Audio"] = value;
+            }
+        }
+    }
+}

+ 12 - 0
FireDrill/Properties/Settings.settings

@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="FireDrill.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="Video" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="Audio" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+  </Settings>
+</SettingsFile>

BIN
FireDrill/Resources/fa-solid-900.ttf


+ 12 - 0
FireDrill/Windows/AboutWindow.xaml

@@ -0,0 +1,12 @@
+<Window x:Class="FireDrill.Windows.AboutWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:FireDrill.Windows"
+        mc:Ignorable="d"
+        Title="AboutWindow" Height="300" Width="300">
+    <Grid>
+        
+    </Grid>
+</Window>

+ 27 - 0
FireDrill/Windows/AboutWindow.xaml.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace FireDrill.Windows
+{
+    /// <summary>
+    /// AboutWindow.xaml 的交互逻辑
+    /// </summary>
+    public partial class AboutWindow : Window
+    {
+        public AboutWindow()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 12 - 0
FireDrill/Windows/HelpWindow.xaml

@@ -0,0 +1,12 @@
+<Window x:Class="FireDrill.Windows.HelpWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:FireDrill.Windows"
+        mc:Ignorable="d"
+        Title="HelpWindow" Height="300" Width="300">
+    <Grid>
+        
+    </Grid>
+</Window>

+ 27 - 0
FireDrill/Windows/HelpWindow.xaml.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace FireDrill.Windows
+{
+    /// <summary>
+    /// HelpWindow.xaml 的交互逻辑
+    /// </summary>
+    public partial class HelpWindow : Window
+    {
+        public HelpWindow()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 22 - 0
FireDrill/Windows/SettingsWindow.xaml

@@ -0,0 +1,22 @@
+<Window x:Class="FireDrill.Windows.SettingsWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:FireDrill.Windows"
+        mc:Ignorable="d"
+        Title="设置" Height="300" Width="400" ResizeMode="CanMinimize" Loaded="Window_Loaded" Closing="Window_Closing">
+    <Grid>
+        <GroupBox x:Name="GroupBox" Header="资源设置" Margin="10">
+            <Grid HorizontalAlignment="Left" Margin="10">
+                <Label Content="视频" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top"/>
+                <TextBox x:Name="Video" Height="24" Margin="0,29,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" IsEnabled="False" VerticalContentAlignment="Center" HorizontalAlignment="Left" Width="332"/>
+                <Button x:Name="Choose_Video" Content="选择视频文件" Margin="0,58,0,0" VerticalAlignment="Top" Height="24" Click="Choose_Video_Click" HorizontalAlignment="Left" Width="332"/>
+
+                <Label Content="音频" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top" Margin="0,87,0,0"/>
+                <TextBox x:Name="Audio" Height="24" Margin="0,116,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" IsEnabled="False" VerticalContentAlignment="Center" HorizontalAlignment="Left" Width="332"/>
+                <Button x:Name="Choose_Audio" Content="选择音频文件" Margin="0,145,0,0" VerticalAlignment="Top" Height="24" Click="Choose_Audio_Click" HorizontalAlignment="Left" Width="332"/>
+            </Grid>
+        </GroupBox>
+    </Grid>
+</Window>

+ 63 - 0
FireDrill/Windows/SettingsWindow.xaml.cs

@@ -0,0 +1,63 @@
+using System.Windows;
+using System.Windows.Forms;
+
+namespace FireDrill.Windows
+{
+    /// <summary>
+    /// SettingsWindow.xaml 的交互逻辑
+    /// </summary>
+    public partial class SettingsWindow : Window
+    {
+        public SettingsWindow()
+        {
+            InitializeComponent();
+        }
+
+        private void Window_Loaded(object sender, RoutedEventArgs e)
+        {
+            Video.Text = Properties.Settings.Default.Video;
+            Audio.Text = Properties.Settings.Default.Audio;
+        }
+
+        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+        {
+            DialogResult = true;
+            Properties.Settings.Default.Video = Video.Text;
+            Properties.Settings.Default.Audio = Audio.Text;
+            Properties.Settings.Default.Save();
+            Properties.Settings.Default.Reload();
+        }
+
+        private void Choose_Video_Click(object sender, RoutedEventArgs e)
+        {
+            var ofd = new OpenFileDialog
+            {
+                Filter = Properties.Resources.SettingsWindow_Video_Filter,
+                ValidateNames = true,
+                CheckPathExists = true,
+                CheckFileExists = true,
+                Multiselect = false
+            };
+            if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
+            var strFileName = ofd.FileName;
+            Video.Text = strFileName;
+            Properties.Settings.Default.Video = strFileName;
+        }
+
+        private void Choose_Audio_Click(object sender, RoutedEventArgs e)
+        {
+            var ofd = new OpenFileDialog
+            {
+                Filter = Properties.Resources.SettingsWindow_Audio_Filter,
+                ValidateNames = true,
+                CheckPathExists = true,
+                CheckFileExists = true,
+                Multiselect = false
+            };
+            if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
+            var strFileName = ofd.FileName;
+            Audio.Text = strFileName;
+            Properties.Settings.Default.Audio = strFileName;
+        }
+    }
+}