C# Class Business.MediaEncoderBusiness

Mostra file Open project: mysteryx93/NaturalGroundingPlayer Class Usage Examples

Public Properties

Property Type Description
ProcessingQueue ObservableCollection

Public Methods

Method Description
ApplyInterFrame ( AviSynthScriptBuilder Script, MediaEncoderSettings settings, int CPU ) : void
AutoLoadJobsAsync ( ) : Task

Automatically reloads jobs if the encoder was unexpectedly closed.

AutoLoadPreviewFileAsync ( ) : Task

Auto-load Preview file if encoded was unexpectedly closed.

ClearTempFolder ( ) : void

Clears the temp folder (unfinished downloads) except Media Encoder files.

ConvertAudioBitrateToQuality ( int bitrate ) : int
ConvertAudioQualityToBitrate ( int q ) : int
CustomScriptHasChanges ( MediaEncoderSettings settings ) : bool
DeleteJobFiles ( MediaEncoderSettings settings ) : void
DeletePreviewFilesAsync ( ) : Task
EncodeAudio ( MediaEncoderSettings settings ) : bool
EncodeFileAsync ( MediaEncoderSettings settings ) : Task

Starts encoding with specified settings. If an encoding is already in process, it will be added to the queue and start once the previous encodings are finished.

FinalizeKeep ( EncodingCompletedEventArgs jobInfo ) : void
FinalizeReplace ( EncodingCompletedEventArgs jobInfo ) : void
GenerateCustomScript ( MediaEncoderSettings settings ) : void
GenerateScript ( MediaEncoderSettings settings, bool preview, bool multiThreaded ) : void
GenerateVideoScript ( MediaEncoderSettings settings, string inputFile, bool preview, bool multiThreaded ) : AviSynthScriptBuilder
GetNextAvailableFileName ( string dest ) : string

Returns the next available file name to avoid overriding an existing file.

GetPreviewSourceFile ( MediaEncoderSettings settings ) : string
LoadSettingsFile ( string fileName ) : MediaEncoderSettings
MovePreviewFilesAsync ( MediaEncoderSettings settings ) : Task

Moves specified settings file as preview files.

PreparePreviewFile ( MediaEncoderSettings settings, bool overwrite ) : Task
SafeMove ( string source, string dest ) : string

Moves specified file to specified destination, numerating the destination to avoid duplicates and attempting several times.

SaveSettingsFile ( MediaEncoderSettings settings, string fileName ) : void

Private Methods

Method Description
EncodeFileThread ( MediaEncoderSettings settings ) : EncodingCompletedEventArgs
FinalizeEncoding ( MediaEncoderSettings settings, System.DateTime startTime ) : EncodingCompletedEventArgs
GetEncodingResults ( MediaEncoderSettings settings, string finalFile, System.DateTime startTime ) : EncodingCompletedEventArgs
GetMediaInfo ( string previewFile, MediaEncoderSettings settings ) : Task
Getx264Process ( ) : Process
IsFileLocked ( string fileName ) : bool

Returns whether specified file is in use.

StartEncodeFileAsync ( MediaEncoderSettings settings ) : Task
WaitEncodeProcessAsync ( MediaEncoderSettings settings, Process jobProcess ) : Task

Method Details

ApplyInterFrame() public method

public ApplyInterFrame ( AviSynthScriptBuilder Script, MediaEncoderSettings settings, int CPU ) : void
Script AviSynthScriptBuilder
settings MediaEncoderSettings
CPU int
return void

AutoLoadJobsAsync() public method

Automatically reloads jobs if the encoder was unexpectedly closed.
public AutoLoadJobsAsync ( ) : Task
return Task

AutoLoadPreviewFileAsync() public method

Auto-load Preview file if encoded was unexpectedly closed.
public AutoLoadPreviewFileAsync ( ) : Task
return Task

ClearTempFolder() public static method

Clears the temp folder (unfinished downloads) except Media Encoder files.
public static ClearTempFolder ( ) : void
return void

ConvertAudioBitrateToQuality() public method

public ConvertAudioBitrateToQuality ( int bitrate ) : int
bitrate int
return int

ConvertAudioQualityToBitrate() public method

public ConvertAudioQualityToBitrate ( int q ) : int
q int
return int

CustomScriptHasChanges() public method

public CustomScriptHasChanges ( MediaEncoderSettings settings ) : bool
settings MediaEncoderSettings
return bool

DeleteJobFiles() public method

public DeleteJobFiles ( MediaEncoderSettings settings ) : void
settings MediaEncoderSettings
return void

DeletePreviewFilesAsync() public method

public DeletePreviewFilesAsync ( ) : Task
return Task

EncodeAudio() public method

public EncodeAudio ( MediaEncoderSettings settings ) : bool
settings MediaEncoderSettings
return bool

EncodeFileAsync() public method

Starts encoding with specified settings. If an encoding is already in process, it will be added to the queue and start once the previous encodings are finished.
public EncodeFileAsync ( MediaEncoderSettings settings ) : Task
settings MediaEncoderSettings The encoding settings.
return Task

FinalizeKeep() public method

public FinalizeKeep ( EncodingCompletedEventArgs jobInfo ) : void
jobInfo EncodingCompletedEventArgs
return void

FinalizeReplace() public method

public FinalizeReplace ( EncodingCompletedEventArgs jobInfo ) : void
jobInfo EncodingCompletedEventArgs
return void

GenerateCustomScript() public method

public GenerateCustomScript ( MediaEncoderSettings settings ) : void
settings MediaEncoderSettings
return void

GenerateScript() public method

public GenerateScript ( MediaEncoderSettings settings, bool preview, bool multiThreaded ) : void
settings MediaEncoderSettings
preview bool
multiThreaded bool
return void

GenerateVideoScript() public method

public GenerateVideoScript ( MediaEncoderSettings settings, string inputFile, bool preview, bool multiThreaded ) : AviSynthScriptBuilder
settings MediaEncoderSettings
inputFile string
preview bool
multiThreaded bool
return AviSynthScriptBuilder

GetNextAvailableFileName() public method

Returns the next available file name to avoid overriding an existing file.
public GetNextAvailableFileName ( string dest ) : string
dest string The attempted destination.
return string

GetPreviewSourceFile() public method

public GetPreviewSourceFile ( MediaEncoderSettings settings ) : string
settings MediaEncoderSettings
return string

LoadSettingsFile() public method

public LoadSettingsFile ( string fileName ) : MediaEncoderSettings
fileName string
return MediaEncoderSettings

MovePreviewFilesAsync() public method

Moves specified settings file as preview files.
public MovePreviewFilesAsync ( MediaEncoderSettings settings ) : Task
settings MediaEncoderSettings The settings to use for re-encoding.
return Task

PreparePreviewFile() public method

public PreparePreviewFile ( MediaEncoderSettings settings, bool overwrite ) : Task
settings MediaEncoderSettings
overwrite bool
return Task

SafeMove() public method

Moves specified file to specified destination, numerating the destination to avoid duplicates and attempting several times.
public SafeMove ( string source, string dest ) : string
source string The file to move.
dest string The destination to move the file to.
return string

SaveSettingsFile() public method

public SaveSettingsFile ( MediaEncoderSettings settings, string fileName ) : void
settings MediaEncoderSettings
fileName string
return void

Property Details

ProcessingQueue public_oe static_oe property

public static ObservableCollection ProcessingQueue
return ObservableCollection