private void Init(DataTable t) { this.Id = t.GetInt("id"); this.Name = t.GetStr("name"); this.DriverPath = t.GetStr("driver_path"); this.DriverIndex = t.GetInt("driver_index"); this.server = new TunerServer(this.DriverId, this.DriverPath); }
public Tuner(string name, string driverPath) { this.Id = -1; this.Name = name; this.DriverPath = driverPath; this.DriverIndex = 0; this.server = new TunerServer(this.DriverId, this.DriverPath); }
private string Func(TunerServer.Api api, string arg, bool isRet) { IntPtr intPtr = TunerServer.FindWindow("/tvmaid/win", this.driverId); if (intPtr == IntPtr.Zero) { throw new Exception("TVTest呼び出しに失敗しました(TVTestが終了されました)。"); } Ticket ticket = new Ticket("/tvmaid/mutex/call/" + this.driverId); Shared shared = null; Shared shared2 = null; string result; try { if (!ticket.GetOwner(60000)) { throw new Exception("TVTest呼び出しに失敗しました(タイムアウト)。"); } if (arg != null) { shared = new Shared("/tvmaid/map/in/" + this.driverId); shared.Write(arg); } if (isRet) { shared2 = new Shared("/tvmaid/map/out/" + this.driverId); } UIntPtr uIntPtr; if (TunerServer.SendMessageTimeout(intPtr, (uint)api, UIntPtr.Zero, IntPtr.Zero, 0u, 60000u, out uIntPtr).ToInt32() == 0) { throw new Exception("TVTest呼び出しに失敗しました(タイムアウト)。"); } uint num = uIntPtr.ToUInt32(); if (num != 0u) { throw new TunerServerExceotion(num); } result = (isRet ? shared2.Read() : null); } finally { if (shared != null) { shared.Dispose(); } if (shared2 != null) { shared2.Dispose(); } ticket.Dispose(); } return(result); }
public bool IsOpen() { return(TunerServer.FindWindow("/tvmaid/win", this.driverId) != IntPtr.Zero); }