/// </summary>\r
private int lastJobId;\r
\r
- /// <summary>\r
- /// The instance Id of this HandBrake instance.\r
- /// </summary>\r
- private int instanceId;\r
-\r
#endregion\r
\r
/// <summary>\r
/// </param>\r
public QueueManager(int instanceId)\r
{\r
- this.instanceId = instanceId;\r
-\r
// If this is the first instance, just use the main queue file, otherwise add the instance id to the filename.\r
this.queueFile = instanceId == 0 ? "hb_queue_recovery.xml" : string.Format("hb_queue_recovery{0}.xml", instanceId);\r
}\r
+++ /dev/null
-\r
-Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual Studio 2008\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrakeCS", "HandBrakeCS.csproj", "{A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrake.ApplicationServices", "HandBrake.ApplicationServices\HandBrake.ApplicationServices.csproj", "{087A2BA8-BAC2-4577-A46F-07FF9D420016}"\r
-EndProject\r
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrake.Framework", "HandBrake.Framework\HandBrake.Framework.csproj", "{49AD42C1-BF9B-4D78-A644-020878FAADE6}"\r
-EndProject\r
-Global\r
- GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
- Debug|Any CPU = Debug|Any CPU\r
- Debug|x86 = Debug|x86\r
- Install|Any CPU = Install|Any CPU\r
- Install|x86 = Install|x86\r
- NightlyBuild|Any CPU = NightlyBuild|Any CPU\r
- NightlyBuild|x86 = NightlyBuild|x86\r
- Release|Any CPU = Release|Any CPU\r
- Release|x86 = Release|x86\r
- EndGlobalSection\r
- GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|x86.ActiveCfg = Debug|x86\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Debug|x86.Build.0 = Debug|x86\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|Any CPU.ActiveCfg = Install|Any CPU\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|Any CPU.Build.0 = Install|Any CPU\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|x86.ActiveCfg = Install|x86\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Install|x86.Build.0 = Install|x86\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|Any CPU.ActiveCfg = NightlyBuild|Any CPU\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|Any CPU.Build.0 = NightlyBuild|Any CPU\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|x86.ActiveCfg = NightlyBuild|x86\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.NightlyBuild|x86.Build.0 = NightlyBuild|x86\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|x86.ActiveCfg = Release|x86\r
- {A2923D42-C38B-4B12-8CBA-B8D93D6B13A3}.Release|x86.Build.0 = Release|x86\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Debug|x86.ActiveCfg = Debug|Any CPU\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Install|Any CPU.ActiveCfg = Release|Any CPU\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Install|Any CPU.Build.0 = Release|Any CPU\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Install|x86.ActiveCfg = Release|Any CPU\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.NightlyBuild|Any CPU.ActiveCfg = NightlyBuild|Any CPU\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.NightlyBuild|Any CPU.Build.0 = NightlyBuild|Any CPU\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.NightlyBuild|x86.ActiveCfg = Release|Any CPU\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {087A2BA8-BAC2-4577-A46F-07FF9D420016}.Release|x86.ActiveCfg = Release|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|Any CPU.Build.0 = Debug|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Debug|x86.ActiveCfg = Debug|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|Any CPU.ActiveCfg = NightlyBuild|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|Any CPU.Build.0 = NightlyBuild|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Install|x86.ActiveCfg = NightlyBuild|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|Any CPU.ActiveCfg = NightlyBuild|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|Any CPU.Build.0 = NightlyBuild|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.NightlyBuild|x86.ActiveCfg = NightlyBuild|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|Any CPU.ActiveCfg = Release|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|Any CPU.Build.0 = Release|Any CPU\r
- {49AD42C1-BF9B-4D78-A644-020878FAADE6}.Release|x86.ActiveCfg = Release|Any CPU\r
- EndGlobalSection\r
- GlobalSection(SolutionProperties) = preSolution\r
- HideSolutionNode = FALSE\r
- EndGlobalSection\r
-EndGlobal\r
<Optimize>true</Optimize>\r
</PropertyGroup>\r
<ItemGroup>\r
- <Reference Include="AxInterop.QTOControlLib">\r
- <HintPath>libraries\AxInterop.QTOControlLib.dll</HintPath>\r
- </Reference>\r
<Reference Include="Growl.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=980c2339411be384, processorArchitecture=x86">\r
<SpecificVersion>False</SpecificVersion>\r
<HintPath>libraries\Growl.Connector.dll</HintPath>\r
<Compile Include="Controls\x264Panel.Designer.cs">\r
<DependentUpon>x264Panel.cs</DependentUpon>\r
</Compile>\r
- <Compile Include="Functions\ToolStripRenderOverride.cs" />\r
- <Compile Include="Model\ActivityLogMode.cs" />\r
- <Compile Include="Model\QueryPictureSettingsMode.cs" />\r
- <Compile Include="Model\QueryEncodeMode.cs" />\r
- <Compile Include="Properties\AssemblyInfo.cs" />\r
<Compile Include="frmPreview.cs">\r
<SubType>Form</SubType>\r
</Compile>\r
<Compile Include="frmPreview.Designer.cs">\r
<DependentUpon>frmPreview.cs</DependentUpon>\r
</Compile>\r
+ <Compile Include="Functions\ToolStripRenderOverride.cs" />\r
+ <Compile Include="Model\ActivityLogMode.cs" />\r
+ <Compile Include="Model\QueryPictureSettingsMode.cs" />\r
+ <Compile Include="Model\QueryEncodeMode.cs" />\r
+ <Compile Include="Properties\AssemblyInfo.cs" />\r
<Compile Include="frmAbout.cs">\r
<SubType>Form</SubType>\r
</Compile>\r
</BootstrapperPackage>\r
</ItemGroup>\r
<ItemGroup>\r
- <COMReference Include="QTOControlLib">\r
- <Guid>{7B92F833-027D-402B-BFF9-A67697366F4E}</Guid>\r
- <VersionMajor>1</VersionMajor>\r
- <VersionMinor>0</VersionMinor>\r
- <Lcid>0</Lcid>\r
- <WrapperTool>tlbimp</WrapperTool>\r
- <Isolated>False</Isolated>\r
- </COMReference>\r
- <COMReference Include="QTOLibrary">\r
- <Guid>{29866AED-1E14-417D-BA0F-1A2BE6F5A19E}</Guid>\r
- <VersionMajor>1</VersionMajor>\r
- <VersionMinor>0</VersionMinor>\r
- <Lcid>0</Lcid>\r
- <WrapperTool>tlbimp</WrapperTool>\r
- <Isolated>False</Isolated>\r
- </COMReference>\r
<COMReference Include="stdole">\r
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>\r
<VersionMajor>2</VersionMajor>\r
CreateDirectory "$SMPROGRAMS\Handbrake"\r
CreateShortCut "$SMPROGRAMS\Handbrake\Handbrake.lnk" "$INSTDIR\Handbrake.exe"\r
CreateShortCut "$DESKTOP\Handbrake.lnk" "$INSTDIR\Handbrake.exe"\r
- File "Interop.QTOLibrary.dll"\r
- File "Interop.QTOControlLib.dll"\r
- File "AxInterop.QTOControlLib.dll"\r
File "Growl.Connector.dll"\r
File "Growl.CoreLibrary.dll"\r
File "Handbrake.exe.config"\r
CreateDirectory "$SMPROGRAMS\Handbrake"\r
CreateShortCut "$SMPROGRAMS\Handbrake\Handbrake.lnk" "$INSTDIR\Handbrake.exe"\r
CreateShortCut "$DESKTOP\Handbrake.lnk" "$INSTDIR\Handbrake.exe"\r
- File "Interop.QTOLibrary.dll"\r
- File "Interop.QTOControlLib.dll"\r
- File "AxInterop.QTOControlLib.dll"\r
File "Growl.Connector.dll"\r
File "Growl.CoreLibrary.dll"\r
File "Handbrake.exe.config"\r
private void InitializeComponent()\r
{\r
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmPreview));\r
- this.toolBar = new System.Windows.Forms.ToolStrip();\r
- this.lbl_preview = new System.Windows.Forms.ToolStripLabel();\r
- this.cb_preview = new System.Windows.Forms.ToolStripComboBox();\r
- this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();\r
- this.cb_duration = new System.Windows.Forms.ToolStripComboBox();\r
- this.btn_playQT = new System.Windows.Forms.ToolStripButton();\r
- this.btn_playVLC = new System.Windows.Forms.ToolStripButton();\r
- this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();\r
- this.ProgressBarStatus = new System.Windows.Forms.ToolStripProgressBar();\r
- this.lbl_encodeStatus = new System.Windows.Forms.ToolStripLabel();\r
- this.panel1 = new System.Windows.Forms.Panel();\r
- this.QTControl = new AxQTOControlLib.AxQTControl();\r
- this.toolBar.SuspendLayout();\r
- this.panel1.SuspendLayout();\r
- ((System.ComponentModel.ISupportInitialize)(this.QTControl)).BeginInit();\r
+ this.startPoint = new System.Windows.Forms.ComboBox();\r
+ this.endPoint = new System.Windows.Forms.ComboBox();\r
+ this.label1 = new System.Windows.Forms.Label();\r
+ this.label2 = new System.Windows.Forms.Label();\r
+ this.progressBar = new System.Windows.Forms.ProgressBar();\r
+ this.lbl_progress = new System.Windows.Forms.Label();\r
+ this.btn_play = new System.Windows.Forms.Button();\r
this.SuspendLayout();\r
// \r
- // toolBar\r
- // \r
- this.toolBar.AutoSize = false;\r
- this.toolBar.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;\r
- this.toolBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
- this.lbl_preview,\r
- this.cb_preview,\r
- this.toolStripLabel2,\r
- this.cb_duration,\r
- this.btn_playQT,\r
- this.btn_playVLC,\r
- this.toolStripSeparator1,\r
- this.ProgressBarStatus,\r
- this.lbl_encodeStatus});\r
- this.toolBar.Location = new System.Drawing.Point(0, 0);\r
- this.toolBar.Name = "toolBar";\r
- this.toolBar.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;\r
- this.toolBar.Size = new System.Drawing.Size(722, 25);\r
- this.toolBar.TabIndex = 37;\r
- this.toolBar.Text = "toolStrip1";\r
- // \r
- // lbl_preview\r
- // \r
- this.lbl_preview.BackColor = System.Drawing.Color.Transparent;\r
- this.lbl_preview.Name = "lbl_preview";\r
- this.lbl_preview.Size = new System.Drawing.Size(91, 22);\r
- this.lbl_preview.Text = "Start at Preview:";\r
- // \r
- // cb_preview\r
- // \r
- this.cb_preview.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
- this.cb_preview.DropDownWidth = 75;\r
- this.cb_preview.FlatStyle = System.Windows.Forms.FlatStyle.Standard;\r
- this.cb_preview.Font = new System.Drawing.Font("Tahoma", 9F);\r
- this.cb_preview.Items.AddRange(new object[] {\r
+ // startPoint\r
+ // \r
+ this.startPoint.FormattingEnabled = true;\r
+ this.startPoint.Items.AddRange(new object[] {\r
"1",\r
"2",\r
"3",\r
"8",\r
"9",\r
"10"});\r
- this.cb_preview.Name = "cb_preview";\r
- this.cb_preview.Size = new System.Drawing.Size(75, 25);\r
- // \r
- // toolStripLabel2\r
- // \r
- this.toolStripLabel2.BackColor = System.Drawing.Color.Transparent;\r
- this.toolStripLabel2.Name = "toolStripLabel2";\r
- this.toolStripLabel2.Size = new System.Drawing.Size(107, 22);\r
- this.toolStripLabel2.Text = "Duration (seconds)";\r
+ this.startPoint.Location = new System.Drawing.Point(107, 6);\r
+ this.startPoint.Name = "startPoint";\r
+ this.startPoint.Size = new System.Drawing.Size(72, 21);\r
+ this.startPoint.TabIndex = 38;\r
// \r
- // cb_duration\r
+ // endPoint\r
// \r
- this.cb_duration.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
- this.cb_duration.DropDownWidth = 75;\r
- this.cb_duration.FlatStyle = System.Windows.Forms.FlatStyle.Standard;\r
- this.cb_duration.Font = new System.Drawing.Font("Tahoma", 9F);\r
- this.cb_duration.Items.AddRange(new object[] {\r
+ this.endPoint.FormattingEnabled = true;\r
+ this.endPoint.Items.AddRange(new object[] {\r
"5",\r
"10",\r
"15",\r
"50",\r
"55",\r
"60"});\r
- this.cb_duration.Margin = new System.Windows.Forms.Padding(0);\r
- this.cb_duration.Name = "cb_duration";\r
- this.cb_duration.Size = new System.Drawing.Size(75, 25);\r
- // \r
- // btn_playQT\r
- // \r
- this.btn_playQT.Image = global::Handbrake.Properties.Resources.Play_small;\r
- this.btn_playQT.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
- this.btn_playQT.ImageTransparentColor = System.Drawing.Color.Magenta;\r
- this.btn_playQT.Name = "btn_playQT";\r
- this.btn_playQT.Size = new System.Drawing.Size(96, 22);\r
- this.btn_playQT.Text = "Play with QT";\r
- this.btn_playQT.Click += new System.EventHandler(this.PlayQtClick);\r
- // \r
- // btn_playVLC\r
- // \r
- this.btn_playVLC.Image = global::Handbrake.Properties.Resources.Play_small;\r
- this.btn_playVLC.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
- this.btn_playVLC.ImageTransparentColor = System.Drawing.Color.Magenta;\r
- this.btn_playVLC.Name = "btn_playVLC";\r
- this.btn_playVLC.Size = new System.Drawing.Size(101, 22);\r
- this.btn_playVLC.Text = "Play with VLC";\r
- this.btn_playVLC.Click += new System.EventHandler(this.PlayVlcClick);\r
- // \r
- // toolStripSeparator1\r
- // \r
- this.toolStripSeparator1.Name = "toolStripSeparator1";\r
- this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);\r
- // \r
- // ProgressBarStatus\r
- // \r
- this.ProgressBarStatus.Name = "ProgressBarStatus";\r
- this.ProgressBarStatus.Size = new System.Drawing.Size(100, 22);\r
- this.ProgressBarStatus.Visible = false;\r
- // \r
- // lbl_encodeStatus\r
- // \r
- this.lbl_encodeStatus.Name = "lbl_encodeStatus";\r
- this.lbl_encodeStatus.Size = new System.Drawing.Size(38, 22);\r
- this.lbl_encodeStatus.Text = "0.00%";\r
- this.lbl_encodeStatus.Visible = false;\r
- // \r
- // panel1\r
- // \r
- this.panel1.AutoSize = true;\r
- this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;\r
- this.panel1.Controls.Add(this.QTControl);\r
- this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.panel1.Location = new System.Drawing.Point(0, 25);\r
- this.panel1.Name = "panel1";\r
- this.panel1.Size = new System.Drawing.Size(722, 481);\r
- this.panel1.TabIndex = 40;\r
- // \r
- // QTControl\r
- // \r
- this.QTControl.Enabled = true;\r
- this.QTControl.Location = new System.Drawing.Point(0, 0);\r
- this.QTControl.Name = "QTControl";\r
- this.QTControl.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("QTControl.OcxState")));\r
- this.QTControl.Size = new System.Drawing.Size(64, 72);\r
- this.QTControl.TabIndex = 39;\r
- this.QTControl.Visible = false;\r
+ this.endPoint.Location = new System.Drawing.Point(289, 6);\r
+ this.endPoint.Name = "endPoint";\r
+ this.endPoint.Size = new System.Drawing.Size(70, 21);\r
+ this.endPoint.TabIndex = 39;\r
+ // \r
+ // label1\r
+ // \r
+ this.label1.AutoSize = true;\r
+ this.label1.Location = new System.Drawing.Point(12, 9);\r
+ this.label1.Name = "label1";\r
+ this.label1.Size = new System.Drawing.Size(89, 13);\r
+ this.label1.TabIndex = 40;\r
+ this.label1.Text = "Start at Preview:";\r
+ // \r
+ // label2\r
+ // \r
+ this.label2.AutoSize = true;\r
+ this.label2.Location = new System.Drawing.Point(185, 9);\r
+ this.label2.Name = "label2";\r
+ this.label2.Size = new System.Drawing.Size(98, 13);\r
+ this.label2.TabIndex = 41;\r
+ this.label2.Text = "Duration (seconds)";\r
+ // \r
+ // progressBar\r
+ // \r
+ this.progressBar.Location = new System.Drawing.Point(12, 33);\r
+ this.progressBar.Name = "progressBar";\r
+ this.progressBar.Size = new System.Drawing.Size(301, 18);\r
+ this.progressBar.TabIndex = 42;\r
+ // \r
+ // lbl_progress\r
+ // \r
+ this.lbl_progress.AutoSize = true;\r
+ this.lbl_progress.Location = new System.Drawing.Point(319, 36);\r
+ this.lbl_progress.Name = "lbl_progress";\r
+ this.lbl_progress.Size = new System.Drawing.Size(40, 13);\r
+ this.lbl_progress.TabIndex = 43;\r
+ this.lbl_progress.Text = "0.00%";\r
+ // \r
+ // btn_play\r
+ // \r
+ this.btn_play.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+ this.btn_play.ForeColor = System.Drawing.Color.DarkOrange;\r
+ this.btn_play.Location = new System.Drawing.Point(302, 57);\r
+ this.btn_play.Name = "btn_play";\r
+ this.btn_play.Size = new System.Drawing.Size(57, 24);\r
+ this.btn_play.TabIndex = 44;\r
+ this.btn_play.Text = "Play";\r
+ this.btn_play.UseVisualStyleBackColor = true;\r
+ this.btn_play.Click += new System.EventHandler(this.btn_play_Click);\r
// \r
// frmPreview\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
- this.AutoSize = true;\r
- this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;\r
- this.BackColor = System.Drawing.Color.Black;\r
- this.ClientSize = new System.Drawing.Size(722, 506);\r
- this.Controls.Add(this.panel1);\r
- this.Controls.Add(this.toolBar);\r
+ this.ClientSize = new System.Drawing.Size(369, 91);\r
+ this.Controls.Add(this.btn_play);\r
+ this.Controls.Add(this.lbl_progress);\r
+ this.Controls.Add(this.progressBar);\r
+ this.Controls.Add(this.label2);\r
+ this.Controls.Add(this.label1);\r
+ this.Controls.Add(this.endPoint);\r
+ this.Controls.Add(this.startPoint);\r
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
- this.MinimumSize = new System.Drawing.Size(730, 32);\r
+ this.MaximizeBox = false;\r
+ this.MinimizeBox = false;\r
this.Name = "frmPreview";\r
+ this.ShowIcon = false;\r
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\r
this.Text = "Video Preview";\r
- this.toolBar.ResumeLayout(false);\r
- this.toolBar.PerformLayout();\r
- this.panel1.ResumeLayout(false);\r
- ((System.ComponentModel.ISupportInitialize)(this.QTControl)).EndInit();\r
this.ResumeLayout(false);\r
this.PerformLayout();\r
\r
\r
#endregion\r
\r
- private System.Windows.Forms.ToolStrip toolBar;\r
- private System.Windows.Forms.ToolStripButton btn_playQT;\r
- private AxQTOControlLib.AxQTControl QTControl;\r
- private System.Windows.Forms.ToolStripComboBox cb_preview;\r
- private System.Windows.Forms.ToolStripLabel lbl_preview;\r
- private System.Windows.Forms.ToolStripLabel toolStripLabel2;\r
- private System.Windows.Forms.ToolStripComboBox cb_duration;\r
- private System.Windows.Forms.ToolStripButton btn_playVLC;\r
- private System.Windows.Forms.Panel panel1;\r
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;\r
- private System.Windows.Forms.ToolStripProgressBar ProgressBarStatus;\r
- private System.Windows.Forms.ToolStripLabel lbl_encodeStatus;\r
+ private System.Windows.Forms.ComboBox startPoint;\r
+ private System.Windows.Forms.ComboBox endPoint;\r
+ private System.Windows.Forms.Label label1;\r
+ private System.Windows.Forms.Label label2;\r
+ private System.Windows.Forms.ProgressBar progressBar;\r
+ private System.Windows.Forms.Label lbl_progress;\r
+ private System.Windows.Forms.Button btn_play;\r
+\r
}\r
}
\ No newline at end of file
using System;\r
using System.Diagnostics;\r
using System.IO;\r
- using System.Runtime.InteropServices;\r
using System.Threading;\r
- using System.Windows;\r
using System.Windows.Forms;\r
using Functions;\r
\r
using HandBrake.ApplicationServices.Services;\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
\r
- using QTOControlLib;\r
- using QTOLibrary;\r
-\r
using MessageBox = System.Windows.Forms.MessageBox;\r
\r
/// <summary>\r
/// </summary>\r
private readonly frmMain mainWindow;\r
\r
- /// <summary>\r
- /// True if QT is not installed\r
- /// </summary>\r
- private readonly bool noQt;\r
-\r
/// <summary>\r
/// The encode queue\r
/// </summary>\r
private string currentlyPlaying = string.Empty;\r
\r
/// <summary>\r
- /// Play With VLC tracker\r
- /// </summary>\r
- private bool playWithVlc;\r
-\r
- /// <summary>\r
- /// A Thread for the video player\r
+ /// Update UI Delegate\r
/// </summary>\r
- private Thread player;\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private delegate void UpdateUiHandler(object sender, EventArgs e);\r
\r
#endregion\r
\r
/// </param>\r
public frmPreview(frmMain mw)\r
{\r
- try\r
- {\r
- InitializeComponent();\r
- }\r
- catch (Exception)\r
- {\r
- this.noQt = true;\r
-\r
- int borderWidth = (this.Width - this.ClientSize.Width) / 2;\r
- int titlebarAndBorder = this.Height - this.ClientSize.Height;\r
-\r
- this.Height = toolBar.Height + titlebarAndBorder + 1;\r
- btn_playQT.Enabled = false;\r
- btn_playQT.Visible = false;\r
- }\r
-\r
+ InitializeComponent();\r
this.mainWindow = mw;\r
\r
- cb_preview.SelectedIndex = 0;\r
- cb_duration.SelectedIndex = 1;\r
+ startPoint.SelectedIndex = 0;\r
+ endPoint.SelectedIndex = 1;\r
\r
- cb_preview.Items.Clear();\r
+ startPoint.Items.Clear();\r
for (int i = 1; i <= Properties.Settings.Default.previewScanCount; i++)\r
{\r
- cb_preview.Items.Add(i.ToString());\r
+ startPoint.Items.Add(i.ToString());\r
}\r
\r
- cb_preview.SelectedIndex = 0;\r
+ startPoint.SelectedIndex = 0;\r
\r
encodeQueue.EncodeStarted += this.EncodeQueueEncodeStarted;\r
encodeQueue.EncodeCompleted += this.EncodeQueueEncodeEnded;\r
}\r
\r
- #region Delegates\r
- /// <summary>\r
- /// Update UI Delegate\r
- /// </summary>\r
- /// <param name="sender">\r
- /// The sender.\r
- /// </param>\r
- /// <param name="e">\r
- /// The e.\r
- /// </param>\r
- private delegate void UpdateUiHandler(object sender, EventArgs e);\r
-\r
- /// <summary>\r
- /// The Open Movie Handler\r
- /// </summary>\r
- private delegate void OpenMovieHandler();\r
- #endregion\r
-\r
#region Event Handlers\r
/// <summary>\r
/// The encode has started\r
return;\r
}\r
\r
- ProgressBarStatus.Visible = false;\r
- lbl_encodeStatus.Visible = false;\r
-\r
- if (!this.noQt)\r
- btn_playQT.Enabled = true;\r
- btn_playVLC.Enabled = true;\r
-\r
+ btn_play.Enabled = true;\r
this.Text = this.Text.Replace(" (Encoding)", string.Empty);\r
+ progressBar.Value = 0;\r
+ lbl_progress.Text = "0.00%";\r
\r
// Get the sample filename\r
if (this.mainWindow.text_destination.Text != string.Empty)\r
this.mainWindow.text_destination.Text.Replace(".mp4", "_sample.mp4").Replace(".m4v", "_sample.m4v").\r
Replace(".mkv", "_sample.mkv");\r
\r
- // Play back in QT or VLC\r
- if (!playWithVlc)\r
- Play();\r
- else\r
- PlayVlc();\r
+ this.Play();\r
}\r
catch (Exception exc)\r
{\r
return;\r
}\r
\r
- lbl_encodeStatus.Text = e.PercentComplete + "%";\r
- ProgressBarStatus.Value = (int)Math.Round(e.PercentComplete);\r
+ lbl_progress.Text = e.PercentComplete + "%";\r
+ progressBar.Value = (int)Math.Round(e.PercentComplete);\r
}\r
#endregion\r
\r
#region Encode Sample\r
\r
- /// <summary>\r
- /// Play with VLC\r
- /// </summary>\r
- /// <param name="sender">\r
- /// The sender.\r
- /// </param>\r
- /// <param name="e">\r
- /// The e.\r
- /// </param>\r
- private void PlayVlcClick(object sender, EventArgs e)\r
- {\r
- ProgressBarStatus.Visible = true;\r
- ProgressBarStatus.Value = 0;\r
- lbl_encodeStatus.Visible = true;\r
- playWithVlc = true;\r
- this.panel1.Visible = false;\r
- \r
- try\r
- {\r
- if (!this.noQt)\r
- QTControl.URL = string.Empty;\r
-\r
- if (File.Exists(this.currentlyPlaying))\r
- File.Delete(this.currentlyPlaying);\r
- }\r
- catch (Exception)\r
- {\r
- MessageBox.Show(this, "Unable to delete previous preview file. You may need to restart the application.",\r
- "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
- }\r
-\r
- btn_playQT.Enabled = false;\r
- btn_playVLC.Enabled = false;\r
- this.Text += " (Encoding)";\r
- int duration;\r
- int.TryParse(cb_duration.Text, out duration);\r
- string query = QueryGenerator.GeneratePreviewQuery(this.mainWindow, duration, cb_preview.Text);\r
- ThreadPool.QueueUserWorkItem(this.CreatePreview, query);\r
- }\r
-\r
- /// <summary>\r
- /// Encode and Play with QT\r
- /// </summary>\r
- /// <param name="sender">\r
- /// The sender.\r
- /// </param>\r
- /// <param name="e">\r
- /// The e.\r
- /// </param>\r
- private void PlayQtClick(object sender, EventArgs e)\r
- {\r
- playWithVlc = false;\r
- this.panel1.Visible = true;\r
- if (this.noQt)\r
- {\r
- MessageBox.Show(this,\r
- "It would appear QuickTime 7 is not installed or not accessible. Please (re)install QuickTime.",\r
- "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
- return;\r
- }\r
- if (this.mainWindow.text_destination.Text.Contains(".mkv"))\r
- {\r
- MessageBox.Show(this,\r
- "The QuickTime Control does not support MKV files, It is recommended you use the VLC option instead.",\r
- "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
- }\r
- else\r
- {\r
- ProgressBarStatus.Visible = true;\r
- ProgressBarStatus.Value = 0;\r
- lbl_encodeStatus.Visible = true;\r
- try\r
- {\r
- QTControl.URL = string.Empty;\r
- if (File.Exists(this.currentlyPlaying))\r
- File.Delete(this.currentlyPlaying);\r
- }\r
- catch (Exception)\r
- {\r
- MessageBox.Show(this,\r
- "Unable to delete previous preview file. You may need to restart the application.",\r
- "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
- }\r
-\r
- btn_playQT.Enabled = false;\r
- btn_playVLC.Enabled = false;\r
- this.Text += " (Encoding)";\r
- int duration;\r
- int.TryParse(cb_duration.Text, out duration);\r
- string query = QueryGenerator.GeneratePreviewQuery(this.mainWindow, duration, cb_preview.Text);\r
-\r
- ThreadPool.QueueUserWorkItem(this.CreatePreview, query);\r
- }\r
- }\r
-\r
/// <summary>\r
/// Create the Preview.\r
/// </summary>\r
\r
#region Playback\r
\r
- /// <summary>\r
- /// Play the video back in the QuickTime control\r
- /// </summary>\r
- private void Play()\r
+ private void btn_play_Click(object sender, EventArgs e)\r
{\r
- this.player = new Thread(OpenMovie) { IsBackground = true };\r
- this.player.Start();\r
+ try\r
+ {\r
+ btn_play.Enabled = false;\r
+ if (File.Exists(this.currentlyPlaying))\r
+ File.Delete(this.currentlyPlaying);\r
+ }\r
+ catch (Exception)\r
+ {\r
+ btn_play.Enabled = true;\r
+ MessageBox.Show(this, "Unable to delete previous preview file. You may need to restart the application.",\r
+ "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+ }\r
+\r
+ this.Text += " (Encoding)";\r
+ int duration;\r
+ int.TryParse(endPoint.Text, out duration);\r
+ string query = QueryGenerator.GeneratePreviewQuery(this.mainWindow, duration, startPoint.Text);\r
+ ThreadPool.QueueUserWorkItem(this.CreatePreview, query);\r
}\r
\r
/// <summary>\r
/// Play the video back in an external VLC Player\r
/// </summary>\r
- private void PlayVlc()\r
+ private void Play()\r
{\r
// Launch VLC and Play video.\r
if (this.currentlyPlaying != string.Empty)\r
else\r
vlcPath = Environment.GetEnvironmentVariable("ProgramFiles");\r
\r
- vlcPath = vlcPath != null\r
- ? vlcPath + @"\VideoLAN\VLC\vlc.exe"\r
- : @"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe";\r
-\r
+ \r
if (!File.Exists(Properties.Settings.Default.VLC_Path))\r
{\r
if (File.Exists(vlcPath))\r
}\r
}\r
\r
- /// <summary>\r
- /// QT control - Open the file\r
- /// </summary>\r
- [STAThread]\r
- private void OpenMovie()\r
- {\r
- try\r
- {\r
- if (InvokeRequired)\r
- {\r
- BeginInvoke(new OpenMovieHandler(OpenMovie));\r
- return;\r
- }\r
- QTControl.URL = this.currentlyPlaying;\r
- QTControl.SetSizing(QTSizingModeEnum.qtControlFitsMovie, true);\r
- QTControl.URL = this.currentlyPlaying;\r
- QTControl.Show();\r
-\r
- this.ClientSize = QTControl.Size;\r
- this.Height += toolBar.Height;\r
- }\r
- catch (COMException ex)\r
- {\r
- QTUtils qtu = new QTUtils();\r
- Main.ShowExceptiowWindow("Unable to open movie.", ex + Environment.NewLine + qtu.QTErrorFromErrorCode(ex.ErrorCode));\r
- }\r
- catch (Exception ex)\r
- {\r
- Main.ShowExceptiowWindow("Unable to open movie.", ex.ToString());\r
- }\r
- }\r
-\r
#endregion\r
\r
/// <summary>\r
<value>2.0</value>\r
</resheader>\r
<resheader name="reader">\r
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
</resheader>\r
<resheader name="writer">\r
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
</resheader>\r
- <metadata name="toolBar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <value>17, 17</value>\r
- </metadata>\r
- <data name="QTControl.OcxState" mimetype="application/x-microsoft.net.object.binary.base64">\r
- <value>\r
- AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w\r
- LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0\r
- ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAVQAAAAIB\r
- AAAAAQAAAAAAAAAAAAAAAEAAAAAACAAAnQYAAHEHAAATAA8AAIATAAAAAAADAAAAAAALAP//AwAAAAAA\r
- CAACAAAAAAAIAAIAAAAAAAgAAgAAAAAACw==\r
-</value>\r
- </data>\r
- <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />\r
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />\r
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
<value>\r
AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA\r