Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust to use exception handling to avoid a crash in glyph handling #905

Closed
wants to merge 9 commits into from
Closed
21 changes: 21 additions & 0 deletions Samples/AudioCreation/cs/AudioCreation/AudioCreation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@
<Compile Include="Scenario6_CustomEffects.xaml.cs">
<DependentUpon>Scenario6_CustomEffects.xaml</DependentUpon>
</Compile>
<Compile Include="Scenario7_FrameInputNode.xaml.cs">
<DependentUpon>Scenario7_FrameInputNode.xaml</DependentUpon>
</Compile>
<Compile Include="Scenario8_MaxSubmix.xaml.cs">
<DependentUpon>Scenario8_MaxSubmix.xaml</DependentUpon>
</Compile>
<Compile Include="Scenario9_FrameInputNodeMC.xaml.cs">
<DependentUpon>Scenario9_FrameInputNodeMC.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
Expand Down Expand Up @@ -176,6 +185,18 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Scenario7_FrameInputNode.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Scenario8_MaxSubmix.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Scenario9_FrameInputNodeMC.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\..\SharedContent\cs\Default.rd.xml">
Expand Down
7 changes: 5 additions & 2 deletions Samples/AudioCreation/cs/AudioCreation/SampleConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ public partial class MainPage : Page
new Scenario() { Title="File Playback", ClassType=typeof(Scenario1_FilePlayback)},
new Scenario() { Title="Capture From Device", ClassType=typeof(Scenario2_DeviceCapture)},
new Scenario() { Title="Using A FrameInput Node", ClassType=typeof(Scenario3_FrameInput)},
new Scenario() { Title="Using A Submix Node", ClassType=typeof(Scenario4_Submix)},
new Scenario() { Title="Using A Submix Node", ClassType=typeof(Scenario8_MaxSubmix)},
new Scenario() { Title="Inbox Effects", ClassType=typeof(Scenario5_InboxEffects)},
new Scenario() { Title="Custom Effects", ClassType=typeof(Scenario6_CustomEffects)}
new Scenario() { Title="Custom Effects", ClassType=typeof(Scenario6_CustomEffects)},
new Scenario() { Title="Blended Synth", ClassType=typeof(Scenario7_FrameInput)},
new Scenario() { Title="n Channel read mix", ClassType=typeof(Scenario8_MaxSubmix)},
new Scenario() { Title="Blended multi-channel synth", ClassType=typeof(Scenario9_FrameInputNodeMC)}
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->
<Page
x:Class="AudioCreation.Scenario7_FrameInput"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AudioCreation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="audioPipe.(RelativePanel.RightOf)" Value="frameContainer" />
<Setter Target="audioPipe.(RelativePanel.AlignVerticalCenterWith)" Value="frameContainer" />
<Setter Target="speakerContainer.(RelativePanel.RightOf)" Value="audioPipe" />

<Setter Target="generateButton.(RelativePanel.Below)" Value="audioPipe" />
<Setter Target="generateButton.(RelativePanel.AlignHorizontalCenterWith)" Value="audioPipe" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="12,20,12,12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Margin="0,0,0,10">
<TextBlock Text="Description:" Style="{StaticResource SampleHeaderTextStyle}"/>
<TextBlock Name="DetailText" Style="{StaticResource ScenarioDescriptionTextStyle}" TextWrapping="Wrap" Text="This scenario illustrates using the FrameInputNode to play audio. Audio samples are dynamically generated to fill the FrameInputNode." />
</StackPanel>

<!--Main content is scrollable-->
<ScrollViewer Grid.Row="1" VerticalScrollMode="Auto" VerticalScrollBarVisibility="Auto">
<RelativePanel HorizontalAlignment="Stretch" MinWidth="500">
<!--Input-Pipe-Output-->

<Border x:Name="frameContainer" BorderThickness="0" Background="#4A4A4A" MinWidth="120" MinHeight="45" Margin="0,20,0,0">
<TextBlock x:Name="frame" Text="Frame Input" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
<Rectangle x:Name="audioPipe" Margin="0,20,0,0" Height="10" MinWidth="160" Fill="#313131" HorizontalAlignment="Stretch"/>
<Border x:Name="speakerContainer" BorderThickness="0" Background="#4A4A4A" MinWidth="120" MinHeight="45" Margin="0,20,0,0">
<TextBlock x:Name="speaker" Text="Output Device" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
<Button x:Name="generateButton" Content="Generate Audio" Click="Button_Click" MinWidth="120" MinHeight="45" Margin="0,50,0,0"/>
</RelativePanel>
</ScrollViewer>

<!-- Status Block for providing messages to the user. Use the
NotifyUser() method to populate the message -->
<TextBlock x:Name="StatusBlock" Grid.Row="2" Margin="12, 10, 12, 10" Visibility="Collapsed"/>
</Grid>
</Grid>
</Page>
Loading