// --------------------------------------------------------------------------------------------------------------------
//
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
//
//
// The Interface for HandBrakeInstance
//
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.Interop.Interfaces
{
using System;
using System.Collections.Generic;
using System.Windows.Media.Imaging;
using HandBrake.Interop.EventArgs;
using HandBrake.Interop.Model;
using HandBrake.Interop.SourceData;
///
/// The Interface for HandBrakeInstance
///
public interface IHandBrakeInstance
{
#region Events
///
/// Fires when an encode has completed.
///
event EventHandler EncodeCompleted;
///
/// Fires for progress updates when encoding.
///
event EventHandler EncodeProgress;
///
/// Fires when a scan has completed.
///
event EventHandler ScanCompleted;
///
/// Fires for progress updates when scanning.
///
event EventHandler ScanProgress;
#endregion
#region Properties
///
/// Gets the index of the default title.
///
int FeatureTitle { get; }
///
/// Gets the number of previews created during scan.
///
int PreviewCount { get; }
///
/// Gets the list of titles on this instance.
///
List Titles { get; }
#endregion
#region Public Methods
///
/// Initializes this instance.
///
/// The code for the logging verbosity to use.
void Initialize(int verbosity);
///
/// Calculates the video bitrate for the given job and target size.
///
///
/// The encode job.
///
///
/// The target size in MB.
///
///
/// The currently selected encode length. Used in preview
/// for calculating bitrate when the target size would be wrong.
///
///
/// The video bitrate in kbps.
///
int CalculateBitrate(EncodeJob job, int sizeMB, double overallSelectedLengthSeconds = 0);
///
/// Gives estimated file size (in MB) of the given job and video bitrate.
///
///
/// The encode job.
///
///
/// The video bitrate to be used (kbps).
///
///
/// The estimated file size (in MB) of the given job and video bitrate.
///
double CalculateFileSize(EncodeJob job, int videoBitrate);
///
/// Frees any resources associated with this object.
///
void Dispose();
///
/// Gets an image for the given job and preview
///
///
/// Only incorporates sizing and aspect ratio into preview image.
///
///
/// The encode job to preview.
///
///
/// The index of the preview to get (0-based).
///
///
/// An image with the requested preview.
///
BitmapImage GetPreview(EncodeJob job, int previewNumber);
///
/// Gets the final size for a given encode job.
///
///
/// The encode job to use.
///
///
/// The storage width.
///
///
/// The storage height.
///
///
/// The pixel aspect X number.
///
///
/// The pixel aspect Y number.
///
void GetSize(EncodeJob job, out int width, out int height, out int parWidth, out int parHeight);
///
/// Pauses the current encode.
///
void PauseEncode();
///
/// Resumes a paused encode.
///
void ResumeEncode();
///
/// Starts an encode with the given job.
///
///
/// The job to start.
///
void StartEncode(EncodeJob jobToStart);
///
/// Starts an encode with the given job.
///
///
/// The job to start.
///
///
/// True if this is a preview encode.
///
///
/// The preview number to start the encode at (0-based).
///
///
/// The number of seconds in the preview.
///
///
/// The currently selected encode length. Used in preview
/// for calculating bitrate when the target size would be wrong.
///
void StartEncode(
EncodeJob job, bool preview, int previewNumber, int previewSeconds, double overallSelectedLengthSeconds);
///
/// Starts scanning the given path.
///
///
/// The path to the video to scan.
///
///
/// The number of preview images to make.
///
void StartScan(string path, int previewCount);
///
/// Starts a scan of the given path.
///
///
/// The path of the video to scan.
///
///
/// The number of previews to make on each title.
///
///
/// The title index to scan (1-based, 0 for all titles).
///
void StartScan(string path, int previewCount, int titleIndex);
///
/// Stops the current encode.
///
void StopEncode();
///
/// Stop any running scans
///
void StopScan();
#endregion
}
}