PageRenderTime 183ms CodeModel.GetById 101ms app.highlight 4ms RepoModel.GetById 76ms app.codeStats 1ms

/Multimedia/Vlc/LibVlc/VlcCore.cs

#
C# | 122 lines | 91 code | 19 blank | 12 comment | 0 complexity | 1c6b1243c970e8fe9fd6c880fe9638c9 MD5 | raw file
  1using System;
  2using System.Runtime.InteropServices;
  3
  4namespace Delta.Multimedia.Vlc.LibVlc
  5{
  6	/// <summary>
  7	/// Credits go to Helyar.net which provided a really nice starting point
  8	/// to an own vlc wrapper implementation.
  9	/// <para />
 10	/// http://www.helyar.net/2009/libvlc-media-player-in-c-part-2/
 11	/// <para />
 12	/// For VLC method information see:
 13	/// http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc.html
 14	/// <para />
 15	/// Vlc commands:
 16	/// http://wiki.videolan.org/VLC_command-line_help
 17	/// </summary>
 18	internal static class VlcCore
 19	{
 20		#region libvlc_new (Static)
 21		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 22		public static extern IntPtr libvlc_new(int argc,
 23			[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] argv);
 24		#endregion
 25
 26		#region libvlc_release (Static)
 27		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 28		public static extern void libvlc_release(IntPtr instance);
 29		#endregion
 30
 31		#region libvlc_media_new_location (Static)
 32		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 33		public static extern IntPtr libvlc_media_new_location(IntPtr p_instance,
 34			[MarshalAs(UnmanagedType.LPStr)] string psz_mrl);
 35		#endregion
 36
 37		#region libvlc_media_release (Static)
 38		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 39		public static extern void libvlc_media_release(IntPtr p_meta_desc);
 40		#endregion
 41
 42		#region libvlc_media_get_state (Static)
 43		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 44		public static extern VlcMediaState libvlc_media_get_state(
 45			IntPtr p_meta_desc);
 46		#endregion
 47
 48		#region libvlc_media_player_new_from_media (Static)
 49		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 50		public static extern IntPtr libvlc_media_player_new_from_media(
 51			IntPtr media);
 52		#endregion
 53
 54		#region libvlc_media_player_release (Static)
 55		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 56		public static extern void libvlc_media_player_release(IntPtr player);
 57		#endregion
 58
 59		#region libvlc_media_player_set_hwnd (Static)
 60		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 61		public static extern void libvlc_media_player_set_hwnd(IntPtr player,
 62			IntPtr drawable);
 63		#endregion
 64
 65		#region libvlc_media_player_get_media (Static)
 66		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 67		public static extern IntPtr libvlc_media_player_get_media(IntPtr player);
 68		#endregion
 69
 70		#region libvlc_media_player_set_media (Static)
 71		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 72		public static extern void libvlc_media_player_set_media(IntPtr player,
 73			IntPtr media);
 74		#endregion
 75
 76		#region libvlc_media_player_play (Static)
 77		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 78		public static extern int libvlc_media_player_play(IntPtr player);
 79		#endregion
 80
 81		#region libvlc_media_player_pause (Static)
 82		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 83		public static extern void libvlc_media_player_pause(IntPtr player);
 84		#endregion
 85
 86		#region libvlc_media_player_stop (Static)
 87		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 88		public static extern void libvlc_media_player_stop(IntPtr player);
 89		#endregion
 90
 91		#region libvlc_media_player_get_time (Static)
 92		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 93		public static extern long libvlc_media_player_get_time(IntPtr player);
 94		#endregion
 95
 96		#region libvlc_media_player_get_length (Static)
 97		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
 98		public static extern long libvlc_media_player_get_length(IntPtr player);
 99		#endregion
100
101		#region libvlc_audio_set_volume (Static)
102		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
103		public static extern int libvlc_audio_set_volume(IntPtr player,
104			int volume);
105		#endregion
106
107		#region libvlc_audio_get_volume (Static)
108		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
109		public static extern int libvlc_audio_get_volume(IntPtr player);
110		#endregion
111
112		#region libvlc_clearerr (Static)
113		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
114		public static extern void libvlc_clearerr();
115		#endregion
116
117		#region libvlc_errmsg (Static)
118		[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
119		public static extern IntPtr libvlc_errmsg();
120		#endregion
121	}
122}