PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. using System;
  2. namespace Delta.Multimedia.Vlc.LibVlc
  3. {
  4. internal class VlcInstance : IDisposable
  5. {
  6. #region Handle (Public)
  7. /// <summary>
  8. /// The handle of the vlc manager.
  9. /// </summary>
  10. public IntPtr Handle
  11. {
  12. get;
  13. private set;
  14. }
  15. #endregion
  16. #region Constructors
  17. /// <summary>
  18. /// Create a new instance of the vlc manager.
  19. /// </summary>
  20. /// <param name="args">The arguments sent to the manager.</param>
  21. public VlcInstance(string[] args)
  22. {
  23. Handle = VlcCore.libvlc_new(args.Length, args);
  24. if (Handle == IntPtr.Zero)
  25. {
  26. throw new VlcException();
  27. }
  28. }
  29. #endregion
  30. #region IDisposable Members
  31. /// <summary>
  32. /// Unload the manager handle.
  33. /// </summary>
  34. public void Dispose()
  35. {
  36. VlcCore.libvlc_release(Handle);
  37. }
  38. #endregion
  39. }
  40. }