Skip to content

Commit 4125de2

Browse files
committed
Allowed the user to specify input files in json (optional).
1 parent 0161f03 commit 4125de2

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

OKEGui/OKEGui/Gui/WizardWindow.xaml.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,25 @@ private bool LoadJsonProfile(string profile)
260260
System.Windows.MessageBox.Show("指定的vpy文件没有找到,检查下json文件和vpy文件是不是放一起了?", "vpy文件找不到", MessageBoxButton.OK, MessageBoxImage.Error);
261261
return false;
262262
}
263+
int fileCount = 0;
264+
if (json.InputFiles != null)
265+
{
266+
foreach (string file in json.InputFiles)
267+
{
268+
FileInfo input = new FileInfo(projDir.FullName + "\\" + file);
269+
if (input.Exists)
270+
{
271+
wizardInfo.InputFile.Add(input.FullName);
272+
}
273+
else
274+
{
275+
System.Windows.MessageBox.Show("指定的文件(" + input.FullName + ")不存在啊,跟总监确认下json应该放哪?", "找不到输入文件啊", MessageBoxButton.OK, MessageBoxImage.Error);
276+
return false;
277+
}
278+
}
279+
fileCount = json.InputFiles.Count;
280+
SelectInputFile.CanFinish = fileCount > 0;
281+
}
263282

264283
// 预览
265284
wizardInfo.ProjectPreview = "项目名字: " + json.ProjectName;
@@ -270,6 +289,7 @@ private bool LoadJsonProfile(string profile)
270289
wizardInfo.ProjectPreview += "\n视频编码: " + json.VideoFormat;
271290
wizardInfo.ProjectPreview += "\n视频帧率: " + String.Format("{0:0.000} fps", json.Fps);
272291
wizardInfo.ProjectPreview += "\n音频编码(主音轨): " + json.AudioFormat;
292+
wizardInfo.ProjectPreview += "\n输入文件数量: " + fileCount;
273293

274294
return true;
275295
}

OKEGui/OKEGui/Model/JobProfile.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class JobProfile : ICloneable
2626
[ObsoleteAttribute("SubtitleLanguage is obsolete. Use SubtitleTracks instead.", false)]
2727
public string SubtitleLanguage;
2828
public List<Info> SubtitleTracks;
29+
public List<string> InputFiles;
2930

3031
public Object Clone()
3132
{

OKEGui/OKEGui/demo.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@
1616
"Fps" : 23.976,
1717
"SubtitleTracks" : [{
1818
"Language" : "jpn"
19-
}]
19+
}],
20+
"InputFiles" : [
21+
"Main_Disc\\BDMV\\STREAM\\00000.m2ts",
22+
"Main_Disc\\BDMV\\STREAM\\00001.m2ts",
23+
"Main_Disc\\BDMV\\STREAM\\00002.m2ts",
24+
]
2025
}

OKEGui/OKEGui/demo_720p.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,10 @@
1818
"Fps" : 23.976,
1919
"SubtitleTracks" : [{
2020
"MuxOption" : "Skip"
21-
}]
21+
}],
22+
"InputFiles" : [
23+
"00000.m2ts",
24+
"00001.m2ts",
25+
"00002.m2ts",
26+
]
2227
}

0 commit comments

Comments
 (0)