public MMInterface(MMParameters parmsBlock, WindowParent window) { _parms = parmsBlock; _windowParent = window; _taskList = new List<MM_TASK>(); _thread = new Thread(threadLoop); _thread.Name = "mmInterface"; _ewh = new EventWaitHandle(false, EventResetMode.AutoReset); _thread.Start(); }
//---------------------- PARAM FUNCTIONS -------------------------// public static void InitClientParms(uint ar, MMParameters parms) { parms.Context = CONTEXT.EXTERNAL; parms.ChildMarker = 0; parms.uintID = 0; parms.ARGBTheme = 0x00FFFF; parms.TimeoutMS = 10000; parms.Logpath = null; parms.Open = new Open(); parms.Play = new Play(); parms.Window = new WindowForm(); parms.Dewarp = new Dewarp(); parms.Zoom = new Zoom(); parms.Source = new Source(); parms.Open.URL = ""; parms.Open.UserName = ""; parms.Open.PassWord = ""; parms.Open.Reserved = 0; parms.Open.OpenParms.Size = (uint)Marshal.SizeOf(typeof(MM_CLIENT_OPEN)); parms.Open.OpenParms.PURL = IntPtr.Zero; parms.Open.OpenParms.PDataCBKFN = null; parms.Open.OpenParms.PDataUserData = IntPtr.Zero; parms.Open.OpenParms.PStatusCBKFN = null; parms.Open.OpenParms.PStatusUserData = IntPtr.Zero; parms.Open.OpenParms.OpenFlags = MM_CLIENT_REQUEST.MM_CLIENT_REQUEST_VIDEO_SOURCE | MM_CLIENT_REQUEST.MM_CLIENT_REQUEST_VIDEO_TO_DISPLAY; parms.Open.OpenParms.BRepeat = 1; parms.Open.OpenParms.HWnd = IntPtr.Zero; parms.Open.OpenParms.BNetTCP = 1; parms.Open.OpenParms.CacheVideo = 1000; // 1000 = 1 second parms.Open.OpenParms.CacheAudio = 1000; // 1000 = 1 second parms.Open.OpenParms.PReserved = IntPtr.Zero; parms.Play.StartTime = ""; parms.Play.EndTime = ""; parms.Play.PlayParms.Size = (uint)Marshal.SizeOf(typeof(MM_CLIENT_PLAY)); parms.Play.PlayParms.PStartTime = IntPtr.Zero; parms.Play.PlayParms.PEndTime = IntPtr.Zero; parms.Play.PlayParms.Speed = MM_CLIENT_SPEED.MM_CLIENT_SPEED_ONE; parms.Play.PlayParms.BReverse = 0; parms.Window.WindowParms.Size = (uint)Marshal.SizeOf(typeof(MM_WINDOW)); parms.Window.WindowParms.Placement.Top = 100; parms.Window.WindowParms.Placement.Left = 100; parms.Window.WindowParms.Placement.Right = 640; parms.Window.WindowParms.Placement.Bottom = 480; parms.Window.WindowParms.BorderAndTitleBar = false; parms.Window.WindowParms.ShowState = SHOWSTATE.SHOW; parms.Window.WindowParms.ZOrder = 0; parms.Window.WindowParms.TopMost = false; parms.Window.WindowParms.Alarm = 0; parms.Window.WindowParms.AlarmRGB = 0xFF0000; parms.Dewarp.DewarpParms.Size = (uint)Marshal.SizeOf(typeof(MM_CLIENT_DEWARP)); parms.Dewarp.DewarpParms.BSessionEnabled = 0; parms.Dewarp.DewarpParms.PanoFactor = 1; parms.Dewarp.DewarpParms.FOV = 1.2217304763960306f; parms.Dewarp.DewarpParms.XAngle = 0.0f; parms.Dewarp.DewarpParms.YAngle = 0.0f; parms.Dewarp.DewarpParms.XAngleB = 0.0f; parms.Dewarp.DewarpParms.BHorViewMode = 1; parms.Dewarp.DewarpParms.FOVRot = 0.0f; parms.Dewarp.DewarpParms.XCenter = 0.5f; parms.Dewarp.DewarpParms.YCenter = 0.5f; parms.Dewarp.DewarpParms.Radius = 0.5f; parms.Dewarp.DewarpParms.HStretch = 1.0f; parms.Zoom.ZoomParms.Top = 0; parms.Zoom.ZoomParms.Left = 0; parms.Zoom.ZoomParms.Right = 0; parms.Zoom.ZoomParms.Bottom = 0; parms.Source.SourceParms.Size = (uint)Marshal.SizeOf(typeof(MM_CLIENT_SOURCE)); parms.Source.SourceParms.Flags = 0; parms.Source.SourceParms.BRender = 1; parms.Source.SourceParms.BEnforceAR = ar; }