public void Pause() { if (PlayProcessId != 0) { CommandPipe_Client client = new CommandPipe_Client(PlayProcessId); client.SendData("Cmd:Pause"); Console.WriteLine("ClientCmd:Pause_" + PlayProcessId.ToString()); } }
public void Play(double TimePosition = 0) { if (PlayProcessId != 0) { try { if (Process.GetProcessById(PlayProcessId).HasExited) { PlayProcessId = 0; } else { CommandPipe_Client client = new CommandPipe_Client(PlayProcessId); client.SendData("Cmd:Play"); return; } } catch { PlayProcessId = 0; } } if (SingerDataFinder == null) { return; } isBufferEmpty = false; GenerateBinaryFile(TimePosition); string[] args = new string[] { Process.GetCurrentProcess().Id.ToString() }; ProcessStartInfo psi = new ProcessStartInfo(AppDomain.CurrentDomain.BaseDirectory + "\\VocalUtau.Wavtools.Render.exe", String.Join(" ", args)); if (PlayProcessId != 0) { Process.GetProcessById(PlayProcessId).Kill(); PlayProcessId = 0; } Process p = new Process(); p.StartInfo = psi; p.Start(); PlayProcessId = p.Id; _InitPosition = TimePosition; }
public void PipeSend_Async(string Cmd) { if (PlayProcessId != 0) { try { if (Process.GetProcessById(PlayProcessId).HasExited) { PlayProcessId = 0; } } catch { PlayProcessId = 0; } } if (PlayProcessId != 0) { CommandPipe_Client client = new CommandPipe_Client(PlayProcessId); client.SendData(Cmd); } }