add skip to index feature
This commit is contained in:
parent
9cae5a6bcc
commit
1ab8b5fa7d
1 changed files with 7 additions and 1 deletions
|
@ -16,6 +16,7 @@ namespace MitziPlayer
|
||||||
static int[] Signals;
|
static int[] Signals;
|
||||||
static SerialPort port = null;
|
static SerialPort port = null;
|
||||||
static System.Timers.Timer FrameTimer;
|
static System.Timers.Timer FrameTimer;
|
||||||
|
static string MPVArgs = "";
|
||||||
static long index = 0;
|
static long index = 0;
|
||||||
static int frameSkip = 6;
|
static int frameSkip = 6;
|
||||||
|
|
||||||
|
@ -24,6 +25,11 @@ namespace MitziPlayer
|
||||||
Config = INIFile.Load(args[0]);
|
Config = INIFile.Load(args[0]);
|
||||||
PathPrefix = Path.GetFullPath(args[0]).Replace("manifest.ini", "");
|
PathPrefix = Path.GetFullPath(args[0]).Replace("manifest.ini", "");
|
||||||
Signals = LoadSignals(File.ReadAllLines(PathPrefix+Config.Data["data"]));
|
Signals = LoadSignals(File.ReadAllLines(PathPrefix+Config.Data["data"]));
|
||||||
|
if (args.Count() == 3)
|
||||||
|
{
|
||||||
|
MPVArgs = $"--start={args[2]} ";
|
||||||
|
index = int.Parse(args[2])*60;
|
||||||
|
}
|
||||||
port = new SerialPort(args[1], 9600, Parity.None, 8, StopBits.One);
|
port = new SerialPort(args[1], 9600, Parity.None, 8, StopBits.One);
|
||||||
port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
|
port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
|
||||||
port.Open();
|
port.Open();
|
||||||
|
@ -51,7 +57,7 @@ namespace MitziPlayer
|
||||||
|
|
||||||
static void PlayAudio()
|
static void PlayAudio()
|
||||||
{
|
{
|
||||||
Process.Start("mpv", PathPrefix+Config.Data["audio"]);
|
Process.Start("mpv", MPVArgs+PathPrefix+Config.Data["audio"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PlaySignal(Object sender, ElapsedEventArgs e)
|
static void PlaySignal(Object sender, ElapsedEventArgs e)
|
||||||
|
|
Loading…
Add table
Reference in a new issue