pre 1.1.0.0

fixed ui
fixed logic
This commit is contained in:
STAM 2023-01-14 20:00:15 +03:00
parent 4624416027
commit e49c0b9977
Signed by: stam
GPG Key ID: 4F57E51F9C45F8CD
10 changed files with 2531 additions and 86 deletions

View File

@ -1,33 +1,45 @@
namespace ConverterGui;
namespace ConverterGui;
using System;
using System.Diagnostics;
using System.Reflection;
internal record Command(string InputFile, string OutputFile, bool Clean, bool SaveLog)
internal record Command(string InputFile, string OutputFile, string OutputFileClean, bool Clean, bool SaveLog,string Bitness)
{
private string ExecutablePath =>
Path.Combine(
Path.GetDirectoryName(System.AppContext.BaseDirectory!)!,
@"Tools\x64\retime_phoneme.exe"
@"Tools\"+ Bitness + @"\retime_phoneme.exe"
);
public string GetBatchLine() => string.Join(" ", new[] { $"\"{ExecutablePath}\"" }.Concat(GetArguments().Select(arg => $"\"{arg}\"")));
public Process GetProcess()
{
var proc = new Process()
try
{
StartInfo = new ProcessStartInfo
var proc = new Process()
{
FileName = ExecutablePath
},
EnableRaisingEvents = true,
};
foreach (var item in this.GetArguments())
{
proc.StartInfo.ArgumentList.Add(item);
StartInfo = new ProcessStartInfo
{
FileName = ExecutablePath
},
EnableRaisingEvents = true,
};
foreach (var item in this.GetArguments())
{
proc.StartInfo.ArgumentList.Add(item);
}
return proc;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), @"Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Restart();
return null!;
}
return proc;
}
private IEnumerable<string> GetArguments()
@ -39,6 +51,7 @@ internal record Command(string InputFile, string OutputFile, bool Clean, bool Sa
if (Clean)
{
yield return "-oc";
yield return OutputFileClean;
}
if (SaveLog)
{

View File

@ -0,0 +1,73 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace kru.gui.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("kru.gui.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap favicon_64 {
get {
object obj = ResourceManager.GetObject("favicon.64", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -0,0 +1,124 @@
<?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>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="favicon.64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\favicon.64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

BIN
src/kru.gui/favicon.64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

202
src/kru.gui/frmAbout.Designer.cs generated Normal file
View File

@ -0,0 +1,202 @@
namespace kru.gui
{
partial class frmAbout
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmAbout));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.labelCopy = new System.Windows.Forms.Label();
this.linkLabelSource = new System.Windows.Forms.LinkLabel();
this.linkLabelwowks = new System.Windows.Forms.LinkLabel();
this.buttonOK = new System.Windows.Forms.Button();
this.labelappName = new System.Windows.Forms.Label();
this.labelappVer = new System.Windows.Forms.Label();
this.linkLabelGitHub = new System.Windows.Forms.LinkLabel();
this.linkLabelFreepik = new System.Windows.Forms.LinkLabel();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Image = global::kru.gui.Properties.Resources.favicon_64;
this.pictureBox1.Location = new System.Drawing.Point(12, 12);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(64, 64);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 109);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(90, 15);
this.label1.TabIndex = 1;
this.label1.Text = "Original author:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 124);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(90, 15);
this.label2.TabIndex = 2;
this.label2.Text = "Original source:";
//
// labelCopy
//
this.labelCopy.AutoSize = true;
this.labelCopy.Location = new System.Drawing.Point(82, 44);
this.labelCopy.Name = "labelCopy";
this.labelCopy.Size = new System.Drawing.Size(58, 15);
this.labelCopy.TabIndex = 3;
this.labelCopy.Text = "copyright";
//
// linkLabelSource
//
this.linkLabelSource.AutoSize = true;
this.linkLabelSource.Location = new System.Drawing.Point(108, 124);
this.linkLabelSource.Name = "linkLabelSource";
this.linkLabelSource.Size = new System.Drawing.Size(268, 15);
this.linkLabelSource.TabIndex = 4;
this.linkLabelSource.TabStop = true;
this.linkLabelSource.Text = "https://forum.csmania.ru/viewtopic.php?t=43274";
this.linkLabelSource.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelSource_LinkClicked);
//
// linkLabelwowks
//
this.linkLabelwowks.AutoSize = true;
this.linkLabelwowks.Location = new System.Drawing.Point(108, 109);
this.linkLabelwowks.Name = "linkLabelwowks";
this.linkLabelwowks.Size = new System.Drawing.Size(43, 15);
this.linkLabelwowks.TabIndex = 4;
this.linkLabelwowks.TabStop = true;
this.linkLabelwowks.Text = "wowks";
this.linkLabelwowks.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelwowks_LinkClicked);
//
// buttonOK
//
this.buttonOK.Location = new System.Drawing.Point(316, 12);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 5;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
//
// labelappName
//
this.labelappName.AutoSize = true;
this.labelappName.Font = new System.Drawing.Font("Segoe UI Semibold", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.labelappName.Location = new System.Drawing.Point(82, 9);
this.labelappName.Name = "labelappName";
this.labelappName.Size = new System.Drawing.Size(76, 20);
this.labelappName.TabIndex = 6;
this.labelappName.Text = "appName";
//
// labelappVer
//
this.labelappVer.AutoSize = true;
this.labelappVer.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.labelappVer.Location = new System.Drawing.Point(82, 29);
this.labelappVer.Name = "labelappVer";
this.labelappVer.Size = new System.Drawing.Size(44, 15);
this.labelappVer.TabIndex = 6;
this.labelappVer.Text = "appVer";
//
// linkLabelGitHub
//
this.linkLabelGitHub.AutoSize = true;
this.linkLabelGitHub.Location = new System.Drawing.Point(316, 38);
this.linkLabelGitHub.Name = "linkLabelGitHub";
this.linkLabelGitHub.Size = new System.Drawing.Size(45, 15);
this.linkLabelGitHub.TabIndex = 7;
this.linkLabelGitHub.TabStop = true;
this.linkLabelGitHub.Text = "GitHub";
this.linkLabelGitHub.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelGitHub_LinkClicked);
//
// linkLabelFreepik
//
this.linkLabelFreepik.AutoSize = true;
this.linkLabelFreepik.Location = new System.Drawing.Point(12, 79);
this.linkLabelFreepik.Name = "linkLabelFreepik";
this.linkLabelFreepik.Size = new System.Drawing.Size(45, 15);
this.linkLabelFreepik.TabIndex = 7;
this.linkLabelFreepik.TabStop = true;
this.linkLabelFreepik.Text = "Freepik";
this.linkLabelFreepik.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelFreepik_LinkClicked);
//
// frmAbout
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(403, 148);
this.Controls.Add(this.linkLabelFreepik);
this.Controls.Add(this.linkLabelGitHub);
this.Controls.Add(this.labelappVer);
this.Controls.Add(this.labelappName);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.linkLabelwowks);
this.Controls.Add(this.linkLabelSource);
this.Controls.Add(this.labelCopy);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmAbout";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "appName";
this.Load += new System.EventHandler(this.frmAbout_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private PictureBox pictureBox1;
private Label label1;
private Label label2;
private Label labelCopy;
private LinkLabel linkLabelSource;
private LinkLabel linkLabelwowks;
private Button buttonOK;
private Label labelappName;
private Label labelappVer;
private LinkLabel linkLabelGitHub;
private LinkLabel linkLabelFreepik;
}
}

