Skip to content

Commit 267af8b

Browse files
Merge branch 'user/t-limay/StyleTransfer-framerate' into user/t-limay/StyleTransfer-cpp
2 parents 43d9f16 + 7187482 commit 267af8b

File tree

5 files changed

+55
-32
lines changed

5 files changed

+55
-32
lines changed

Samples/StyleTransfer/AppViewModel.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
using Windows.UI.Core;
2929
using GalaSoft.MvvmLight.Threading;
3030
using System.Threading;
31+
using StyleTransferEffectCpp;
32+
using System.Runtime.InteropServices.WindowsRuntime;
3133

3234
namespace StyleTransfer
3335
{
@@ -46,6 +48,14 @@ public AppViewModel()
4648
_saveEnabled = true;
4749
NotifyUser(true);
4850

51+
m_notifier = new StyleTransferEffectNotifier();
52+
m_notifier.AccountIsInDebit += M_notifier_AccountIsInDebit;
53+
m_notifier.AdjustBalance(-4.0f);
54+
}
55+
56+
private void M_notifier_AccountIsInDebit(object sender, float e)
57+
{
58+
Debug.WriteLine("Account in Debit: " + e);
4959
}
5060

5161
// Media capture properties
@@ -67,6 +77,8 @@ public AppViewModel()
6777
// Activatable Class ID of the video effect.
6878
private String _videoEffectID = "StyleTransferEffectCpp.StyleTransferEffect";
6979
System.Threading.Mutex Processing = new Mutex();
80+
EventRegistrationToken m_eventToken;
81+
StyleTransferEffectCpp.StyleTransferEffectNotifier m_notifier;
7082

7183
// Image style transfer properties
7284
uint m_inWidth, m_inHeight, m_outWidth, m_outHeight;

Samples/StyleTransfer/Package.appxmanifest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
<mp:PhoneIdentity PhoneProductId="7fafd263-abdf-4f88-87a1-ffb0922489d1" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
1515

16+
1617
<Properties>
1718
<DisplayName>StyleTransfer</DisplayName>
1819
<PublisherDisplayName>t-limay</PublisherDisplayName>

