forked from castorix/WinUI3_MediaEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
159 lines (150 loc) · 9.84 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
<Window
x:Class="WinUI3_MediaEngine.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WinUI3_MediaEngine"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid>
<Grid.ColumnDefinitions>
<!--<ColumnDefinition Width="660"></ColumnDefinition>-->
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="135"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<!--<RowDefinition Height="40"></RowDefinition>-->
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Center">
<!--Height="200"-->
<Button x:Name="btnLoadFile" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 0, 10, 0" Width="125"
Click="btnLoadFile_Click" Content="Load File" >
</Button>
<Button x:Name="btnLoadURL" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 6, 10, 0" Width="125"
Click="btnLoadURL_Click" Content="Load URL" >
</Button>
<Button x:Name="btnStop" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 6, 10, 0" Width="125"
Click="btnStop_Click" Content="Stop" >
</Button>
<ToggleSwitch x:Name="tsControls" Header="Show controls" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 6, -50, 0"
OffContent="No" OnContent="Yes" Toggled="tsControls_Toggled" IsOn="True"/>
<ToggleSwitch x:Name="tsMirror" Header="Mirror" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 6, -50, 0"
OffContent="No" OnContent="Yes" Toggled="tsMirror_Toggled">
<ToolTipService.ToolTip>
<ToolTip Content="For medias with a video stream" Placement="Bottom" Background="LightYellow" Foreground="Black"/>
</ToolTipService.ToolTip>
</ToggleSwitch>
<Button x:Name="btnOverlay" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 6, 5, 0" Width="125"
Click="btnOverlay_Click" Content="Test Overlay">
<ToolTipService.ToolTip>
<ToolTip Content="For medias with a video stream" Placement="Bottom" Background="LightYellow" Foreground="Black"/>
</ToolTipService.ToolTip>
</Button>
<ToggleSwitch x:Name="tsEffects" Header="Test Effects" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 6, -50, 0"
OffContent="No" OnContent="Yes" Toggled="tsEffects_Toggled" >
<ToolTipService.ToolTip>
<ToolTip Content="For medias with a video stream" Placement="Bottom" Background="LightYellow" Foreground="Black"/>
</ToolTipService.ToolTip>
</ToggleSwitch>
<CheckBox x:Name="cbInvert" Checked="cbInvert_Checked" Unchecked="cbInvert_Unchecked" Content="Invert"
HorizontalAlignment="Left" VerticalAlignment="Top" Margin="35, 6, 0, 0"
>
</CheckBox>
<!--MinWidth="0"-->
<CheckBox x:Name="cbGrayscale" Checked="cbGrayscale_Checked" Unchecked="cbGrayscale_Unchecked" Content="Gray scale"
HorizontalAlignment="Left" VerticalAlignment="Top" Margin="35, 6, 0, 0"
>
</CheckBox>
<CheckBox x:Name="cbRGB" Checked="cbRGB_Checked" Unchecked="cbRGB_Unchecked" Content="RGB"
HorizontalAlignment="Left" VerticalAlignment="Top" Margin="35, 6, 0, 0"
>
</CheckBox>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="35, 6, 0, 0">
R
</TextBlock>
<Slider x:Name="sliderR" Margin="0, 0, 0, 0" Orientation="Horizontal" Width="80"
VerticalAlignment="Top" HorizontalAlignment="Center"
TickFrequency="1" TickPlacement="None"
Minimum="0" Maximum="255" Value="0"
StepFrequency="1" SnapsTo="StepValues" ValueChanged="sliderR_ValueChanged" >
</Slider>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="35, 8, 0, 0">
G
</TextBlock>
<Slider x:Name="sliderG" Margin="0, 0, 0, 0" Orientation="Horizontal" Width="80"
VerticalAlignment="Top" HorizontalAlignment="Center"
TickFrequency="1" TickPlacement="None"
Minimum="0" Maximum="255" Value="0"
StepFrequency="1" SnapsTo="StepValues" ValueChanged="sliderG_ValueChanged" >
</Slider>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="35, 6, 0, 0">
B
</TextBlock>
<Slider x:Name="sliderB" Margin="0, 0, 0, 0" Orientation="Horizontal" Width="80"
VerticalAlignment="Top" HorizontalAlignment="Center"
TickFrequency="1" TickPlacement="None"
Minimum="0" Maximum="255" Value="0"
StepFrequency="1" SnapsTo="StepValues" ValueChanged="sliderB_ValueChanged" >
</Slider>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<!--<Button x:Name="btnCapture" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 0, 10, 0" Width="40" Height="32"
Click="btnCapture_Click" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
<FontIcon FontFamily="Segoe UI Emoji" FontSize="32" Glyph="📷" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Margin="-14, -14, -10, -10"/>
</Button>-->
<Button x:Name="btnCapture" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 0, 10, 0" Width="40" Height="32"
Click="btnCapture_Click" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
<ToolTipService.ToolTip>
<ToolTip Content="Capture a frame from a video stream" Placement="Bottom" Background="LightYellow" Foreground="Black"/>
</ToolTipService.ToolTip>
<Viewbox Stretch="UniformToFill" StretchDirection="Both" Margin="-14, -14, -10, -10">
<FontIcon FontFamily="Segoe UI Emoji" FontSize="32" Glyph="📷"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Viewbox>
</Button>
<Button x:Name="btnSave" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 0, 10, 0" Width="40" Height="32"
Click="btnSave_Click" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
<ToolTipService.ToolTip>
<ToolTip Content="Save a captured frame" Placement="Bottom" Background="LightYellow" Foreground="Black"/>
</ToolTipService.ToolTip>
<Viewbox Stretch="Uniform" StretchDirection="Both" Margin="-11, -14, -10, -10">
<FontIcon FontFamily="Segoe UI Emoji" FontSize="25" Glyph="💾"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Viewbox>
</Button>
</StackPanel>
<ToggleSwitch x:Name="tsSubtitles" Header="Subtitles" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 6, -50, 0"
OffContent="No" OnContent="Yes" Toggled="tsSubtitles_Toggled" >
<ToolTipService.ToolTip>
<ToolTip Content="For medias with a video stream
after a subtitles file has been set" Placement="Bottom" Background="LightYellow" Foreground="Black"/>
</ToolTipService.ToolTip>
</ToggleSwitch>
<Button x:Name="btnSubtitles" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0, 6, 10, 0" Width="125"
Click="btnSubtitles_Click" Content="Subtitles" Visibility="Collapsed" Background="IndianRed">
</Button>
</StackPanel>
<!--Grid.RowSpan="2"-->
<UserControl x:Name="ctrlVideo"
Margin="10, 10, 0, 10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<Grid>
<!--<Slider x:Name="sliderTime" Margin="0, 0, 6, 0" Orientation="Horizontal" HorizontalAlignment="Stretch"
VerticalAlignment="bottom"
TickFrequency="0.1" TickPlacement="Inline"
Maximum="{x:Bind mediaEngine.GetDuration(mediaEngine.Duration), BindBack=mediaEngine.SetDuration, Mode=TwoWay}"
Minimum="0"
Value="{x:Bind mediaEngine.GetTime(mediaEngine.Time), BindBack=mediaEngine.SetTime, Mode=TwoWay}"
StepFrequency="0.01" SnapsTo="StepValues">
</Slider>-->
</Grid>
</UserControl>
</Grid>
</Window>