<s:String x:Key="/Default/Housekeeping/VsSavedAutocompletionValue/OverrideParameterInfo/=JavaScript/@EntryIndexedValue">NotOverridden</s:String>
<s:String x:Key="/Default/Housekeeping/VsSavedAutocompletionValue/OverrideParameterInfo/=MsBuild/@EntryIndexedValue">NotOverridden</s:String>
<s:String x:Key="/Default/Housekeeping/VsSavedAutocompletionValue/OverrideParameterInfo/=VB/@EntryIndexedValue">NotOverridden</s:String>
- <s:String x:Key="/Default/Housekeeping/VsSavedAutocompletionValue/OverrideParameterInfo/=Xaml/@EntryIndexedValue">NotOverridden</s:String></wpf:ResourceDictionary>
\ No newline at end of file
+ <s:String x:Key="/Default/Housekeeping/VsSavedAutocompletionValue/OverrideParameterInfo/=Xaml/@EntryIndexedValue">NotOverridden</s:String>
+ <s:Int64 x:Key="/Default/StyleCopOptions/ParsingPerformance/@EntryValue">8</s:Int64></wpf:ResourceDictionary>
\ No newline at end of file
/// </param>\r
protected override void OnStartup(StartupEventArgs e)\r
{\r
+ if (e.Args.Any(f => f.Equals("--instant")))\r
+ {\r
+ AppArguments.IsInstantHandBrake = true;\r
+ MessageBox.Show("Instant HandBrake is just a prototype for toying with ideas. It may or may not work, or even be included in future builds.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);\r
+ }\r
+\r
base.OnStartup(e);\r
\r
// If we have a file dropped on the icon, try scanning it.\r
- string[] fileNames = e.Args;\r
- if (fileNames.Any() && (File.Exists(fileNames[0]) || Directory.Exists(fileNames[0])))\r
+ string[] args = e.Args;\r
+ if (args.Any() && (File.Exists(args[0]) || Directory.Exists(args[0])))\r
{\r
IMainViewModel mvm = IoC.Get<IMainViewModel>();\r
- mvm.StartScan(fileNames[0], 0);\r
+ mvm.StartScan(args[0], 0);\r
}\r
}\r
\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="AppArguments.cs" company="HandBrake Project (http://handbrake.fr)">\r
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+// Defines the AppArguments type.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF\r
+{\r
+ /// <summary>\r
+ /// The app arguments.\r
+ /// </summary>\r
+ public class AppArguments\r
+ {\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether is instant hand brake.\r
+ /// </summary>\r
+ public static bool IsInstantHandBrake { get; set; }\r
+ }\r
+}\r
<Generator>MSBuild:Compile</Generator>\r
<SubType>Designer</SubType>\r
</ApplicationDefinition>\r
+ <Compile Include="AppArguments.cs" />\r
<Compile Include="AttachedProperties\DriveMenu.cs" />\r
<Compile Include="AttachedProperties\MenuItemExtensions.cs" />\r
<Compile Include="Commands\CancelScanCommand.cs" />\r
<Compile Include="Views\EncoderOptionsView.xaml.cs">\r
<DependentUpon>EncoderOptionsView.xaml</DependentUpon>\r
</Compile>\r
+ <Compile Include="Views\InstantMainView.xaml.cs">\r
+ <DependentUpon>InstantMainView.xaml</DependentUpon>\r
+ </Compile>\r
<Compile Include="Views\QueueSelectionView.xaml.cs">\r
<DependentUpon>QueueSelectionView.xaml</DependentUpon>\r
</Compile>\r
<Generator>MSBuild:Compile</Generator>\r
<SubType>Designer</SubType>\r
</Page>\r
+ <Page Include="Views\InstantMainView.xaml">\r
+ <SubType>Designer</SubType>\r
+ <Generator>MSBuild:Compile</Generator>\r
+ </Page>\r
<Page Include="Views\QueueSelectionView.xaml">\r
<Generator>MSBuild:Compile</Generator>\r
<SubType>Designer</SubType>\r
public enum ShellWindow\r
{\r
MainWindow,\r
- OptionsWindow\r
+ OptionsWindow,\r
+ InstantMainWindow\r
}\r
}\r
/// </summary>\r
Preset SelectedPreset { set; }\r
\r
+ /// <summary>\r
+ /// Gets or Sets IsInstandHandBrake.\r
+ /// </summary>\r
+ bool IsInstandHandBrake { get; set; }\r
+\r
/// <summary>\r
/// Shutdown the Application\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Gets or sets a value indicating progress percentage.\r
+ /// </summary>\r
public int ProgressPercentage { get; set; }\r
\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether the app is in "instant" mode\r
+ /// </summary>\r
+ public bool IsInstandHandBrake { get; set; }\r
+\r
#endregion\r
\r
#region Load and Shutdown Handling\r
"Preset Update", MessageBoxButton.OK, MessageBoxImage.Information);\r
\r
// Queue Recovery\r
- QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);\r
+ if (!AppArguments.IsInstantHandBrake)\r
+ {\r
+ QueueRecoveryHelper.RecoverQueue(this.queueProcessor, this.errorService);\r
+ }\r
\r
this.SelectedPreset = this.presetService.DefaultPreset;\r
\r
// Populate the Source menu with drives.\r
- this.SourceMenu = new BindingList<SourceMenuItem>(this.GenerateSourceMenu());\r
+ if (!AppArguments.IsInstantHandBrake)\r
+ {\r
+ this.SourceMenu = new BindingList<SourceMenuItem>(this.GenerateSourceMenu());\r
+ }\r
\r
// Log Cleaning\r
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearOldLogs))\r
{\r
if (this.queueProcessor.EncodeService.IsEncoding)\r
{\r
+ string josPending = string.Empty;\r
+ if (this.IsInstandHandBrake)\r
+ {\r
+ josPending = ", Pending Jobs {5}";\r
+ }\r
+\r
this.ProgramStatusLabel =\r
string.Format(\r
- "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}, Pending Jobs {5}",\r
+ "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}" + josPending,\r
e.PercentComplete,\r
e.CurrentFrameRate,\r
e.AverageFrameRate,\r
\r
using Caliburn.Micro;\r
\r
+ using Castle.Facilities.FactorySupport;\r
+\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
\r
using HandBrakeWPF.Helpers;\r
/// </summary>\r
private bool showOptions;\r
\r
+ /// <summary>\r
+ /// The show instant.\r
+ /// </summary>\r
+ private bool showInstant;\r
+\r
#endregion\r
\r
/// <summary>\r
public ShellViewModel(IErrorService errorService)\r
{\r
this.errorService = errorService;\r
- this.showMainWindow = true;\r
- this.showOptions = false;\r
+\r
+ if (!AppArguments.IsInstantHandBrake)\r
+ {\r
+ this.showMainWindow = true;\r
+ this.showOptions = false;\r
+ this.showInstant = false;\r
+ }\r
+ else\r
+ {\r
+ this.showMainWindow = false;\r
+ this.showOptions = false;\r
+ this.showInstant = true;\r
+ }\r
}\r
\r
/// <summary>\r
{\r
this.ShowMainWindow = true;\r
this.ShowOptions = false;\r
+ this.ShowInstant = false;\r
+ this.MainViewModel.IsInstandHandBrake = false;\r
}\r
else if (window == ShellWindow.OptionsWindow)\r
{\r
this.ShowOptions = true;\r
this.ShowMainWindow = false;\r
+ this.ShowInstant = false;\r
+ this.MainViewModel.IsInstandHandBrake = false;\r
+ }\r
+ else if (window == ShellWindow.InstantMainWindow)\r
+ {\r
+ this.ShowInstant = true;\r
+ this.ShowOptions = false;\r
+ this.ShowMainWindow = false;\r
+ this.MainViewModel.IsInstandHandBrake = true;\r
}\r
else\r
{\r
this.ShowMainWindow = true;\r
this.ShowOptions = false;\r
+ this.ShowInstant = false;\r
+ this.MainViewModel.IsInstandHandBrake = false;\r
}\r
}\r
\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether ShowInstant.\r
+ /// </summary>\r
+ public bool ShowInstant\r
+ {\r
+ get\r
+ {\r
+ return this.showInstant;\r
+ }\r
+ set\r
+ {\r
+ this.showInstant = value;\r
+ this.NotifyOfPropertyChange(() => this.ShowInstant);\r
+ }\r
+ }\r
+\r
/// <summary>\r
/// Gets WindowTitle.\r
/// </summary>\r
{\r
get\r
{\r
- return "HandBrake";\r
+ return AppArguments.IsInstantHandBrake ? "Instant HandBrake" : "HandBrake";\r
}\r
}\r
\r
--- /dev/null
+<UserControl x:Class="HandBrakeWPF.Views.InstantMainView"\r
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"\r
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\r
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" \r
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"\r
+ xmlns:cal="http://www.caliburnproject.org"\r
+ xmlns:controls="clr-namespace:HandBrakeWPF.Controls"\r
+ xmlns:converters="clr-namespace:HandBrakeWPF.Converters"\r
+ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"\r
+ mc:Ignorable="d" \r
+ cal:Message.Attach="[Event Loaded] = [Action Load]"\r
+ >\r
+\r
+ <i:Interaction.Triggers>\r
+ <i:EventTrigger EventName="Drop">\r
+ <cal:ActionMessage MethodName="FilesDroppedOnWindow">\r
+ <cal:Parameter Value="$eventArgs" />\r
+ </cal:ActionMessage>\r
+ </i:EventTrigger>\r
+ </i:Interaction.Triggers>\r
+\r
+ <UserControl.Resources>\r
+ <converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />\r
+ </UserControl.Resources>\r
+\r
+ <!-- Window Body -->\r
+ <Grid>\r
+ <Grid.RowDefinitions>\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="*" />\r
+ <RowDefinition Height="Auto" />\r
+ </Grid.RowDefinitions>\r
+\r
+\r
+ <!-- Source -->\r
+ <StackPanel Orientation="Vertical" Grid.Row="0">\r
+ <!-- Source -->\r
+ <StackPanel Margin="10,5,5,5"\r
+ HorizontalAlignment="Stretch"\r
+ VerticalAlignment="Stretch"\r
+ >\r
+ <StackPanel Orientation="Horizontal">\r
+ <Label Content="Source" FontWeight="Bold" />\r
+ <Label Content="{Binding Path=SourceLabel}" />\r
+ </StackPanel>\r
+\r
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="8,10,0,10">\r
+\r
+ <TextBlock Text="Drag and Drop a file - OR - Open a " />\r
+ <Button cal:Message.Attach="[Event Click] = [Action FileScan]" Padding="8,2">\r
+ File\r
+ </Button>\r
+ <TextBlock Text="- OR -" FontWeight="Bold" Margin="10,0,10,0" />\r
+ <Button cal:Message.Attach="[Event Click] = [Action FolderScan]" Padding="8,2">\r
+ Folder\r
+ </Button>\r
+\r
+ </StackPanel>\r
+\r
+\r
+ <StackPanel Orientation="Horizontal">\r
+ <Label Margin="8,0,0,0" Content="Title" />\r
+ <ComboBox Name="Titles"\r
+ MinWidth="100"\r
+ Margin="8,0,0,0"\r
+ ItemsSource="{Binding ScannedSource.Titles}"\r
+ SelectedItem="{Binding Path=SelectedTitle}"\r
+ />\r
+ <!--<Label Margin="8,0,0,0" Content="Angle" />\r
+ <ComboBox Name="Angles"\r
+ MinWidth="60"\r
+ Margin="8,0,0,0"\r
+ ItemsSource="{Binding Angles}"\r
+ SelectedItem="{Binding SelectedAngle}"/>-->\r
+\r
+ <Label Margin="8,0,0,0" Content="Chapters" />\r
+ <ComboBox Name="StartPoint"\r
+ MinWidth="60"\r
+ Margin="8,0,0,0"\r
+ ItemsSource="{Binding StartEndRangeItems}"\r
+ SelectedItem="{Binding SelectedStartPoint}"/>\r
+\r
+ <Label Margin="8,0,0,0" Content="through" />\r
+ <ComboBox Name="EndPoint"\r
+ MinWidth="60"\r
+ Margin="8,0,0,0"\r
+ ItemsSource="{Binding StartEndRangeItems}"\r
+ SelectedItem="{Binding SelectedEndPoint}"/>\r
+\r
+ <Label Margin="8,0,0,0" Content="Duration" />\r
+ <Label Margin="8,0,0,0" Content="{Binding Duration}" />\r
+ </StackPanel>\r
+ </StackPanel>\r
+ </StackPanel>\r
+\r
+\r
+ <!-- Destination -->\r
+ <StackPanel Grid.Row="1"\r
+ Margin="10,5,5,5"\r
+ HorizontalAlignment="Stretch"\r
+ VerticalAlignment="Stretch"\r
+ >\r
+ <Label Content="Destination" FontWeight="Bold" />\r
+ <Grid>\r
+ <Grid.ColumnDefinitions>\r
+ <ColumnDefinition Width="Auto" />\r
+ <ColumnDefinition Width="*" />\r
+ <ColumnDefinition Width="Auto" />\r
+ </Grid.ColumnDefinitions>\r
+ <Label Margin="8,0,0,0" Content="File" />\r
+ <TextBox Name="Destination"\r
+ Grid.Column="1"\r
+ Margin="8,0,0,0"\r
+ Text="{Binding Destination,\r
+ UpdateSourceTrigger=PropertyChanged}"\r
+ />\r
+ <Button Name="DestinationBrowser"\r
+ Grid.Column="2"\r
+ Margin="8,0,5,0"\r
+ Padding="8,2"\r
+ Content="Browse"\r
+ cal:Message.Attach="[Event Click] = [Action BrowseDestination]"\r
+ />\r
+ </Grid>\r
+ </StackPanel>\r
+\r
+ <!-- Opitons -->\r
+ <StackPanel Grid.Row="2"\r
+ Margin="10,5,5,5"\r
+ HorizontalAlignment="Stretch"\r
+ VerticalAlignment="Stretch"\r
+ >\r
+ <Label Content="Options" FontWeight="Bold" />\r
+\r
+ <StackPanel Orientation="Horizontal" Margin="8,0,0,0">\r
+ <TextBlock Text="Preset:" Margin="0,0,5,0" />\r
+ <ComboBox ItemsSource="{Binding Presets}" SelectedItem="{Binding SelectedPreset}" MinWidth="150" />\r
+ </StackPanel>\r
+\r
+ </StackPanel>\r
+\r
+\r
+ <!-- Buttons and Queueing -->\r
+ <Grid Grid.Row="3" Margin="10,5,5,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >\r
+ <Grid.RowDefinitions>\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="Auto" />\r
+ </Grid.RowDefinitions>\r
+ <Label Content="Start" FontWeight="Bold" Grid.Row="0" />\r
+ <Button Content="Start Encoding" cal:Message.Attach="[Event Click] = [Action StartEncode]" FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center"\r
+ Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />\r
+ <Button Content="Stop Encoding" cal:Message.Attach="[Event Click] = [Action StopEncode]" FontWeight="Bold" Grid.Row="1" Padding="8,2" HorizontalAlignment="Center" \r
+ Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
+ </Grid>\r
+\r
+\r
+ <!-- StatusPanel -->\r
+ <controls:StatusPanel x:Name="loadingPanel"\r
+ Grid.Row="3"\r
+ Grid.RowSpan="2"\r
+ Height="70"\r
+ VerticalAlignment="Bottom"\r
+ Panel.ZIndex="10"\r
+ IsLoading="{Binding ShowStatusWindow}"\r
+ Message="{Binding StatusLabel}"\r
+ SubMessage="Please Wait ..."\r
+ />\r
+\r
+ <!-- Status Bar -->\r
+ <StatusBar Grid.Row="4" Grid.ColumnSpan="2" MinHeight="32" >\r
+\r
+ <ProgressBar Value="{Binding ProgressPercentage}" Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}}"\r
+ Width="100" Height="18" VerticalAlignment="Center"/>\r
+ <Label VerticalAlignment="Center"\r
+ Content="{Binding Path=ProgramStatusLabel}" />\r
+\r
+ </StatusBar>\r
+\r
+ </Grid>\r
+</UserControl>\r
--- /dev/null
+namespace HandBrakeWPF.Views\r
+{\r
+ using System.Windows.Controls;\r
+\r
+ /// <summary>\r
+ /// Interaction logic for InstantMainView.xaml\r
+ /// </summary>\r
+ public partial class InstantMainView : UserControl\r
+ {\r
+ public InstantMainView()\r
+ {\r
+ InitializeComponent();\r
+ }\r
+ }\r
+}\r
Margin="10,10,5,5"\r
HorizontalAlignment="Stretch"\r
VerticalAlignment="Stretch"\r
+ MinHeight="350" MinWidth="720"\r
>\r
<TabItem Name="pictureTab" Header="Picture">\r
<ContentControl x:Name="PictureSettingsViewModel" />\r
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"\r
xmlns:Data="clr-namespace:System.Windows.Data;assembly=PresentationFramework"\r
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"\r
+ xmlns:views="clr-namespace:HandBrakeWPF.Views"\r
Title="{Data:Binding Path=WindowTitle}"\r
Width="1015"\r
Height="670"\r
WindowStartupLocation="CenterScreen"\r
TextOptions.TextFormattingMode="Display"\r
Style="{StaticResource mainWindowStyle}"\r
+ x:Name="shellView"\r
>\r
<Window.Resources>\r
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />\r
<Grid>\r
<ContentControl x:Name="MainViewModel" Visibility="{Binding ShowMainWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
<ContentControl x:Name="OptionsViewModel" Visibility="{Binding ShowOptions, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
+\r
+ <views:InstantMainView DataContext="{Binding MainViewModel}" \r
+ Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.ShowInstant, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
</Grid>\r
</Window>\r
{\r
this.TaskbarItemInfo = Win7.WindowsTaskbar;\r
}\r
+\r
+ // Window Sizing\r
+ if (AppArguments.IsInstantHandBrake)\r
+ {\r
+ this.SizeToContent = SizeToContent.WidthAndHeight;\r
+ this.MinHeight = 380;\r
+ this.MinWidth = 600;\r
+ }\r
}\r
\r
/// <summary>\r