C# Class Business.MediaEncoderBusiness

Afficher le fichier Open project: mysteryx93/NaturalGroundingPlayer Class Usage Examples

Méthodes publiques

Свойство Type Description
ProcessingQueue ObservableCollection

Méthodes publiques

Méthode 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

Méthode 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 méthode

public ApplyInterFrame ( AviSynthScriptBuilder Script, MediaEncoderSettings settings, int CPU ) : void
Script AviSynthScriptBuilder
settings MediaEncoderSettings
CPU int
Résultat void

AutoLoadJobsAsync() public méthode

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

AutoLoadPreviewFileAsync() public méthode

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

ClearTempFolder() public static méthode

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

ConvertAudioBitrateToQuality() public méthode

public ConvertAudioBitrateToQuality ( int bitrate ) : int
bitrate int
Résultat int

ConvertAudioQualityToBitrate() public méthode

public ConvertAudioQualityToBitrate ( int q ) : int
q int
Résultat int

CustomScriptHasChanges() public méthode

public CustomScriptHasChanges ( MediaEncoderSettings settings ) : bool
settings MediaEncoderSettings
Résultat bool

DeleteJobFiles() public méthode

public DeleteJobFiles ( MediaEncoderSettings settings ) : void
settings MediaEncoderSettings
Résultat void

DeletePreviewFilesAsync() public méthode

public DeletePreviewFilesAsync ( ) : Task
Résultat Task

EncodeAudio() public méthode

public EncodeAudio ( MediaEncoderSettings settings ) : bool
settings MediaEncoderSettings
Résultat bool

EncodeFileAsync() public méthode

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.
Résultat Task

FinalizeKeep() public méthode

public FinalizeKeep ( EncodingCompletedEventArgs jobInfo ) : void
jobInfo EncodingCompletedEventArgs
Résultat void

FinalizeReplace() public méthode

public FinalizeReplace ( EncodingCompletedEventArgs jobInfo ) : void
jobInfo EncodingCompletedEventArgs
Résultat void

GenerateCustomScript() public méthode

public GenerateCustomScript ( MediaEncoderSettings settings ) : void
settings MediaEncoderSettings
Résultat void

GenerateScript() public méthode

public GenerateScript ( MediaEncoderSettings settings, bool preview, bool multiThreaded ) : void
settings MediaEncoderSettings
preview bool
multiThreaded bool
Résultat void

GenerateVideoScript() public méthode

public GenerateVideoScript ( MediaEncoderSettings settings, string inputFile, bool preview, bool multiThreaded ) : AviSynthScriptBuilder
settings MediaEncoderSettings
inputFile string
preview bool
multiThreaded bool
Résultat AviSynthScriptBuilder

GetNextAvailableFileName() public méthode

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

GetPreviewSourceFile() public méthode

public GetPreviewSourceFile ( MediaEncoderSettings settings ) : string
settings MediaEncoderSettings
Résultat string

LoadSettingsFile() public méthode

public LoadSettingsFile ( string fileName ) : MediaEncoderSettings
fileName string
Résultat MediaEncoderSettings

MovePreviewFilesAsync() public méthode

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

PreparePreviewFile() public méthode

public PreparePreviewFile ( MediaEncoderSettings settings, bool overwrite ) : Task
settings MediaEncoderSettings
overwrite bool
Résultat Task

SafeMove() public méthode

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.
Résultat string

SaveSettingsFile() public méthode

public SaveSettingsFile ( MediaEncoderSettings settings, string fileName ) : void
settings MediaEncoderSettings
fileName string
Résultat void

Property Details

ProcessingQueue public_oe static_oe property

public static ObservableCollection ProcessingQueue
Résultat ObservableCollection