mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
FFMpegCore: enable root configuration view ctor
Former-commit-id: 02ac7c5ac0
This commit is contained in:
parent
0cb4f0e660
commit
2fe729832e
2 changed files with 27 additions and 5 deletions
|
@ -14,12 +14,27 @@ public abstract class FFBase : IDisposable
|
||||||
protected string ConfiguredRoot;
|
protected string ConfiguredRoot;
|
||||||
protected Process Process;
|
protected Process Process;
|
||||||
|
|
||||||
protected FFBase()
|
protected FFBase(FFMpegOptions opts = null)
|
||||||
{
|
{
|
||||||
ConfiguredRoot =
|
var options = opts;
|
||||||
!File.Exists(_ConfigFile) ?
|
|
||||||
_DefaultRoot :
|
if (
|
||||||
JsonConvert.DeserializeObject<Dictionary<string, string>>(File.ReadAllText(_ConfigFile))["RootDirectory"];
|
opts == null &&
|
||||||
|
File.Exists(_ConfigFile)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
options = JsonConvert.DeserializeObject<FFMpegOptions>(File.ReadAllText(_ConfigFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options == null)
|
||||||
|
{
|
||||||
|
options = new FFMpegOptions
|
||||||
|
{
|
||||||
|
RootDirectory = _DefaultRoot
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfiguredRoot = options.RootDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
7
FFMpegCore/FFMPEG/FFMpegOptions.cs
Normal file
7
FFMpegCore/FFMPEG/FFMpegOptions.cs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
namespace FFMpegCore.FFMPEG
|
||||||
|
{
|
||||||
|
public class FFMpegOptions
|
||||||
|
{
|
||||||
|
public string RootDirectory { get; set; }
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue