add skip to index feature

This commit is contained in:
Persephone Bubblegum-Holidy 2025-04-25 22:28:37 -07:00
parent 9cae5a6bcc
commit 1ab8b5fa7d

View file

@ -16,6 +16,7 @@ namespace MitziPlayer
static int[] Signals;
static SerialPort port = null;
static System.Timers.Timer FrameTimer;
static string MPVArgs = "";
static long index = 0;
static int frameSkip = 6;
@ -24,6 +25,11 @@ namespace MitziPlayer
Config = INIFile.Load(args[0]);
PathPrefix = Path.GetFullPath(args[0]).Replace("manifest.ini", "");
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.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);
port.Open();
@ -51,7 +57,7 @@ namespace MitziPlayer
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)