-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
229 lines (227 loc) · 17 KB
/
MainWindow.xaml
File metadata and controls
229 lines (227 loc) · 17 KB
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
<Window x:Class="KinectOSC.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="755" MaxHeight="755" MinHeight="230" Width="680" MaxWidth="680" MinWidth="680" Loaded="WindowLoaded" Closing="WindowClosing"
ResizeMode="CanResizeWithGrip">
<Window.Resources>
<SolidColorBrush x:Key="MediumGreyBrush" Color="#ff6e6e6e"/>
<SolidColorBrush x:Key="KinectPurpleBrush" Color="#ff52318f"/>
<SolidColorBrush x:Key="KinectBlueBrush" Color="#ff00BCF2"/>
<Style TargetType="{x:Type CheckBox}" x:Key="SquareCheckBox" >
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<Grid>
<StackPanel Orientation="Horizontal" Background="Transparent">
<Grid x:Name="SquareCheckBoxChecked">
<Image x:Name="CheckedNormal" Source="Images\CheckedNormal.png" Stretch="None" HorizontalAlignment="Center"/>
<Image x:Name="CheckedHover" Source="Images\CheckedHover.png" Stretch="None" HorizontalAlignment="Center" Visibility="Collapsed"/>
</Grid>
<Grid x:Name="SquareCheckBoxUnchecked" Visibility="Collapsed">
<Image x:Name="UncheckedNormal" Source="Images\UncheckedNormal.png" Stretch="None" HorizontalAlignment="Center"/>
<Image x:Name="UncheckedHover" Source="Images\UncheckedHover.png" Stretch="None" HorizontalAlignment="Center" Visibility="Collapsed"/>
</Grid>
<TextBlock x:Name="SquareCheckBoxText" Text="{TemplateBinding Content}" TextAlignment="Left" VerticalAlignment="Center" Foreground="{StaticResource KinectPurpleBrush}" FontSize="15" Margin="9,0,0,0"/>
</StackPanel>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="false">
<Setter Property="Visibility" Value="Collapsed" TargetName="SquareCheckBoxChecked"/>
<Setter Property="Visibility" Value="Visible" TargetName="SquareCheckBoxUnchecked"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Visibility" Value="Collapsed" TargetName="SquareCheckBoxChecked"/>
<Setter Property="Visibility" Value="Hidden" TargetName="SquareCheckBoxUnchecked"/>
<Setter Property="Foreground" Value="DarkGray" TargetName="SquareCheckBoxText"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Visibility" Value="Collapsed" TargetName="CheckedNormal"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="UncheckedNormal"/>
<Setter Property="Visibility" Value="Visible" TargetName="CheckedHover"/>
<Setter Property="Visibility" Value="Visible" TargetName="UncheckedHover"/>
<Setter Property="Foreground" Value="{StaticResource KinectBlueBrush}" TargetName="SquareCheckBoxText"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid Name="layoutGrid" Margin="10 0 10 0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<DockPanel Grid.Row="0" Grid.ColumnSpan="3" Margin="0 0 0 20">
<Image DockPanel.Dock="Left" Source="Images\Logo.png" Stretch="None" Margin="0 10 0 5"/>
<TextBlock DockPanel.Dock="Right" VerticalAlignment="Bottom" Foreground="{StaticResource MediumGreyBrush}" FontFamily="Segoe UI" FontSize="18">Skeleton OSC</TextBlock>
<Image Grid.Column="1" Source="Images\Status.png" Stretch="None" HorizontalAlignment="Center" Margin="0 0 0 5"/>
</DockPanel>
<StackPanel Grid.Row="1" Grid.ColumnSpan="3" Width="640" Height="480" HorizontalAlignment="Left" Background="AntiqueWhite">
<Image Name="ColorImage" Width="640" Height="480" Margin="0,0,0,0" />
<Image Name="Image" Width="640" Height="480" Margin="0,-480,0,0" Panel.ZIndex="100" />
<TextBox ScrollViewer.HorizontalScrollBarVisibility="Auto" Visibility="Collapsed" ScrollViewer.VerticalScrollBarVisibility="Auto"
Background="#BBFFFFFF" FontSize="16" ScrollViewer.CanContentScroll="True" Height="480" HorizontalAlignment="Right" Margin="0,-480,0,0"
Name="oscViewer" VerticalAlignment="Top" Width="355" Panel.ZIndex="200" />
<Button Visibility="Collapsed" Name="CloseOscViewer" Content="Close" Click="CloseOscViewerClicked" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 -480 20 0" Width="100" Height="30"
FontSize="16" Panel.ZIndex="300"></Button>
</StackPanel>
<StackPanel Grid.Row="2">
<CheckBox Style="{StaticResource SquareCheckBox}" Content="Seated Mode" IsChecked="False" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Center"
Margin="0 0 10 10" Name="checkBoxSeatedMode" Checked="CheckBoxSeatedModeChanged" Unchecked="CheckBoxSeatedModeChanged" ToolTipService.ShowDuration="12000">
<CheckBox.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">Toggle Seated Mode</TextBlock>
<TextBlock>In seated mode you only get joints for the arms, hands, neck, head, spine (no legs)</TextBlock>
</StackPanel>
</ToolTip>
</CheckBox.ToolTip>
</CheckBox>
<CheckBox Style="{StaticResource SquareCheckBox}" Content="Track Nearest Only" IsChecked="False" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Center"
Margin="0 -10 10 10" Name="checkBoxTrackNearestOnly" Checked="CheckBoxTrackNearestOnlyChanged" Unchecked="CheckBoxTrackNearestOnlyChanged" ToolTipService.ShowDuration="12000">
<CheckBox.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">Toggle Track Nearest Only</TextBlock>
<TextBlock>If checked: the Kinect will only track the nearest skeleton</TextBlock>
<TextBlock>If unchecked: the Kinect will track two skeletons as soon as they are seen</TextBlock>
</StackPanel>
</ToolTip>
</CheckBox.ToolTip>
</CheckBox>
<CheckBox Style="{StaticResource SquareCheckBox}" IsChecked="True" Content="Show Video" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 -10 10 10"
Name="checkBoxDrawColor" Checked="CheckBoxDrawColorChanged" Unchecked="CheckBoxDrawColorChanged">
<CheckBox.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">Toggle Video Streaming</TextBlock>
<TextBlock>If checked: Video will be shown in window</TextBlock>
<TextBlock>If unchecked: Video window will show the last frame frozen</TextBlock>
</StackPanel>
</ToolTip>
</CheckBox.ToolTip>
</CheckBox>
<CheckBox Style="{StaticResource SquareCheckBox}" IsChecked="True" Content="Show Skeleton" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 -10 10 10"
Name="checkBoxShowSkeleton" Checked="CheckBoxShowSkeletonChanged" Unchecked="CheckBoxShowSkeletonChanged">
<CheckBox.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">Toggle Skeleton Drawing</TextBlock>
<TextBlock>If checked: Skeletons will be drawn</TextBlock>
<TextBlock>If unchecked: Skeletons will NOT be drawn</TextBlock>
</StackPanel>
</ToolTip>
</CheckBox.ToolTip>
</CheckBox>
</StackPanel>
<StackPanel Grid.Row="2" Grid.ColumnSpan="2" Grid.Column="1">
<CheckBox Style="{StaticResource SquareCheckBox}" IsChecked="True" Content="OSC On" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 0 10 10"
Name="checkBoxOscOn" Checked="CheckBoxOscOnChanged" Unchecked="CheckBoxOscOnChanged">
<CheckBox.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">Toggle OSC streaming</TextBlock>
<TextBlock>If checked: OSC is streaming</TextBlock>
<TextBlock>If unchecked: OSC is NOT streaming</TextBlock>
</StackPanel>
</ToolTip>
</CheckBox.ToolTip>
</CheckBox>
<TextBlock Name="OscLabel" Text="OSC Address" Margin="0,0,0,0" FontSize="14" Width="85" HorizontalAlignment="Left" ToolTipService.ShowDuration="24000">
<TextBlock.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">Set Osc Address Prefix</TextBlock>
<TextBlock>Osc Address should start with a "/"</TextBlock>
<TextBlock>The OSC addresses will be whatever you put here + a counter for each data point in the order of the joints and x, y, z</TextBlock>
<TextBlock>This is useful for programs that have hard-coded address requirements (like Isadora)</TextBlock>
<TextBlock>If you want to let the program define the addresses leave this blank</TextBlock>
<TextBlock>This only applies if "Send Separately" is checked.</TextBlock>
<TextBlock>Hitting the change button or the enter key will trigger the change</TextBlock>
</StackPanel>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
<TextBox Name="OscAddress" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="85,-20,0,0" Width="110" Height="25" FontSize="16" Text=""
VerticalContentAlignment="Center" IsEnabled="false" KeyUp="OscAddressKeyUp"></TextBox>
<Button Name="ChangeAddress" Content="Change" Width="50" Height="25" HorizontalAlignment="Left" Click="ChangeAddressClicked" Margin="200 -25 0 0"></Button>
<CheckBox Style="{StaticResource SquareCheckBox}" IsChecked="False" Content="Show OSC Data" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="265 -55 0 10" Name="checkBoxShowOscData" Checked="CheckBoxShowOscDataChanged" Unchecked="CheckBoxShowOscDataChanged" ToolTipService.ShowDuration="12000">
<CheckBox.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">Show OSC data window</TextBlock>
<TextBlock>You can see one frame of OSC data to verify that data is working and to see the joint names</TextBlock>
</StackPanel>
</ToolTip>
</CheckBox.ToolTip>
</CheckBox>
<CheckBox Style="{StaticResource SquareCheckBox}" IsChecked="True" Content="Send Pos as %" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="265 -31 0 10" Name="checkBoxSendPositionAsPercentage" Checked="CheckBoxSendPositionAsPercentageChanged" Unchecked="CheckBoxSendPositionAsPercentageChanged" ToolTipService.ShowDuration="12000">
<CheckBox.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">Send Position Values as Percentages</TextBlock>
<TextBlock>If checked: The values of x and y are sent as percentage of width and height, z is in meters from the camera</TextBlock>
<TextBlock>If unchecked: The values are sent raw</TextBlock>
<TextBlock>Generally this is best left checked</TextBlock>
</StackPanel>
</ToolTip>
</CheckBox.ToolTip>
</CheckBox>
<CheckBox Style="{StaticResource SquareCheckBox}" IsChecked="False" Content="Send As String" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="265 -10 0 10" Name="checkBoxSendAsString" Checked="CheckBoxSendAsStringChanged" Unchecked="CheckBoxSendAsStringChanged" ToolTipService.ShowDuration="12000">
<CheckBox.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">OSC data format</TextBlock>
<TextBlock>If checked: OSC can be sent as one single string "Joint Name|Joint Number:x|y|z, more joints"</TextBlock>
<TextBlock>If unchecked: Each joint can be sent separately as 3 floats (x, y, z) or totally separately using the checkbox below</TextBlock>
</StackPanel>
</ToolTip>
</CheckBox.ToolTip>
</CheckBox>
<CheckBox Style="{StaticResource SquareCheckBox}" IsChecked="False" Content="Send Separately" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="265 -10 0 10" Name="checkBoxSendSeparately" Checked="CheckBoxSendSeparatelyChanged" Unchecked="CheckBoxSendSeparatelyChanged" ToolTipService.ShowDuration="15000" IsEnabled="True">
<CheckBox.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">Toggle Sending data separately</TextBlock>
<TextBlock>If checked: OSC will be sent as individual osc data elements "/skeleton#/JointName/x/#.##" etc...</TextBlock>
<TextBlock>This is useful for sending to software that can't handle osc bundles.</TextBlock>
<TextBlock>If unchecked: Each joint will be sent separately as 3 floats (x, y, z)</TextBlock>
</StackPanel>
</ToolTip>
</CheckBox.ToolTip>
</CheckBox>
<TextBlock Name="PortLabel" Text="Port Number" Margin="0,-40,0,0" FontSize="14" Height="25" Width="85" HorizontalAlignment="Left" ToolTipService.ShowDuration="15000">
<TextBlock.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">Set Port Number</TextBlock>
<TextBlock>Port number can be anything from 0 - 65535</TextBlock>
<TextBlock>But it is recommended to use a port between 1025 and 49151</TextBlock>
<TextBlock>Hitting the change button or the enter key will trigger the change</TextBlock>
</StackPanel>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
<TextBox Name="OscPort" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="135,-35,0,0" Width="60" Height="25" FontSize="16" Text="3001"
VerticalContentAlignment="Center" KeyUp="OscPortKeyUp"></TextBox>
<Button Name="ChangePort" Content="Change" Width="50" Height="25" HorizontalAlignment="Left" Click="ChangePortClicked" Margin="200 -45 0 0"></Button>
</StackPanel>
<StatusBar Grid.Row="3" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Name="statusBar" VerticalAlignment="Bottom" Background="White" Foreground="{StaticResource MediumGreyBrush}">
<StatusBarItem Padding="0 0 0 10">
<TextBlock Name="statusBarText" Margin="0">Hover over the checkboxes and labels to see additional info.</TextBlock>
</StatusBarItem>
</StatusBar>
</Grid>
</Window>