Skip to content

Commit

Permalink
Converted from standalone exe to windows exe to use WPF
Browse files Browse the repository at this point in the history
  • Loading branch information
benaclejames committed Feb 27, 2022
1 parent 00bef7f commit f392018
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 11 deletions.
17 changes: 13 additions & 4 deletions VRCFaceTracking.sln
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32126.315
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VRCFaceTracking", "VRCFaceTracking\VRCFaceTracking.csproj", "{0767C09E-D536-464B-B0A1-46D5BFA19E98}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VRCFT Module Example", "VRCFT Module Example\VRCFT Module Example.csproj", "{296110E5-3AE7-4D9F-BE09-890194CDD76E}"
Expand All @@ -10,13 +13,19 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{296110E5-3AE7-4D9F-BE09-890194CDD76E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{296110E5-3AE7-4D9F-BE09-890194CDD76E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{296110E5-3AE7-4D9F-BE09-890194CDD76E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{296110E5-3AE7-4D9F-BE09-890194CDD76E}.Release|Any CPU.Build.0 = Release|Any CPU
{0767C09E-D536-464B-B0A1-46D5BFA19E98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0767C09E-D536-464B-B0A1-46D5BFA19E98}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0767C09E-D536-464B-B0A1-46D5BFA19E98}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0767C09E-D536-464B-B0A1-46D5BFA19E98}.Release|Any CPU.Build.0 = Release|Any CPU
{296110E5-3AE7-4D9F-BE09-890194CDD76E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{296110E5-3AE7-4D9F-BE09-890194CDD76E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{296110E5-3AE7-4D9F-BE09-890194CDD76E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{296110E5-3AE7-4D9F-BE09-890194CDD76E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7160120F-762F-4906-B9F5-F0B1AB71E928}
EndGlobalSection
EndGlobal
10 changes: 10 additions & 0 deletions VRCFaceTracking/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- Bind startup to MainStandalone.Main -->
<Application x:Class="VRCFaceTracking.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VRCFaceTracking"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
14 changes: 14 additions & 0 deletions VRCFaceTracking/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Threading;

namespace VRCFaceTracking
{
public partial class App
{
private readonly Thread _oscThread = new Thread(MainStandalone.Initialize);

public App()
{
_oscThread.Start();
}
}
}
2 changes: 2 additions & 0 deletions VRCFaceTracking/InputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ namespace VRCFaceTracking
{
public class InputManager
{
// Move to the WPF window as a button
public bool ShouldPause;

public InputManager() => new Thread(Listen).Start();

private void Listen()
{
return;
while (true)
{
var key = Console.ReadKey(true);
Expand Down
11 changes: 8 additions & 3 deletions VRCFaceTracking/MainStandalone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows;
using VRCFaceTracking.OSC;

[assembly: AssemblyTitle("VRCFaceTracking")]
Expand All @@ -17,6 +18,10 @@
[assembly: AssemblyVersion("3.0.1")]
[assembly: AssemblyFileVersion("3.0.1")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly
)]

namespace VRCFaceTracking
{
Expand All @@ -34,10 +39,10 @@ private static IEnumerable<OscMessage> ConstructMessages(IEnumerable<OSCParams.B
private static string _ip = "127.0.0.1";
private static int _inPort = 9001, _outPort = 9000;

public static void Main(string[] args)
public static void Initialize()
{
// Parse Arguments
foreach (var arg in args)
/*foreach (var arg in args)
{
if (arg.StartsWith("--osc="))
{
Expand Down Expand Up @@ -67,7 +72,7 @@ public static void Main(string[] args)
return;
}
}
}
}*/

// Initialize dependencies and tracking runtimes
Logger.Msg("VRCFT Standalone Initializing!");
Expand Down
18 changes: 18 additions & 0 deletions VRCFaceTracking/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Window x:Class="VRCFaceTracking.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VRCFaceTracking"
mc:Ignorable="d"
Title="VRCFaceTracking" Height="450" Width="800" Background="#3b3b3b">
<Grid>
<Image x:Name="VRCFTLogo" HorizontalAlignment="Left" Height="120" Margin="20,20,0,0" VerticalAlignment="Top" Width="120" Source="VRCFTLogo.png"/>
<TextBlock HorizontalAlignment="Left" Margin="145,20,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="115" Width="185" Foreground="#FFE8E8E8" FontWeight="Bold" FontSize="20">
Welcome to <LineBreak/>
VRCFaceTracking
</TextBlock>


</Grid>
</Window>
14 changes: 14 additions & 0 deletions VRCFaceTracking/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Windows;

namespace VRCFaceTracking
{
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();

//VRCFTLogo.Source = new
}
}
}
Binary file added VRCFaceTracking/VRCFTLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 30 additions & 4 deletions VRCFaceTracking/VRCFaceTracking.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0767C09E-D536-464B-B0A1-46D5BFA19E98}</ProjectGuid>
<OutputType>Exe</OutputType>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VRCFaceTracking</RootNamespace>
<AssemblyName>VRCFaceTracking</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<OutputType>Exe</OutputType>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand All @@ -28,7 +28,6 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputType>Exe</OutputType>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -41,6 +40,14 @@
<ApplicationIcon>VRCFT.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<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>
<Compile Include="ConfigParser.cs" />
<Compile Include="DependencyManager.cs" />
<Compile Include="InputManager.cs" />
Expand Down Expand Up @@ -84,18 +91,21 @@
<EmbeddedResource Include="TrackingLibs\SRanipal\SRWorks_Log.dll" />
<EmbeddedResource Include="TrackingLibs\SRanipal\ViveSR_Client.dll" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0-preview.1.22076.8\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
<Private>True</Private>
Expand Down Expand Up @@ -125,9 +135,25 @@
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<Content Include="VRCFT.ico" />
<Resource Include="VRCFTLogo.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.Text.Json.7.0.0-preview.1.22076.8\build\System.Text.Json.targets" Condition="Exists('..\packages\System.Text.Json.7.0.0-preview.1.22076.8\build\System.Text.Json.targets')" />
Expand Down

0 comments on commit f392018

Please sign in to comment.