Skip to content

Commit

Permalink
WinGui: (WPF) Further work on the WPF UI and associated servies and u…
Browse files Browse the repository at this point in the history
…tilities. Started working on wiring up the ability to encode.

git-svn-id: svn://localhost/HandBrake/trunk@4347 b64f7644-9d1e-0410-96f1-a4d463321fa5
  • Loading branch information
sr55 committed Nov 13, 2011
1 parent dd8c90d commit 6b32113
Show file tree
Hide file tree
Showing 14 changed files with 415 additions and 65 deletions.
2 changes: 1 addition & 1 deletion win/CS/Functions/QueryGenerator.cs
Expand Up @@ -192,7 +192,7 @@ private static string SourceQuery(frmMain mainWindow, int mode, int duration, st
query += string.Format(" --start-at frame:{0} --stop-at frame:{1}", mainWindow.drop_chapterStart.Text, calculatedDuration);
break;
case 3: // Preview
query += " --previews " + UserSettingService.GetUserSetting<int>(UserSettingConstants.PreviewScanCount) + " ";
query += " --previews " + UserSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount) + " ";
query += " --start-at-preview " + preview;
query += " --stop-at duration:" + duration + " ";
break;
Expand Down
Expand Up @@ -114,5 +114,10 @@ public class ASUserSettingConstants
/// Min Title Scan Duration
/// </summary>
public const string MinScanDuration = "MinTitleScanDuration";

/// <summary>
/// Preview Scan Count
/// </summary>
public const string PreviewScanCount = "previewScanCount";
}
}
7 changes: 7 additions & 0 deletions win/CS/HandBrake.ApplicationServices/Parsing/Source.cs
Expand Up @@ -21,6 +21,12 @@ public Source()
Titles = new List<Title>();
}

/// <summary>
/// Gets or sets ScanPath.
/// The Path used by the Scan Service.
/// </summary>
public string ScanPath { get; set; }

/// <summary>
/// Gets or sets Titles. A list of titles from the source
/// </summary>
Expand Down Expand Up @@ -59,6 +65,7 @@ public static Source Parse(StreamReader output)
public void CopyTo(Source source)
{
source.Titles = this.Titles;
source.ScanPath = this.ScanPath;
}
}
}
14 changes: 11 additions & 3 deletions win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
Expand Up @@ -50,6 +50,11 @@ public class LibScan : IScan
/// </summary>
private readonly StringBuilder logging;

/// <summary>
/// The Current source scan path.
/// </summary>
private string currentSourceScanPath;

#endregion

/// <summary>
Expand Down Expand Up @@ -168,14 +173,17 @@ private void ScanSource(object sourcePath, int title, int previewCount)
{
this.logging.Clear();

string source = sourcePath.ToString().EndsWith("\\") ? sourcePath.ToString() : "\"" + sourcePath + "\"";
currentSourceScanPath = source;

IsScanning = true;
if (this.ScanStared != null)
this.ScanStared(this, new EventArgs());

if (title != 0)
instance.StartScan(sourcePath.ToString(), previewCount, title);
instance.StartScan(source, previewCount, title);
else
instance.StartScan(sourcePath.ToString(), previewCount);
instance.StartScan(source, previewCount);
}
catch (Exception exc)
{
Expand All @@ -200,7 +208,7 @@ private void ScanSource(object sourcePath, int title, int previewCount)
/// </param>
private void InstanceScanCompleted(object sender, EventArgs e)
{
this.SouceData = new Source { Titles = ConvertTitles(this.instance.Titles) };
this.SouceData = new Source { Titles = ConvertTitles(this.instance.Titles), ScanPath = currentSourceScanPath};

IsScanning = false;

Expand Down
Expand Up @@ -231,6 +231,7 @@ private void ScanSource(object sourcePath, int title, int previewCount)
this.readData = new Parser(this.hbProc.StandardError.BaseStream);
this.readData.OnScanProgress += this.OnScanProgress;
this.SouceData = Source.Parse(this.readData);
this.SouceData.ScanPath = source;

// Write the Buffer out to file.
using (StreamWriter scanLog = new StreamWriter(dvdInfoPath))
Expand Down

0 comments on commit 6b32113

Please sign in to comment.