Skip to content

Commit

Permalink
Preparations for ViewPort translation
Browse files Browse the repository at this point in the history
Not functional yet!
  • Loading branch information
ShortDevelopment committed Oct 28, 2021
1 parent 77b4edf commit f77d661
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 31 deletions.
68 changes: 37 additions & 31 deletions VBAudioRouter/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,43 @@
IsOpen="False" Visibility="Collapsed" Closed="BackgroundAudioPermissionsWarning_Closed"
Severity="Warning" Title="Permissions" Message="App does not have permissions to play background audio" />
</Grid>
<Grid Grid.Row="1">
<Canvas x:Name="ConnectionCanvas" />
<Grid x:Name="NodeContainer" Background="Transparent">
<Grid.ContextFlyout>
<MenuFlyout x:Name="ContextMenuFlyout">
<MenuFlyoutSubItem Text="Input">
<MenuFlyoutItem Text="Microphone" Tag="MicInputNodeControl" Click="MenuFlyoutItem_Click" />
<MenuFlyoutItem Text="File" Tag="FileInputNodeControl" Click="MenuFlyoutItem_Click" />
<MenuFlyoutItem Text="TTS" Tag="TextToSpeechInputNodeControl" Click="MenuFlyoutItem_Click" />
</MenuFlyoutSubItem>
<MenuFlyoutSeparator />
<MenuFlyoutSubItem Text="Effects">
<MenuFlyoutItem Text="Equalizer" Tag="EQNodeControl" Click="MenuFlyoutItem_Click" />
<MenuFlyoutItem Text="Reverb" Tag="ReverbNodeControl" Click="MenuFlyoutItem_Click" />
<MenuFlyoutItem Text="Echo" Tag="EchoNodeControl" Click="MenuFlyoutItem_Click" />
<MenuFlyoutItem Text="Limiter" Tag="LimiterNodeControl" Click="MenuFlyoutItem_Click" />
</MenuFlyoutSubItem>
<MenuFlyoutSubItem Text="Transforms">
<MenuFlyoutItem Text="Gain" Tag="GainNodeControl" Click="MenuFlyoutItem_Click" />
</MenuFlyoutSubItem>
<MenuFlyoutSeparator />
<MenuFlyoutSubItem Text="Output">
<MenuFlyoutItem Text="Device" IsEnabled="False" />
<MenuFlyoutItem Text="File" IsEnabled="False" />
<MenuFlyoutItem Text="Spectrum" Tag="SpectrumNodeControl" Click="MenuFlyoutItem_Click" />
</MenuFlyoutSubItem>
</MenuFlyout>
</Grid.ContextFlyout>
<controls1:NodeControl Title="Output" TitleBrush="{StaticResource NodeTitleBarColor}" VerticalAlignment="Top" HorizontalAlignment="Left">
<controls1:OutputNodeControl Canvas="{x:Bind ConnectionCanvas}" x:Name="DefaultOutputNode" />
</controls1:NodeControl>
<Grid Grid.Row="1">
<Grid x:Name="ViewPort"
ManipulationMode="TranslateX, TranslateY" ManipulationDelta="Grid_ManipulationDelta">
<Canvas x:Name="ConnectionCanvas" />
<Grid x:Name="NodeContainer" Background="Transparent">
<Grid.ContextFlyout>
<MenuFlyout x:Name="ContextMenuFlyout">
<MenuFlyoutSubItem Text="Input">
<MenuFlyoutItem Text="Microphone" Tag="MicInputNodeControl" Click="MenuFlyoutItem_Click" />
<MenuFlyoutItem Text="File" Tag="FileInputNodeControl" Click="MenuFlyoutItem_Click" />
<MenuFlyoutItem Text="TTS" Tag="TextToSpeechInputNodeControl" Click="MenuFlyoutItem_Click" />
</MenuFlyoutSubItem>
<MenuFlyoutSeparator />
<MenuFlyoutSubItem Text="Effects">
<MenuFlyoutItem Text="Equalizer" Tag="EQNodeControl" Click="MenuFlyoutItem_Click" />
<MenuFlyoutItem Text="Reverb" Tag="ReverbNodeControl" Click="MenuFlyoutItem_Click" />
<MenuFlyoutItem Text="Echo" Tag="EchoNodeControl" Click="MenuFlyoutItem_Click" />
<MenuFlyoutItem Text="Limiter" Tag="LimiterNodeControl" Click="MenuFlyoutItem_Click" />
</MenuFlyoutSubItem>
<MenuFlyoutSubItem Text="Transforms">
<MenuFlyoutItem Text="Gain" Tag="GainNodeControl" Click="MenuFlyoutItem_Click" />
</MenuFlyoutSubItem>
<MenuFlyoutSeparator />
<MenuFlyoutSubItem Text="Output">
<MenuFlyoutItem Text="Device" IsEnabled="False" />
<MenuFlyoutItem Text="File" IsEnabled="False" />
<MenuFlyoutItem Text="Spectrum" Tag="SpectrumNodeControl" Click="MenuFlyoutItem_Click" />
</MenuFlyoutSubItem>
</MenuFlyout>
</Grid.ContextFlyout>
<controls1:NodeControl Title="Output" TitleBrush="{StaticResource NodeTitleBarColor}" VerticalAlignment="Top" HorizontalAlignment="Left">
<controls1:OutputNodeControl Canvas="{x:Bind ConnectionCanvas}" x:Name="DefaultOutputNode" />
</controls1:NodeControl>
</Grid>
<Grid.RenderTransform>
<CompositeTransform x:Name="ViewPortTransform" />
</Grid.RenderTransform>
</Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="10" CornerRadius="5" Background="{StaticResource MenuBackground}">
<AppBarButton x:Name="PlayButton" Icon="Play" Foreground="{StaticResource PositiveColor}" LabelPosition="Collapsed" />
Expand Down
6 changes: 6 additions & 0 deletions VBAudioRouter/MainPage.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,10 @@ Public NotInheritable Class MainPage
Await Launcher.LaunchUriAsync(New Uri("https://github.com/ShortDevelopment/VB-Audio-Router/wiki"))
End Sub

Private Sub Grid_ManipulationDelta(sender As Object, e As ManipulationDeltaRoutedEventArgs)
Exit Sub
If e.OriginalSource IsNot ViewPort Then Exit Sub
ViewPortTransform.TranslateX += e.Delta.Translation.X
ViewPortTransform.TranslateY += e.Delta.Translation.Y
End Sub
End Class

0 comments on commit f77d661

Please sign in to comment.