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
|
<UserControl x:Class="HandBrakeWPF.Views.InstantMainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cal="http://www.caliburnproject.org"
xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
xmlns:converters="clr-namespace:HandBrakeWPF.Converters"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
mc:Ignorable="d"
cal:Message.Attach="[Event Loaded] = [Action Load]"
>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Drop">
<cal:ActionMessage MethodName="FilesDroppedOnWindow">
<cal:Parameter Value="$eventArgs" />
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
<UserControl.Resources>
<converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
</UserControl.Resources>
<!-- Window Body -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Source -->
<StackPanel Orientation="Vertical" Grid.Row="0">
<!-- Source -->
<StackPanel Margin="10,5,5,5"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
>
<StackPanel Orientation="Horizontal">
<Label Content="Source" FontWeight="Bold" />
<Label Content="{Binding Path=SourceLabel}" />
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="8,10,0,10">
<TextBlock Text="Drag and Drop a file - OR - Open a " />
<Button cal:Message.Attach="[Event Click] = [Action FileScan]" Padding="8,2">
File
</Button>
<TextBlock Text="- OR -" FontWeight="Bold" Margin="10,0,10,0" />
<Button cal:Message.Attach="[Event Click] = [Action FolderScan]" Padding="8,2">
Folder
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Margin="8,0,0,0" Content="Title" />
<ComboBox Name="Titles"
MinWidth="100"
Margin="8,0,0,0"
ItemsSource="{Binding ScannedSource.Titles}"
SelectedItem="{Binding Path=SelectedTitle}"
/>
<!--<Label Margin="8,0,0,0" Content="Angle" />
<ComboBox Name="Angles"
MinWidth="60"
Margin="8,0,0,0"
ItemsSource="{Binding Angles}"
SelectedItem="{Binding SelectedAngle}"/>-->
<Label Margin="8,0,0,0" Content="Chapters" />
<ComboBox Name="StartPoint"
MinWidth="60"
Margin="8,0,0,0"
ItemsSource="{Binding StartEndRangeItems}"
SelectedItem="{Binding SelectedStartPoint}"/>
<Label Margin="8,0,0,0" Content="through" />
<ComboBox Name="EndPoint"
MinWidth="60"
Margin="8,0,0,0"
ItemsSource="{Binding StartEndRangeItems}"
SelectedItem="{Binding SelectedEndPoint}"/>
<Label Margin="8,0,0,0" Content="Duration" />
<Label Margin="8,0,0,0" Content="{Binding Duration}" />
</StackPanel>
</StackPanel>
</StackPanel>
<!-- Destination -->
<StackPanel Grid.Row="1"
Margin="10,5,5,5"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
>
<Label Content="Destination" FontWeight="Bold" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Margin="8,0,0,0" Content="File" />
<TextBox Name="Destination"
Grid.Column="1"
Margin="8,0,0,0"
Text="{Binding Destination,
UpdateSourceTrigger=PropertyChanged}"
/>
<Button Name="DestinationBrowser"
Grid.Column="2"
Margin="8,0,5,0"
Padding="8,2"
Content="Browse"
cal:Message.Attach="[Event Click] = [Action BrowseDestination]"
/>
</Grid>
</StackPanel>
<!-- Opitons -->
<StackPanel Grid.Row="2"
Margin="10,5,5,5"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
>
<Label Content="Options" FontWeight="Bold" />
<StackPanel Orientation="Horizontal" Margin="8,0,0,0">
<TextBlock Text="Preset:" Margin="0,0,5,0" />
<ComboBox ItemsSource="{Binding Presets}" SelectedItem="{Binding SelectedPreset}" MinWidth="150" />
</StackPanel>
</StackPanel>
<!-- Buttons and Queueing -->
<Grid Grid.Row="3" Margin="10,5,5,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Content="Start" FontWeight="Bold" Grid.Row="0" />
<Button Content="Start Encoding" cal:Message.Attach="[Event Click] = [Action StartEncode]" FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center"
Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
<Button Content="Stop Encoding" cal:Message.Attach="[Event Click] = [Action StopEncode]" FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center"
Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
</Grid>
<!-- StatusPanel -->
<controls:StatusPanel x:Name="loadingPanel"
Grid.Row="3"
Grid.RowSpan="2"
Height="70"
VerticalAlignment="Bottom"
Panel.ZIndex="10"
IsLoading="{Binding ShowStatusWindow}"
Message="{Binding StatusLabel}"
SubMessage="Please Wait ..."
/>
<!-- Status Bar -->
<StatusBar Grid.Row="4" Grid.ColumnSpan="2" MinHeight="32" >
<ProgressBar Value="{Binding ProgressPercentage}" Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}}"
Width="100" Height="18" VerticalAlignment="Center"/>
<Label VerticalAlignment="Center"
Content="{Binding Path=ProgramStatusLabel}" />
</StatusBar>
</Grid>
</UserControl>
|