118
src/kru.gui/frmAbout.cs Normal file
View File

@ -0,0 +1,118 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace kru.gui
{
public partial class frmAbout : Form
{
public frmAbout()
{
InitializeComponent();
}
public string archbitness = "x86";
public void bitness()
{
if (Environment.Is64BitProcess == true && Environment.Is64BitOperatingSystem == true)
{
archbitness = "x64";
}
else
{
archbitness = "x86";
}
}
private void frmAbout_Load(object sender, EventArgs e)
{
bitness();
var appVer = Assembly.GetEntryAssembly()!.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion;
var appName = Assembly.GetEntryAssembly()!.GetCustomAttribute<AssemblyProductAttribute>()!.Product;
var appCopy = Assembly.GetEntryAssembly()!.GetCustomAttribute<AssemblyCopyrightAttribute>()!.Copyright;
this.Text = $@"{appName} {appVer} ({archbitness})";
labelappName.Text = $@"{appName} ({archbitness})";
labelappVer.Text = appVer;
labelCopy.Text = $@"Copyright © {appCopy}";
}
private void linkLabelSource_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process myProcess = new Process();
try
{
// true is the default, but it is important not to set it to false
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.FileName = "https://forum.csmania.ru/viewtopic.php?t=43274";
myProcess.Start();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
private void linkLabelwowks_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process myProcess = new Process();
try
{
// true is the default, but it is important not to set it to false
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.FileName = "https://forum.csmania.ru/memberlist.php?mode=viewprofile&u=59383";
myProcess.Start();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
private void buttonOK_Click(object sender, EventArgs e)
{
this.Close();
}
private void linkLabelGitHub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process myProcess = new Process();
try
{
// true is the default, but it is important not to set it to false
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.FileName = "https://github.com/AntinomyCollective/Retime-Phoneme-Util-GUI";
myProcess.Start();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
private void linkLabelFreepik_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process myProcess = new Process();
try
{
// true is the default, but it is important not to set it to false
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.FileName = "https://www.freepik.com/";
myProcess.Start();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}

1833
src/kru.gui/frmAbout.resx Normal file

File diff suppressed because it is too large Load Diff

View File

@ -38,15 +38,17 @@ partial class frmMain
this.fbBrowseInput = new System.Windows.Forms.FolderBrowserDialog();
this.fbBrowseOutput = new System.Windows.Forms.FolderBrowserDialog();
this.sfdOutput = new System.Windows.Forms.SaveFileDialog();
this.grpClean = new System.Windows.Forms.GroupBox();
this.rdClean = new System.Windows.Forms.RadioButton();
this.rdFixed = new System.Windows.Forms.RadioButton();
this.chkSaveLogs = new System.Windows.Forms.CheckBox();
this.groupBoxInput = new System.Windows.Forms.GroupBox();
this.groupBoxOutput = new System.Windows.Forms.GroupBox();
this.grpClean.SuspendLayout();
this.chkClean = new System.Windows.Forms.CheckBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtOutputClean = new System.Windows.Forms.TextBox();
this.btnBrowseOutputClean = new System.Windows.Forms.Button();
this.buttonAbout = new System.Windows.Forms.Button();
this.groupBoxInput.SuspendLayout();
this.groupBoxOutput.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// txtInput
@ -56,7 +58,7 @@ partial class frmMain
this.txtInput.Location = new System.Drawing.Point(5, 21);
this.txtInput.Margin = new System.Windows.Forms.Padding(2);
this.txtInput.Name = "txtInput";
this.txtInput.Size = new System.Drawing.Size(235, 23);
this.txtInput.Size = new System.Drawing.Size(292, 23);
this.txtInput.TabIndex = 1;
this.txtInput.TextChanged += new System.EventHandler(this.TxtInputTextChanged);
//
@ -67,14 +69,14 @@ partial class frmMain
this.txtOutput.Location = new System.Drawing.Point(5, 21);
this.txtOutput.Margin = new System.Windows.Forms.Padding(2);
this.txtOutput.Name = "txtOutput";
this.txtOutput.Size = new System.Drawing.Size(234, 23);
this.txtOutput.Size = new System.Drawing.Size(292, 23);
this.txtOutput.TabIndex = 3;
this.txtOutput.TextChanged += new System.EventHandler(this.TxtOutputTextChanged);
//
// btnBrowseInput
//
this.btnBrowseInput.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnBrowseInput.Location = new System.Drawing.Point(244, 21);
this.btnBrowseInput.Location = new System.Drawing.Point(301, 21);
this.btnBrowseInput.Margin = new System.Windows.Forms.Padding(2);
this.btnBrowseInput.Name = "btnBrowseInput";
this.btnBrowseInput.Size = new System.Drawing.Size(75, 23);
@ -86,7 +88,7 @@ partial class frmMain
// btnBrowseOutput
//
this.btnBrowseOutput.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnBrowseOutput.Location = new System.Drawing.Point(243, 21);
this.btnBrowseOutput.Location = new System.Drawing.Point(301, 21);
this.btnBrowseOutput.Margin = new System.Windows.Forms.Padding(2);
this.btnBrowseOutput.Name = "btnBrowseOutput";
this.btnBrowseOutput.Size = new System.Drawing.Size(75, 23);
@ -97,9 +99,9 @@ partial class frmMain
//
// btnSave
//
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSave.Enabled = false;
this.btnSave.Location = new System.Drawing.Point(11, 210);
this.btnSave.Location = new System.Drawing.Point(239, 233);
this.btnSave.Margin = new System.Windows.Forms.Padding(2);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(75, 23);
@ -112,7 +114,7 @@ partial class frmMain
//
this.btnStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnStart.Enabled = false;
this.btnStart.Location = new System.Drawing.Point(261, 210);
this.btnStart.Location = new System.Drawing.Point(318, 233);
this.btnStart.Margin = new System.Windows.Forms.Padding(2);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(75, 23);
@ -126,52 +128,13 @@ partial class frmMain
this.sfdOutput.Filter = "\"Batch File|*.bat|All files|*.*\"";
this.sfdOutput.FileOk += new System.ComponentModel.CancelEventHandler(this.sfdOutput_FileOk);
//
// grpClean
//
this.grpClean.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.grpClean.Controls.Add(this.rdClean);
this.grpClean.Controls.Add(this.rdFixed);
this.grpClean.Location = new System.Drawing.Point(5, 48);
this.grpClean.Margin = new System.Windows.Forms.Padding(2);
this.grpClean.Name = "grpClean";
this.grpClean.Padding = new System.Windows.Forms.Padding(2);
this.grpClean.Size = new System.Drawing.Size(224, 69);
this.grpClean.TabIndex = 8;
this.grpClean.TabStop = false;
this.grpClean.Text = "Mode:";
//
// rdClean
//
this.rdClean.AutoSize = true;
this.rdClean.Location = new System.Drawing.Point(4, 43);
this.rdClean.Margin = new System.Windows.Forms.Padding(2);
this.rdClean.Name = "rdClean";
this.rdClean.Size = new System.Drawing.Size(55, 19);
this.rdClean.TabIndex = 1;
this.rdClean.Text = "Clean";
this.rdClean.UseVisualStyleBackColor = true;
//
// rdFixed
//
this.rdFixed.AutoSize = true;
this.rdFixed.Checked = true;
this.rdFixed.Location = new System.Drawing.Point(4, 20);
this.rdFixed.Margin = new System.Windows.Forms.Padding(2);
this.rdFixed.Name = "rdFixed";
this.rdFixed.Size = new System.Drawing.Size(98, 19);
this.rdFixed.TabIndex = 0;
this.rdFixed.TabStop = true;
this.rdFixed.Text = "Fixed(default)";
this.rdFixed.UseVisualStyleBackColor = true;
//
// chkSaveLogs
//
this.chkSaveLogs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.chkSaveLogs.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.chkSaveLogs.AutoSize = true;
this.chkSaveLogs.Checked = true;
this.chkSaveLogs.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkSaveLogs.Location = new System.Drawing.Point(243, 98);
this.chkSaveLogs.Location = new System.Drawing.Point(92, 236);
this.chkSaveLogs.Margin = new System.Windows.Forms.Padding(2);
this.chkSaveLogs.Name = "chkSaveLogs";
this.chkSaveLogs.Size = new System.Drawing.Size(75, 19);
@ -187,7 +150,7 @@ partial class frmMain
this.groupBoxInput.Controls.Add(this.btnBrowseInput);
this.groupBoxInput.Location = new System.Drawing.Point(12, 12);
this.groupBoxInput.Name = "groupBoxInput";
this.groupBoxInput.Size = new System.Drawing.Size(324, 63);
this.groupBoxInput.Size = new System.Drawing.Size(381, 63);
this.groupBoxInput.TabIndex = 10;
this.groupBoxInput.TabStop = false;
this.groupBoxInput.Text = "Input folder:";
@ -198,38 +161,104 @@ partial class frmMain
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxOutput.Controls.Add(this.txtOutput);
this.groupBoxOutput.Controls.Add(this.btnBrowseOutput);
this.groupBoxOutput.Controls.Add(this.chkSaveLogs);
this.groupBoxOutput.Controls.Add(this.grpClean);
this.groupBoxOutput.Location = new System.Drawing.Point(12, 81);
this.groupBoxOutput.Name = "groupBoxOutput";
this.groupBoxOutput.Size = new System.Drawing.Size(323, 122);
this.groupBoxOutput.Size = new System.Drawing.Size(381, 63);
this.groupBoxOutput.TabIndex = 11;
this.groupBoxOutput.TabStop = false;
this.groupBoxOutput.Text = "Output folder:";
//
// chkClean
//
this.chkClean.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.chkClean.AutoSize = true;
this.chkClean.Location = new System.Drawing.Point(5, 50);
this.chkClean.Margin = new System.Windows.Forms.Padding(2);
this.chkClean.Name = "chkClean";
this.chkClean.Size = new System.Drawing.Size(112, 19);
this.chkClean.TabIndex = 9;
this.chkClean.Text = "Save Clean copy";
this.chkClean.UseVisualStyleBackColor = true;
this.chkClean.CheckedChanged += new System.EventHandler(this.chkClean_CheckedChanged);
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.txtOutputClean);
this.groupBox1.Controls.Add(this.btnBrowseOutputClean);
this.groupBox1.Controls.Add(this.chkClean);
this.groupBox1.Location = new System.Drawing.Point(12, 150);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(381, 74);
this.groupBox1.TabIndex = 11;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Output folder for clean files (Optional):";
//
// txtOutputClean
//
this.txtOutputClean.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtOutputClean.Enabled = false;
this.txtOutputClean.Location = new System.Drawing.Point(5, 21);
this.txtOutputClean.Margin = new System.Windows.Forms.Padding(2);
this.txtOutputClean.Name = "txtOutputClean";
this.txtOutputClean.Size = new System.Drawing.Size(292, 23);
this.txtOutputClean.TabIndex = 3;
this.txtOutputClean.TextChanged += new System.EventHandler(this.TxtOutputTextChanged);
//
// btnBrowseOutputClean
//
this.btnBrowseOutputClean.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnBrowseOutputClean.Enabled = false;
this.btnBrowseOutputClean.Location = new System.Drawing.Point(301, 21);
this.btnBrowseOutputClean.Margin = new System.Windows.Forms.Padding(2);
this.btnBrowseOutputClean.Name = "btnBrowseOutputClean";
this.btnBrowseOutputClean.Size = new System.Drawing.Size(75, 23);
this.btnBrowseOutputClean.TabIndex = 5;
this.btnBrowseOutputClean.Text = "Browse";
this.btnBrowseOutputClean.UseVisualStyleBackColor = true;
this.btnBrowseOutputClean.Click += new System.EventHandler(this.BtnBrowseOutputCleanClick);
//
// buttonAbout
//
this.buttonAbout.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonAbout.Location = new System.Drawing.Point(12, 233);
this.buttonAbout.Name = "buttonAbout";
this.buttonAbout.Size = new System.Drawing.Size(75, 23);
this.buttonAbout.TabIndex = 12;
this.buttonAbout.Text = "About";
this.buttonAbout.UseVisualStyleBackColor = true;
this.buttonAbout.Click += new System.EventHandler(this.buttonAbout_Click);
//
// frmMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(347, 244);
this.ClientSize = new System.Drawing.Size(404, 267);
this.Controls.Add(this.buttonAbout);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.chkSaveLogs);
this.Controls.Add(this.groupBoxOutput);
this.Controls.Add(this.groupBoxInput);
this.Controls.Add(this.btnStart);
this.Controls.Add(this.btnSave);
this.HelpButton = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(2);
this.MinimumSize = new System.Drawing.Size(363, 283);
this.MinimumSize = new System.Drawing.Size(420, 306);
this.Name = "frmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Retime Phoneme Util GUI 1.0.0.0";
this.Text = "appName";
this.Load += new System.EventHandler(this.frmMain_Load);
this.grpClean.ResumeLayout(false);
this.grpClean.PerformLayout();
this.groupBoxInput.ResumeLayout(false);
this.groupBoxInput.PerformLayout();
this.groupBoxOutput.ResumeLayout(false);
this.groupBoxOutput.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
@ -243,10 +272,12 @@ partial class frmMain
private FolderBrowserDialog fbBrowseInput;
private FolderBrowserDialog fbBrowseOutput;
private SaveFileDialog sfdOutput;
private GroupBox grpClean;
private RadioButton rdClean;
private RadioButton rdFixed;
private CheckBox chkSaveLogs;
private GroupBox groupBoxInput;
private GroupBox groupBoxOutput;
private CheckBox chkClean;
private GroupBox groupBox1;
private TextBox txtOutputClean;
private Button btnBrowseOutputClean;
private Button buttonAbout;
}

View File

@ -1,10 +1,27 @@
using System.Reflection;
using kru.gui;
namespace ConverterGui;
public partial class frmMain : Form
{
public frmMain() => InitializeComponent();
public string archbitness = "x86";
public void bitness()
{
if (Environment.Is64BitProcess == true && Environment.Is64BitOperatingSystem == true)
{
archbitness = "x64";
}
else
{
archbitness = "x86";
}
}
private void BtnBrowseOutputClick(object sender, EventArgs e) => this.txtOutput.Text = this.fbBrowseOutput.ShowDialog() == DialogResult.OK ? this.fbBrowseOutput.SelectedPath : string.Empty;
private void BtnBrowseOutputCleanClick(object sender, EventArgs e) => this.txtOutputClean.Text = this.fbBrowseOutput.ShowDialog() == DialogResult.OK ? this.fbBrowseOutput.SelectedPath : string.Empty;
private void BtnBrowseInputClick(object sender, EventArgs e) => this.txtInput.Text = this.fbBrowseInput.ShowDialog() == DialogResult.OK ? this.fbBrowseInput.SelectedPath : string.Empty;
private void TxtOutputTextChanged(object sender, EventArgs e)
@ -29,14 +46,17 @@ public partial class frmMain : Form
.Select(a => a.GetBatchLine()));
}
MessageBox.Show("Done!");
MessageBox.Show(@"Done!",@"Success!",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
private void EnableButtons()
{
var enabled = !string.IsNullOrWhiteSpace(this.txtInput.Text)
&& !string.IsNullOrWhiteSpace(this.txtOutput.Text)
&& Directory.Exists(this.txtInput.Text);
//&& !string.IsNullOrWhiteSpace(this.txtOutputClean.Text)
&& Directory.Exists(this.txtInput.Text)
//&& Directory.Exists(this.txtOutputClean.Text)
&& Directory.Exists(this.txtOutput.Text);
this.btnSave.Enabled = this.btnStart.Enabled = enabled;
}
@ -46,12 +66,14 @@ public partial class frmMain : Form
{
Input = this.txtInput.Text,
Output = this.txtOutput.Text,
Clean = this.rdClean.Checked,
OutputClean = this.txtOutputClean.Text,
Clean = this.chkClean.Checked,
SaveLog = chkSaveLogs.Checked,
Bitness = archbitness
};
var commands = Directory
.GetFiles(options.Input, "*.wav")
.Select(inputFile => new Command(inputFile, Path.Combine(options.Output, Path.GetFileName(inputFile)), options.Clean, options.SaveLog))
.Select(inputFile => new Command(inputFile, Path.Combine(options.Output, Path.GetFileName(inputFile)), Path.Combine(options.OutputClean, Path.GetFileName(inputFile)), options.Clean, options.SaveLog,options.Bitness))
.ToArray();
return commands;
@ -68,16 +90,30 @@ public partial class frmMain : Form
await proc.WaitForExitAsync().ConfigureAwait(false);
}
this.Enabled = true;
MessageBox.Show("Done!");
MessageBox.Show(@"Done!", @"Success!", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void frmMain_Load(object sender, EventArgs e)
{
bitness();
var appVer = Assembly.GetEntryAssembly()!.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion;
var appName = Assembly.GetEntryAssembly()!.GetCustomAttribute<AssemblyProductAttribute>()!.Product;
this.Text = $@"{appName} {appVer} ({archbitness})";
}
private void sfdOutput_FileOk(object sender, System.ComponentModel.CancelEventArgs e)
{
}
private void chkClean_CheckedChanged(object sender, EventArgs e)
{
txtOutputClean.Enabled = btnBrowseOutputClean.Enabled = chkClean.Checked;
}
private void buttonAbout_Click(object sender, EventArgs e)
{
var frmabout = new frmAbout();
frmabout.ShowDialog();
}
}

View File

@ -18,9 +18,9 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/AntinomyCollective/Retime-Phoneme-Uti-GUI</RepositoryUrl>
<PackageTags>epicmorg, retime, Phoneme, Util, GUI, Antinomy, Collective</PackageTags>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<Version>1.0.0.0</Version>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
<Version>1.1.0.0</Version>
<Copyright>EpicMorg 2023</Copyright>
<Product>Retime Phoneme Util GUI</Product>
<IsPackable>true</IsPackable>
@ -30,6 +30,21 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="Tools\x64\libgcc_s_seh-1.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>