本文整理汇总了C#中HandBrake类的典型用法代码示例。如果您正苦于以下问题:C# HandBrake类的具体用法?C# HandBrake怎么用?C# HandBrake使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HandBrake类属于命名空间,在下文中一共展示了HandBrake类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EncodeServiceEncodeCompleted
/// <summary>
/// The encode service_ encode completed.
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The EncodeCompletedEventArgs.
/// </param>
private void EncodeServiceEncodeCompleted(object sender, HandBrake.ApplicationServices.EventArgs.EncodeCompletedEventArgs e)
{
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.GrowlEncode))
{
// GrowlCommunicator.Notify("Encode Completed", "Put down that cocktail...\nyour Handbrake encode is done.");
}
}
示例2: EncodeService_EncodeCompleted
/// <summary>
/// The encode service_ encode completed.
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The EncodeCompletedEventArgs.
/// </param>
private void EncodeService_EncodeCompleted(object sender, HandBrake.ApplicationServices.EventArgs.EncodeCompletedEventArgs e)
{
// Send the file to the users requested applicaiton
if (e.Successful)
{
this.SendToApplication(e.FileName);
}
// Allow the system to sleep again.
Execute.OnUIThread(() =>
{
if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PreventSleep))
{
Win32.AllowSleep();
}
});
}
示例3: EncodeStatusChanged
/// <summary>
/// The Encode Status has changed Handler
/// </summary>
/// <param name="sender">
/// The Sender
/// </param>
/// <param name="e">
/// The Encode Progress Event Args
/// </param>
private void EncodeStatusChanged(object sender, HandBrake.ApplicationServices.EventArgs.EncodeProgressEventArgs e)
{
Execute.OnUIThread(
() =>
{
this.ProgramStatusLabel =
string.Format(
"{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}, Pending Jobs {5}",
e.PercentComplete,
e.CurrentFrameRate,
e.AverageFrameRate,
e.EstimatedTimeLeft,
e.ElapsedTime,
this.queueProcessor.QueueManager.Count);
});
}
示例4: ScanCompleted
/// <summary>
/// Handle the Scan Completed Event
/// </summary>
/// <param name="sender">
/// The Sender
/// </param>
/// <param name="e">
/// The EventArgs
/// </param>
private void ScanCompleted(object sender, HandBrake.ApplicationServices.EventArgs.ScanCompletedEventArgs e)
{
Execute.OnUIThread(() =>
{
if (e.Successful)
{
this.scanService.SouceData.CopyTo(this.ScannedSource);
this.NotifyOfPropertyChange("ScannedSource");
this.NotifyOfPropertyChange("ScannedSource.Titles");
this.SelectedTitle = this.ScannedSource.Titles.FirstOrDefault(t => t.MainTitle)
?? this.ScannedSource.Titles.FirstOrDefault();
this.JobContextService.CurrentSource = this.ScannedSource;
this.JobContextService.CurrentTask = this.CurrentTask;
this.SetupTabs();
this.ShowStatusWindow = false;
}
this.SourceLabel = "Scan Completed";
this.StatusLabel = "Scan Completed";
});
}
示例5: UserSettingServiceSettingChanged
/// <summary>
/// The user setting service_ setting changed.
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The e.
/// </param>
private void UserSettingServiceSettingChanged(object sender, HandBrake.ApplicationServices.EventArgs.SettingChangedEventArgs e)
{
if (e.Key == UserSettingConstants.ShowAdvancedTab)
{
this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);
}
}
示例6: EncodeService_EncodeStatusChanged
/// <summary>
/// Handle the Encode Status Changed Event.
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The EncodeProgressEventArgs.
/// </param>
private void EncodeService_EncodeStatusChanged(object sender, HandBrake.ApplicationServices.EventArgs.EncodeProgressEventArgs e)
{
this.JobStatus = string.Format(
"Encoding: Pass {0} of {1}, {2:00.00}%, FPS: {3:000.0}, Avg FPS: {4:000.0}, Time Remaining: {5}, Elapsed: {6:hh\\:mm\\:ss}",
e.Task,
e.TaskCount,
e.PercentComplete,
e.CurrentFrameRate,
e.AverageFrameRate,
e.EstimatedTimeLeft,
e.ElapsedTime);
}
示例7: ScanServiceWrapperScanCompleted
/// <summary>
/// The scan service Scan Completed Event Handler.
/// Fires CanExecuteChanged
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The ScanCompletedEventArgs.
/// </param>
private void ScanServiceWrapperScanCompleted(object sender, HandBrake.ApplicationServices.EventArgs.ScanCompletedEventArgs e)
{
Caliburn.Micro.Execute.OnUIThread(() => this.CanExecuteChanged(sender, EventArgs.Empty));
}
示例8: ScanStatusChanged
/// <summary>
/// Handle the Scan Status Changed Event.
/// </summary>
/// <param name="sender">
/// The Sender
/// </param>
/// <param name="e">
/// The EventArgs
/// </param>
private void ScanStatusChanged(object sender, HandBrake.ApplicationServices.EventArgs.ScanProgressEventArgs e)
{
this.SourceLabel = string.Format("Scanning Title {0} of {1} ({2}%)", e.CurrentTitle, e.Titles, e.Percentage);
this.StatusLabel = string.Format("Scanning Title {0} of {1} ({2}%)", e.CurrentTitle, e.Titles, e.Percentage);
}
示例9: encodeService_EncodeCompleted
/// <summary>
/// Handle the Encode Completed Event
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The EncodeCompletedEventArgs.
/// </param>
private void encodeService_EncodeCompleted(object sender, HandBrake.ApplicationServices.EventArgs.EncodeCompletedEventArgs e)
{
this.Percentage = "0.00%";
this.PercentageValue = 0;
this.encodeService.EncodeCompleted -= this.encodeService_EncodeCompleted;
this.encodeService.EncodeStatusChanged -= this.encodeService_EncodeStatusChanged;
this.PlayFile();
}
示例10: encodeService_EncodeStatusChanged
/// <summary>
/// Handle Encode Progress Events
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The EncodeProgressEventArgs.
/// </param>
private void encodeService_EncodeStatusChanged(object sender, HandBrake.ApplicationServices.EventArgs.EncodeProgressEventArgs e)
{
this.Percentage = string.Format("{0} %", e.PercentComplete.ToString(CultureInfo.InvariantCulture));
this.PercentageValue = e.PercentComplete;
}
示例11: ScanCompleted
/// <summary>
/// Handle the Scan Completed Event
/// </summary>
/// <param name="sender">
/// The Sender
/// </param>
/// <param name="e">
/// The EventArgs
/// </param>
private void ScanCompleted(object sender, HandBrake.ApplicationServices.EventArgs.ScanCompletedEventArgs e)
{
if (e.Successful)
{
this.ScannedSource = this.scanService.SouceData;
}
}
示例12: EncodeStatusChanged
/// <summary>
/// The Encode Status has changed Handler
/// </summary>
/// <param name="sender">
/// The Sender
/// </param>
/// <param name="e">
/// The Encode Progress Event Args
/// </param>
private void EncodeStatusChanged(object sender, HandBrake.ApplicationServices.EventArgs.EncodeProgressEventArgs e)
{
//
}
示例13: Vm_LogMessageReceived
/// <summary>
/// The vm_ log message received.
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The e.
/// </param>
private void Vm_LogMessageReceived(object sender, HandBrake.ApplicationServices.Services.Logging.EventArgs.LogEventArgs e)
{
try
{
if (e == null)
{
Caliburn.Micro.Execute.OnUIThread(
() =>
{
LogViewModel vm = this.DataContext as LogViewModel;
if (vm != null)
{
this.logText.Clear();
this.logText.AppendText(vm.ActivityLog);
}
else
{
Debug.WriteLine("Failed to Reset Log correctly.");
}
});
}
else
{
// This works better than Data Binding because of the scroll.
this.logText.AppendText(Environment.NewLine + e.Log.Content);
if (this.AutoScroll.IsChecked)
{
this.logText.ScrollToEnd();
}
}
}
catch (Exception exc)
{
Debug.WriteLine(exc);
}
}
示例14: EncodeStatusChanged
/// <summary>
/// The Encode Status has changed Handler
/// </summary>
/// <param name="sender">
/// The Sender
/// </param>
/// <param name="e">
/// The Encode Progress Event Args
/// </param>
private void EncodeStatusChanged(object sender, HandBrake.ApplicationServices.EventArgs.EncodeProgressEventArgs e)
{
int percent;
int.TryParse(
Math.Round(e.PercentComplete).ToString(CultureInfo.InvariantCulture),
out percent);
Execute.OnUIThread(
() =>
{
if (this.queueProcessor.EncodeService.IsEncoding)
{
string josPending = string.Empty;
if (!AppArguments.IsInstantHandBrake)
{
josPending = ", Pending Jobs {5}";
}
this.ProgramStatusLabel =
string.Format(
"{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}, Elapsed: {4:hh\\:mm\\:ss}" + josPending,
e.PercentComplete,
e.CurrentFrameRate,
e.AverageFrameRate,
e.EstimatedTimeLeft,
e.ElapsedTime,
this.queueProcessor.Count);
if (lastEncodePercentage != percent && this.windowsSeven.IsWindowsSeven)
{
this.windowsSeven.SetTaskBarProgress(percent);
}
lastEncodePercentage = percent;
this.ProgressPercentage = percent;
this.NotifyOfPropertyChange(() => ProgressPercentage);
}
else
{
this.ProgramStatusLabel = "Queue Finished";
this.IsEncoding = false;
if (this.windowsSeven.IsWindowsSeven)
{
this.windowsSeven.SetTaskBarProgressToNoProgress();
}
}
});
}
示例15: ScanServiceScanCompleted
/// <summary>
/// The scan service scan completed event
/// </summary>
/// <param name="sender">
/// The sender.
/// </param>
/// <param name="e">
/// The ScanCompletedEventArgs
/// </param>
private void ScanServiceScanCompleted(object sender, HandBrake.ApplicationServices.EventArgs.ScanCompletedEventArgs e)
{
this.ScanCompleted(sender, e);
}