// class via a tool like ResGen or Visual Studio.\r
// To add or remove a member, edit your .ResX file then rerun ResGen\r
// with the /str option, or rebuild your VS project.\r
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]\r
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]\r
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r
public class ResourcesUI {\r
}\r
\r
/// <summary>\r
- /// Looks up a localized string similar to Picture.\r
+ /// Looks up a localized string similar to Dimensions.\r
/// </summary>\r
public static string MainView_PictureTab {\r
get {\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to No Source.\r
+ /// </summary>\r
+ public static string SummaryView_NoSource {\r
+ get {\r
+ return ResourceManager.GetString("SummaryView_NoSource", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to No Subtitle Tracks.\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to No Tracks.\r
+ /// </summary>\r
+ public static string SummaryView_NoTracks {\r
+ get {\r
+ return ResourceManager.GetString("SummaryView_NoTracks", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Preview {0} of {1}.\r
/// </summary>\r
<value>Pause</value>\r
</data>\r
<data name="MainView_PictureTab" xml:space="preserve">\r
- <value>Picture</value>\r
+ <value>Dimensions</value>\r
</data>\r
<data name="MainView_Presets" xml:space="preserve">\r
<value>Presets</value>\r
<data name="SummaryView_PreviewInfo" xml:space="preserve">\r
<value>Preview {0} of {1}</value>\r
</data>\r
+ <data name="SummaryView_NoSource" xml:space="preserve">\r
+ <value>No Source</value>\r
+ </data>\r
+ <data name="SummaryView_NoTracks" xml:space="preserve">\r
+ <value>No Tracks</value>\r
+ </data>\r
</root>
\ No newline at end of file
using System.Text;
using System.Windows.Media.Imaging;
+ using HandBrake.ApplicationServices.Interop;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
using HandBrakeWPF.EventArgs;
private bool isMkv;
private int selectedPreview = 2;
+ private bool isPreviousPreviewControlVisible;
+
+ private bool isNextPreviewControlVisible;
+
public SummaryViewModel(IScan scanService, IUserSettingService userSettingService)
{
this.scanService = scanService;
public BitmapImage PreviewImage { get; set; }
public bool PreviewNotAvailable { get; set; }
+ public int MaxWidth { get; set; }
+ public int MaxHeight { get; set; }
public string VideoTrackInfo { get; set; }
public string AudioTrackInfo { get; set; }
public string DimensionInfo { get; set; }
public string AspectInfo { get; set; }
- public bool IsPreviousPreviewControlVisible { get; set; } = false;
- public bool IsNextPreviewControlVisible { get; set; } = false;
- public bool IsPreviewInfoVisible { get; set; } = false;
+
+ public bool IsPreviewInfoVisible { get; set; }
public string PreviewInfo { get; set; }
+ public bool IsPreviousPreviewControlVisible
+ {
+ get
+ {
+ return this.isPreviousPreviewControlVisible;
+ }
+ set
+ {
+ if (value == this.isPreviousPreviewControlVisible) return;
+ this.isPreviousPreviewControlVisible = value;
+ this.NotifyOfPropertyChange(() => this.IsPreviousPreviewControlVisible);
+ }
+ }
+
+ public bool IsNextPreviewControlVisible
+ {
+ get
+ {
+ return this.isNextPreviewControlVisible;
+ }
+ set
+ {
+ if (value == this.isNextPreviewControlVisible) return;
+ this.isNextPreviewControlVisible = value;
+ this.NotifyOfPropertyChange(() => this.IsNextPreviewControlVisible);
+ }
+ }
+
#endregion
#region Task Properties
if (this.selectedPreview == maxPreview)
{
this.IsNextPreviewControlVisible = false;
- this.NotifyOfPropertyChange(() => this.IsNextPreviewControlVisible);
}
}
if (this.selectedPreview == 1)
{
this.IsPreviousPreviewControlVisible = false;
- this.NotifyOfPropertyChange(() => this.IsPreviousPreviewControlVisible);
}
}
{
this.IsNextPreviewControlVisible = false;
}
-
- this.NotifyOfPropertyChange(() => this.IsPreviousPreviewControlVisible);
- this.NotifyOfPropertyChange(() => this.IsNextPreviewControlVisible);
}
#region Private Methods
filters.Add(ResourcesUI.SummaryView_Rotation);
}
- return string.Join(", ", filters).Trim();
+ return string.Join(", ", filters).TrimEnd(',').Trim();
}
private string GetAudioDescription()
if (this.Task.AudioTracks.Count >= 1)
{
AudioTrack track1 = this.Task.AudioTracks[0];
- desc.AppendLine(string.Format("{0}, {1}", EnumHelper<AudioEncoder>.GetDisplay(track1.Encoder), track1.MixDown));
+ HBMixdown mixdownName = HandBrakeEncoderHelpers.GetMixdown(track1.MixDown);
+ string mixdown = mixdownName != null ? ", " + mixdownName.DisplayName : string.Empty;
+ desc.AppendLine(string.Format("{0}{1}", EnumHelper<AudioEncoder>.GetDisplay(track1.Encoder), mixdown));
}
if (this.Task.AudioTracks.Count >= 2)
{
AudioTrack track2 = this.Task.AudioTracks[1];
- desc.AppendLine(string.Format("{0}, {1}", EnumHelper<AudioEncoder>.GetDisplay(track2.Encoder), track2.MixDown));
+ HBMixdown mixdownName = HandBrakeEncoderHelpers.GetMixdown(track2.MixDown);
+ string mixdown = mixdownName != null ? ", " + mixdownName.DisplayName : string.Empty;
+ desc.AppendLine(string.Format("{0}{1}", EnumHelper<AudioEncoder>.GetDisplay(track2.Encoder), mixdown));
}
if (this.Task.AudioTracks.Count > 2)
if (this.Task.SubtitleTracks.Count >= 1)
{
SubtitleTrack track1 = this.Task.SubtitleTracks[0];
- desc.AppendLine(string.Format("{0}, {1}", track1.SourceTrack, track1.Burned ? ResourcesUI.SummaryView_Burned : string.Empty));
+ string subtitleName = track1.IsSrtSubtitle ? track1.SrtFileName : track1.SourceTrack.ToString();
+ string burned = track1.Burned ? ", " + ResourcesUI.SummaryView_Burned : string.Empty;
+ desc.AppendLine(string.Format("{0}{1}", subtitleName, burned));
}
if (this.Task.SubtitleTracks.Count >= 2)
{
SubtitleTrack track2 = this.Task.SubtitleTracks[1];
- desc.AppendLine(string.Format("{0}, {1}", track2.SourceTrack, track2.Burned ? ResourcesUI.SummaryView_Burned : string.Empty));
+ string subtitleName = track2.IsSrtSubtitle ? track2.SrtFileName : track2.SourceTrack.ToString();
+ string burned = track2.Burned ? ", " + ResourcesUI.SummaryView_Burned : string.Empty;
+ desc.AppendLine(string.Format("{0}{1}", subtitleName, burned));
}
if (this.Task.SubtitleTracks.Count > 2)
private void ClearDisplay()
{
- this.VideoTrackInfo = string.Empty;
+ this.VideoTrackInfo = ResourcesUI.SummaryView_NoTracks;
this.NotifyOfPropertyChange(() => this.VideoTrackInfo);
this.AudioTrackInfo = string.Empty;
this.ChapterInfo = string.Empty;
this.NotifyOfPropertyChange(() => this.ChapterInfo);
- this.FiltersInfo = string.Empty;
+ this.FiltersInfo = ResourcesUI.SummaryView_NoFilters;
this.NotifyOfPropertyChange(() => this.FiltersInfo);
- this.DimensionInfo = string.Empty;
+ this.DimensionInfo = ResourcesUI.SummaryView_NoSource;
this.NotifyOfPropertyChange(() => this.ChapterInfo);
this.AspectInfo = string.Empty;
{
this.PreviewNotAvailable = false;
this.PreviewImage = image;
+ this.MaxWidth = (int)image.Width;
+ this.MaxHeight = (int)image.Height;
this.IsPreviewInfoVisible = true;
this.NotifyOfPropertyChange(() => this.IsPreviewInfoVisible);
this.NotifyOfPropertyChange(() => this.PreviewImage);
+ this.NotifyOfPropertyChange(() => this.MaxWidth);
+ this.NotifyOfPropertyChange(() => this.MaxHeight);
}
}
<TabItem Name="summaryTab" Header="{x:Static Properties:ResourcesUI.MainView_SummaryTab}">\r
<ContentControl x:Name="SummaryViewModel" />\r
</TabItem>\r
- <TabItem Name="videoTab" Header="{x:Static Properties:ResourcesUI.MainView_VideoTab}">\r
- <ContentControl x:Name="VideoViewModel" VerticalAlignment="Stretch" />\r
- </TabItem>\r
<TabItem Name="pictureTab" Header="{x:Static Properties:ResourcesUI.MainView_PictureTab}">\r
<ContentControl x:Name="PictureSettingsViewModel" />\r
</TabItem>\r
<TabItem Name="filtersTab" Header="{x:Static Properties:ResourcesUI.MainView_FiltersTab}">\r
<ContentControl x:Name="FiltersViewModel" />\r
</TabItem>\r
+ <TabItem Name="videoTab" Header="{x:Static Properties:ResourcesUI.MainView_VideoTab}">\r
+ <ContentControl x:Name="VideoViewModel" VerticalAlignment="Stretch" />\r
+ </TabItem>\r
<TabItem Name="audioTab" Header="{x:Static Properties:ResourcesUI.MainView_AudioTab}">\r
<ContentControl x:Name="AudioViewModel" />\r
</TabItem>\r
<converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
</UserControl.Resources>
- <Grid Margin="5,5,0,0">
+ <Grid Margin="10,5,0,5">
<Grid.ColumnDefinitions>
- <ColumnDefinition Width="4*" />
- <ColumnDefinition Width="5*" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
-
<!-- Column 1 -->
-
- <Grid Margin="5,0,0,0" Grid.Column="0" >
+ <Grid Grid.Column="0" MinWidth="325" MaxWidth="400" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75" />
<ColumnDefinition Width="*" />
<TextBlock Text="Format:" FontSize="14" FontFamily="Sergio Light" Grid.Row="0" VerticalAlignment="Center" />
- <ComboBox Name="Container" Width="100" HorizontalAlignment="Left" Margin="0,2,0,5" Grid.Row="0" Grid.Column="1"
- ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Mux}"
+ <ComboBox Name="Container" Width="100" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1"
+ ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Mux}" VerticalAlignment="Center"
ItemsSource="{Binding OutputFormats, Converter={StaticResource enumComboConverter}}"
SelectedItem="{Binding SelectedOutputFormat, Converter={StaticResource enumComboConverter}}" />
<CheckBox Name="WebOptimized" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1"
<TextBlock Text="Tracks:" FontSize="14" FontFamily="Sergio Light" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" />
<TextBlock Text="{Binding VideoTrackInfo}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" />
- <TextBlock Text="{Binding AudioTrackInfo}" Grid.Row="6" Grid.Column="1" />
- <TextBlock Text="{Binding SubtitleTrackInfo}" Grid.Row="7" Grid.Column="1" />
+ <TextBlock Text="{Binding AudioTrackInfo}" Grid.Row="6" Grid.Column="1" TextWrapping="Wrap" />
+ <TextBlock Text="{Binding SubtitleTrackInfo}" Grid.Row="7" Grid.Column="1" TextWrapping="Wrap" />
<TextBlock Text="{Binding ChapterInfo}" Grid.Row="8" Grid.Column="1" />
<TextBlock Text="Filters:" FontSize="14" FontFamily="Sergio Light" Grid.Row="10" Grid.Column="0" VerticalAlignment="Center" />
</Grid>
<!-- Column 2 -->
-
- <Grid Grid.Column="1">
+ <Grid Grid.Column="1" Margin="10,0,0,5">
<Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
-
- <Grid>
- <Image Source="{Binding PreviewImage}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="10,5,10,0" x:Name="previewImage" MouseMove="PreviewImage_OnMouseMove" Panel.ZIndex="0" />
- <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Center" HorizontalAlignment="Left" Panel.ZIndex="1" cal:Message.Attach="[Event MouseDown] = [Action PreviousPreview]"
+ <Grid Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Left" VerticalAlignment="Top">
+
+ <Grid.RowDefinitions>
+ <RowDefinition Height="*" />
+ <RowDefinition Height="Auto" MinHeight="26" />
+ <RowDefinition Height="Auto" MinHeight="26" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <Image Source="{Binding PreviewImage}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,5,10,0" x:Name="previewImage" MouseMove="PreviewImage_OnMouseMove" MouseLeave="PreviewImage_OnMouseLeave" Panel.ZIndex="0" Grid.ColumnSpan="2"
+ MaxWidth="{Binding MaxWidth}" MaxHeight="{Binding MaxHeight}" />
+
+ <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Center" HorizontalAlignment="Left" Panel.ZIndex="1" cal:Message.Attach="[Event MouseDown] = [Action PreviousPreview]" Grid.ColumnSpan="2"
Background="Black" Opacity="0.75" Margin="20,0,0,0" Visibility="{Binding IsPreviousPreviewControlVisible, Converter={StaticResource boolToVisConverter}}" >
<TextBlock Text="<" FontSize="30" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="8,3" Margin="0" />
</Border>
- <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Center" HorizontalAlignment="Right" Panel.ZIndex="1" cal:Message.Attach="[Event MouseDown] = [Action NextPreview]"
+ <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Center" HorizontalAlignment="Right" Panel.ZIndex="1" cal:Message.Attach="[Event MouseDown] = [Action NextPreview]" Grid.ColumnSpan="2"
Background="Black" Opacity="0.75" Margin="0,0,20,0" Visibility="{Binding IsNextPreviewControlVisible, Converter={StaticResource boolToVisConverter}}">
- <TextBlock Text=">" FontSize="30" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="8,3" Margin="0" />
+ <TextBlock Text=">" FontSize="30" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="8,3" Margin="0" />
</Border>
- <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Bottom" HorizontalAlignment="Center"
+ <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Bottom" HorizontalAlignment="Center" Grid.ColumnSpan="2"
Background="Black" Opacity="0.75" Margin="0,5,0,10">
<TextBlock Text="{Binding PreviewInfo}" FontSize="14" Foreground="White" Padding="8,3" Visibility="{Binding IsPreviewInfoVisible, Converter={StaticResource boolToVisConverter}}" />
</Border>
- </Grid>
-
-
- <Grid Margin="10,5,0,0" Grid.Row="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="85" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
-
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Grid.Resources>
- <Style TargetType="TextBlock">
- <Setter Property="Margin" Value="0,0,0,0" />
- <Setter Property="Padding" Value="3" />
- </Style>
- </Grid.Resources>
+ <TextBlock Text="Dimensions:" FontSize="14" FontFamily="Sergio Light" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" />
+ <TextBlock Text="{Binding DimensionInfo}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1" Margin="5,0,0,0" />
- <TextBlock Text="Dimensions:" FontSize="14" FontFamily="Sergio Light" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" />
- <TextBlock Text="{Binding DimensionInfo}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="0" Grid.Column="1" />
+ <TextBlock Text="Aspect:" FontSize="14" FontFamily="Sergio Light" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Visibility="Collapsed" />
+ <TextBlock Text="{Binding AspectInfo}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="2" Grid.Column="1" Margin="5,0,0,0" Visibility="Collapsed" />
- <TextBlock Text="Aspect:" FontSize="14" FontFamily="Sergio Light" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Visibility="Collapsed" />
- <TextBlock Text="{Binding AspectInfo}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1" Visibility="Collapsed" />
</Grid>
</Grid>
{
using System.Windows.Controls;
using System.Windows.Input;
+ using System.Windows.Media;
using HandBrakeWPF.ViewModels.Interfaces;
((ISummaryViewModel)this.DataContext).SetPreviewControlVisibility(leftHalf, rightHalf);
}
}
+
+ private void PreviewImage_OnMouseLeave(object sender, MouseEventArgs e)
+ {
+ HitTestResult result = VisualTreeHelper.HitTest(this.previewImage, e.GetPosition(this.previewImage));
+
+ if (result != null && result.VisualHit.GetType() == typeof(Image))
+ {
+ e.Handled = true;
+ return;
+ }
+
+ ((ISummaryViewModel)this.DataContext).SetPreviewControlVisibility(false, false);
+ }
}
}