Samples/StyleTransfer/VideoEffect/StyleTransferEffectCpp/StyleTransferEffectCpp.vcxproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.props')" />
34
<Import Project="..\..\packages\Microsoft.AI.MachineLearning.1.3.1-dev-20200711-0122-00cc8041c\build\native\Microsoft.AI.MachineLearning.props" Condition="Exists('..\..\packages\Microsoft.AI.MachineLearning.1.3.1-dev-20200711-0122-00cc8041c\build\native\Microsoft.AI.MachineLearning.props')" />
45
<Import Project="packages\Microsoft.AI.MachineLearning.1.3.0\build\native\Microsoft.AI.MachineLearning.props" Condition="Exists('packages\Microsoft.AI.MachineLearning.1.3.0\build\native\Microsoft.AI.MachineLearning.props')" />
56
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.props')" />
@@ -123,6 +124,7 @@
123124
<ClInclude Include="StyleTransferEffect.h">
124125
<DependentUpon>StyleTransferEffect.idl</DependentUpon>
125126
</ClInclude>
127+
<ClInclude Include="StyleTransferEffectNotifier.h" />
126128
</ItemGroup>
127129
<ItemGroup>
128130
<ClCompile Include="pch.cpp">
@@ -132,8 +134,10 @@
132134
<DependentUpon>StyleTransferEffect.idl</DependentUpon>
133135
</ClCompile>
134136
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
137+
<ClCompile Include="StyleTransferEffectNotifier.cpp" />
135138
</ItemGroup>
136139
<ItemGroup>
140+
<Midl Include="StyleTransferEffectNotifier.idl" />
137141
<Midl Include="StyleTransferEffect.idl" />
138142
</ItemGroup>
139143
<ItemGroup>
@@ -151,6 +155,7 @@
151155
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.200615.7\build\native\Microsoft.Windows.CppWinRT.targets')" />
152156
<Import Project="packages\Microsoft.AI.MachineLearning.1.3.0\build\native\Microsoft.AI.MachineLearning.targets" Condition="Exists('packages\Microsoft.AI.MachineLearning.1.3.0\build\native\Microsoft.AI.MachineLearning.targets')" />
153157
<Import Project="..\..\packages\Microsoft.AI.MachineLearning.1.3.1-dev-20200711-0122-00cc8041c\build\native\Microsoft.AI.MachineLearning.targets" Condition="Exists('..\..\packages\Microsoft.AI.MachineLearning.1.3.1-dev-20200711-0122-00cc8041c\build\native\Microsoft.AI.MachineLearning.targets')" />
158+
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.targets')" />
154159
</ImportGroup>
155160
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
156161
<PropertyGroup>
@@ -162,5 +167,7 @@
162167
<Error Condition="!Exists('packages\Microsoft.AI.MachineLearning.1.3.0\build\native\Microsoft.AI.MachineLearning.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.AI.MachineLearning.1.3.0\build\native\Microsoft.AI.MachineLearning.targets'))" />
163168
<Error Condition="!Exists('..\..\packages\Microsoft.AI.MachineLearning.1.3.1-dev-20200711-0122-00cc8041c\build\native\Microsoft.AI.MachineLearning.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.AI.MachineLearning.1.3.1-dev-20200711-0122-00cc8041c\build\native\Microsoft.AI.MachineLearning.props'))" />
164169
<Error Condition="!Exists('..\..\packages\Microsoft.AI.MachineLearning.1.3.1-dev-20200711-0122-00cc8041c\build\native\Microsoft.AI.MachineLearning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.AI.MachineLearning.1.3.1-dev-20200711-0122-00cc8041c\build\native\Microsoft.AI.MachineLearning.targets'))" />
170+
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.props'))" />
171+
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.targets'))" />
165172
</Target>
166173
</Project>
Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<ItemGroup>
4-
<Filter Include="Resources">
5-
<UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
6-
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
7-
</Filter>
8-
<Filter Include="Generated Files">
9-
<UniqueIdentifier>{926ab91d-31b4-48c3-b9a4-e681349f27f0}</UniqueIdentifier>
10-
</Filter>
11-
</ItemGroup>
12-
<ItemGroup>
13-
<ClCompile Include="pch.cpp" />
14-
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
15-
</ItemGroup>
16-
<ItemGroup>
17-
<ClInclude Include="pch.h" />
18-
</ItemGroup>
19-
<ItemGroup>
20-
<None Include="StyleTransferEffectCpp.def" />
21-
<None Include="packages.config" />
22-
</ItemGroup>
23-
<ItemGroup>
24-
<None Include="PropertySheet.props" />
25-
</ItemGroup>
26-
<ItemGroup>
27-
<Text Include="readme.txt" />
28-
</ItemGroup>
29-
<ItemGroup>
30-
<Midl Include="StyleTransferEffect.idl" />
31-
</ItemGroup>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Resources">
5+
<UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
6+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
7+
</Filter>
8+
<Filter Include="Generated Files">
9+
<UniqueIdentifier>{926ab91d-31b4-48c3-b9a4-e681349f27f0}</UniqueIdentifier>
10+
</Filter>
11+
</ItemGroup>
12+
<ItemGroup>
13+
<ClCompile Include="pch.cpp" />
14+
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
15+
<ClCompile Include="StyleTransferEffectNotifier.cpp" />
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClInclude Include="pch.h" />
19+
<ClInclude Include="StyleTransferEffectNotifier.h" />
20+
</ItemGroup>
21+
<ItemGroup>
22+
<None Include="StyleTransferEffectCpp.def" />
23+
<None Include="packages.config" />
24+
</ItemGroup>
25+
<ItemGroup>
26+
<None Include="PropertySheet.props" />
27+
</ItemGroup>
28+
<ItemGroup>
29+
<Text Include="readme.txt" />
30+
</ItemGroup>
31+
<ItemGroup>
32+
<Midl Include="StyleTransferEffect.idl" />
33+
<Midl Include="StyleTransferEffectNotifier.idl" />
34+
</ItemGroup>
3235
</Project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Microsoft.AI.MachineLearning" version="1.3.1-dev-20200711-0122-00cc8041c" targetFramework="native" />
4-
<package id="Microsoft.Windows.CppWinRT" version="2.0.200615.7" targetFramework="native" />
4+
<package id="Microsoft.Windows.CppWinRT" version="2.0.200703.9" targetFramework="native" />
55
</packages>

0 commit comments

Comments
 (0)