/Multimedia/Vlc/LibVlc/VlcInstance.cs
C# | 43 lines | 30 code | 3 blank | 10 comment | 2 complexity | e9b2207e501ddeb9583b0fb16fca858a MD5 | raw file
Possible License(s): Apache-2.0
- using System;
-
- namespace Delta.Multimedia.Vlc.LibVlc
- {
- internal class VlcInstance : IDisposable
- {
- #region Handle (Public)
- /// <summary>
- /// The handle of the vlc manager.
- /// </summary>
- public IntPtr Handle
- {
- get;
- private set;
- }
- #endregion
-
- #region Constructors
- /// <summary>
- /// Create a new instance of the vlc manager.
- /// </summary>
- /// <param name="args">The arguments sent to the manager.</param>
- public VlcInstance(string[] args)
- {
- Handle = VlcCore.libvlc_new(args.Length, args);
- if (Handle == IntPtr.Zero)
- {
- throw new VlcException();
- }
- }
- #endregion
-
- #region IDisposable Members
- /// <summary>
- /// Unload the manager handle.
- /// </summary>
- public void Dispose()
- {
- VlcCore.libvlc_release(Handle);
- }
- #endregion
- }
- }