Commit 0eb00629 authored by Martin Finkel's avatar Martin Finkel

[Docs] MediaDiscoverer

parent 5a345658
...@@ -5,9 +5,9 @@ using System.Runtime.InteropServices; ...@@ -5,9 +5,9 @@ using System.Runtime.InteropServices;
namespace LibVLCSharp.Shared namespace LibVLCSharp.Shared
{ {
/// <summary> /// <summary>
/// libvlc v3 check /// MediaDiscoverer should be used to find media on NAS and any SMB/UPnP-enabled device on your local network.
/// </summary> /// </summary>
public partial class MediaDiscoverer : Internal public class MediaDiscoverer : Internal
{ {
MediaDiscovererEventManager _eventManager; MediaDiscovererEventManager _eventManager;
MediaList _mediaList; MediaList _mediaList;
...@@ -47,8 +47,12 @@ namespace LibVLCSharp.Shared ...@@ -47,8 +47,12 @@ namespace LibVLCSharp.Shared
internal static extern IntPtr LibVLCMediaDiscovererMediaList(IntPtr discovererMediaList); internal static extern IntPtr LibVLCMediaDiscovererMediaList(IntPtr discovererMediaList);
} }
/// <summary>
/// Media discoverer constructor
/// </summary>
/// <param name="libVLC">libvlc instance this will be attached to</param>
/// <param name="name">name from one of LibVLC.MediaDiscoverers</param>
public MediaDiscoverer(LibVLC libVLC, string name) public MediaDiscoverer(LibVLC libVLC, string name)
//v3 check. differen ctors
: base(() => Native.LibVLCMediaDiscovererNew(libVLC.NativeReference, name), Native.LibVLCMediaDiscovererRelease) : base(() => Native.LibVLCMediaDiscovererNew(libVLC.NativeReference, name), Native.LibVLCMediaDiscovererRelease)
{ {
} }
...@@ -118,12 +122,18 @@ namespace LibVLCSharp.Shared ...@@ -118,12 +122,18 @@ namespace LibVLCSharp.Shared
#region Events #region Events
/// <summary>
/// Media discovery has been started for this media discoverer
/// </summary>
public event EventHandler<EventArgs> Started public event EventHandler<EventArgs> Started
{ {
add => EventManager.AttachEvent(EventType.MediaDiscovererStarted, value); add => EventManager.AttachEvent(EventType.MediaDiscovererStarted, value);
remove => EventManager.DetachEvent(EventType.MediaDiscovererStarted, value); remove => EventManager.DetachEvent(EventType.MediaDiscovererStarted, value);
} }
/// <summary>
/// Media discovery has been stopped for this media discoverer
/// </summary>
public event EventHandler<EventArgs> Stopped public event EventHandler<EventArgs> Stopped
{ {
add => EventManager.AttachEvent(EventType.MediaDiscovererStopped, value); add => EventManager.AttachEvent(EventType.MediaDiscovererStopped, value);
...@@ -132,6 +142,10 @@ namespace LibVLCSharp.Shared ...@@ -132,6 +142,10 @@ namespace LibVLCSharp.Shared
#endregion #endregion
/// <summary>
/// Dispose of this media discoverer
/// </summary>
/// <param name="disposing">true if called from a method</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (IsDisposed || NativeReference == IntPtr.Zero) if (IsDisposed || NativeReference == IntPtr.Zero)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment