mirror of
https://github.com/wagesj45/butterflow-ui.git
synced 2025-03-12 12:46:39 -05:00
Using Gu.WPF.Media control for enhanced playback. See: https://github.com/JohanLarsson/Gu.Wpf.Media
197 lines
14 KiB
XML
197 lines
14 KiB
XML
<Window x:Class="butterflow_ui.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:gu="https://github.com/JohanLarsson/Gu.Wpf.Media"
|
|
xmlns:loc="clr-namespace:butterflow_ui.Localization"
|
|
xmlns:butterflow_ui="clr-namespace:butterflow_ui"
|
|
mc:Ignorable="d"
|
|
x:Name="butterflowUIWindow"
|
|
Title="{x:Static loc:Localization.Title}" Height="600" Width="800">
|
|
<DockPanel>
|
|
<Menu DockPanel.Dock="Top">
|
|
<MenuItem Header="{x:Static loc:Localization.FileMenu}">
|
|
<MenuItem Header="Open">
|
|
<MenuItem.Icon>
|
|
<ContentControl Template="{StaticResource OpenIcon}" />
|
|
</MenuItem.Icon>
|
|
</MenuItem>
|
|
<MenuItem Header="Save Configuration">
|
|
<MenuItem.Icon>
|
|
<ContentControl Template="{StaticResource SaveIcon}" />
|
|
</MenuItem.Icon>
|
|
</MenuItem>
|
|
<MenuItem Header="Save Configuration As...">
|
|
<MenuItem.Icon>
|
|
<ContentControl Template="{StaticResource SaveAsIcon}" />
|
|
</MenuItem.Icon>
|
|
</MenuItem>
|
|
</MenuItem>
|
|
<MenuItem Header="{x:Static loc:Localization.EditMenu}" />
|
|
<MenuItem Header="{x:Static loc:Localization.HelpMenu}">
|
|
<MenuItem Header="{x:Static loc:Localization.AboutButterflowMenu}" >
|
|
<MenuItem.Icon>
|
|
<ContentControl Template="{StaticResource LinkIcon}" />
|
|
</MenuItem.Icon>
|
|
</MenuItem>
|
|
<MenuItem Header="{x:Static loc:Localization.AboutButterflowUIMenu}">
|
|
<MenuItem.Icon>
|
|
<ContentControl Template="{StaticResource LinkIcon}" />
|
|
</MenuItem.Icon>
|
|
</MenuItem>
|
|
<Separator />
|
|
<MenuItem Header="{x:Static loc:Localization.AboutMenu}">
|
|
<MenuItem.Icon>
|
|
<ContentControl Template="{StaticResource QuestionIcon}" />
|
|
</MenuItem.Icon>
|
|
</MenuItem>
|
|
</MenuItem>
|
|
</Menu>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="0.3*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<GroupBox Grid.ColumnSpan="4" Grid.Row="0" Header="{x:Static loc:Localization.FileInputGroupBox}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<Label Grid.Column="0" Content="{x:Static loc:Localization.FileLabel}"/>
|
|
<TextBox Name="txtFileName" Grid.Column="1" IsReadOnly="True" Text="{Binding OptionsConfiguration.VideoInput, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type butterflow_ui:MainWindow}}, UpdateSourceTrigger=PropertyChanged}"/>
|
|
<Button Grid.Column="2" MinWidth="25" Name="btnFilePicker" Click="btnFilePicker_Click">...</Button>
|
|
</Grid>
|
|
</GroupBox>
|
|
<GroupBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Header="{x:Static loc:Localization.CommonOptionsGroupBox}">
|
|
<ScrollViewer>
|
|
<StackPanel>
|
|
<butterflow_ui:ButterflowOption LabelValue="{x:Static loc:Localization.PlaybackRateLabel}" >
|
|
<StackPanel Orientation="Vertical">
|
|
<butterflow_ui:ButterflowOption LabelValue="">
|
|
<RadioButton GroupName="PlaybackRate" Checked="PlaybackRateRadioButton_Checked" Content="{x:Static loc:Localization._2xLabel}" Tag="2x" />
|
|
</butterflow_ui:ButterflowOption>
|
|
<butterflow_ui:ButterflowOption LabelValue="">
|
|
<RadioButton GroupName="PlaybackRate" Checked="PlaybackRateRadioButton_Checked" Content="{x:Static loc:Localization._3xLabel}" Tag="3x" />
|
|
</butterflow_ui:ButterflowOption>
|
|
<butterflow_ui:ButterflowOption LabelValue="">
|
|
<RadioButton GroupName="PlaybackRate" Checked="PlaybackRateRadioButton_Checked" Content="{x:Static loc:Localization._4xLabel}" Tag="4x" />
|
|
</butterflow_ui:ButterflowOption>
|
|
<butterflow_ui:ButterflowOption LabelValue="">
|
|
<RadioButton GroupName="PlaybackRate" Checked="PlaybackRateRadioButton_Checked" Content="{x:Static loc:Localization._24fpsLabel}" Tag="24"/>
|
|
</butterflow_ui:ButterflowOption>
|
|
<butterflow_ui:ButterflowOption LabelValue="">
|
|
<RadioButton GroupName="PlaybackRate" Checked="PlaybackRateRadioButton_Checked" Content="{x:Static loc:Localization._30fpsLabel}" Tag="30" />
|
|
</butterflow_ui:ButterflowOption>
|
|
<butterflow_ui:ButterflowOption LabelValue="">
|
|
<RadioButton GroupName="PlaybackRate" Checked="PlaybackRateRadioButton_Checked" Content="{x:Static loc:Localization._60fpsLabel}" Tag="60" />
|
|
</butterflow_ui:ButterflowOption>
|
|
<butterflow_ui:ButterflowOption LabelValue="">
|
|
<RadioButton GroupName="PlaybackRate" Checked="PlaybackRateRadioButton_Checked" Content="{x:Static loc:Localization._120fpsLabel}" Tag="120" />
|
|
</butterflow_ui:ButterflowOption>
|
|
<butterflow_ui:ButterflowOption LabelValue="{x:Static loc:Localization.CustomPlaybackRateLabel}" DescriptionValue="{x:Static loc:Localization.PlaybackRateDescription}">
|
|
<TextBox Text="{Binding OptionsConfiguration.PlaybackRate, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type butterflow_ui:MainWindow}}, UpdateSourceTrigger=PropertyChanged}" />
|
|
</butterflow_ui:ButterflowOption>
|
|
</StackPanel>
|
|
</butterflow_ui:ButterflowOption>
|
|
<butterflow_ui:ButterflowOption LabelValue="{x:Static loc:Localization.RenderingLabel}">
|
|
<StackPanel>
|
|
<butterflow_ui:ButterflowOption DescriptionValue="{x:Static loc:Localization.KeepAudioDescription}">
|
|
<CheckBox IsChecked="{Binding OptionsConfiguration.KeepAudio, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type butterflow_ui:MainWindow}}, UpdateSourceTrigger=PropertyChanged}" Content="{x:Static loc:Localization.KeepAudioLabel}" />
|
|
</butterflow_ui:ButterflowOption>
|
|
<butterflow_ui:ButterflowOption DescriptionValue="Renders the video with no compression.">
|
|
<CheckBox IsChecked="{Binding OptionsConfiguration.LosslessQuality, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type butterflow_ui:MainWindow}}, UpdateSourceTrigger=PropertyChanged}" Content="{x:Static loc:Localization.LosslessLabel}" />
|
|
</butterflow_ui:ButterflowOption>
|
|
</StackPanel>
|
|
</butterflow_ui:ButterflowOption>
|
|
<butterflow_ui:ButterflowOption LabelValue="{x:Static loc:Localization.ResolutionLabel}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<butterflow_ui:ButterflowOption Grid.Column="0" LabelValue="{x:Static loc:Localization.WidthLabel}">
|
|
<TextBox Text="{Binding OptionsConfiguration.Width, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type butterflow_ui:MainWindow}}, UpdateSourceTrigger=PropertyChanged}" />
|
|
</butterflow_ui:ButterflowOption>
|
|
<butterflow_ui:ButterflowOption Grid.Column="1" LabelValue="{x:Static loc:Localization.HeightLabel}">
|
|
<TextBox Text="{Binding OptionsConfiguration.Height, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type butterflow_ui:MainWindow}}, UpdateSourceTrigger=PropertyChanged}" />
|
|
</butterflow_ui:ButterflowOption>
|
|
</Grid>
|
|
</butterflow_ui:ButterflowOption>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</GroupBox>
|
|
<GroupBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Header="{x:Static loc:Localization.AdvancedOptionsGroupBox}">
|
|
<ScrollViewer>
|
|
<StackPanel>
|
|
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</GroupBox>
|
|
<Grid Grid.Row="1" Grid.RowSpan="2" Grid.Column="2" Grid.ColumnSpan="2">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<gu:MediaElementWrapper Grid.Row="0" Name="mediaPreview" Stretch="Uniform" ScrubbingEnabled="True" Source="{Binding OptionsConfiguration.VideoInput, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type butterflow_ui:MainWindow}}, UpdateSourceTrigger=PropertyChanged}" MediaOpened="mediaPreview_MediaOpened" MediaEnded="mediaPreview_MediaEnded" />
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<Label Grid.Column="0" Content="{Binding ElementName=mediaPreview, Path=Position, Converter={x:Static gu:TimeSpanToStringConverter.Default}}" />
|
|
<Slider Grid.Column="1" Name="sliderMedia"
|
|
Value="{Binding ElementName=mediaPreview, Path=Position, Converter={x:Static gu:NullableTimeSpanToSecondsConverter.Default}}"
|
|
Maximum="{Binding Path=Length, ElementName=mediaPreview, Converter={x:Static gu:NullableTimeSpanToSecondsConverter.Default}}" />
|
|
<Label Grid.Column="2" Content="{Binding Path=Length, ElementName=mediaPreview, Converter={x:Static gu:TimeSpanToStringConverter.Default}}" />
|
|
</Grid>
|
|
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center">
|
|
<Button Name="bntVideoBackward" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="bntVideoBackward_Click">
|
|
<ContentControl HorizontalAlignment="Center" Template="{StaticResource BackwardIcon}" />
|
|
</Button>
|
|
<Button Name="bntVideoPlay" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="bntVideoPlay_Click">
|
|
<ContentControl HorizontalAlignment="Center" Name="PlayPauseButtonIcon" Template="{StaticResource PlayIcon}" />
|
|
</Button>
|
|
<Button Name="bntVideoStop" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="bntVideoStop_Click">
|
|
<ContentControl HorizontalAlignment="Center" Template="{StaticResource StopIcon}" />
|
|
</Button>
|
|
<Button Name="bntVideoForward" BorderThickness="0" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="bntVideoForward_Click">
|
|
<ContentControl HorizontalAlignment="Center" Template="{StaticResource ForwardIcon}" />
|
|
</Button>
|
|
</StackPanel>
|
|
</Grid>
|
|
<StatusBar Grid.Row="3" Grid.ColumnSpan="4">
|
|
<StatusBar.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
</Grid>
|
|
</ItemsPanelTemplate>
|
|
</StatusBar.ItemsPanel>
|
|
<StatusBarItem Grid.Column="0">
|
|
<Button>
|
|
<ContentControl Template="{StaticResource CopyIcon}" />
|
|
</Button>
|
|
</StatusBarItem>
|
|
<StatusBarItem Grid.Column="1">
|
|
<TextBlock Text="{Binding OptionsConfiguration.CommandLineOutput, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type butterflow_ui:MainWindow}}}"/>
|
|
</StatusBarItem>
|
|
</StatusBar>
|
|
</Grid>
|
|
</DockPanel>
|
|
</Window>
|