├── README.md
├── AssToolkit
├── AddNewEff.resources
├── MainForm.resources
├── Properties
│ ├── Resources.resources
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── app.config
├── AssToolkit.licenseheader
├── Program.cs
├── Srt2Ass
│ ├── WriteToFile.cs
│ ├── Configuration.cs
│ └── ConvertAlgorithm.cs
├── Ass2Srt
│ ├── AssReader.cs
│ ├── AssAnalyzer.cs
│ ├── SrtWriter.cs
│ ├── AssWriter.cs
│ ├── AssAnalyzerForAss.cs
│ └── AssAnalyzerForSrt.cs
├── AddNewEff.cs
├── AssToolkit.csproj
├── AddNewEff.resx
├── AddNewEff.Designer.cs
├── MainForm.cs
├── MainForm.resx
└── MainForm.designer.cs
├── AssToolkit.sln
├── .gitignore
└── LICENSE.txt
/README.md:
--------------------------------------------------------------------------------
1 | AssToolkit
2 | ==========
3 |
4 | ASS与SRT格式字幕文件相互转换工具,支持将SRT文本以预设特效转换为ASS字幕格式,支持将ASS以多语言多版本批量打包输出。
--------------------------------------------------------------------------------
/AssToolkit/AddNewEff.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dxcheng25/AssToolkit/HEAD/AssToolkit/AddNewEff.resources
--------------------------------------------------------------------------------
/AssToolkit/MainForm.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dxcheng25/AssToolkit/HEAD/AssToolkit/MainForm.resources
--------------------------------------------------------------------------------
/AssToolkit/Properties/Resources.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dxcheng25/AssToolkit/HEAD/AssToolkit/Properties/Resources.resources
--------------------------------------------------------------------------------
/AssToolkit/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AssToolkit/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AssToolkit.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssToolkit", "AssToolkit\AssToolkit.csproj", "{B4ED7071-672D-4ACB-B1EE-879A6CE071C1}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|x86 = Debug|x86
9 | Release|x86 = Release|x86
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {B4ED7071-672D-4ACB-B1EE-879A6CE071C1}.Debug|x86.ActiveCfg = Debug|x86
13 | {B4ED7071-672D-4ACB-B1EE-879A6CE071C1}.Debug|x86.Build.0 = Debug|x86
14 | {B4ED7071-672D-4ACB-B1EE-879A6CE071C1}.Release|x86.ActiveCfg = Release|x86
15 | {B4ED7071-672D-4ACB-B1EE-879A6CE071C1}.Release|x86.Build.0 = Release|x86
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/AssToolkit/AssToolkit.licenseheader:
--------------------------------------------------------------------------------
1 | extensions: designer.cs generated.cs
2 | extensions: .cs .cpp .h
3 | /************************************************************************
4 | *Copyright (C) 2013 David Cheng
5 | *Author: David Cheng
6 | ************************************************************************
7 | *
8 | *This program is free software; you can redistribute it and/or modify
9 | *it under the terms of the GNU General Public License as published by
10 | *the Free Software Foundation; either version 2 of the License, or
11 | *(at your option) any later version.
12 | *
13 | *This program is distributed in the hope that it will be useful,
14 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | *GNU General Public License for more details.
17 | *
18 | *You should have received a copy of the GNU General Public License along
19 | *with this program; if not, write to the Free Software Foundation, Inc.,
20 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 | ************************************************************************/
22 |
--------------------------------------------------------------------------------
/AssToolkit/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.261
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace AssToolkit.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/AssToolkit/Program.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.Windows.Forms;
24 |
25 | namespace AssToolkit
26 | {
27 | static class Program
28 | {
29 | ///
30 | /// 应用程序的主入口点。
31 | ///
32 | [STAThread]
33 | static void Main()
34 | {
35 | Application.EnableVisualStyles();
36 | Application.SetCompatibleTextRenderingDefault(false);
37 | Application.Run(new MainForm());
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
2 | [Bb]in/
3 | [Oo]bj/
4 |
5 | # mstest test results
6 | TestResults
7 |
8 | ## Ignore Visual Studio temporary files, build results, and
9 | ## files generated by popular Visual Studio add-ons.
10 |
11 | # User-specific files
12 | *.suo
13 | *.user
14 | *.sln.docstates
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Rr]elease/
19 | x64/
20 | *_i.c
21 | *_p.c
22 | *.ilk
23 | *.meta
24 | *.obj
25 | *.pch
26 | *.pdb
27 | *.pgc
28 | *.pgd
29 | *.rsp
30 | *.sbr
31 | *.tlb
32 | *.tli
33 | *.tlh
34 | *.tmp
35 | *.log
36 | *.vspscc
37 | *.vssscc
38 | .builds
39 |
40 | # Visual C++ cache files
41 | ipch/
42 | *.aps
43 | *.ncb
44 | *.opensdf
45 | *.sdf
46 |
47 | # Visual Studio profiler
48 | *.psess
49 | *.vsp
50 | *.vspx
51 |
52 | # Guidance Automation Toolkit
53 | *.gpState
54 |
55 | # ReSharper is a .NET coding add-in
56 | _ReSharper*
57 |
58 | # NCrunch
59 | *.ncrunch*
60 | .*crunch*.local.xml
61 |
62 | # Installshield output folder
63 | [Ee]xpress
64 |
65 | # DocProject is a documentation generator add-in
66 | DocProject/buildhelp/
67 | DocProject/Help/*.HxT
68 | DocProject/Help/*.HxC
69 | DocProject/Help/*.hhc
70 | DocProject/Help/*.hhk
71 | DocProject/Help/*.hhp
72 | DocProject/Help/Html2
73 | DocProject/Help/html
74 |
75 | # Click-Once directory
76 | publish
77 |
78 | # Publish Web Output
79 | *.Publish.xml
80 |
81 | # NuGet Packages Directory
82 | packages
83 |
84 | # Windows Azure Build Output
85 | csx
86 | *.build.csdef
87 |
88 | # Windows Store app package directory
89 | AppPackages/
90 |
91 | # Others
92 | [Bb]in
93 | [Oo]bj
94 | sql
95 | TestResults
96 | [Tt]est[Rr]esult*
97 | *.Cache
98 | ClientBin
99 | [Ss]tyle[Cc]op.*
100 | ~$*
101 | *.dbmdl
102 | Generated_Code #added for RIA/Silverlight projects
103 |
104 | # Backup & report files from converting an old project file to a newer
105 | # Visual Studio version. Backup files are not needed, because we have git ;-)
106 | _UpgradeReport_Files/
107 | Backup*/
108 | UpgradeLog*.XML
109 |
--------------------------------------------------------------------------------
/AssToolkit/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System.Reflection;
22 | using System.Runtime.CompilerServices;
23 | using System.Runtime.InteropServices;
24 | using System.Resources;
25 |
26 | // General Information about an assembly is controlled through the following
27 | // set of attributes. Change these attribute values to modify the information
28 | // associated with an assembly.
29 | [assembly: AssemblyTitle("AssToolkit")]
30 | [assembly: AssemblyDescription("")]
31 | [assembly: AssemblyConfiguration("")]
32 | [assembly: AssemblyCompany("")]
33 | [assembly: AssemblyProduct("AssToolkit")]
34 | [assembly: AssemblyCopyright("Copyright © 2013")]
35 | [assembly: AssemblyTrademark("")]
36 | [assembly: AssemblyCulture("")]
37 |
38 | // Setting ComVisible to false makes the types in this assembly not visible
39 | // to COM components. If you need to access a type in this assembly from
40 | // COM, set the ComVisible attribute to true on that type.
41 | [assembly: ComVisible(false)]
42 |
43 | // The following GUID is for the ID of the typelib if this project is exposed to COM
44 | [assembly: Guid("ccdae7bb-c43a-4308-b71f-e4cde300e0e0")]
45 |
46 | // Version information for an assembly consists of the following four values:
47 | //
48 | // Major Version
49 | // Minor Version
50 | // Build Number
51 | // Revision
52 | //
53 | // You can specify all the values or you can default the Build and Revision Numbers
54 | // by using the '*' as shown below:
55 | // [assembly: AssemblyVersion("1.0.*")]
56 | [assembly: AssemblyVersion("1.5.1.0")]
57 | [assembly: AssemblyFileVersion("1.5.1.0")]
58 | [assembly: NeutralResourcesLanguageAttribute("zh-Hans")]
59 |
--------------------------------------------------------------------------------
/AssToolkit/Srt2Ass/WriteToFile.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.Text;
24 | using System.IO;
25 |
26 | namespace Srt2Ass
27 | {
28 | class WriteToFile
29 | {
30 | FileStream FS;
31 | StreamWriter writeTmpUnicode;
32 |
33 |
34 | public WriteToFile(string fileDtn)
35 | {
36 | string fileName;
37 | fileName = fileDtn.Substring(0, fileDtn.LastIndexOf('.'));
38 | FS = new FileStream(fileName + ".tmp", FileMode.Append);
39 | //writeTmpUnicode = new StreamWriter(FS, Encoding.Unicode);
40 | //Now use UTF8 to make it work on UNIX-like Systems
41 | writeTmpUnicode = new StreamWriter(FS, Encoding.UTF8);
42 | }
43 |
44 | public void WriteASS(string[] ScriptInfo, string[]V4Style, string events, Queue qSubs, string encodeType)
45 | {
46 | writeTmpUnicode.WriteLine("[Script Info]");
47 | foreach (string strScriptInfo in ScriptInfo)
48 | {
49 | writeTmpUnicode.WriteLine(strScriptInfo);
50 | }
51 | writeTmpUnicode.WriteLine("");
52 | writeTmpUnicode.WriteLine("[V4+ Styles]");
53 | foreach (string strV4Style in V4Style)
54 | {
55 | writeTmpUnicode.WriteLine(strV4Style);
56 | }
57 | writeTmpUnicode.WriteLine("");
58 | writeTmpUnicode.WriteLine("[Events]");
59 | writeTmpUnicode.WriteLine(events);
60 |
61 | while (qSubs.Count != 0)
62 | {
63 | writeTmpUnicode.WriteLine(qSubs.Dequeue());
64 | }
65 |
66 | writeTmpUnicode.Flush();
67 | }
68 |
69 | public void CloseFile()
70 | {
71 | FS.Close();
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/AssToolkit/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34003
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace AssToolkit.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AssToolkit.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/AssToolkit/Ass2Srt/AssReader.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.Text;
24 | using System.IO;
25 |
26 | namespace Ass2Srt
27 | {
28 | class AssReader
29 | {
30 | string filePath;
31 | string fileContent;
32 | FileStream fs;
33 | StreamReader sr;
34 |
35 | public AssReader(string filePath)
36 | {
37 | this.filePath = filePath;
38 | }
39 |
40 | public bool IsValid()
41 | {
42 | try
43 | {
44 | fs = new FileStream(filePath, FileMode.Open);
45 | sr = new StreamReader(fs, true);
46 |
47 | if (fs.Length > 1024 * 1024 || fs.Length <= 0) //文件不得大于1M
48 | {
49 | return false;
50 | }
51 |
52 | else
53 | {
54 | fileContent = sr.ReadToEnd();
55 |
56 | if (fileContent.Contains("Dialogue:"))
57 | {
58 | return true;
59 | }
60 |
61 | else
62 | {
63 | return false;
64 | }
65 | }
66 | }
67 |
68 | catch (Exception)
69 | {
70 | return false;
71 | }
72 |
73 | finally
74 | {
75 | fs.Close();
76 | }
77 | }
78 |
79 | public string ReadDialogues()
80 | {
81 | string strDialogues;
82 | int firstDialoguePos = fileContent.IndexOf("Dialogue");
83 | strDialogues = fileContent.Substring(firstDialoguePos);
84 |
85 | return strDialogues;
86 | }
87 |
88 | public string ReadDescription()
89 | {
90 | string strDescription;
91 | int firstDialoguePos = fileContent.IndexOf("Dialogue");
92 | strDescription = fileContent.Substring(0, firstDialoguePos);
93 |
94 | return strDescription;
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/AssToolkit/AddNewEff.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.ComponentModel;
24 | using System.Data;
25 | using System.Drawing;
26 | using System.Text;
27 | using System.Windows.Forms;
28 | using Srt2Ass;
29 |
30 | namespace AssToolkit
31 | {
32 | public partial class AddNewEff : Form
33 | {
34 | public bool IsModification = false;
35 |
36 | public AddNewEff()
37 | {
38 | InitializeComponent();
39 | IsModification = false;
40 | }
41 |
42 | public AddNewEff(string name, string[] scriptInfo, string[] v4Style, string events, string engStyle)
43 | {
44 | InitializeComponent();
45 | IsModification = true;
46 | tbVS.Lines = v4Style;
47 | tbSI.Lines = scriptInfo;
48 | tbEng.Text = engStyle;
49 | tbEvents.Text = events;
50 | tbEffName.Text = name;
51 | }
52 |
53 | private void btnSaveEffect_Click(object sender, EventArgs e)
54 | {
55 | string[] strScriptInfo = tbSI.Lines;
56 | string[] strV4Style = tbVS.Lines;
57 | string events = tbEvents.Text;
58 | string engEffect = tbEng.Text;
59 | string name = tbEffName.Text;
60 | try
61 | {
62 | if (tbEvents.Text == "" || tbSI.Text == "" || tbVS.Text == "")
63 | {
64 | throw new Exception("请补全特效代码");
65 | }
66 |
67 | if (IsModification)
68 | {
69 | Configuration.CreateEffectProfile(name, strScriptInfo, strV4Style, events, engEffect);
70 | MessageBox.Show("特效已经修改", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
71 | this.Close();
72 | }
73 |
74 | else
75 | {
76 | if (!Configuration.CfgProfiles.ContainsKey(name))
77 | {
78 | Configuration.CreateEffectProfile(name, strScriptInfo, strV4Style, events, engEffect);
79 | MessageBox.Show("新特效已添加", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
80 | this.Close();
81 | }
82 |
83 | else
84 | {
85 | throw new Exception("特效名重复 请更换");
86 | }
87 | }
88 | }
89 |
90 | catch (Exception ex)
91 | {
92 | MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
93 | }
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/AssToolkit/Ass2Srt/AssAnalyzer.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.Text;
24 | using Microsoft.VisualBasic;
25 |
26 | namespace Ass2Srt
27 | {
28 | class AssAnalyzer
29 | {
30 | protected string ConvertToTrad(string strDialogue)
31 | {
32 | return (Microsoft.VisualBasic.Strings.StrConv(strDialogue as String, Microsoft.VisualBasic.VbStrConv.TraditionalChinese, 0));
33 | //return "";
34 | }
35 |
36 | protected string[] SplitString(string originalString, string seperator)
37 | {
38 | List lSS = new List();
39 | while (true)
40 | {
41 | int index = originalString.IndexOf(seperator);
42 | if (index >= 0)
43 | {
44 | lSS.Add(originalString.Substring(0, index));
45 | originalString = originalString.Substring(index + 2);
46 | }
47 |
48 | else
49 | {
50 | lSS.Add(originalString);
51 | break;
52 | }
53 | }
54 |
55 | return lSS.ToArray();
56 | }
57 |
58 | protected string[] DialogueSplitter(string strDialogues)
59 | {
60 | string[] strSplittedDialogues = SplitString(strDialogues, "\r\n");
61 |
62 | return strSplittedDialogues;
63 | }
64 |
65 | protected int CountDigitsInString(string strDialogues)
66 | {
67 | int numDigits = 0;
68 | for (int i = 0; i < strDialogues.Length; ++i)
69 | {
70 | if (strDialogues[i] >= '0' && strDialogues[i] <= '9')
71 | {
72 | ++numDigits;
73 | }
74 | }
75 |
76 | return numDigits;
77 | }
78 |
79 | protected int CountSpacesInString(string strDialogues)
80 | {
81 | int numDigits = 0;
82 | for (int i = 0; i < strDialogues.Length; ++i)
83 | {
84 | if (strDialogues[i] == ' ')
85 | {
86 | ++numDigits;
87 | }
88 | }
89 |
90 | return numDigits;
91 | }
92 |
93 | protected int CountLettersInString(string strDialogues, char l)
94 | {
95 | int numDigits = 0;
96 | for (int i = 0; i < strDialogues.Length; ++i)
97 | {
98 | if (strDialogues[i] == l)
99 | {
100 | ++numDigits;
101 | }
102 | }
103 |
104 | return numDigits;
105 | }
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/AssToolkit/Ass2Srt/SrtWriter.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.Text;
24 | using System.IO;
25 |
26 | namespace Ass2Srt
27 | {
28 | class SrtWriter
29 | {
30 | string strFileName;
31 | string strFolderPath;
32 | string strNewFolderPath;
33 | int type;
34 | FileStream fs;
35 | StreamWriter sw;
36 |
37 | public SrtWriter(string strFolderPath, string strFileNameWithoutExtension, int type)
38 | {
39 | this.strFolderPath = strFolderPath;
40 | this.strFileName = strFileNameWithoutExtension;
41 | this.type = type;
42 | }
43 |
44 | public bool WriteSrtFile(string[] strSrtLines)
45 | {
46 | CreateFolder();
47 | switch (type)
48 | {
49 | case 0:
50 | strFileName += ".简体&英文";
51 | break;
52 | case 1:
53 | strFileName += ".繁体&英文";
54 | break;
55 | case 2:
56 | strFileName += ".简体";
57 | break;
58 | case 3:
59 | strFileName += ".繁体";
60 | break;
61 | case 4:
62 | strFileName += ".英文";
63 | break;
64 | }
65 |
66 | strFileName += ".srt";
67 |
68 | try
69 | {
70 | fs = new FileStream(strNewFolderPath + "\\" + strFileName, FileMode.OpenOrCreate);
71 | //if (type == 0 || type == 2)
72 | //{
73 | // sw = new StreamWriter(fs, Encoding.GetEncoding(936));
74 | //}
75 | //else if (type == 1 || type == 3)
76 | //{
77 | // sw = new StreamWriter(fs, Encoding.GetEncoding(950));
78 | //}
79 | //else
80 | //{
81 | //sw = new StreamWriter(fs, Encoding.Unicode);
82 | //Now use UTF8 to make it work on UNIX-like systems.
83 | sw = new StreamWriter(fs, Encoding.UTF8);
84 | //}
85 |
86 | foreach (string s in strSrtLines)
87 | {
88 | sw.WriteLine(s);
89 | sw.Flush();
90 | }
91 |
92 | fs.Close();
93 | return true;
94 | }
95 |
96 | catch(Exception)
97 | {
98 | return false;
99 | }
100 | }
101 |
102 | private void CreateFolder()
103 | {
104 | string strDirectoryName = strFolderPath + "\\" + strFileName;
105 | if (Directory.Exists(strDirectoryName))
106 | {
107 |
108 | }
109 |
110 | else
111 | {
112 | Directory.CreateDirectory(strDirectoryName);
113 | }
114 |
115 | strNewFolderPath = strDirectoryName;
116 | }
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/AssToolkit/Ass2Srt/AssWriter.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.Text;
24 | using System.IO;
25 |
26 | namespace Ass2Srt
27 | {
28 | class AssWriter
29 | {
30 | string strFileName;
31 | string strFolderPath;
32 | string strNewFolderPath;
33 | int type;
34 | FileStream fs;
35 | StreamWriter sw;
36 |
37 | public AssWriter(string strFolderPath, string strFileNameWithoutExtension, int type)
38 | {
39 | this.strFolderPath = strFolderPath;
40 | this.strFileName = strFileNameWithoutExtension;
41 | this.type = type; // 5-简英 6-繁英 7-简体 8-繁体 9-英文
42 | }
43 |
44 | public bool WriteAssFile(string[] strAssDescription, string[] strAssDialogues)
45 | {
46 | CreateFolder();
47 | switch (type)
48 | {
49 | case 5:
50 | strFileName += ".简体&英文";
51 | break;
52 | case 6:
53 | strFileName += ".繁体&英文";
54 | break;
55 | case 7:
56 | strFileName += ".简体";
57 | break;
58 | case 8:
59 | strFileName += ".繁体";
60 | break;
61 | case 9:
62 | strFileName += ".英文";
63 | break;
64 | }
65 |
66 | strFileName += ".ass";
67 |
68 | try
69 | {
70 | fs = new FileStream(strNewFolderPath + "\\" + strFileName, FileMode.OpenOrCreate);
71 | //if (type == 0 || type == 2)
72 | //{
73 | // sw = new StreamWriter(fs, Encoding.GetEncoding(936));
74 | //}
75 | //else if (type == 1 || type == 3)
76 | //{
77 | // sw = new StreamWriter(fs, Encoding.GetEncoding(950));
78 | //}
79 | //else
80 | //{
81 | //sw = new StreamWriter(fs, Encoding.Unicode);
82 | //NOW USE UTF8 to make it work on UNIX-like systems.
83 | sw = new StreamWriter(fs, Encoding.UTF8);
84 | //}
85 |
86 | for(int i = 0; i < strAssDescription.Length - 1; i++)
87 | {
88 | sw.WriteLine(strAssDescription[i]);
89 | sw.Flush();
90 | }
91 |
92 | foreach(string s in strAssDialogues)
93 | {
94 | sw.WriteLine(s);
95 | sw.Flush();
96 | }
97 |
98 | fs.Close();
99 | return true;
100 | }
101 |
102 | catch(Exception)
103 | {
104 | return false;
105 | }
106 | }
107 |
108 | private void CreateFolder()
109 | {
110 | string strDirectoryName = strFolderPath + "\\" + strFileName;
111 | if (Directory.Exists(strDirectoryName))
112 | {
113 |
114 | }
115 |
116 | else
117 | {
118 | Directory.CreateDirectory(strDirectoryName);
119 | }
120 |
121 | strNewFolderPath = strDirectoryName;
122 | }
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/AssToolkit/AssToolkit.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 | 8.0.30703
7 | 2.0
8 | {B4ED7071-672D-4ACB-B1EE-879A6CE071C1}
9 | WinExe
10 | Properties
11 | AssToolkit
12 | AssToolkit
13 | v2.0
14 | 512
15 |
16 |
17 | x86
18 | True
19 | full
20 | False
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | x86
28 | pdbonly
29 | True
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 | true
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Form
49 |
50 |
51 | AddNewEff.cs
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | Form
60 |
61 |
62 | MainForm.cs
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | AddNewEff.cs
72 |
73 |
74 | MainForm.cs
75 |
76 |
77 | ResXFileCodeGenerator
78 | Resources.Designer.cs
79 | Designer
80 |
81 |
82 | True
83 | Resources.resx
84 | True
85 |
86 |
87 |
88 |
89 | SettingsSingleFileGenerator
90 | Settings.Designer.cs
91 |
92 |
93 | True
94 | Settings.settings
95 | True
96 |
97 |
98 |
99 |
100 |
107 |
--------------------------------------------------------------------------------
/AssToolkit/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/AssToolkit/AddNewEff.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | ; // The sub is created by AssToolkit
122 | ; // AssToolkit is an ASS Converter designed by David C.
123 | ; // 欢迎访问人人影视 http://www.YYeTs.com
124 | Title:YYeTs
125 | Original Script:YYeTs
126 | Synch Point:0
127 | ScriptType:v4.00+
128 | Collisions:Normal
129 | Timer:100.0000
130 |
131 |
--------------------------------------------------------------------------------
/AssToolkit/Ass2Srt/AssAnalyzerForAss.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.Text;
24 | using System.Text.RegularExpressions;
25 |
26 | namespace Ass2Srt
27 | {
28 | class AssAnalyzerForAss : AssAnalyzer
29 | {
30 | string strDialogues;
31 | string strDescriptions;
32 | int type;
33 | bool DoubleOrSingle;
34 |
35 | public AssAnalyzerForAss(string strDialogues, string strDescriptions, int type, bool DoubleOrSingle)
36 | {
37 | this.strDialogues = strDialogues;
38 | this.strDescriptions = strDescriptions;
39 | this.type = type; // 5-简英 6-繁英 7-简体 8-繁体 9-英文
40 | this.DoubleOrSingle = DoubleOrSingle;
41 | }
42 |
43 | public void Analyze(out string[] oDescriptions, out string[] oDialogues)
44 | {
45 | string[] ssDialogues = DialogueSplitter(strDialogues);
46 | string[] ssDescription = DialogueSplitter(strDescriptions);
47 | string[] ssDialoguesProcessed = DialogueProcessor(ssDialogues);
48 |
49 | oDialogues = ssDialoguesProcessed;
50 | oDescriptions = ssDescription;
51 | }
52 |
53 | public string[] DialogueProcessor(string[] ssDialogues)
54 | {
55 | if (type == 5)
56 | {
57 | return ssDialogues;
58 | }
59 |
60 | List lDialogues = new List();
61 | List lSimpChiSubs = new List();
62 | List lEngSubs = new List();
63 | Regex rx = new Regex(@"[^\{^\}]+");
64 | Regex exEngOrChi = new Regex(@"[\u4e00-\u9fa5]");
65 |
66 | foreach (string s in ssDialogues)
67 | {
68 | string strDiag = "";
69 | lSimpChiSubs.Clear();
70 | lEngSubs.Clear();
71 | MatchCollection MC = rx.Matches(s);
72 | foreach (Match M in MC)
73 | {
74 | if (M.ToString() == "" || M.ToString()[0] == '\\')
75 | {
76 | continue;
77 | }
78 |
79 | else
80 | {
81 | //if (M.ToString().Contains("Dialogue:"))
82 | //{
83 | // string[] tss = SplitString(M.ToString(), ",,");
84 | // if (tss[tss.Length - 1] != "")
85 | // {
86 | // strDiag += tss[tss.Length - 1];
87 | // }
88 | //}
89 |
90 | //else
91 | //{
92 | // strDiag += M.ToString();
93 | //}
94 |
95 | if (DoubleOrSingle)
96 | {
97 | //M.ToString()ing[] ss = SplitM.ToString()ing(M.ToString()Diag, "\\N");
98 | //foreach (M.ToString()ing M.ToString() in ss)
99 | //{
100 | if (M.ToString() != "")
101 | {
102 | if (exEngOrChi.IsMatch(M.ToString()))
103 | {
104 | lSimpChiSubs.Add(M.ToString());
105 | }
106 |
107 | else
108 | {
109 | if (!M.ToString().Contains("Dialogue:") && !M.ToString().Contains("YYeTs"))
110 | {
111 | lEngSubs.Add(M.ToString());
112 | }
113 | }
114 | //}
115 | }
116 | }
117 |
118 | else
119 | {
120 | if (M.ToString() != "")
121 | {
122 | lSimpChiSubs.Add(M.ToString());
123 | }
124 | }
125 | }
126 | }
127 |
128 | switch (type)
129 | {
130 | case 6:
131 | {
132 | strDiag = CvrtSubToTradChi(s, lSimpChiSubs);
133 | if (strDiag != "")
134 | {
135 | lDialogues.Add(strDiag);
136 | }
137 | break;
138 | }
139 |
140 | case 7:
141 | {
142 | strDiag = DeleteEngSub(s, lEngSubs);
143 | if (strDiag != "")
144 | {
145 | lDialogues.Add(strDiag);
146 | }
147 | break;
148 | }
149 |
150 | case 8:
151 | {
152 | strDiag = CvrtSubToTradChi(s, lSimpChiSubs);
153 | strDiag = DeleteEngSub(strDiag, lEngSubs);
154 | if (strDiag != "")
155 | {
156 | lDialogues.Add(strDiag);
157 | }
158 | break;
159 | }
160 | }
161 | }
162 |
163 | return lDialogues.ToArray();
164 | }
165 |
166 | //public string[] DescriptionProcessor(string[] ssDialogues)
167 | //{
168 |
169 | //}
170 |
171 | private string DeleteEngSub(string strDialogue, List lEngSubs)
172 | {
173 | string strProcessed = "";
174 | Regex exEngOrChi = new Regex(@"[\u4e00-\u9fa5]");
175 |
176 | foreach (string strEngSub in lEngSubs)
177 | {
178 | if (strEngSub != " " && !strEngSub.Contains("■") && strDialogue.Contains("\\N"))
179 | {
180 | strDialogue = strDialogue.Replace(strEngSub, "\\*tObErEmOvEd*/");
181 | }
182 | }
183 |
184 | string[] ss = SplitString(strDialogue, "\\N");
185 |
186 | for(int i = 0; i < ss.Length; i++)
187 | {
188 | if (ss[i].Contains("\\*tObErEmOvEd*/"))
189 | {
190 | continue;
191 | }
192 |
193 | else
194 | {
195 | if (i == 0)
196 | {
197 | strProcessed += ss[i];
198 | }
199 |
200 | else
201 | {
202 | strProcessed += ("\\N" + ss[i]);
203 | }
204 | }
205 | }
206 |
207 | return strProcessed;
208 | }
209 |
210 | private string CvrtSubToTradChi(string strDialogue, List lSimpChiSubs)
211 | {
212 | List lTradChiSubs = new List();
213 | string strProcessed = strDialogue;
214 |
215 | foreach (string sSimpChiSub in lSimpChiSubs)
216 | {
217 | lTradChiSubs.Add(ConvertToTrad(sSimpChiSub));
218 | }
219 |
220 | for (int i = 0; i < lSimpChiSubs.Count; i++)
221 | {
222 | strProcessed = strProcessed.Replace(lSimpChiSubs[i], lTradChiSubs[i]);
223 | }
224 |
225 | return strProcessed;
226 | }
227 | }
228 | }
229 |
--------------------------------------------------------------------------------
/AssToolkit/Srt2Ass/Configuration.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.Text;
24 | using System.Xml;
25 | using System.Collections;
26 | using System.Windows.Forms;
27 |
28 | namespace Srt2Ass
29 | {
30 | public static class Configuration
31 | {
32 | static public Hashtable CfgProfiles = new Hashtable();
33 |
34 | public static void CreateMainCfgXML()
35 | {
36 | XmlDocument mainCfgXml = new XmlDocument();
37 | XmlElement mainCfgXmlElement_Root;
38 | XmlDeclaration mainCfgXmlDeclare = mainCfgXml.CreateXmlDeclaration("1.0", "UTF-8", "yes");
39 | mainCfgXmlElement_Root = mainCfgXml.CreateElement("StyleName_Path");
40 | mainCfgXml.AppendChild(mainCfgXmlElement_Root);
41 | mainCfgXml.Save(Application.StartupPath + "\\MainCfg.xml");
42 | }
43 |
44 | public static void LoadORCreateMainXML()
45 | {
46 | XmlDocument mainCfgXml = new XmlDocument();
47 | try
48 | {
49 | mainCfgXml.Load(Application.StartupPath + "\\MainCfg.xml");
50 | LoadMainCfgXML();
51 | }
52 |
53 | catch (Exception)
54 | {
55 | CreateMainCfgXML();
56 | LoadMainCfgXML();
57 | }
58 | }
59 |
60 | public static void LoadMainCfgXML()
61 | {
62 | CfgProfiles.Clear();
63 | XmlDocument mainCfgXml = new XmlDocument();
64 | mainCfgXml.Load(Application.StartupPath + "\\MainCfg.xml");
65 |
66 | XmlNodeList nodes = mainCfgXml.ChildNodes.Item(0).ChildNodes;
67 | foreach (XmlElement node in nodes)
68 | {
69 | CfgProfiles.Add(node.Attributes.Item(0).Value.ToString(), node.ChildNodes.Item(0).Attributes.Item(0).Value.ToString());
70 | }
71 | }
72 |
73 | public static void ModifyMainCfgXML(string name, string path, bool ExistsOrNot)
74 | {
75 | XmlDocument mainCfgXml = new XmlDocument();
76 | mainCfgXml.Load(Application.StartupPath + "\\MainCfg.xml");
77 | XmlNode rootNode = mainCfgXml.ChildNodes.Item(0);
78 | if (!ExistsOrNot)
79 | {
80 | XmlElement elem = mainCfgXml.CreateElement("Style");
81 | elem.SetAttribute("Name", name);
82 | rootNode.AppendChild(elem);
83 | XmlElement elem2 = mainCfgXml.CreateElement("Path");
84 | elem2.SetAttribute("Dtn", path);
85 | elem.AppendChild(elem2);
86 | CfgProfiles.Add(name, path);
87 | }
88 |
89 | mainCfgXml.Save(Application.StartupPath + "\\MainCfg.xml");
90 | }
91 |
92 | public static void CreateEffectProfile(string name, string[] scriptInfo, string[] V4Style, string events, string engEffect)
93 | {
94 | XmlDocument effProfile = new XmlDocument();
95 |
96 | effProfile.CreateXmlDeclaration("1.0", "UTF-8", "yes");
97 | XmlElement effProfileElement_root = effProfile.CreateElement("EffectProfile");
98 | effProfile.AppendChild(effProfileElement_root);
99 | XmlElement effProfileElement_ScriptInfo = effProfile.CreateElement("ScriptInfo");
100 | effProfileElement_root.AppendChild(effProfileElement_ScriptInfo);
101 | XmlElement effProfileElement_StringValue = effProfile.CreateElement("SIValues");
102 | foreach (string singleScriptInfo in scriptInfo)
103 | {
104 | effProfileElement_StringValue = effProfile.CreateElement("SIValues");
105 | effProfileElement_StringValue.SetAttribute("StringValue", singleScriptInfo);
106 | effProfileElement_ScriptInfo.AppendChild(effProfileElement_StringValue);
107 | }
108 |
109 | XmlElement effProfileElement_V4Style = effProfile.CreateElement("V4Style");
110 | effProfileElement_root.AppendChild(effProfileElement_V4Style);
111 | effProfileElement_StringValue = effProfile.CreateElement("VSValues");
112 | foreach (string singleV4Style in V4Style)
113 | {
114 | effProfileElement_StringValue = effProfile.CreateElement("VSValues");
115 | effProfileElement_StringValue.SetAttribute("StringValue", singleV4Style);
116 | effProfileElement_V4Style.AppendChild(effProfileElement_StringValue);
117 | }
118 |
119 | XmlElement effProfileElement_Events = effProfile.CreateElement("Events");
120 | effProfileElement_root.AppendChild(effProfileElement_Events);
121 | effProfileElement_StringValue = effProfile.CreateElement("EventValue");
122 | effProfileElement_StringValue.SetAttribute("StringValue", events);
123 | effProfileElement_Events.AppendChild(effProfileElement_StringValue);
124 |
125 | XmlElement effProfileElement_EngEffect = effProfile.CreateElement("EngEffect");
126 | effProfileElement_root.AppendChild(effProfileElement_EngEffect);
127 | effProfileElement_StringValue = effProfile.CreateElement("EngEffectValue");
128 | effProfileElement_StringValue.SetAttribute("StringValue", engEffect);
129 | effProfileElement_EngEffect.AppendChild(effProfileElement_StringValue);
130 |
131 | effProfile.Save(Application.StartupPath + "\\" + name + ".xml");
132 |
133 | if(CfgProfiles.ContainsKey(name))
134 | {
135 | ModifyMainCfgXML(name, Application.StartupPath + "\\" + name + ".xml", true);
136 | }
137 |
138 | else
139 | {
140 | ModifyMainCfgXML(name, Application.StartupPath + "\\" + name + ".xml", false);
141 | }
142 | }
143 |
144 | public static Hashtable LoadEffectProfile(string path)
145 | {
146 | Hashtable effects = new Hashtable();
147 | List scriptInfo = new List();
148 | List V4Style = new List();
149 | string events = "";
150 | string engEffect = "";
151 |
152 | XmlDocument effProfile = new XmlDocument();
153 |
154 | effProfile.Load(Application.StartupPath + "\\" + path);
155 |
156 | XmlNodeList effNodes = effProfile.ChildNodes.Item(0).ChildNodes;
157 | foreach (XmlNode effNode in effNodes)
158 | {
159 | foreach (XmlNode effValue in effNode.ChildNodes)
160 | {
161 | if (effValue.Name == "SIValues")
162 | {
163 | scriptInfo.Add(effValue.Attributes.Item(0).Value);
164 | }
165 |
166 | if (effValue.Name == "VSValues")
167 | {
168 | V4Style.Add(effValue.Attributes.Item(0).Value);
169 | }
170 |
171 | if (effValue.Name == "EventValue")
172 | {
173 | events = effValue.Attributes.Item(0).Value;
174 | }
175 |
176 | if (effValue.Name == "EngEffectValue")
177 | {
178 | engEffect = effValue.Attributes.Item(0).Value;
179 | }
180 | }
181 | }
182 |
183 | effects.Add("ScriptInfo", scriptInfo);
184 | effects.Add("V4Style", V4Style);
185 | effects.Add("Events", events);
186 | effects.Add("EngEffect", engEffect);
187 |
188 | return effects;
189 | }
190 |
191 | public static void DeleteProfile(string name)
192 | {
193 | XmlDocument mainCfgXml = new XmlDocument();
194 | mainCfgXml.Load(Application.StartupPath + "\\MainCfg.xml");
195 | XmlNodeList cfgNodes = mainCfgXml.ChildNodes.Item(0).ChildNodes;
196 | foreach (XmlElement elem in cfgNodes)
197 | {
198 | if (elem.Attributes.Item(0).Value == name)
199 | {
200 | mainCfgXml.ChildNodes.Item(0).RemoveChild(elem);
201 | }
202 | }
203 |
204 | mainCfgXml.Save(Application.StartupPath + "\\MainCfg.xml");
205 | CfgProfiles.Remove(name);
206 | }
207 | }
208 | }
209 |
--------------------------------------------------------------------------------
/AssToolkit/AddNewEff.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace AssToolkit
2 | {
3 | partial class AddNewEff
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddNewEff));
32 | this.tbEvents = new System.Windows.Forms.TextBox();
33 | this.tbEng = new System.Windows.Forms.TextBox();
34 | this.lbEvents = new System.Windows.Forms.Label();
35 | this.label1 = new System.Windows.Forms.Label();
36 | this.tbVS = new System.Windows.Forms.TextBox();
37 | this.lbVS = new System.Windows.Forms.Label();
38 | this.tbSI = new System.Windows.Forms.TextBox();
39 | this.lbSI = new System.Windows.Forms.Label();
40 | this.gbEffDetail = new System.Windows.Forms.GroupBox();
41 | this.btnSaveEffect = new System.Windows.Forms.Button();
42 | this.lbEffName = new System.Windows.Forms.Label();
43 | this.tbEffName = new System.Windows.Forms.TextBox();
44 | this.gbEffDetail.SuspendLayout();
45 | this.SuspendLayout();
46 | //
47 | // tbEvents
48 | //
49 | this.tbEvents.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
50 | this.tbEvents.Location = new System.Drawing.Point(6, 262);
51 | this.tbEvents.Name = "tbEvents";
52 | this.tbEvents.Size = new System.Drawing.Size(428, 21);
53 | this.tbEvents.TabIndex = 23;
54 | this.tbEvents.Text = "Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text";
55 | //
56 | // tbEng
57 | //
58 | this.tbEng.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
59 | this.tbEng.Location = new System.Drawing.Point(6, 308);
60 | this.tbEng.Name = "tbEng";
61 | this.tbEng.Size = new System.Drawing.Size(428, 21);
62 | this.tbEng.TabIndex = 24;
63 | //
64 | // lbEvents
65 | //
66 | this.lbEvents.AutoSize = true;
67 | this.lbEvents.Location = new System.Drawing.Point(4, 247);
68 | this.lbEvents.Name = "lbEvents";
69 | this.lbEvents.Size = new System.Drawing.Size(41, 12);
70 | this.lbEvents.TabIndex = 21;
71 | this.lbEvents.Text = "Events";
72 | //
73 | // label1
74 | //
75 | this.label1.AutoSize = true;
76 | this.label1.Location = new System.Drawing.Point(4, 293);
77 | this.label1.Name = "label1";
78 | this.label1.Size = new System.Drawing.Size(65, 12);
79 | this.label1.TabIndex = 22;
80 | this.label1.Text = "英文行特效";
81 | //
82 | // tbVS
83 | //
84 | this.tbVS.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
85 | this.tbVS.Location = new System.Drawing.Point(6, 144);
86 | this.tbVS.Multiline = true;
87 | this.tbVS.Name = "tbVS";
88 | this.tbVS.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
89 | this.tbVS.Size = new System.Drawing.Size(428, 95);
90 | this.tbVS.TabIndex = 20;
91 | //
92 | // lbVS
93 | //
94 | this.lbVS.AutoSize = true;
95 | this.lbVS.Location = new System.Drawing.Point(4, 130);
96 | this.lbVS.Name = "lbVS";
97 | this.lbVS.Size = new System.Drawing.Size(59, 12);
98 | this.lbVS.TabIndex = 19;
99 | this.lbVS.Text = "V4+ Style";
100 | //
101 | // tbSI
102 | //
103 | this.tbSI.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
104 | this.tbSI.Location = new System.Drawing.Point(6, 33);
105 | this.tbSI.Multiline = true;
106 | this.tbSI.Name = "tbSI";
107 | this.tbSI.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
108 | this.tbSI.Size = new System.Drawing.Size(428, 92);
109 | this.tbSI.TabIndex = 18;
110 | this.tbSI.Text = resources.GetString("tbSI.Text");
111 | //
112 | // lbSI
113 | //
114 | this.lbSI.AutoSize = true;
115 | this.lbSI.Location = new System.Drawing.Point(4, 18);
116 | this.lbSI.Name = "lbSI";
117 | this.lbSI.Size = new System.Drawing.Size(71, 12);
118 | this.lbSI.TabIndex = 17;
119 | this.lbSI.Text = "Script Info";
120 | //
121 | // gbEffDetail
122 | //
123 | this.gbEffDetail.Controls.Add(this.tbSI);
124 | this.gbEffDetail.Controls.Add(this.tbEvents);
125 | this.gbEffDetail.Controls.Add(this.lbSI);
126 | this.gbEffDetail.Controls.Add(this.tbEng);
127 | this.gbEffDetail.Controls.Add(this.lbVS);
128 | this.gbEffDetail.Controls.Add(this.lbEvents);
129 | this.gbEffDetail.Controls.Add(this.tbVS);
130 | this.gbEffDetail.Controls.Add(this.label1);
131 | this.gbEffDetail.Location = new System.Drawing.Point(2, 52);
132 | this.gbEffDetail.Name = "gbEffDetail";
133 | this.gbEffDetail.Size = new System.Drawing.Size(445, 337);
134 | this.gbEffDetail.TabIndex = 25;
135 | this.gbEffDetail.TabStop = false;
136 | this.gbEffDetail.Text = "特效细节";
137 | //
138 | // btnSaveEffect
139 | //
140 | this.btnSaveEffect.Location = new System.Drawing.Point(332, 395);
141 | this.btnSaveEffect.Name = "btnSaveEffect";
142 | this.btnSaveEffect.Size = new System.Drawing.Size(116, 26);
143 | this.btnSaveEffect.TabIndex = 26;
144 | this.btnSaveEffect.Text = "保存此特效";
145 | this.btnSaveEffect.UseVisualStyleBackColor = true;
146 | this.btnSaveEffect.Click += new System.EventHandler(this.btnSaveEffect_Click);
147 | //
148 | // lbEffName
149 | //
150 | this.lbEffName.AutoSize = true;
151 | this.lbEffName.Location = new System.Drawing.Point(7, 9);
152 | this.lbEffName.Name = "lbEffName";
153 | this.lbEffName.Size = new System.Drawing.Size(53, 12);
154 | this.lbEffName.TabIndex = 27;
155 | this.lbEffName.Text = "特效名称";
156 | //
157 | // tbEffName
158 | //
159 | this.tbEffName.Location = new System.Drawing.Point(9, 24);
160 | this.tbEffName.Name = "tbEffName";
161 | this.tbEffName.Size = new System.Drawing.Size(439, 21);
162 | this.tbEffName.TabIndex = 28;
163 | //
164 | // AddNewEff
165 | //
166 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
167 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
168 | this.ClientSize = new System.Drawing.Size(453, 429);
169 | this.Controls.Add(this.tbEffName);
170 | this.Controls.Add(this.lbEffName);
171 | this.Controls.Add(this.btnSaveEffect);
172 | this.Controls.Add(this.gbEffDetail);
173 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
174 | this.Name = "AddNewEff";
175 | this.Text = "添加新特效";
176 | this.gbEffDetail.ResumeLayout(false);
177 | this.gbEffDetail.PerformLayout();
178 | this.ResumeLayout(false);
179 | this.PerformLayout();
180 |
181 | }
182 |
183 | #endregion
184 |
185 | private System.Windows.Forms.TextBox tbEvents;
186 | private System.Windows.Forms.TextBox tbEng;
187 | private System.Windows.Forms.Label lbEvents;
188 | private System.Windows.Forms.Label label1;
189 | private System.Windows.Forms.TextBox tbVS;
190 | private System.Windows.Forms.Label lbVS;
191 | private System.Windows.Forms.TextBox tbSI;
192 | private System.Windows.Forms.Label lbSI;
193 | private System.Windows.Forms.GroupBox gbEffDetail;
194 | private System.Windows.Forms.Button btnSaveEffect;
195 | private System.Windows.Forms.Label lbEffName;
196 | private System.Windows.Forms.TextBox tbEffName;
197 | }
198 | }
--------------------------------------------------------------------------------
/AssToolkit/Ass2Srt/AssAnalyzerForSrt.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.Text;
24 | using System.Text.RegularExpressions;
25 | using Microsoft.VisualBasic;
26 |
27 | namespace Ass2Srt
28 | {
29 | class AssAnalyzerForSrt : AssAnalyzer
30 | {
31 | string strDialogues;
32 | int type;
33 | bool DoubleOrSingle;
34 |
35 | public AssAnalyzerForSrt(string strDialogues, int type, bool DoubleOrSingle)
36 | {
37 | this.strDialogues = strDialogues;
38 | this.type = type; //0-简英,1-繁英,2-简中,3-繁中,4-英文
39 | this.DoubleOrSingle = DoubleOrSingle; //T-Double, F-Single
40 | }
41 |
42 | public string[] Analyze()
43 | {
44 | try
45 | {
46 | int subCount = 1;
47 | List lSrtLines = new List();
48 | string[] strSpittedDialogues = DialogueSplitter(strDialogues);
49 | foreach (string strDialogue in strSpittedDialogues)
50 | {
51 | lSrtLines.AddRange(DialogueProcessor(strDialogue, subCount));
52 | subCount++;
53 | }
54 |
55 | return lSrtLines.ToArray();
56 | }
57 |
58 | catch
59 | {
60 | return null;
61 | }
62 | }
63 |
64 | private List DialogueProcessor(string strDialogue, int subCount)
65 | {
66 | List lDialogueProcessed = new List();
67 | List lDialogueGot = new List();
68 | //lDialogueProcessed.Add(GetTime(strDialogue));
69 | lDialogueGot = GetDialogue(strDialogue);
70 | if (lDialogueGot.Count == 0)
71 | {
72 |
73 | }
74 |
75 | else
76 | {
77 | lDialogueProcessed.Add(subCount.ToString());
78 | lDialogueProcessed.AddRange(GetDialogue(strDialogue));
79 | lDialogueProcessed.Add("");
80 | }
81 |
82 | return lDialogueProcessed;
83 | }
84 |
85 | private string GetTime(string strDialogue)
86 | {
87 | string strSrtTime;
88 | List lTime = new List();
89 | Regex rx = new Regex(@"\d{1}:\d{2}:\d{2}.\d{2}");
90 | MatchCollection MC = rx.Matches(strDialogue);
91 | foreach (Match m in MC)
92 | {
93 | lTime.Add(m.ToString());
94 | }
95 |
96 | strSrtTime = "0" + lTime[0].Replace('.', ',') + "0 --> " + "0" + lTime[1].Replace('.', ',') + "0";
97 |
98 | return strSrtTime;
99 | }
100 |
101 | private List GetDialogue(string strDialogue)
102 | {
103 | List lDialogues = new List();
104 | Regex rx = new Regex(@"[^\{^\}]+");
105 | Regex exEngOrChi = new Regex(@"[\u4e00-\u9fa5]");
106 | strDialogue = strDialogue.Replace("\\h", " ");
107 | MatchCollection MC = rx.Matches(strDialogue);
108 | string strDialogueLong = "";
109 | string strControlCmd = "";
110 | if (MC.Count > 0)
111 | {
112 | if (MC[0].ToString().Contains(",,"))
113 | {
114 | string t = MC[0].ToString();
115 | string[] tt = SplitString(t, ",,");
116 | strDialogueLong += tt[tt.Length - 1];
117 | }
118 | }
119 |
120 | for (int i = 1; i < MC.Count; i++)
121 | {
122 | string t = MC[i].ToString();
123 |
124 | if (t[0] == '\\')
125 | {
126 | string[] controlCmds = t.Split('\\');
127 | foreach (string s in controlCmds)
128 | {
129 | //Keep only {\an} and {\pos} tags in srt files
130 | if (s.Contains("an") || s.Contains("pos"))
131 | {
132 | strControlCmd += "{" + "\\" + s + "}";
133 | continue;
134 | }
135 | }
136 |
137 | continue;
138 | }
139 |
140 | else if (t == " ")
141 | {
142 | continue;
143 | }
144 |
145 | //if (t.Contains("\\N"))
146 | //{
147 |
148 | strDialogueLong += t;
149 | }
150 |
151 | //strDialogue = strControlCmd + strDialogue;
152 | //lDialogues.Add(GetTime(strDialogue));
153 | string[] ss = SplitString(strDialogueLong, "\\N");
154 | List lSS = new List();
155 | foreach (string s in ss)
156 | {
157 | if (s == "")
158 | {
159 | continue;
160 | }
161 |
162 | //Skip lines of ass bitmaps.
163 | if ( CountDigitsInString(s) + CountSpacesInString(s) + CountLettersInString(s, 'l')
164 | + CountLettersInString(s, 'm') + CountLettersInString(s, 'b')
165 | > 0.8 * s.Length )
166 | {
167 | continue;
168 | }
169 |
170 | switch (type)
171 | {
172 | case 0:
173 | {
174 | lSS.Add(s);
175 | break;
176 | }
177 | case 1:
178 | {
179 | if (exEngOrChi.IsMatch(s))
180 | {
181 | lSS.Add(ConvertToTrad(s));
182 | }
183 |
184 | else
185 | {
186 | lSS.Add(s);
187 | }
188 |
189 | break;
190 | }
191 | case 2:
192 | {
193 | if (DoubleOrSingle)
194 | {
195 | if (exEngOrChi.IsMatch(s))
196 | {
197 | lSS.Add(s);
198 | }
199 |
200 | else
201 | {
202 |
203 | }
204 | }
205 |
206 | else
207 | {
208 | lSS.Add(s);
209 | }
210 |
211 | break;
212 | }
213 | case 3:
214 | {
215 | if (DoubleOrSingle)
216 | {
217 | if (exEngOrChi.IsMatch(s))
218 | {
219 | lSS.Add(ConvertToTrad(s));
220 | }
221 |
222 | else
223 | {
224 |
225 | }
226 | }
227 |
228 | else
229 | {
230 | lSS.Add(ConvertToTrad(s));
231 | }
232 |
233 | break;
234 | }
235 | case 4:
236 | {
237 | if (exEngOrChi.IsMatch(s))
238 | {
239 |
240 | }
241 | else
242 | {
243 | lSS.Add(s);
244 | }
245 |
246 | break;
247 | }
248 | }
249 |
250 | }
251 | //}
252 |
253 | if (lSS.Count > 0)
254 | {
255 | if (lSS[0] != "■")
256 | {
257 | lDialogues.Add(GetTime(strDialogue));
258 | lSS[0] = strControlCmd + lSS[0];
259 | lDialogues.AddRange(lSS);
260 | }
261 | }
262 |
263 | return lDialogues;
264 | }
265 | }
266 | }
267 |
--------------------------------------------------------------------------------
/AssToolkit/Srt2Ass/ConvertAlgorithm.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.Text;
24 | using System.IO;
25 | using System.Text.RegularExpressions;
26 |
27 | namespace Srt2Ass
28 | {
29 | class ConvertAlgorithm
30 | {
31 | List originalSubs = new List();
32 | Queue qChiSub = new Queue();
33 | Queue qEngSub = new Queue();
34 | Queue qTimeSpan = new Queue();
35 | Queue qSubs = new Queue();
36 | string fileSource;
37 | string folderDtn;
38 | string[] scriptInfo;
39 | string[] V4Style;
40 | string engStyle;
41 | string events;
42 |
43 | public void Entry(string fileSourceParam, string folderDtnParam, string[] scriptInfoParam, string[] V4StyleParam, string engStyleParam, string eventsParam)
44 | {
45 | originalSubs.Clear();
46 | qSubs.Clear();
47 | qChiSub.Clear();
48 | qEngSub.Clear();
49 | qTimeSpan.Clear();
50 |
51 | fileSource = fileSourceParam;
52 | folderDtn = folderDtnParam;
53 | scriptInfo = scriptInfoParam;
54 | V4Style = V4StyleParam;
55 | engStyle = engStyleParam;
56 | events = eventsParam;
57 |
58 | string fileDtn = null;
59 | WriteToFile WTF;
60 |
61 | fileDtn = folderDtn + "\\" + Path.GetFileName(fileSource);
62 | ReadFile(fileSource);
63 |
64 | WTF = new WriteToFile(fileDtn);
65 | WTF.WriteASS(scriptInfo, V4Style, events, qSubs, "Unicode");
66 | WTF.CloseFile();
67 | string fileName;
68 | fileName = fileDtn.Substring(0, fileDtn.LastIndexOf('.'));
69 | CopyTmpFileToAss(fileName);
70 | }
71 |
72 | private void CopyTmpFileToAss(string fileName)
73 | {
74 | CopyTmpFileToAss(fileName, fileName);
75 | }
76 |
77 | private void CopyTmpFileToAss(string originalFileName, string fileName)
78 | {
79 | try
80 | {
81 | File.Copy(originalFileName + ".tmp", fileName + ".ass", false);
82 | }
83 |
84 | catch (Exception)
85 | {
86 | fileName += "_new";
87 | CopyTmpFileToAss(originalFileName, fileName);
88 | }
89 |
90 | File.Delete(originalFileName + ".tmp");
91 | }
92 |
93 | private void ReadFile(string fileSource)
94 | {
95 | string strTimeSpan = "";
96 | int startIndex = 0;
97 | int endIndex = 0;
98 | StreamReader readSrc;
99 |
100 | try
101 | {
102 | //Regex exEngOrChi = new Regex(@"[^\x00-\xff]");
103 | Regex exIsTime = new Regex(@"(.+)(?=-)-->(?<=>)[\s][^\s]+");
104 | //if (strEncoding == "ANSI")
105 | //{
106 | readSrc = new StreamReader(fileSource, Encoding.GetEncoding(936));
107 | //}
108 | //else
109 | //{
110 | // readSrc = new StreamReader(fileSource, Encoding.Unicode);
111 | //}
112 |
113 | while (!readSrc.EndOfStream)
114 | {
115 | originalSubs.Add(readSrc.ReadLine());
116 | }
117 |
118 | for (int i = 0; i < originalSubs.Count; i++)
119 | {
120 | if (exIsTime.IsMatch(originalSubs[i]))
121 | {
122 | if (startIndex == 0)
123 | {
124 | startIndex = i;
125 | continue;
126 | }
127 |
128 | else
129 | {
130 | strTimeSpan = originalSubs[startIndex];
131 | endIndex = i;
132 | EnqueueSubs(ref startIndex, ref endIndex, ref strTimeSpan, originalSubs);
133 | }
134 | }
135 | }
136 |
137 | endIndex = originalSubs.Count + 1;
138 | strTimeSpan = originalSubs[startIndex];
139 | EnqueueSubs(ref startIndex, ref endIndex, ref strTimeSpan, originalSubs);
140 | readSrc.Close();
141 | #region deprecated
142 | /*
143 | //排除文件头部空行
144 | strTmp = readSrc.ReadLine();
145 | if (exIsTime.IsMatch(strTmp))
146 | {
147 | while (!readSrc.EndOfStream)
148 | {
149 | strTmp = readSrc.ReadLine();
150 | if (strTmp == "")
151 | {
152 |
153 | }
154 |
155 | else if (exEngOrChi.IsMatch(strTmp))
156 | {
157 | if (strChiSub != "")
158 | strChiSub = strChiSub + "\\N" + strTmp;
159 | else
160 | strChiSub = strTmp;
161 | }
162 |
163 | else
164 | {
165 | if (strEngSub != "")
166 | strEngSub = strEngSub + "\\N" + strTmp;
167 | else
168 | strEngSub = strTmp;
169 | }
170 | }
171 | }
172 | while (strTmp == "" && !readSrc.EndOfStream)
173 | {
174 | strTmp = readSrc.ReadLine();
175 | }
176 |
177 | strNo = strTmp;
178 | if (!exIsNumber.IsMatch(strNo))
179 | {
180 | throw new NotTheFileException("文件错误,请重新选择");
181 | }
182 |
183 | if (!readSrc.EndOfStream)
184 | {
185 | strTimeSpan = readSrc.ReadLine();
186 | }
187 | //strChiSub = readSrc.ReadLine();
188 | while (!readSrc.EndOfStream)
189 | {
190 | strTmp = readSrc.ReadLine();
191 | if (strTmp == "")
192 | break;
193 |
194 | else if (exEngOrChi.IsMatch(strTmp))
195 | {
196 | if (strChiSub != "")
197 | strChiSub = strChiSub + "\\N" + strTmp;
198 | else
199 | strChiSub = strTmp;
200 | }
201 |
202 | else
203 | {
204 | if (strEngSub != "")
205 | strEngSub = strEngSub + "\\N" + strTmp;
206 | else
207 | strEngSub = strTmp;
208 | }
209 | }
210 |
211 | TimeProc(strTimeSpan, ref startTime, ref endTime);
212 |
213 | if (strEngSub == "")
214 | {
215 | sub = "Dialogue: 0," + startTime + "," + endTime + ",*Default,NTP,0000,0000,0000,," + strChiSub;
216 | }
217 |
218 | else
219 | {
220 | sub = "Dialogue: 0," + startTime + "," + endTime + ",*Default,NTP,0000,0000,0000,," + strChiSub + "\\N" + engStyle + strEngSub;
221 | }
222 |
223 | qSubs.Enqueue(sub);
224 | strChiSub = strEngSub = strTimeSpan = "";
225 | }
226 | */
227 | #endregion
228 | }
229 |
230 | catch (Exception)
231 | {
232 | throw new Exception("字幕转换失败,错误时间:" + strTimeSpan);
233 | }
234 | }
235 |
236 | public void EnqueueSubs(ref int startIndex, ref int endIndex, ref string strTimeSpan, List originalSubs)
237 | {
238 | string strTmp = "";
239 | string sub = "";
240 | string strChiSub = "";
241 | string strEngSub = "";
242 | string startTime = "";
243 | string endTime = "";
244 | int subCount = 0;
245 | Regex exEngOrChi = new Regex(@"[\u4e00-\u9fa5]");
246 |
247 | for (int k = startIndex + 1; k < endIndex - 1; k++)
248 | {
249 | strTmp = originalSubs[k];
250 | if (strTmp == "")
251 | {
252 |
253 | }
254 |
255 | else
256 | {
257 | subCount++;
258 | if (exEngOrChi.IsMatch(strTmp) || subCount == 1)
259 | {
260 | if (strChiSub != "")
261 | strChiSub = strChiSub + "\\N" + strTmp;
262 | else
263 | strChiSub = strTmp;
264 | }
265 |
266 | else
267 | {
268 | if (strEngSub != "")
269 | strEngSub = strEngSub + "\\N" + strTmp;
270 | else
271 | strEngSub = strTmp;
272 | }
273 | }
274 | }
275 |
276 | TimeProc(strTimeSpan, ref startTime, ref endTime);
277 |
278 | if (strEngSub == "")
279 | {
280 | sub = "Dialogue: 0," + startTime + "," + endTime + ",*Default,NTP,0000,0000,0000,," + strChiSub;
281 | }
282 |
283 | else if (strChiSub == "")
284 | {
285 | sub = "Dialogue: 0," + startTime + "," + endTime + ",*Default,NTP,0000,0000,0000,," + engStyle + strEngSub;
286 | }
287 |
288 | else
289 | {
290 | sub = "Dialogue: 0," + startTime + "," + endTime + ",*Default,NTP,0000,0000,0000,," + strChiSub + "\\N" + engStyle + strEngSub;
291 | }
292 |
293 | qSubs.Enqueue(sub);
294 | strChiSub = strEngSub = strTimeSpan = "";
295 | startIndex = endIndex;
296 | subCount = 0;
297 | }
298 |
299 | public void TimeProc(string timeSpan, ref string startTime, ref string endTime)
300 | {
301 | Regex exTime = new Regex(@"\d{1}\:\d{2}\:\d{2}\,\d{2}");
302 | MatchCollection mtTimes = exTime.Matches(timeSpan);
303 | startTime = mtTimes[0].ToString();
304 | endTime = mtTimes[1].ToString();
305 | startTime = startTime.Replace(',', '.');
306 | endTime = endTime.Replace(',', '.');
307 | }
308 | }
309 | }
310 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
--------------------------------------------------------------------------------
/AssToolkit/MainForm.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 | *Copyright (C) 2013 David Cheng
3 | *Author: David Cheng
4 | ************************************************************************
5 | *
6 | *This program is free software; you can redistribute it and/or modify
7 | *it under the terms of the GNU General Public License as published by
8 | *the Free Software Foundation; either version 2 of the License, or
9 | *(at your option) any later version.
10 | *
11 | *This program is distributed in the hope that it will be useful,
12 | *but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | *GNU General Public License for more details.
15 | *
16 | *You should have received a copy of the GNU General Public License along
17 | *with this program; if not, write to the Free Software Foundation, Inc.,
18 | *51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 | ************************************************************************/
20 |
21 | using System;
22 | using System.Collections.Generic;
23 | using System.ComponentModel;
24 | using System.Data;
25 | using System.Drawing;
26 | using System.Text;
27 | using System.Windows.Forms;
28 | using System.IO;
29 | using System.Diagnostics;
30 | using System.Collections;
31 | using Ass2Srt;
32 | using Srt2Ass;
33 |
34 | namespace AssToolkit
35 | {
36 | public partial class MainForm : Form
37 | {
38 | public MainForm()
39 | {
40 | InitializeComponent();
41 | Control.CheckForIllegalCrossThreadCalls = false;
42 | MaximizeBox = false;
43 | //Ass2Srt
44 | lvASSFileSelection.Clear();
45 | rbChinEng.Checked = true;
46 |
47 | //Srt2Ass
48 | lvSrtFileSelection.Clear();
49 | LoadEffects();
50 | }
51 |
52 | #region Ass2Srt
53 | private void btnA2SStartProcessing_Click(object sender, EventArgs e)
54 | {
55 | bgwA2SOutput.RunWorkerAsync();
56 | }
57 |
58 | private void bgwA2SOutput_DoWork(object sender, DoWorkEventArgs e)
59 | {
60 | A2SControlEnabled(false);
61 |
62 | string strDialogues;
63 | string strDescriptions;
64 | string strFolderPath;
65 | string strFileNameWithExtension;
66 | string strFileNameWithoutExtension;
67 | string strFilePath;
68 | string strDestDir = null;
69 | int fileNum = lvASSFileSelection.Items.Count;
70 | ssProgressBar.Maximum = fileNum;
71 | ssProgressBar.Minimum = 0;
72 | ssProgressBar.Step = 1;
73 | ssProgressBar.Value = 0;
74 |
75 | foreach (ListViewItem lviFile in lvASSFileSelection.Items)
76 | {
77 | strDestDir = tbSrtOutputFolder.Text;
78 | strFilePath = (string)lviFile.Tag;
79 | int lastSlash = strFilePath.LastIndexOf("\\");
80 | strFolderPath = strFilePath.Substring(0, lastSlash);
81 | strFileNameWithExtension = strFilePath.Substring(lastSlash + 1);
82 |
83 | int lastDot = strFileNameWithExtension.LastIndexOf(".");
84 | strFileNameWithoutExtension = strFileNameWithExtension.Substring(0, lastDot);
85 |
86 | AssReader ar = new AssReader(strFilePath);
87 | if (ar.IsValid())
88 | {
89 | foreach (ListViewItem lviType in lvVersionSelection.CheckedItems)
90 | {
91 | if (lviType.Index <= 4)
92 | {
93 | strDialogues = ar.ReadDialogues();
94 | AssAnalyzerForSrt aafs = new AssAnalyzerForSrt(strDialogues, lviType.Index, rbChinEng.Checked);
95 | string[] strSrtLines = aafs.Analyze();
96 | SrtWriter sw = new SrtWriter(strDestDir, strFileNameWithoutExtension, lviType.Index);
97 | sw.WriteSrtFile(strSrtLines);
98 | }
99 |
100 | else
101 | {
102 | string[] strAssDialogues;
103 | string[] strAssDescriptions;
104 | strDialogues = ar.ReadDialogues();
105 | strDescriptions = ar.ReadDescription();
106 | AssAnalyzerForAss aafa = new AssAnalyzerForAss(strDialogues, strDescriptions, lviType.Index, rbChinEng.Checked);
107 | aafa.Analyze(out strAssDescriptions, out strAssDialogues);
108 | AssWriter aw = new AssWriter(strDestDir, strFileNameWithoutExtension, lviType.Index);
109 | aw.WriteAssFile(strAssDescriptions, strAssDialogues);
110 | }
111 | }
112 |
113 | ZipPatcher(strDestDir, strFileNameWithoutExtension);
114 | ssProgressBar.PerformStep();
115 | }
116 |
117 | else
118 | {
119 | MessageBox.Show("不是.ass文件!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
120 | }
121 | }
122 |
123 | A2SControlEnabled(true);
124 | }
125 |
126 | private void A2SControlEnabled(bool enabled)
127 | {
128 | gbSrtOutputFolder.Enabled = enabled;
129 | gbVersions.Enabled = enabled;
130 | gbAssFile.Enabled = enabled;
131 | btnA2SStartProcessing.Enabled = enabled;
132 | }
133 |
134 | private void lvASSFileSelection_DragEnter(object sender, DragEventArgs e)
135 | {
136 | if(e.Data.GetDataPresent(DataFormats.FileDrop))
137 | {
138 | e.Effect = DragDropEffects.Link;
139 | }
140 |
141 | else
142 | {
143 | e.Effect = DragDropEffects.None;
144 | }
145 | }
146 |
147 | private void lvASSFileSelection_DragDrop(object sender, DragEventArgs e)
148 | {
149 | lvASSFileSelection.Clear();
150 | Array arrFilePaths;
151 | arrFilePaths = ((Array)e.Data.GetData(DataFormats.FileDrop));
152 |
153 | for (int i = 0; i < arrFilePaths.Length; i++)
154 | {
155 | string filePath = arrFilePaths.GetValue(i).ToString();
156 | int lastDot = filePath.LastIndexOf(".");
157 | string fileExtension = filePath.Substring(lastDot);
158 | int lastSlash = filePath.LastIndexOf("\\");
159 | string fileNameWithExtension = filePath.Substring(lastSlash + 1);
160 | if (fileExtension == ".ass")
161 | {
162 | ListViewItem lvi = new ListViewItem();
163 | lvi.StateImageIndex = 0;
164 | lvi.Text = fileNameWithExtension;
165 | lvi.Tag = filePath;
166 | lvASSFileSelection.Items.Add(lvi);
167 | }
168 | }
169 |
170 | if (lvASSFileSelection.Items.Count != 0)
171 | {
172 | string filePath = (string)lvASSFileSelection.Items[0].Tag;
173 | tbSrtOutputFolder.Text = filePath.Substring(0, filePath.LastIndexOf("\\"));
174 | }
175 | }
176 |
177 | private void ZipPatcher(string folderName, string fileName)
178 | {
179 | string szPath = Application.StartupPath + "\\7z\\" + "7za.exe";
180 | string arguements = "a -mcu \"" + folderName + "\\" + fileName + ".zip\" \"" + folderName + "\\" + fileName + "\"";
181 |
182 | Process szProcess = new Process();
183 | szProcess.StartInfo.FileName = szPath;
184 | szProcess.StartInfo.Arguments = arguements;
185 | szProcess.StartInfo.UseShellExecute = false;
186 | szProcess.StartInfo.CreateNoWindow = true;
187 | szProcess.StartInfo.RedirectStandardOutput = true;
188 |
189 | szProcess.Start();
190 | szProcess.BeginOutputReadLine();
191 | szProcess.OutputDataReceived += new DataReceivedEventHandler(SZProcess_OutputDataReceived);
192 |
193 | }
194 |
195 | private void SZProcess_OutputDataReceived(object sender, DataReceivedEventArgs e)
196 | {
197 | if(!string.IsNullOrEmpty(e.Data))
198 | {
199 | Console.WriteLine(e.Data + Environment.NewLine);
200 | }
201 | }
202 |
203 | private void btnSrtFdSelection_Click(object sender, EventArgs e)
204 | {
205 | fbdSelectDestDir.ShowDialog();
206 | tbSrtOutputFolder.Text = fbdSelectDestDir.SelectedPath;
207 | }
208 |
209 | private void rbChinEng_CheckedChanged(object sender, EventArgs e)
210 | {
211 | if (rbChinEng.Checked == true)
212 | {
213 | for (int i = 0; i < lvVersionSelection.Items.Count; i++)
214 | {
215 | lvVersionSelection.Items[i].Checked = false;
216 | }
217 |
218 | for (int i = 0; i < lvVersionSelection.Items.Count; i++)
219 | {
220 | lvVersionSelection.Items[i].Checked = true;
221 | }
222 | }
223 | }
224 |
225 | private void rbChi_CheckedChanged(object sender, EventArgs e)
226 | {
227 | if (rbChi.Checked == true)
228 | {
229 | for (int i = 0; i < lvVersionSelection.Items.Count; i++)
230 | {
231 | lvVersionSelection.Items[i].Checked = false;
232 | }
233 |
234 | lvVersionSelection.Items[2].Checked = true;
235 | lvVersionSelection.Items[3].Checked = true;
236 | lvVersionSelection.Items[7].Checked = true;
237 | lvVersionSelection.Items[8].Checked = true;
238 | }
239 | }
240 | #endregion
241 |
242 | #region Srt2Ass
243 | private void lvSrtFileSelection_DragEnter(object sender, DragEventArgs e)
244 | {
245 | if (e.Data.GetDataPresent(DataFormats.FileDrop))
246 | {
247 | e.Effect = DragDropEffects.Link;
248 | }
249 |
250 | else
251 | {
252 | e.Effect = DragDropEffects.None;
253 | }
254 | }
255 |
256 | private void lvSrtFileSelection_DragDrop(object sender, DragEventArgs e)
257 | {
258 | lvSrtFileSelection.Clear();
259 | Array arrFilePaths;
260 | arrFilePaths = ((Array)e.Data.GetData(DataFormats.FileDrop));
261 |
262 | for (int i = 0; i < arrFilePaths.Length; i++)
263 | {
264 | string filePath = arrFilePaths.GetValue(i).ToString();
265 | int lastDot = filePath.LastIndexOf(".");
266 | string fileExtension = filePath.Substring(lastDot);
267 | int lastSlash = filePath.LastIndexOf("\\");
268 | string fileNameWithExtension = filePath.Substring(lastSlash + 1);
269 | if (fileExtension == ".srt")
270 | {
271 | ListViewItem lvi = new ListViewItem();
272 | lvi.StateImageIndex = 0;
273 | lvi.Text = fileNameWithExtension;
274 | lvi.Tag = filePath;
275 | lvSrtFileSelection.Items.Add(lvi);
276 | }
277 | }
278 |
279 | if (lvSrtFileSelection.Items.Count != 0)
280 | {
281 | string filePath = (string)lvSrtFileSelection.Items[0].Tag;
282 | tbASSOutputFolder.Text = filePath.Substring(0, filePath.LastIndexOf("\\"));
283 | }
284 | }
285 |
286 | private void btnASSFolderSelection_Click(object sender, EventArgs e)
287 | {
288 | fbdSelectDestDir.ShowDialog();
289 | tbASSOutputFolder.Text = fbdSelectDestDir.SelectedPath;
290 | }
291 |
292 | private void bgwS2AOutput_DoWork(object sender, DoWorkEventArgs e)
293 | {
294 | ConvertAlgorithm C = new ConvertAlgorithm();
295 |
296 | int fileNum = lvSrtFileSelection.Items.Count;
297 | string[] scriptInfo = new string[0];
298 | string[] v4Style = new string[0];
299 | string events = "";
300 | string engStyle = "";
301 |
302 | ssProgressBar.Maximum = fileNum;
303 | ssProgressBar.Minimum = 0;
304 | ssProgressBar.Step = 1;
305 | ssProgressBar.Value = 0;
306 |
307 | try
308 | {
309 | if (lvSrtFileSelection.Items.Count == 0)
310 | {
311 | throw new Exception("请选择源文件");
312 | }
313 |
314 | if (tbASSOutputFolder.Text == "")
315 | {
316 | throw new Exception("请选择目标文件夹");
317 | }
318 |
319 | if (cbEffCfg.Text == "")
320 | {
321 | throw new Exception("请选择特效");
322 | }
323 |
324 | ReadEffectDetail(cbEffCfg.Text, ref scriptInfo, ref v4Style, ref events, ref engStyle);
325 | S2AControlEnable(false);
326 | foreach (ListViewItem lviFile in lvSrtFileSelection.Items)
327 | {
328 | string file = lviFile.Tag as string;
329 | C.Entry(file, tbASSOutputFolder.Text, scriptInfo, v4Style, engStyle, events);
330 | ssProgressBar.PerformStep();
331 | }
332 | S2AControlEnable(true);
333 |
334 | }
335 |
336 | catch (Exception Ex)
337 | {
338 | MessageBox.Show(Ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
339 | }
340 | }
341 |
342 | private void ReadEffectDetail(string name, ref string[] scriptInfo, ref string[] v4Style,
343 | ref string events, ref string engStyle)
344 | {
345 | Hashtable htEffects;
346 | List lScriptInfo;
347 | List lV4Style;
348 | string strEvents;
349 | string strEngEffect;
350 |
351 | if (Configuration.CfgProfiles.ContainsKey(name))
352 | {
353 | htEffects = Configuration.LoadEffectProfile(name + ".xml");
354 | lScriptInfo = (List)htEffects["ScriptInfo"];
355 | lV4Style = (List)htEffects["V4Style"];
356 | strEvents = (string)htEffects["Events"];
357 | strEngEffect = (string)htEffects["EngEffect"];
358 |
359 | scriptInfo = lScriptInfo.ToArray();
360 | v4Style = lV4Style.ToArray();
361 | events = strEvents;
362 | engStyle = strEngEffect;
363 | }
364 |
365 | else
366 | {
367 | scriptInfo = new string[0];
368 | v4Style = new string[0];
369 | events = "";
370 | engStyle = "";
371 | }
372 | }
373 |
374 | private void btnS2AStartProcessing_Click(object sender, EventArgs e)
375 | {
376 | bgwS2AOutput.RunWorkerAsync();
377 | }
378 |
379 | private void btnAddEff_Click(object sender, EventArgs e)
380 | {
381 | AddNewEff ade = new AddNewEff();
382 | ade.ShowDialog(this);
383 | LoadEffects();
384 | }
385 |
386 | private void LoadEffects()
387 | {
388 | cbEffCfg.Items.Clear();
389 | cbEffCfg.Text = "";
390 | Configuration.LoadORCreateMainXML();
391 | if (Configuration.CfgProfiles.Count != 0)
392 | {
393 | foreach (DictionaryEntry de in Configuration.CfgProfiles)
394 | {
395 | cbEffCfg.Items.Add(de.Key.ToString());
396 | }
397 | }
398 | }
399 |
400 | private void btnModifyEff_Click(object sender, EventArgs e)
401 | {
402 | string effName = cbEffCfg.Text;
403 | string[] scriptInfo = new string[0];
404 | string[] v4Style = new string[0];
405 | string engStyle = "";
406 | string events = "";
407 |
408 | ReadEffectDetail(effName, ref scriptInfo, ref v4Style, ref events, ref engStyle);
409 | AddNewEff ade = new AddNewEff(effName, scriptInfo, v4Style, events, engStyle);
410 | ade.ShowDialog(this);
411 | LoadEffects();
412 | }
413 |
414 | private void btnImportEffFiles_Click(object sender, EventArgs e)
415 | {
416 | string name;
417 | string path;
418 | string[] strFileSources = null;
419 | ofdSelectFile.Multiselect = true;
420 | ofdSelectFile.FileName = null;
421 | ofdSelectFile.Filter = "XML配置文件(*.xml)|*.xml";
422 | ofdSelectFile.ShowDialog();
423 | strFileSources = ofdSelectFile.FileNames;
424 |
425 | foreach (string fileSource in strFileSources)
426 | {
427 | try
428 | {
429 | path = fileSource.Substring(((fileSource.LastIndexOf("\\")) + 1), fileSource.Length - fileSource.LastIndexOf("\\") - 1);
430 | name = path.Substring(0, path.LastIndexOf('.'));
431 | File.Copy(fileSource, Application.StartupPath + "\\" + path);
432 | Configuration.ModifyMainCfgXML(name, path, false);
433 | LoadEffects();
434 | }
435 |
436 | catch (Exception ex)
437 | {
438 | MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
439 | }
440 | }
441 | }
442 |
443 | private void btnDelEff_Click(object sender, EventArgs e)
444 | {
445 | string name = cbEffCfg.Text;
446 | Configuration.DeleteProfile(name);
447 | try
448 | {
449 | File.Delete(name + ".xml");
450 | }
451 |
452 | catch (Exception)
453 | {
454 |
455 | }
456 |
457 | LoadEffects();
458 | }
459 |
460 | private void S2AControlEnable(bool isEnable)
461 | {
462 | gbEffCfg.Enabled = isEnable;
463 | gbSrtFile.Enabled = isEnable;
464 | gbSrtOutputFolder.Enabled = isEnable;
465 | }
466 |
467 | #endregion
468 | }
469 | }
470 |
--------------------------------------------------------------------------------
/AssToolkit/MainForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 |
125 | AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
126 | LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
127 | ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADo
128 | HgAAAk1TRnQBSQFMAwEBAAHQAQAB0AEAATABAAEwAQAE/wEhAQAI/wFCAU0BNgcAATYDAAEoAwABwAMA
129 | ATADAAEBAQABIAYAAZAuAAMnAToDJwE6AycBOgMnAToDJwE6AycBOgMnAToDJwE6AycBOgMnAToDJwE6
130 | AycBOgMnAToDJwE6AycBOgMnAToDJwE6AycBOgMnAToDJwE6AycBOgMnAToDJwE6AycBOgMnAToDJwE6
131 | AycBOgMnAToDJwE6AycBOgMnAToDJwE6AycBOgMnAToDJwE6AycBOgMUARz/AP8AZgADUwGqAwAB/wMA
132 | Af8DAAH/AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wMA
133 | Af8DAAH/AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wMAAf8DAAH/AwAB/wMA
134 | Af8DAAH/AwAB/wMAAf8DAAH/AwAB/wMbASb/AP8AZgADUwGqkP8DAAH/AxsBJv8A/wBmAANTAaqQ/wMA
135 | Af8DGwEm/wD/AGYAA1MBqpD/AwAB/wMbASb/AP8AZgADUwGqkP8DAAH/AxsBJv8A/wBmAANTAaqQ/wMA
136 | Af8DGwEm/wD/AGYAA1MBqgP+Af8D/gH/A/4B/wHYAswB/wHhAtgB/wHhAtgB/wHjAtoB/wHjAtoB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wH4AwABDxIAAf8B/AMAAR8SAAb/EgAL
260 |
261 |
262 |
263 | 106, 17
264 |
265 |
266 | 236, 18
267 |
268 |
269 | 383, 18
270 |
271 |
272 | 504, 18
273 |
274 |
275 | 647, 18
276 |
277 |
278 | 68
279 |
280 |
--------------------------------------------------------------------------------
/AssToolkit/MainForm.designer.cs:
--------------------------------------------------------------------------------
1 | namespace AssToolkit
2 | {
3 | partial class MainForm
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows 窗体设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] {
33 | "srt",
34 | "简体中文&英文"}, -1);
35 | System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem(new string[] {
36 | "srt",
37 | "繁体中文&英文"}, -1);
38 | System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem(new string[] {
39 | "srt",
40 | "简体中文"}, -1);
41 | System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem(new string[] {
42 | "srt",
43 | "繁体中文"}, -1);
44 | System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem(new string[] {
45 | "srt",
46 | "英文"}, -1);
47 | System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem(new string[] {
48 | "ass",
49 | "简体中文&英文"}, -1);
50 | System.Windows.Forms.ListViewItem listViewItem7 = new System.Windows.Forms.ListViewItem(new string[] {
51 | "ass",
52 | "繁体中文&英文"}, -1);
53 | System.Windows.Forms.ListViewItem listViewItem8 = new System.Windows.Forms.ListViewItem(new string[] {
54 | "ass",
55 | "简体中文"}, -1);
56 | System.Windows.Forms.ListViewItem listViewItem9 = new System.Windows.Forms.ListViewItem(new string[] {
57 | "ass",
58 | "繁体中文"}, -1);
59 | System.Windows.Forms.ListViewItem listViewItem10 = new System.Windows.Forms.ListViewItem("1");
60 | System.Windows.Forms.ListViewItem listViewItem11 = new System.Windows.Forms.ListViewItem("2");
61 | System.Windows.Forms.ListViewItem listViewItem12 = new System.Windows.Forms.ListViewItem("3");
62 | System.Windows.Forms.ListViewItem listViewItem13 = new System.Windows.Forms.ListViewItem("4");
63 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
64 | System.Windows.Forms.ListViewItem listViewItem14 = new System.Windows.Forms.ListViewItem("1");
65 | System.Windows.Forms.ListViewItem listViewItem15 = new System.Windows.Forms.ListViewItem("2");
66 | System.Windows.Forms.ListViewItem listViewItem16 = new System.Windows.Forms.ListViewItem("3");
67 | System.Windows.Forms.ListViewItem listViewItem17 = new System.Windows.Forms.ListViewItem("4");
68 | this.gbVersions = new System.Windows.Forms.GroupBox();
69 | this.rbChi = new System.Windows.Forms.RadioButton();
70 | this.rbChinEng = new System.Windows.Forms.RadioButton();
71 | this.lvVersionSelection = new System.Windows.Forms.ListView();
72 | this.chExtension = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
73 | this.chLanguage = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
74 | this.gbAssFile = new System.Windows.Forms.GroupBox();
75 | this.lvASSFileSelection = new System.Windows.Forms.ListView();
76 | this.chFileIcon = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
77 | this.chFileName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
78 | this.ilIcons = new System.Windows.Forms.ImageList(this.components);
79 | this.gbSrtOutputFolder = new System.Windows.Forms.GroupBox();
80 | this.btnSrtFdSelection = new System.Windows.Forms.Button();
81 | this.tbSrtOutputFolder = new System.Windows.Forms.TextBox();
82 | this.btnA2SStartProcessing = new System.Windows.Forms.Button();
83 | this.bgwA2SOutput = new System.ComponentModel.BackgroundWorker();
84 | this.fbdSelectDestDir = new System.Windows.Forms.FolderBrowserDialog();
85 | this.statusStrip1 = new System.Windows.Forms.StatusStrip();
86 | this.ssProgressBar = new System.Windows.Forms.ToolStripProgressBar();
87 | this.tabControl = new System.Windows.Forms.TabControl();
88 | this.tpAss2Srt = new System.Windows.Forms.TabPage();
89 | this.tpSrt2Ass = new System.Windows.Forms.TabPage();
90 | this.gbEffCfg = new System.Windows.Forms.GroupBox();
91 | this.btnModifyEff = new System.Windows.Forms.Button();
92 | this.btnImportEffFiles = new System.Windows.Forms.Button();
93 | this.btnDelEff = new System.Windows.Forms.Button();
94 | this.btnAddEff = new System.Windows.Forms.Button();
95 | this.lbEffCfgSelection = new System.Windows.Forms.Label();
96 | this.cbEffCfg = new System.Windows.Forms.ComboBox();
97 | this.gbASSOutputFolder = new System.Windows.Forms.GroupBox();
98 | this.btnASSFolderSelection = new System.Windows.Forms.Button();
99 | this.tbASSOutputFolder = new System.Windows.Forms.TextBox();
100 | this.btnS2AStartProcessing = new System.Windows.Forms.Button();
101 | this.gbSrtFile = new System.Windows.Forms.GroupBox();
102 | this.lvSrtFileSelection = new System.Windows.Forms.ListView();
103 | this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
104 | this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
105 | this.bgwS2AOutput = new System.ComponentModel.BackgroundWorker();
106 | this.ofdSelectFile = new System.Windows.Forms.OpenFileDialog();
107 | this.gbVersions.SuspendLayout();
108 | this.gbAssFile.SuspendLayout();
109 | this.gbSrtOutputFolder.SuspendLayout();
110 | this.statusStrip1.SuspendLayout();
111 | this.tabControl.SuspendLayout();
112 | this.tpAss2Srt.SuspendLayout();
113 | this.tpSrt2Ass.SuspendLayout();
114 | this.gbEffCfg.SuspendLayout();
115 | this.gbASSOutputFolder.SuspendLayout();
116 | this.gbSrtFile.SuspendLayout();
117 | this.SuspendLayout();
118 | //
119 | // gbVersions
120 | //
121 | this.gbVersions.Controls.Add(this.rbChi);
122 | this.gbVersions.Controls.Add(this.rbChinEng);
123 | this.gbVersions.Controls.Add(this.lvVersionSelection);
124 | this.gbVersions.Location = new System.Drawing.Point(6, 204);
125 | this.gbVersions.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
126 | this.gbVersions.Name = "gbVersions";
127 | this.gbVersions.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
128 | this.gbVersions.Size = new System.Drawing.Size(367, 161);
129 | this.gbVersions.TabIndex = 0;
130 | this.gbVersions.TabStop = false;
131 | this.gbVersions.Text = "输出版本";
132 | //
133 | // rbChi
134 | //
135 | this.rbChi.AutoSize = true;
136 | this.rbChi.Location = new System.Drawing.Point(89, 18);
137 | this.rbChi.Name = "rbChi";
138 | this.rbChi.Size = new System.Drawing.Size(74, 21);
139 | this.rbChi.TabIndex = 1;
140 | this.rbChi.TabStop = true;
141 | this.rbChi.Text = "中文单语";
142 | this.rbChi.UseVisualStyleBackColor = true;
143 | this.rbChi.CheckedChanged += new System.EventHandler(this.rbChi_CheckedChanged);
144 | //
145 | // rbChinEng
146 | //
147 | this.rbChinEng.AutoSize = true;
148 | this.rbChinEng.Location = new System.Drawing.Point(9, 18);
149 | this.rbChinEng.Name = "rbChinEng";
150 | this.rbChinEng.Size = new System.Drawing.Size(74, 21);
151 | this.rbChinEng.TabIndex = 1;
152 | this.rbChinEng.TabStop = true;
153 | this.rbChinEng.Text = "中英双语";
154 | this.rbChinEng.UseVisualStyleBackColor = true;
155 | this.rbChinEng.CheckedChanged += new System.EventHandler(this.rbChinEng_CheckedChanged);
156 | //
157 | // lvVersionSelection
158 | //
159 | this.lvVersionSelection.CheckBoxes = true;
160 | this.lvVersionSelection.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
161 | this.chExtension,
162 | this.chLanguage});
163 | listViewItem1.Checked = true;
164 | listViewItem1.StateImageIndex = 1;
165 | listViewItem2.Checked = true;
166 | listViewItem2.StateImageIndex = 1;
167 | listViewItem3.Checked = true;
168 | listViewItem3.StateImageIndex = 1;
169 | listViewItem4.Checked = true;
170 | listViewItem4.StateImageIndex = 1;
171 | listViewItem5.Checked = true;
172 | listViewItem5.StateImageIndex = 1;
173 | listViewItem5.Tag = "";
174 | listViewItem6.Checked = true;
175 | listViewItem6.StateImageIndex = 1;
176 | listViewItem7.StateImageIndex = 0;
177 | listViewItem8.StateImageIndex = 0;
178 | listViewItem9.StateImageIndex = 0;
179 | this.lvVersionSelection.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
180 | listViewItem1,
181 | listViewItem2,
182 | listViewItem3,
183 | listViewItem4,
184 | listViewItem5,
185 | listViewItem6,
186 | listViewItem7,
187 | listViewItem8,
188 | listViewItem9});
189 | this.lvVersionSelection.Location = new System.Drawing.Point(6, 46);
190 | this.lvVersionSelection.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
191 | this.lvVersionSelection.Name = "lvVersionSelection";
192 | this.lvVersionSelection.Size = new System.Drawing.Size(355, 110);
193 | this.lvVersionSelection.TabIndex = 0;
194 | this.lvVersionSelection.UseCompatibleStateImageBehavior = false;
195 | this.lvVersionSelection.View = System.Windows.Forms.View.Details;
196 | //
197 | // chExtension
198 | //
199 | this.chExtension.Text = "文件类型";
200 | this.chExtension.Width = 92;
201 | //
202 | // chLanguage
203 | //
204 | this.chLanguage.Text = "字幕语言";
205 | this.chLanguage.Width = 133;
206 | //
207 | // gbAssFile
208 | //
209 | this.gbAssFile.Controls.Add(this.lvASSFileSelection);
210 | this.gbAssFile.Location = new System.Drawing.Point(6, 7);
211 | this.gbAssFile.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
212 | this.gbAssFile.Name = "gbAssFile";
213 | this.gbAssFile.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
214 | this.gbAssFile.Size = new System.Drawing.Size(367, 195);
215 | this.gbAssFile.TabIndex = 1;
216 | this.gbAssFile.TabStop = false;
217 | this.gbAssFile.Text = "ASS文件";
218 | //
219 | // lvASSFileSelection
220 | //
221 | this.lvASSFileSelection.AllowDrop = true;
222 | this.lvASSFileSelection.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
223 | this.chFileIcon,
224 | this.chFileName});
225 | listViewItem10.StateImageIndex = 0;
226 | listViewItem11.StateImageIndex = 0;
227 | listViewItem12.StateImageIndex = 0;
228 | listViewItem13.StateImageIndex = 0;
229 | this.lvASSFileSelection.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
230 | listViewItem10,
231 | listViewItem11,
232 | listViewItem12,
233 | listViewItem13});
234 | this.lvASSFileSelection.Location = new System.Drawing.Point(6, 15);
235 | this.lvASSFileSelection.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
236 | this.lvASSFileSelection.Name = "lvASSFileSelection";
237 | this.lvASSFileSelection.Size = new System.Drawing.Size(355, 174);
238 | this.lvASSFileSelection.StateImageList = this.ilIcons;
239 | this.lvASSFileSelection.TabIndex = 0;
240 | this.lvASSFileSelection.UseCompatibleStateImageBehavior = false;
241 | this.lvASSFileSelection.View = System.Windows.Forms.View.SmallIcon;
242 | this.lvASSFileSelection.DragDrop += new System.Windows.Forms.DragEventHandler(this.lvASSFileSelection_DragDrop);
243 | this.lvASSFileSelection.DragEnter += new System.Windows.Forms.DragEventHandler(this.lvASSFileSelection_DragEnter);
244 | //
245 | // ilIcons
246 | //
247 | this.ilIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilIcons.ImageStream")));
248 | this.ilIcons.TransparentColor = System.Drawing.Color.Transparent;
249 | this.ilIcons.Images.SetKeyName(0, "gzwjtb 026.png");
250 | //
251 | // gbSrtOutputFolder
252 | //
253 | this.gbSrtOutputFolder.Controls.Add(this.btnSrtFdSelection);
254 | this.gbSrtOutputFolder.Controls.Add(this.tbSrtOutputFolder);
255 | this.gbSrtOutputFolder.Location = new System.Drawing.Point(6, 368);
256 | this.gbSrtOutputFolder.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
257 | this.gbSrtOutputFolder.Name = "gbSrtOutputFolder";
258 | this.gbSrtOutputFolder.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
259 | this.gbSrtOutputFolder.Size = new System.Drawing.Size(367, 51);
260 | this.gbSrtOutputFolder.TabIndex = 2;
261 | this.gbSrtOutputFolder.TabStop = false;
262 | this.gbSrtOutputFolder.Text = "输出根目录";
263 | //
264 | // btnSrtFdSelection
265 | //
266 | this.btnSrtFdSelection.Font = new System.Drawing.Font("Times New Roman", 7.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
267 | this.btnSrtFdSelection.Location = new System.Drawing.Point(337, 19);
268 | this.btnSrtFdSelection.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
269 | this.btnSrtFdSelection.Name = "btnSrtFdSelection";
270 | this.btnSrtFdSelection.Size = new System.Drawing.Size(24, 23);
271 | this.btnSrtFdSelection.TabIndex = 1;
272 | this.btnSrtFdSelection.Text = "...";
273 | this.btnSrtFdSelection.UseVisualStyleBackColor = true;
274 | this.btnSrtFdSelection.Click += new System.EventHandler(this.btnSrtFdSelection_Click);
275 | //
276 | // tbSrtOutputFolder
277 | //
278 | this.tbSrtOutputFolder.BackColor = System.Drawing.SystemColors.Window;
279 | this.tbSrtOutputFolder.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
280 | this.tbSrtOutputFolder.Location = new System.Drawing.Point(6, 19);
281 | this.tbSrtOutputFolder.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
282 | this.tbSrtOutputFolder.Name = "tbSrtOutputFolder";
283 | this.tbSrtOutputFolder.ReadOnly = true;
284 | this.tbSrtOutputFolder.Size = new System.Drawing.Size(330, 23);
285 | this.tbSrtOutputFolder.TabIndex = 0;
286 | this.tbSrtOutputFolder.TabStop = false;
287 | //
288 | // btnA2SStartProcessing
289 | //
290 | this.btnA2SStartProcessing.Location = new System.Drawing.Point(268, 426);
291 | this.btnA2SStartProcessing.Name = "btnA2SStartProcessing";
292 | this.btnA2SStartProcessing.Size = new System.Drawing.Size(105, 23);
293 | this.btnA2SStartProcessing.TabIndex = 3;
294 | this.btnA2SStartProcessing.Text = "开始输出";
295 | this.btnA2SStartProcessing.UseVisualStyleBackColor = true;
296 | this.btnA2SStartProcessing.Click += new System.EventHandler(this.btnA2SStartProcessing_Click);
297 | //
298 | // bgwA2SOutput
299 | //
300 | this.bgwA2SOutput.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgwA2SOutput_DoWork);
301 | //
302 | // statusStrip1
303 | //
304 | this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
305 | this.ssProgressBar});
306 | this.statusStrip1.Location = new System.Drawing.Point(0, 485);
307 | this.statusStrip1.Name = "statusStrip1";
308 | this.statusStrip1.Size = new System.Drawing.Size(383, 22);
309 | this.statusStrip1.TabIndex = 4;
310 | this.statusStrip1.Text = "ssStatusStrip";
311 | //
312 | // ssProgressBar
313 | //
314 | this.ssProgressBar.Name = "ssProgressBar";
315 | this.ssProgressBar.Size = new System.Drawing.Size(200, 16);
316 | //
317 | // tabControl
318 | //
319 | this.tabControl.Controls.Add(this.tpAss2Srt);
320 | this.tabControl.Controls.Add(this.tpSrt2Ass);
321 | this.tabControl.Location = new System.Drawing.Point(0, 0);
322 | this.tabControl.Name = "tabControl";
323 | this.tabControl.SelectedIndex = 0;
324 | this.tabControl.Size = new System.Drawing.Size(385, 485);
325 | this.tabControl.TabIndex = 6;
326 | //
327 | // tpAss2Srt
328 | //
329 | this.tpAss2Srt.Controls.Add(this.gbAssFile);
330 | this.tpAss2Srt.Controls.Add(this.gbVersions);
331 | this.tpAss2Srt.Controls.Add(this.gbSrtOutputFolder);
332 | this.tpAss2Srt.Controls.Add(this.btnA2SStartProcessing);
333 | this.tpAss2Srt.Location = new System.Drawing.Point(4, 26);
334 | this.tpAss2Srt.Name = "tpAss2Srt";
335 | this.tpAss2Srt.Padding = new System.Windows.Forms.Padding(3);
336 | this.tpAss2Srt.Size = new System.Drawing.Size(377, 455);
337 | this.tpAss2Srt.TabIndex = 0;
338 | this.tpAss2Srt.Text = "Ass->Srt";
339 | this.tpAss2Srt.UseVisualStyleBackColor = true;
340 | //
341 | // tpSrt2Ass
342 | //
343 | this.tpSrt2Ass.Controls.Add(this.gbEffCfg);
344 | this.tpSrt2Ass.Controls.Add(this.gbASSOutputFolder);
345 | this.tpSrt2Ass.Controls.Add(this.btnS2AStartProcessing);
346 | this.tpSrt2Ass.Controls.Add(this.gbSrtFile);
347 | this.tpSrt2Ass.Location = new System.Drawing.Point(4, 26);
348 | this.tpSrt2Ass.Name = "tpSrt2Ass";
349 | this.tpSrt2Ass.Padding = new System.Windows.Forms.Padding(3);
350 | this.tpSrt2Ass.Size = new System.Drawing.Size(377, 455);
351 | this.tpSrt2Ass.TabIndex = 1;
352 | this.tpSrt2Ass.Text = "Srt->Ass";
353 | this.tpSrt2Ass.UseVisualStyleBackColor = true;
354 | //
355 | // gbEffCfg
356 | //
357 | this.gbEffCfg.Controls.Add(this.btnModifyEff);
358 | this.gbEffCfg.Controls.Add(this.btnImportEffFiles);
359 | this.gbEffCfg.Controls.Add(this.btnDelEff);
360 | this.gbEffCfg.Controls.Add(this.btnAddEff);
361 | this.gbEffCfg.Controls.Add(this.lbEffCfgSelection);
362 | this.gbEffCfg.Controls.Add(this.cbEffCfg);
363 | this.gbEffCfg.Location = new System.Drawing.Point(6, 255);
364 | this.gbEffCfg.Name = "gbEffCfg";
365 | this.gbEffCfg.Size = new System.Drawing.Size(367, 104);
366 | this.gbEffCfg.TabIndex = 29;
367 | this.gbEffCfg.TabStop = false;
368 | this.gbEffCfg.Text = "特效";
369 | //
370 | // btnModifyEff
371 | //
372 | this.btnModifyEff.Location = new System.Drawing.Point(157, 70);
373 | this.btnModifyEff.Name = "btnModifyEff";
374 | this.btnModifyEff.Size = new System.Drawing.Size(78, 23);
375 | this.btnModifyEff.TabIndex = 4;
376 | this.btnModifyEff.Text = "修改该特效";
377 | this.btnModifyEff.UseVisualStyleBackColor = true;
378 | this.btnModifyEff.Click += new System.EventHandler(this.btnModifyEff_Click);
379 | //
380 | // btnImportEffFiles
381 | //
382 | this.btnImportEffFiles.Location = new System.Drawing.Point(83, 70);
383 | this.btnImportEffFiles.Name = "btnImportEffFiles";
384 | this.btnImportEffFiles.Size = new System.Drawing.Size(68, 23);
385 | this.btnImportEffFiles.TabIndex = 3;
386 | this.btnImportEffFiles.Text = "导入特效";
387 | this.btnImportEffFiles.UseVisualStyleBackColor = true;
388 | this.btnImportEffFiles.Click += new System.EventHandler(this.btnImportEffFiles_Click);
389 | //
390 | // btnDelEff
391 | //
392 | this.btnDelEff.Location = new System.Drawing.Point(241, 70);
393 | this.btnDelEff.Name = "btnDelEff";
394 | this.btnDelEff.Size = new System.Drawing.Size(78, 23);
395 | this.btnDelEff.TabIndex = 2;
396 | this.btnDelEff.Text = "删除该特效";
397 | this.btnDelEff.UseVisualStyleBackColor = true;
398 | this.btnDelEff.Click += new System.EventHandler(this.btnDelEff_Click);
399 | //
400 | // btnAddEff
401 | //
402 | this.btnAddEff.Location = new System.Drawing.Point(9, 70);
403 | this.btnAddEff.Name = "btnAddEff";
404 | this.btnAddEff.Size = new System.Drawing.Size(68, 23);
405 | this.btnAddEff.TabIndex = 2;
406 | this.btnAddEff.Text = "新增特效";
407 | this.btnAddEff.UseVisualStyleBackColor = true;
408 | this.btnAddEff.Click += new System.EventHandler(this.btnAddEff_Click);
409 | //
410 | // lbEffCfgSelection
411 | //
412 | this.lbEffCfgSelection.AutoSize = true;
413 | this.lbEffCfgSelection.Location = new System.Drawing.Point(6, 19);
414 | this.lbEffCfgSelection.Name = "lbEffCfgSelection";
415 | this.lbEffCfgSelection.Size = new System.Drawing.Size(56, 17);
416 | this.lbEffCfgSelection.TabIndex = 1;
417 | this.lbEffCfgSelection.Text = "选择特效";
418 | //
419 | // cbEffCfg
420 | //
421 | this.cbEffCfg.FormattingEnabled = true;
422 | this.cbEffCfg.Location = new System.Drawing.Point(9, 39);
423 | this.cbEffCfg.Name = "cbEffCfg";
424 | this.cbEffCfg.Size = new System.Drawing.Size(352, 25);
425 | this.cbEffCfg.TabIndex = 0;
426 | //
427 | // gbASSOutputFolder
428 | //
429 | this.gbASSOutputFolder.Controls.Add(this.btnASSFolderSelection);
430 | this.gbASSOutputFolder.Controls.Add(this.tbASSOutputFolder);
431 | this.gbASSOutputFolder.Location = new System.Drawing.Point(6, 364);
432 | this.gbASSOutputFolder.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
433 | this.gbASSOutputFolder.Name = "gbASSOutputFolder";
434 | this.gbASSOutputFolder.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
435 | this.gbASSOutputFolder.Size = new System.Drawing.Size(367, 51);
436 | this.gbASSOutputFolder.TabIndex = 27;
437 | this.gbASSOutputFolder.TabStop = false;
438 | this.gbASSOutputFolder.Text = "输出根目录";
439 | //
440 | // btnASSFolderSelection
441 | //
442 | this.btnASSFolderSelection.Font = new System.Drawing.Font("Times New Roman", 7.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
443 | this.btnASSFolderSelection.Location = new System.Drawing.Point(337, 19);
444 | this.btnASSFolderSelection.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
445 | this.btnASSFolderSelection.Name = "btnASSFolderSelection";
446 | this.btnASSFolderSelection.Size = new System.Drawing.Size(24, 23);
447 | this.btnASSFolderSelection.TabIndex = 1;
448 | this.btnASSFolderSelection.Text = "...";
449 | this.btnASSFolderSelection.UseVisualStyleBackColor = true;
450 | this.btnASSFolderSelection.Click += new System.EventHandler(this.btnASSFolderSelection_Click);
451 | //
452 | // tbASSOutputFolder
453 | //
454 | this.tbASSOutputFolder.BackColor = System.Drawing.SystemColors.Window;
455 | this.tbASSOutputFolder.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
456 | this.tbASSOutputFolder.Location = new System.Drawing.Point(6, 19);
457 | this.tbASSOutputFolder.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
458 | this.tbASSOutputFolder.Name = "tbASSOutputFolder";
459 | this.tbASSOutputFolder.ReadOnly = true;
460 | this.tbASSOutputFolder.Size = new System.Drawing.Size(330, 23);
461 | this.tbASSOutputFolder.TabIndex = 0;
462 | this.tbASSOutputFolder.TabStop = false;
463 | //
464 | // btnS2AStartProcessing
465 | //
466 | this.btnS2AStartProcessing.Location = new System.Drawing.Point(268, 426);
467 | this.btnS2AStartProcessing.Name = "btnS2AStartProcessing";
468 | this.btnS2AStartProcessing.Size = new System.Drawing.Size(105, 23);
469 | this.btnS2AStartProcessing.TabIndex = 28;
470 | this.btnS2AStartProcessing.Text = "开始输出";
471 | this.btnS2AStartProcessing.UseVisualStyleBackColor = true;
472 | this.btnS2AStartProcessing.Click += new System.EventHandler(this.btnS2AStartProcessing_Click);
473 | //
474 | // gbSrtFile
475 | //
476 | this.gbSrtFile.Controls.Add(this.lvSrtFileSelection);
477 | this.gbSrtFile.Location = new System.Drawing.Point(6, 7);
478 | this.gbSrtFile.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
479 | this.gbSrtFile.Name = "gbSrtFile";
480 | this.gbSrtFile.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
481 | this.gbSrtFile.Size = new System.Drawing.Size(367, 249);
482 | this.gbSrtFile.TabIndex = 26;
483 | this.gbSrtFile.TabStop = false;
484 | this.gbSrtFile.Text = "SRT文件";
485 | //
486 | // lvSrtFileSelection
487 | //
488 | this.lvSrtFileSelection.AllowDrop = true;
489 | this.lvSrtFileSelection.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
490 | this.columnHeader1,
491 | this.columnHeader2});
492 | listViewItem14.StateImageIndex = 0;
493 | listViewItem15.StateImageIndex = 0;
494 | listViewItem16.StateImageIndex = 0;
495 | listViewItem17.StateImageIndex = 0;
496 | this.lvSrtFileSelection.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
497 | listViewItem14,
498 | listViewItem15,
499 | listViewItem16,
500 | listViewItem17});
501 | this.lvSrtFileSelection.Location = new System.Drawing.Point(6, 15);
502 | this.lvSrtFileSelection.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
503 | this.lvSrtFileSelection.Name = "lvSrtFileSelection";
504 | this.lvSrtFileSelection.Size = new System.Drawing.Size(355, 226);
505 | this.lvSrtFileSelection.StateImageList = this.ilIcons;
506 | this.lvSrtFileSelection.TabIndex = 0;
507 | this.lvSrtFileSelection.UseCompatibleStateImageBehavior = false;
508 | this.lvSrtFileSelection.View = System.Windows.Forms.View.SmallIcon;
509 | this.lvSrtFileSelection.DragDrop += new System.Windows.Forms.DragEventHandler(this.lvSrtFileSelection_DragDrop);
510 | this.lvSrtFileSelection.DragEnter += new System.Windows.Forms.DragEventHandler(this.lvSrtFileSelection_DragEnter);
511 | //
512 | // bgwS2AOutput
513 | //
514 | this.bgwS2AOutput.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgwS2AOutput_DoWork);
515 | //
516 | // ofdSelectFile
517 | //
518 | this.ofdSelectFile.FileName = "ofdSelectFile";
519 | //
520 | // MainForm
521 | //
522 | this.AllowDrop = true;
523 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
524 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
525 | this.ClientSize = new System.Drawing.Size(383, 507);
526 | this.Controls.Add(this.tabControl);
527 | this.Controls.Add(this.statusStrip1);
528 | this.Font = new System.Drawing.Font("Microsoft YaHei", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
529 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
530 | this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
531 | this.Name = "MainForm";
532 | this.Text = "ASSToolkit V1.5.1";
533 | this.gbVersions.ResumeLayout(false);
534 | this.gbVersions.PerformLayout();
535 | this.gbAssFile.ResumeLayout(false);
536 | this.gbSrtOutputFolder.ResumeLayout(false);
537 | this.gbSrtOutputFolder.PerformLayout();
538 | this.statusStrip1.ResumeLayout(false);
539 | this.statusStrip1.PerformLayout();
540 | this.tabControl.ResumeLayout(false);
541 | this.tpAss2Srt.ResumeLayout(false);
542 | this.tpSrt2Ass.ResumeLayout(false);
543 | this.gbEffCfg.ResumeLayout(false);
544 | this.gbEffCfg.PerformLayout();
545 | this.gbASSOutputFolder.ResumeLayout(false);
546 | this.gbASSOutputFolder.PerformLayout();
547 | this.gbSrtFile.ResumeLayout(false);
548 | this.ResumeLayout(false);
549 | this.PerformLayout();
550 |
551 | }
552 |
553 | #endregion
554 |
555 | private System.Windows.Forms.GroupBox gbVersions;
556 | private System.Windows.Forms.ListView lvVersionSelection;
557 | private System.Windows.Forms.ColumnHeader chExtension;
558 | private System.Windows.Forms.ColumnHeader chLanguage;
559 | private System.Windows.Forms.GroupBox gbAssFile;
560 | private System.Windows.Forms.ListView lvASSFileSelection;
561 | private System.Windows.Forms.ColumnHeader chFileIcon;
562 | private System.Windows.Forms.ColumnHeader chFileName;
563 | private System.Windows.Forms.ImageList ilIcons;
564 | private System.Windows.Forms.GroupBox gbSrtOutputFolder;
565 | private System.Windows.Forms.TextBox tbSrtOutputFolder;
566 | private System.Windows.Forms.Button btnSrtFdSelection;
567 | private System.Windows.Forms.Button btnA2SStartProcessing;
568 | private System.ComponentModel.BackgroundWorker bgwA2SOutput;
569 | private System.Windows.Forms.FolderBrowserDialog fbdSelectDestDir;
570 | private System.Windows.Forms.RadioButton rbChi;
571 | private System.Windows.Forms.RadioButton rbChinEng;
572 | private System.Windows.Forms.StatusStrip statusStrip1;
573 | private System.Windows.Forms.ToolStripProgressBar ssProgressBar;
574 | private System.Windows.Forms.TabControl tabControl;
575 | private System.Windows.Forms.TabPage tpAss2Srt;
576 | private System.Windows.Forms.TabPage tpSrt2Ass;
577 | private System.Windows.Forms.GroupBox gbSrtFile;
578 | private System.Windows.Forms.ListView lvSrtFileSelection;
579 | private System.Windows.Forms.ColumnHeader columnHeader1;
580 | private System.Windows.Forms.ColumnHeader columnHeader2;
581 | private System.Windows.Forms.GroupBox gbASSOutputFolder;
582 | private System.Windows.Forms.Button btnASSFolderSelection;
583 | private System.Windows.Forms.TextBox tbASSOutputFolder;
584 | private System.Windows.Forms.Button btnS2AStartProcessing;
585 | private System.Windows.Forms.GroupBox gbEffCfg;
586 | private System.Windows.Forms.Button btnDelEff;
587 | private System.Windows.Forms.Button btnAddEff;
588 | private System.Windows.Forms.Label lbEffCfgSelection;
589 | private System.Windows.Forms.ComboBox cbEffCfg;
590 | private System.Windows.Forms.Button btnImportEffFiles;
591 | private System.ComponentModel.BackgroundWorker bgwS2AOutput;
592 | private System.Windows.Forms.Button btnModifyEff;
593 | private System.Windows.Forms.OpenFileDialog ofdSelectFile;
594 | }
595 | }
596 |
597 |
--------------------------------------------------------------------------------