Skip to content
This repository was archived by the owner on Feb 9, 2019. It is now read-only.

Commit c4be544

Browse files
committed
[修复] 修复各种bug
1 parent c36d712 commit c4be544

File tree

3 files changed

+39
-28
lines changed

3 files changed

+39
-28
lines changed

OKEGui/OKEGui/Gui/WizardWindow.xaml.cs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ public class JsonProfile
448448
public string ProjectName { get; set; }
449449
public string EncoderType { get; set; }
450450
public string Encoder { get; set; }
451-
public string EnocderParam { get; set; }
451+
public string EncoderParam { get; set; }
452452
public string ContainerFormat { get; set; }
453453
public string VideoFormat { get; set; }
454454
public List<JobDetails.AudioInfo> AudioTracks { get; set; }
@@ -480,7 +480,7 @@ private bool LoadJsonProfile(string profile)
480480
wizardInfo.EncoderInfo = this.GetEncoderInfo(wizardInfo.EncoderPath);
481481
}
482482

483-
wizardInfo.EncoderParam = okeProj.EnocderParam;
483+
wizardInfo.EncoderParam = okeProj.EncoderParam;
484484

485485
Dictionary<string, ComboBoxItem> comboItems = new Dictionary<string, ComboBoxItem>() {
486486
{ "MKV", MKVContainer},
@@ -522,8 +522,12 @@ private bool LoadJsonProfile(string profile)
522522
}
523523
comboItems[wizardInfo.AudioFormat].IsSelected = true;
524524

525-
wizardInfo.InputScript = new FileInfo(projDir.FullName + "\\" + okeProj.InputScript).FullName;
526-
wizardInfo.VSScript = File.ReadAllText(wizardInfo.InputScript);
525+
var scriptFile = new FileInfo(projDir.FullName + "\\" + okeProj.InputScript);
526+
527+
if (scriptFile.Exists) {
528+
wizardInfo.InputScript = scriptFile.FullName;
529+
wizardInfo.VSScript = File.ReadAllText(wizardInfo.InputScript);
530+
}
527531

528532
// 预览
529533
wizardInfo.ProjectPreview += "项目名字: " + wizardInfo.TaskNamePrefix;
@@ -638,8 +642,12 @@ private void OpenProjectBtn_Click(object sender, RoutedEventArgs e)
638642
}
639643
comboItems[wizardInfo.AudioFormat].IsSelected = true;
640644

641-
wizardInfo.InputScript = new FileInfo(projDir.FullName + "\\" + okeproj.ReadString("OKEProject", "InputScript", "")).FullName;
642-
wizardInfo.VSScript = File.ReadAllText(wizardInfo.InputScript);
645+
var scriptFile = new FileInfo(projDir.FullName + "\\" + okeproj.ReadString("OKEProject", "InputScript", ""));
646+
647+
if (scriptFile.Exists) {
648+
wizardInfo.InputScript = scriptFile.FullName;
649+
wizardInfo.VSScript = File.ReadAllText(wizardInfo.InputScript);
650+
}
643651

644652
// 预览
645653
wizardInfo.ProjectPreview += "项目名字: " + wizardInfo.TaskNamePrefix;

OKEGui/OKEGui/OKEGui.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
<Generator>ResXFileCodeGenerator</Generator>
141141
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
142142
</EmbeddedResource>
143+
<None Include="demo.json" />
143144
<None Include="packages.config" />
144145
<None Include="Properties\Settings.settings">
145146
<Generator>SettingsSingleFileGenerator</Generator>

OKEGui/OKEGui/demo.json

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,28 @@
1414
//InputScript = demo1.vpy
1515
//ExtractAudioTrack = true(暂时不使用)
1616
{
17-
"Version" : 2,
18-
"ProjectName" : "Demo2",
19-
"EncoderType" : "x265",
20-
"Encoder" : "x265-10b.exe",
21-
"EnocderParam" : "--crf 19",
22-
"ContainerFormat" : "mkv",
23-
"VideoFormat" : "hevc",
24-
// "AudioFormat" : "flac"
25-
// 封装顺序安装json文件顺序
26-
// track是第几个音轨?并不是第几个轨道
27-
"AudioTracks" : [{
28-
"TrackId" : 1,
29-
"Format" : "aac",
30-
"Bitrate" : 128,
31-
"ExtraArg" : "-adst"
32-
},
33-
{
34-
"TrackId" : 0,
35-
"Format" : "flac",
36-
"SkipMuxing" : true
37-
}],
38-
"InputScript" : "demo1.vpy"
17+
"Version": 2,
18+
"ProjectName": "Demo2",
19+
"EncoderType": "x265",
20+
"Encoder": "x265-10b.exe",
21+
"EncoderParam": "--crf 19",
22+
"ContainerFormat": "mkv",
23+
"VideoFormat": "hevc",
24+
// "AudioFormat" : "flac"
25+
// 封装顺序安装json文件顺序
26+
// track是第几个音轨?并不是第几个轨道
27+
"AudioTracks": [
28+
{
29+
"TrackId": 1,
30+
"Format": "aac",
31+
"Bitrate": 128,
32+
"ExtraArg": "-adst"
33+
},
34+
{
35+
"TrackId": 0,
36+
"Format": "flac",
37+
"SkipMuxing": true
38+
}
39+
],
40+
"InputScript": "demo1.vpy"
3941
}

0 commit comments

Comments
 (0)