public VlcMediaListPlayer(IVlcControl vlcControl) { var handle = VlcContext.InteropManager.MediaListPlayerInterops.NewInstance.Invoke(VlcContext.HandleManager.LibVlcHandle); VlcContext.HandleManager.MediasListPlayerHandles.Add(this, handle); myVlcControlHost = vlcControl; myVlcMediaList = new VlcMediaList(); VlcContext.InteropManager.MediaListPlayerInterops.SetMediaList.Invoke( VlcContext.HandleManager.MediasListPlayerHandles[this], VlcContext.HandleManager.MediasListHandles[myVlcMediaList]); VlcContext.InteropManager.MediaListPlayerInterops.SetMediaPlayer.Invoke( VlcContext.HandleManager.MediasListPlayerHandles[this], VlcContext.HandleManager.MediaPlayerHandles[myVlcControlHost]); }
/// <summary> /// Close of LibVlc and VlcControls instance /// </summary> public static void CloseAll() { if (HandleManager != null) { var mediaBases = new MediaBase[HandleManager.MediasHandles.Count]; HandleManager.MediasHandles.Keys.CopyTo(mediaBases, 0); foreach (MediaBase mediaBase in mediaBases) { mediaBase.Dispose(); } if (HandleManager.MediaPlayerHandles != null) { var mediaPlayers = new IVlcControl[HandleManager.MediaPlayerHandles.Count]; HandleManager.MediaPlayerHandles.Keys.CopyTo(mediaPlayers, 0); foreach (IVlcControl mediaPlayerHandle in mediaPlayers) { mediaPlayerHandle.Dispose(); } HandleManager.MediaPlayerHandles.Clear(); } if (InteropManager != null) { InteropManager.ReleaseInstance.Invoke(HandleManager.LibVlcHandle); } HandleManager.LibVlcHandle = IntPtr.Zero; } ErrorHandling = null; if (InteropManager == null) { return; } InteropManager.Dispose(); InteropManager = null; IsInitialized = false; }
internal VlcVideoProperties(IVlcControl vlcControl) { myHostVlcControl = vlcControl; }
internal VlcAudioProperties(IVlcControl vlcControl) { myHostVlcControl = vlcControl; }
/// <summary> /// Close of LibVlc and VlcControls instance /// </summary> public static void CloseAll() { if (HandleManager != null) { var mediaBases = new MediaBase[HandleManager.MediasHandles.Count]; HandleManager.MediasHandles.Keys.CopyTo(mediaBases, 0); foreach (MediaBase mediaBase in mediaBases) { mediaBase.Dispose(); } if (HandleManager.MediaPlayerHandles != null) { var mediaPlayers = new IVlcControl[HandleManager.MediaPlayerHandles.Count]; HandleManager.MediaPlayerHandles.Keys.CopyTo(mediaPlayers, 0); foreach (IVlcControl mediaPlayerHandle in mediaPlayers) { mediaPlayerHandle.Dispose(); } HandleManager.MediaPlayerHandles.Clear(); } if (InteropManager != null) InteropManager.ReleaseInstance.Invoke(HandleManager.LibVlcHandle); HandleManager.LibVlcHandle = IntPtr.Zero; } ErrorHandling = null; if (InteropManager == null) return; InteropManager.Dispose(); InteropManager = null; IsInitialized = false; }