mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Initial UI work for video converter tool
This commit is contained in:
parent
f49f7d15fa
commit
cc59328d14
5 changed files with 430 additions and 1 deletions
|
@ -445,7 +445,7 @@
|
|||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>449, 145</value>
|
||||
<value>456, 147</value>
|
||||
</data>
|
||||
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
|
||||
<value>CenterScreen</value>
|
||||
|
|
225
ShareX.MediaLib/Forms/VideoConverterForm.Designer.cs
generated
Normal file
225
ShareX.MediaLib/Forms/VideoConverterForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,225 @@
|
|||
namespace ShareX.MediaLib.Forms
|
||||
{
|
||||
partial class VideoConverterForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.lblInputFilePath = new System.Windows.Forms.Label();
|
||||
this.txtInputFilePath = new System.Windows.Forms.TextBox();
|
||||
this.btnInputFilePathBrowse = new System.Windows.Forms.Button();
|
||||
this.txtOutputFolder = new System.Windows.Forms.TextBox();
|
||||
this.lblOutputFolder = new System.Windows.Forms.Label();
|
||||
this.btnOutputFolderBrowse = new System.Windows.Forms.Button();
|
||||
this.lblOutputFileName = new System.Windows.Forms.Label();
|
||||
this.txtOutputFileName = new System.Windows.Forms.TextBox();
|
||||
this.lblVideoCodec = new System.Windows.Forms.Label();
|
||||
this.cbVideoCodec = new System.Windows.Forms.ComboBox();
|
||||
this.lblVideoQuality = new System.Windows.Forms.Label();
|
||||
this.nudVideoQuality = new System.Windows.Forms.NumericUpDown();
|
||||
this.btnEncode = new System.Windows.Forms.Button();
|
||||
this.lblCLI = new System.Windows.Forms.Label();
|
||||
this.txtCLI = new System.Windows.Forms.TextBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudVideoQuality)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblInputFilePath
|
||||
//
|
||||
this.lblInputFilePath.AutoSize = true;
|
||||
this.lblInputFilePath.Location = new System.Drawing.Point(13, 16);
|
||||
this.lblInputFilePath.Name = "lblInputFilePath";
|
||||
this.lblInputFilePath.Size = new System.Drawing.Size(74, 13);
|
||||
this.lblInputFilePath.TabIndex = 0;
|
||||
this.lblInputFilePath.Text = "Input file path:";
|
||||
//
|
||||
// txtInputFilePath
|
||||
//
|
||||
this.txtInputFilePath.Location = new System.Drawing.Point(120, 12);
|
||||
this.txtInputFilePath.Name = "txtInputFilePath";
|
||||
this.txtInputFilePath.Size = new System.Drawing.Size(280, 20);
|
||||
this.txtInputFilePath.TabIndex = 1;
|
||||
//
|
||||
// btnInputFilePathBrowse
|
||||
//
|
||||
this.btnInputFilePathBrowse.Location = new System.Drawing.Point(408, 11);
|
||||
this.btnInputFilePathBrowse.Name = "btnInputFilePathBrowse";
|
||||
this.btnInputFilePathBrowse.Size = new System.Drawing.Size(32, 23);
|
||||
this.btnInputFilePathBrowse.TabIndex = 2;
|
||||
this.btnInputFilePathBrowse.Text = "...";
|
||||
this.btnInputFilePathBrowse.UseVisualStyleBackColor = true;
|
||||
this.btnInputFilePathBrowse.Click += new System.EventHandler(this.btnInputFilePathBrowse_Click);
|
||||
//
|
||||
// txtOutputFolder
|
||||
//
|
||||
this.txtOutputFolder.Location = new System.Drawing.Point(120, 36);
|
||||
this.txtOutputFolder.Name = "txtOutputFolder";
|
||||
this.txtOutputFolder.Size = new System.Drawing.Size(280, 20);
|
||||
this.txtOutputFolder.TabIndex = 4;
|
||||
//
|
||||
// lblOutputFolder
|
||||
//
|
||||
this.lblOutputFolder.AutoSize = true;
|
||||
this.lblOutputFolder.Location = new System.Drawing.Point(13, 40);
|
||||
this.lblOutputFolder.Name = "lblOutputFolder";
|
||||
this.lblOutputFolder.Size = new System.Drawing.Size(71, 13);
|
||||
this.lblOutputFolder.TabIndex = 3;
|
||||
this.lblOutputFolder.Text = "Output folder:";
|
||||
//
|
||||
// btnOutputFolderBrowse
|
||||
//
|
||||
this.btnOutputFolderBrowse.Location = new System.Drawing.Point(408, 35);
|
||||
this.btnOutputFolderBrowse.Name = "btnOutputFolderBrowse";
|
||||
this.btnOutputFolderBrowse.Size = new System.Drawing.Size(32, 23);
|
||||
this.btnOutputFolderBrowse.TabIndex = 5;
|
||||
this.btnOutputFolderBrowse.Text = "...";
|
||||
this.btnOutputFolderBrowse.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lblOutputFileName
|
||||
//
|
||||
this.lblOutputFileName.AutoSize = true;
|
||||
this.lblOutputFileName.Location = new System.Drawing.Point(13, 64);
|
||||
this.lblOutputFileName.Name = "lblOutputFileName";
|
||||
this.lblOutputFileName.Size = new System.Drawing.Size(87, 13);
|
||||
this.lblOutputFileName.TabIndex = 6;
|
||||
this.lblOutputFileName.Text = "Output file name:";
|
||||
//
|
||||
// txtOutputFileName
|
||||
//
|
||||
this.txtOutputFileName.Location = new System.Drawing.Point(120, 60);
|
||||
this.txtOutputFileName.Name = "txtOutputFileName";
|
||||
this.txtOutputFileName.Size = new System.Drawing.Size(280, 20);
|
||||
this.txtOutputFileName.TabIndex = 7;
|
||||
//
|
||||
// lblVideoCodec
|
||||
//
|
||||
this.lblVideoCodec.AutoSize = true;
|
||||
this.lblVideoCodec.Location = new System.Drawing.Point(13, 88);
|
||||
this.lblVideoCodec.Name = "lblVideoCodec";
|
||||
this.lblVideoCodec.Size = new System.Drawing.Size(70, 13);
|
||||
this.lblVideoCodec.TabIndex = 8;
|
||||
this.lblVideoCodec.Text = "Video codec:";
|
||||
//
|
||||
// cbVideoCodec
|
||||
//
|
||||
this.cbVideoCodec.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbVideoCodec.FormattingEnabled = true;
|
||||
this.cbVideoCodec.Location = new System.Drawing.Point(120, 84);
|
||||
this.cbVideoCodec.Name = "cbVideoCodec";
|
||||
this.cbVideoCodec.Size = new System.Drawing.Size(80, 21);
|
||||
this.cbVideoCodec.TabIndex = 9;
|
||||
//
|
||||
// lblVideoQuality
|
||||
//
|
||||
this.lblVideoQuality.AutoSize = true;
|
||||
this.lblVideoQuality.Location = new System.Drawing.Point(13, 112);
|
||||
this.lblVideoQuality.Name = "lblVideoQuality";
|
||||
this.lblVideoQuality.Size = new System.Drawing.Size(70, 13);
|
||||
this.lblVideoQuality.TabIndex = 10;
|
||||
this.lblVideoQuality.Text = "Video quality:";
|
||||
//
|
||||
// nudVideoQuality
|
||||
//
|
||||
this.nudVideoQuality.Location = new System.Drawing.Point(120, 108);
|
||||
this.nudVideoQuality.Name = "nudVideoQuality";
|
||||
this.nudVideoQuality.Size = new System.Drawing.Size(80, 20);
|
||||
this.nudVideoQuality.TabIndex = 11;
|
||||
this.nudVideoQuality.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// btnEncode
|
||||
//
|
||||
this.btnEncode.Location = new System.Drawing.Point(16, 264);
|
||||
this.btnEncode.Name = "btnEncode";
|
||||
this.btnEncode.Size = new System.Drawing.Size(424, 23);
|
||||
this.btnEncode.TabIndex = 14;
|
||||
this.btnEncode.Text = "Start encoding";
|
||||
this.btnEncode.UseVisualStyleBackColor = true;
|
||||
this.btnEncode.Click += new System.EventHandler(this.btnEncode_Click);
|
||||
//
|
||||
// lblCLI
|
||||
//
|
||||
this.lblCLI.AutoSize = true;
|
||||
this.lblCLI.Location = new System.Drawing.Point(13, 136);
|
||||
this.lblCLI.Name = "lblCLI";
|
||||
this.lblCLI.Size = new System.Drawing.Size(26, 13);
|
||||
this.lblCLI.TabIndex = 12;
|
||||
this.lblCLI.Text = "CLI:";
|
||||
//
|
||||
// txtCLI
|
||||
//
|
||||
this.txtCLI.Location = new System.Drawing.Point(16, 152);
|
||||
this.txtCLI.Multiline = true;
|
||||
this.txtCLI.Name = "txtCLI";
|
||||
this.txtCLI.Size = new System.Drawing.Size(424, 104);
|
||||
this.txtCLI.TabIndex = 13;
|
||||
//
|
||||
// VideoConverterForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.ClientSize = new System.Drawing.Size(456, 298);
|
||||
this.Controls.Add(this.txtCLI);
|
||||
this.Controls.Add(this.lblCLI);
|
||||
this.Controls.Add(this.btnEncode);
|
||||
this.Controls.Add(this.nudVideoQuality);
|
||||
this.Controls.Add(this.lblVideoQuality);
|
||||
this.Controls.Add(this.cbVideoCodec);
|
||||
this.Controls.Add(this.lblVideoCodec);
|
||||
this.Controls.Add(this.txtOutputFileName);
|
||||
this.Controls.Add(this.lblOutputFileName);
|
||||
this.Controls.Add(this.btnOutputFolderBrowse);
|
||||
this.Controls.Add(this.lblOutputFolder);
|
||||
this.Controls.Add(this.txtOutputFolder);
|
||||
this.Controls.Add(this.btnInputFilePathBrowse);
|
||||
this.Controls.Add(this.txtInputFilePath);
|
||||
this.Controls.Add(this.lblInputFilePath);
|
||||
this.Name = "VideoConverterForm";
|
||||
this.Text = "ShareX - Video converter";
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudVideoQuality)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblInputFilePath;
|
||||
private System.Windows.Forms.TextBox txtInputFilePath;
|
||||
private System.Windows.Forms.Button btnInputFilePathBrowse;
|
||||
private System.Windows.Forms.TextBox txtOutputFolder;
|
||||
private System.Windows.Forms.Label lblOutputFolder;
|
||||
private System.Windows.Forms.Button btnOutputFolderBrowse;
|
||||
private System.Windows.Forms.Label lblOutputFileName;
|
||||
private System.Windows.Forms.TextBox txtOutputFileName;
|
||||
private System.Windows.Forms.Label lblVideoCodec;
|
||||
private System.Windows.Forms.ComboBox cbVideoCodec;
|
||||
private System.Windows.Forms.Label lblVideoQuality;
|
||||
private System.Windows.Forms.NumericUpDown nudVideoQuality;
|
||||
private System.Windows.Forms.Button btnEncode;
|
||||
private System.Windows.Forms.Label lblCLI;
|
||||
private System.Windows.Forms.TextBox txtCLI;
|
||||
}
|
||||
}
|
75
ShareX.MediaLib/Forms/VideoConverterForm.cs
Normal file
75
ShareX.MediaLib/Forms/VideoConverterForm.cs
Normal file
|
@ -0,0 +1,75 @@
|
|||
#region License Information (GPL v3)
|
||||
|
||||
/*
|
||||
ShareX - A program that allows you to take screenshots and share any file type
|
||||
Copyright (c) 2007-2019 ShareX Team
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using ShareX.HelpersLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ShareX.MediaLib.Forms
|
||||
{
|
||||
public partial class VideoConverterForm : Form
|
||||
{
|
||||
public VideoConverterForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
}
|
||||
|
||||
private void btnInputFilePathBrowse_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (OpenFileDialog ofd = new OpenFileDialog())
|
||||
{
|
||||
if (ofd.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
string filePath = ofd.FileName;
|
||||
txtInputFilePath.Text = filePath;
|
||||
|
||||
if (string.IsNullOrEmpty(txtOutputFolder.Text))
|
||||
{
|
||||
txtOutputFolder.Text = Path.GetDirectoryName(filePath);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(txtOutputFileName.Text))
|
||||
{
|
||||
txtOutputFileName.Text = Path.GetFileNameWithoutExtension(filePath) + "-output";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnEncode_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
120
ShareX.MediaLib/Forms/VideoConverterForm.resx
Normal file
120
ShareX.MediaLib/Forms/VideoConverterForm.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -102,6 +102,12 @@
|
|||
<Compile Include="Forms\ImageThumbnailerForm.Designer.cs">
|
||||
<DependentUpon>ImageThumbnailerForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\VideoConverterForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\VideoConverterForm.Designer.cs">
|
||||
<DependentUpon>VideoConverterForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\VideoThumbnailerForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -220,6 +226,9 @@
|
|||
<EmbeddedResource Include="Forms\ImageThumbnailerForm.zh-TW.resx">
|
||||
<DependentUpon>ImageThumbnailerForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\VideoConverterForm.resx">
|
||||
<DependentUpon>VideoConverterForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\VideoThumbnailerForm.de.resx">
|
||||
<DependentUpon>VideoThumbnailerForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
Loading…
Reference in a new issue