-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
235 lines (202 loc) · 9.54 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="TunerWinUI.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:oxy="using:OxyPlot"
mc:Ignorable="d">
<Window.SystemBackdrop>
<MicaBackdrop Kind="Base"></MicaBackdrop>
</Window.SystemBackdrop>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition MaxHeight="50"/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="250"/>
</Grid.ColumnDefinitions>
<!-- INDICATORS (LEFT) -->
<StackPanel Grid.Column="0"
Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<!-- TODO -->
<StackPanel Orientation="Vertical"
VerticalAlignment="Center"
Margin="0 0 5 0">
<TextBlock Text="Real-time Info"
VerticalAlignment="Center"
HorizontalAlignment="Center"
TextAlignment="Center"
FontSize="10"
FontWeight="Medium"
Margin="0 0 0 5"/>
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center"
HorizontalAlignment="Center">
<Border BorderThickness="1"
Margin="0 0 20 0"
CornerRadius="2"
Padding="5 2"
BorderBrush="Black">
<TextBlock Text="{x:Bind TimeDomainPlot.FrameRate, Mode=OneWay}"/>
</Border>
</StackPanel>
</StackPanel>
</StackPanel>
<!-- MIDDLE CONTROLS -->
<StackPanel Grid.Column="1"
Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<!-- SAMPLING RATE CHOOSER -->
<StackPanel Orientation="Vertical"
VerticalAlignment="Center"
Margin="0 0 5 0">
<TextBlock Text="Sampling Rate"
VerticalAlignment="Center"
HorizontalAlignment="Center"
TextAlignment="Center"
FontSize="10"
FontWeight="Medium"
Margin="0 0 0 5"/>
<ComboBox ItemsSource="{x:Bind AudioEngine.AvailableSamplingRates}"
x:Name="SamplingRateCombo"
MinWidth="120"
MaxWidth="120"
VerticalContentAlignment="Center"
VerticalAlignment="Stretch"
SelectedItem="44100 Hz"/>
</StackPanel>
<!-- FFT SIZE CHOOSER -->
<StackPanel Orientation="Vertical"
VerticalAlignment="Center"
Margin="5 0 5 0">
<TextBlock Text="FFT Size"
VerticalAlignment="Center"
HorizontalAlignment="Center"
TextAlignment="Center"
FontSize="10"
FontWeight="Medium"
Margin="0 0 0 5"/>
<ComboBox ItemsSource="{x:Bind FrequencyDomainPlot.AvailableFFTSizes}"
x:Name="FFTSizeCombo"
MinWidth="100"
MaxWidth="100"
VerticalContentAlignment="Center"
VerticalAlignment="Stretch"
SelectedIndex="0"/>
</StackPanel>
<!-- SOURCE CHOOSER -->
<StackPanel Orientation="Vertical"
VerticalAlignment="Center"
Margin="5 0 0 0">
<TextBlock Text="Audio Source Device"
VerticalAlignment="Center"
HorizontalAlignment="Center"
TextAlignment="Center"
FontSize="10"
FontWeight="Medium"
Margin="0 0 0 5"/>
<StackPanel Orientation="Horizontal">
<ComboBox ItemsSource="{x:Bind AudioEngine.OnlineDevices}"
x:Name="SourceDeviceCombo"
MinWidth="350"
PlaceholderText="No sources available right now"
VerticalContentAlignment="Center"
VerticalAlignment="Stretch"
SelectedIndex="0"/>
<Button Click="RefreshOnlineDevices_Click"
VerticalAlignment="Stretch"
Margin="5 0 0 0">
<StackPanel Orientation="Horizontal">
<Viewbox MaxHeight="16"
MaxWidth="16"
>
<SymbolIcon Symbol="Refresh"/>
</Viewbox>
</StackPanel>
</Button>
</StackPanel>
</StackPanel>
</StackPanel>
<!-- CONTROLS (RIGHT) -->
<StackPanel Grid.Column="2"
Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<StackPanel Orientation="Vertical"
VerticalAlignment="Center"
Margin="0 0 5 0">
<TextBlock Text="Controls"
VerticalAlignment="Center"
HorizontalAlignment="Center"
TextAlignment="Center"
FontSize="10"
FontWeight="Medium"
Margin="0 0 0 5"/>
<Button x:Name="CaptureButton"
Click="ToggleCapture_Click"
VerticalAlignment="Stretch">
<StackPanel Orientation="Horizontal">
<Viewbox MaxHeight="16"
MaxWidth="16">
<SymbolIcon Symbol="Play"
x:Name="CaptureButtonSymbol"/>
</Viewbox>
</StackPanel>
</Button>
</StackPanel>
</StackPanel>
</Grid>
</Grid>
<!-- OSCILLOSCOPE -->
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
TextAlignment="Center"
FontWeight="Bold"
FontSize="22"
Text="PCM Time Data"
/>
<Page Grid.Row="1">
<oxy:PlotView Model="{x:Bind TimeDomainPlot.Model}"
Background="Transparent"/>
</Page>
</Grid>
<!-- FOURIER PLOT -->
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
TextAlignment="Center"
FontWeight="Bold"
FontSize="22"
Text="FFT Frequency Data"
/>
<Page Grid.Row="1">
<oxy:PlotView Model="{x:Bind FrequencyDomainPlot.Model}"
Background="Transparent"/>
</Page>
</Grid>
</Grid>
</Window>