<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tappen</id>
	<title>VideoLAN Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tappen"/>
	<link rel="alternate" type="text/html" href="https://wiki.videolan.org/Special:Contributions/Tappen/"/>
	<updated>2026-11-04T14:51:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=NativeLibVlc.cs&amp;diff=8423</id>
		<title>NativeLibVlc.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=NativeLibVlc.cs&amp;diff=8423"/>
		<updated>2007-04-21T01:44:54Z</updated>

		<summary type="html">&lt;p&gt;Tappen: Fixed a bug in Stop().  It was pausing instead of stopping.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{example code|l=LGPL|for=.Net Interface to VLC}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * NativeLibVlc.cs: NativeLibVlc class definition&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Diagnostics;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.IO;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using Microsoft.Win32;&lt;br /&gt;
&lt;br /&gt;
namespace VLanControl&lt;br /&gt;
{&lt;br /&gt;
	internal enum ObjectType : int&lt;br /&gt;
	{&lt;br /&gt;
		VLC_OBJECT_ROOT = (-1),&lt;br /&gt;
		VLC_OBJECT_VLC = (-2),&lt;br /&gt;
		VLC_OBJECT_MODULE = (-3),&lt;br /&gt;
		VLC_OBJECT_INTF = (-4),&lt;br /&gt;
		VLC_OBJECT_PLAYLIST = (-5),&lt;br /&gt;
		VLC_OBJECT_ITEM = (-6),&lt;br /&gt;
		VLC_OBJECT_INPUT = (-7),&lt;br /&gt;
		VLC_OBJECT_DECODER = (-8),&lt;br /&gt;
		VLC_OBJECT_VOUT = (-9),&lt;br /&gt;
		VLC_OBJECT_AOUT = (-10),&lt;br /&gt;
		VLC_OBJECT_SOUT = (-11),&lt;br /&gt;
		VLC_OBJECT_HTTPD = (-12),&lt;br /&gt;
		VLC_OBJECT_PACKETIZER = (-13),&lt;br /&gt;
		VLC_OBJECT_ENCODER = (-14),&lt;br /&gt;
		VLC_OBJECT_DIALOGS = (-15),&lt;br /&gt;
		VLC_OBJECT_VLM = (-16),&lt;br /&gt;
		VLC_OBJECT_ANNOUNCE = (-17),&lt;br /&gt;
		VLC_OBJECT_DEMUX = (-18),&lt;br /&gt;
		VLC_OBJECT_ACCESS = (-19),&lt;br /&gt;
		VLC_OBJECT_STREAM = (-20),&lt;br /&gt;
		VLC_OBJECT_OPENGL = (-21),&lt;br /&gt;
		VLC_OBJECT_FILTER = (-22),&lt;br /&gt;
		VLC_OBJECT_VOD = (-23),&lt;br /&gt;
		VLC_OBJECT_SPU = (-24),&lt;br /&gt;
		VLC_OBJECT_TLS = (-25),&lt;br /&gt;
		VLC_OBJECT_SD = (-26),&lt;br /&gt;
		VLC_OBJECT_XML = (-27),&lt;br /&gt;
		VLC_OBJECT_OSDMENU = (-28),&lt;br /&gt;
		VLC_OBJECT_STATS = (-29),&lt;br /&gt;
		VLC_OBJECT_HTTPD_HOST = (-30),&lt;br /&gt;
&lt;br /&gt;
		VLC_OBJECT_GENERIC = (-666),&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	internal enum VlcError : int&lt;br /&gt;
	{&lt;br /&gt;
		Success = -0,&lt;br /&gt;
		NoMem = -1,&lt;br /&gt;
		Thread = -2,&lt;br /&gt;
		Timeout = -3,&lt;br /&gt;
&lt;br /&gt;
		NoMod = -10,&lt;br /&gt;
&lt;br /&gt;
		NoObj = -20,&lt;br /&gt;
		BadObj = -21,&lt;br /&gt;
&lt;br /&gt;
		NoVar = -30,&lt;br /&gt;
		BadVar = -31,&lt;br /&gt;
&lt;br /&gt;
		Exit = -255,&lt;br /&gt;
		Generic = -666,&lt;br /&gt;
&lt;br /&gt;
		Exception = -998,&lt;br /&gt;
		NoInit = -999,&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	internal enum InputState : int&lt;br /&gt;
	{&lt;br /&gt;
		INIT_S = 0,&lt;br /&gt;
		OPENING_S = 1,&lt;br /&gt;
		BUFFERING_S = 2,&lt;br /&gt;
		PLAYING_S = 3,&lt;br /&gt;
		PAUSE_S = 4,&lt;br /&gt;
		END_S = 5,&lt;br /&gt;
		ERROR_S = 6,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	internal class NativeLibVlc : IDisposable&lt;br /&gt;
	{&lt;br /&gt;
        #region private vlc enums&lt;br /&gt;
&lt;br /&gt;
        enum Mode : int&lt;br /&gt;
        {&lt;br /&gt;
            Insert      = 0x01,&lt;br /&gt;
            Replace     = 0x02,&lt;br /&gt;
            Append      = 0x04,&lt;br /&gt;
            Go          = 0x08,&lt;br /&gt;
            CheckInsert = 0x10&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
		public const Int32 EndOfPlaylist = -666;&lt;br /&gt;
&lt;br /&gt;
		[Flags]&lt;br /&gt;
		enum ObjectSearchMode : int&lt;br /&gt;
		{&lt;br /&gt;
			FIND_PARENT         = 0x0001,&lt;br /&gt;
			FIND_CHILD          = 0x0002,&lt;br /&gt;
			FIND_ANYWHERE       = 0x0003,&lt;br /&gt;
			FIND_STRICT         = 0x0010,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Flags]&lt;br /&gt;
		enum VarFlags : int&lt;br /&gt;
		{&lt;br /&gt;
			/** \defgroup var_flags Additive flags&lt;br /&gt;
			 * These flags are added to the type field of the variable. Most as a result of&lt;br /&gt;
			 * a __var_Change() call, but some may be added at creation time&lt;br /&gt;
			 * @{&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_HASCHOICE     = 0x0100,&lt;br /&gt;
			VLC_VAR_HASMIN        = 0x0200,&lt;br /&gt;
			VLC_VAR_HASMAX        = 0x0400,&lt;br /&gt;
			VLC_VAR_HASSTEP       = 0x0800,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_ISLIST        = 0x1000,&lt;br /&gt;
			VLC_VAR_ISCOMMAND     = 0x2000,&lt;br /&gt;
			VLC_VAR_ISCONFIG      = 0x2000,&lt;br /&gt;
&lt;br /&gt;
			/** Creation flag */&lt;br /&gt;
			VLC_VAR_DOINHERIT     = 0x8000,&lt;br /&gt;
&lt;br /&gt;
			/**&lt;br /&gt;
			 * \defgroup var_action Variable actions&lt;br /&gt;
			 * These are the different actions that can be used with __var_Change().&lt;br /&gt;
			 * The parameters given are the meaning of the two last parameters of&lt;br /&gt;
			 * __var_Change() when this action is being used.&lt;br /&gt;
			 * @{&lt;br /&gt;
			 */&lt;br /&gt;
&lt;br /&gt;
			/**&lt;br /&gt;
			 * Set the minimum value of this variable&lt;br /&gt;
			 * \param p_val The new minimum value&lt;br /&gt;
			 * \param p_val2 Unused&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_SETMIN              = 0x0010,&lt;br /&gt;
			/**&lt;br /&gt;
			 * Set the maximum value of this variable&lt;br /&gt;
			 * \param p_val The new maximum value&lt;br /&gt;
			 * \param p_val2 Unused&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_SETMAX              = 0x0011,&lt;br /&gt;
			VLC_VAR_SETSTEP             = 0x0012,&lt;br /&gt;
			/**&lt;br /&gt;
			 * Set the value of this variable without triggering any callbacks&lt;br /&gt;
			 * \param p_val The new value&lt;br /&gt;
			 * \param p_val2 Unused&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_SETVALUE            = 0x0013,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_SETTEXT             = 0x0014,&lt;br /&gt;
			VLC_VAR_GETTEXT             = 0x0015,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_ADDCHOICE           = 0x0020,&lt;br /&gt;
			VLC_VAR_DELCHOICE           = 0x0021,&lt;br /&gt;
			VLC_VAR_CLEARCHOICES        = 0x0022,&lt;br /&gt;
			VLC_VAR_SETDEFAULT          = 0x0023,&lt;br /&gt;
			VLC_VAR_GETCHOICES          = 0x0024,&lt;br /&gt;
			VLC_VAR_FREECHOICES         = 0x0025,&lt;br /&gt;
			VLC_VAR_GETLIST             = 0x0026,&lt;br /&gt;
			VLC_VAR_FREELIST            = 0x0027,&lt;br /&gt;
			VLC_VAR_CHOICESCOUNT        = 0x0028,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_INHERITVALUE        = 0x0030,&lt;br /&gt;
			VLC_VAR_TRIGGER_CALLBACKS   = 0x0035,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		enum playlist_command : int&lt;br /&gt;
		{&lt;br /&gt;
			PLAYLIST_PLAY = 0,      /**&amp;lt; No arg.                            res=can fail*/&lt;br /&gt;
			PLAYLIST_AUTOPLAY = 1,  /**&amp;lt; No arg.                            res=cant fail*/&lt;br /&gt;
			PLAYLIST_VIEWPLAY = 2,  /**&amp;lt; arg1= int, arg2= playlist_item_t*,*/&lt;br /&gt;
								/**  arg3 = playlist_item_t*          , res=can fail */&lt;br /&gt;
			PLAYLIST_ITEMPLAY = 3,  /** &amp;lt;arg1 = playlist_item_t *         , res=can fail */&lt;br /&gt;
			PLAYLIST_PAUSE = 4,     /**&amp;lt; No arg                             res=can fail*/&lt;br /&gt;
			PLAYLIST_STOP = 5,      /**&amp;lt; No arg                             res=can fail*/&lt;br /&gt;
			PLAYLIST_SKIP = 6,      /**&amp;lt; arg1=int,                          res=can fail*/&lt;br /&gt;
			PLAYLIST_GOTO = 7,      /**&amp;lt; arg1=int                           res=can fail */&lt;br /&gt;
			PLAYLIST_VIEWGOTO = 8   /**&amp;lt; arg1=int                           res=can fail */&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		enum CONFIG_ITEM : int&lt;br /&gt;
		{&lt;br /&gt;
			CONFIG_ITEM_STRING = 0x0010,&lt;br /&gt;
			CONFIG_ITEM_FILE = 0x0020,&lt;br /&gt;
			CONFIG_ITEM_MODULE = 0x0030,&lt;br /&gt;
			CONFIG_ITEM_INTEGER = 0x0040,&lt;br /&gt;
			CONFIG_ITEM_BOOL = 0x0050,&lt;br /&gt;
			CONFIG_ITEM_FLOAT = 0x0060,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		enum input_query_e : int&lt;br /&gt;
		{&lt;br /&gt;
			/* input variable &amp;quot;position&amp;quot; */&lt;br /&gt;
			INPUT_GET_POSITION = 0,         /* arg1= double *       res=    */&lt;br /&gt;
			INPUT_SET_POSITION,         /* arg1= double         res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* input variable &amp;quot;length&amp;quot; */&lt;br /&gt;
			INPUT_GET_LENGTH,           /* arg1= int64_t *      res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* input variable &amp;quot;time&amp;quot; */&lt;br /&gt;
			INPUT_GET_TIME,             /* arg1= int64_t *      res=    */&lt;br /&gt;
			INPUT_SET_TIME,             /* arg1= int64_t        res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* input variable &amp;quot;rate&amp;quot; (1 is DEFAULT_RATE) */&lt;br /&gt;
			INPUT_GET_RATE,             /* arg1= int *          res=    */&lt;br /&gt;
			INPUT_SET_RATE,             /* arg1= int            res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* input variable &amp;quot;state&amp;quot; */&lt;br /&gt;
			INPUT_GET_STATE,            /* arg1= int *          res=    */&lt;br /&gt;
			INPUT_SET_STATE,            /* arg1= int            res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* input variable &amp;quot;audio-delay&amp;quot; and &amp;quot;sub-delay&amp;quot; */&lt;br /&gt;
			INPUT_GET_AUDIO_DELAY,      /* arg1 = int* res=can fail */&lt;br /&gt;
			INPUT_SET_AUDIO_DELAY,      /* arg1 = int  res=can fail */&lt;br /&gt;
			INPUT_GET_SPU_DELAY,        /* arg1 = int* res=can fail */&lt;br /&gt;
			INPUT_SET_SPU_DELAY,        /* arg1 = int  res=can fail */&lt;br /&gt;
&lt;br /&gt;
			/* Meta datas */&lt;br /&gt;
			INPUT_ADD_INFO,   /* arg1= char* arg2= char* arg3=...     res=can fail */&lt;br /&gt;
			INPUT_GET_INFO,   /* arg1= char* arg2= char* arg3= char** res=can fail */&lt;br /&gt;
			INPUT_DEL_INFO,   /* arg1= char* arg2= char*              res=can fail */&lt;br /&gt;
			INPUT_SET_NAME,   /* arg1= char* res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* Input config options */&lt;br /&gt;
			INPUT_ADD_OPTION,      /* arg1= char * arg2= char *  res=can fail*/&lt;br /&gt;
&lt;br /&gt;
			/* Input properties */&lt;br /&gt;
			INPUT_GET_BYTE_POSITION,     /* arg1= int64_t *       res=    */&lt;br /&gt;
			INPUT_SET_BYTE_SIZE,         /* arg1= int64_t *       res=    */&lt;br /&gt;
&lt;br /&gt;
			/* bookmarks */&lt;br /&gt;
			INPUT_GET_BOOKMARKS,   /* arg1= seekpoint_t *** arg2= int * res=can fail */&lt;br /&gt;
			INPUT_CLEAR_BOOKMARKS, /* res=can fail */&lt;br /&gt;
			INPUT_ADD_BOOKMARK,    /* arg1= seekpoint_t *  res=can fail   */&lt;br /&gt;
			INPUT_CHANGE_BOOKMARK, /* arg1= seekpoint_t * arg2= int * res=can fail   */&lt;br /&gt;
			INPUT_DEL_BOOKMARK,    /* arg1= seekpoint_t *  res=can fail   */&lt;br /&gt;
			INPUT_SET_BOOKMARK,    /* arg1= int  res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* On the fly input slave */&lt;br /&gt;
			INPUT_ADD_SLAVE        /* arg1= char * */&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
        #region private vlc structs&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct libvlc_exception_t&lt;br /&gt;
		{&lt;br /&gt;
			public Int32 b_raised;&lt;br /&gt;
			public IntPtr psz_message;&lt;br /&gt;
&lt;br /&gt;
			public void Init()&lt;br /&gt;
			{&lt;br /&gt;
				libvlc_exception_init(out this);&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			public bool WasExceptionRaised()&lt;br /&gt;
			{&lt;br /&gt;
				if(0 != libvlc_exception_raised(ref this))&lt;br /&gt;
				{&lt;br /&gt;
					libvlc_exception_clear(ref this);&lt;br /&gt;
					return true;&lt;br /&gt;
				}&lt;br /&gt;
				return false;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct libvlc_instance_t&lt;br /&gt;
		{&lt;br /&gt;
			public IntPtr p_vlc;&lt;br /&gt;
			public IntPtr p_playlist;&lt;br /&gt;
			public IntPtr p_vlm;&lt;br /&gt;
			public Int32 i_vlc_id;&lt;br /&gt;
&lt;br /&gt;
			public libvlc_instance_t(IntPtr vlc, IntPtr playlist, int vlcHandle)&lt;br /&gt;
			{&lt;br /&gt;
				this.p_vlc = vlc;&lt;br /&gt;
				this.p_playlist = playlist;&lt;br /&gt;
				this.p_vlm = IntPtr.Zero;&lt;br /&gt;
				this.i_vlc_id = vlcHandle;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct vlc_list_t&lt;br /&gt;
		{&lt;br /&gt;
			public Int32 i_count;&lt;br /&gt;
			public IntPtr p_values;&lt;br /&gt;
			public IntPtr pi_types;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        [StructLayout( LayoutKind.Explicit )]&lt;br /&gt;
        struct vlc_value_t&lt;br /&gt;
        {&lt;br /&gt;
            [FieldOffset( 0 )]  public Int32   i_int;&lt;br /&gt;
            [FieldOffset( 0 )]  public Int32   b_bool;&lt;br /&gt;
            [FieldOffset( 0 )][MarshalAs(UnmanagedType.R4)]  public float   f_float;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  psz_string;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  p_address;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  p_object;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  p_list;&lt;br /&gt;
            [FieldOffset( 0 )][MarshalAs(UnmanagedType.I8)]  public Int64   i_time;&lt;br /&gt;
&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  psz_name;&lt;br /&gt;
            [FieldOffset( 4 )]  public Int32   i_object_id;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct module_config_t&lt;br /&gt;
		{&lt;br /&gt;
			public CONFIG_ITEM i_type;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
		#region vlc api interop&lt;br /&gt;
		const int AOUT_VOLUME_MAX = 1024;&lt;br /&gt;
		const int VOLUME_MAX = 200;&lt;br /&gt;
		const int DEFAULT_CHAN = 1;&lt;br /&gt;
		const String Playlist_Current = &amp;quot;item-change&amp;quot;;&lt;br /&gt;
		const String Now_Playing = &amp;quot;Now Playing&amp;quot;;&lt;br /&gt;
		const String Meta_information = &amp;quot;Meta-information&amp;quot;;&lt;br /&gt;
		const String Meta_title = &amp;quot;meta-title&amp;quot;;&lt;br /&gt;
		const String Meta_author = &amp;quot;meta-author&amp;quot;;&lt;br /&gt;
		const String Meta_artist = &amp;quot;meta-artist&amp;quot;;&lt;br /&gt;
		const String Meta_genre = &amp;quot;meta-genre&amp;quot;;&lt;br /&gt;
		const String Meta_description = &amp;quot;meta-description&amp;quot;;&lt;br /&gt;
		const String Meta_url = &amp;quot;meta-url&amp;quot;;&lt;br /&gt;
		&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern int VLC_Create();&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError VLC_Init(int iVLC, int Argc, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)]string[] Argv);&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern string VLC_Version();&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern VlcError VLC_CleanUp(int iVLC);&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern VlcError VLC_Destroy(int iVLC);&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern string VLC_Error(int i_err);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr vlc_current_object(int i_object);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr __vlc_object_find(IntPtr p_vlc, ObjectType objectType, ObjectSearchMode mode);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __vlc_object_release(IntPtr p_vlc);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __var_Set(IntPtr p_vlc, String name, vlc_value_t value);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __var_Get(IntPtr p_this, String name, ref vlc_value_t value);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __var_Change(IntPtr p_this, String name, VarFlags varFlags,&lt;br /&gt;
			ref vlc_value_t value, ref vlc_value_t value2);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __aout_VolumeGet(IntPtr p_vlc, ref Int16 volume);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __aout_VolumeSet(IntPtr p_vlc, Int16 volume);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __aout_VolumeMute(IntPtr p_vlc, IntPtr alwaysNull);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_exception_init(out libvlc_exception_t p_exception);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern Int32 libvlc_exception_raised(ref libvlc_exception_t p_exception);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_exception_clear(ref libvlc_exception_t p_exception);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_playlist_play(ref libvlc_instance_t libvlc, Int32 id, &lt;br /&gt;
			Int32 optionsCount, IntPtr optionsAlwaysNull, ref libvlc_exception_t p_exception);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr libvlc_playlist_get_input(ref libvlc_instance_t libvlc, ref libvlc_exception_t p_exception);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int VLC_PlaylistIndex(int vlcObject);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int VLC_PlaylistNumberOfItems(int vlcObject);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_input_free(IntPtr p_input);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int libvlc_video_get_width(IntPtr p_input, ref libvlc_exception_t p_exception);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int libvlc_video_get_height(IntPtr p_input, ref libvlc_exception_t p_exception);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;, CallingConvention=CallingConvention.Cdecl)]&lt;br /&gt;
		static extern VlcError playlist_LockControl(IntPtr p_playlist, playlist_command i_query);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;, CallingConvention = CallingConvention.Cdecl)]&lt;br /&gt;
		static extern VlcError playlist_LockControl(IntPtr p_playlist, playlist_command i_query, Int32 arg1);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError playlist_Clear(IntPtr p_playlist);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError playlist_AddExt(IntPtr p_playlist, String mrl, String mrlDuplicate, &lt;br /&gt;
			Mode mode, Int32 pos, Int64 mtime_t, &lt;br /&gt;
			[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr)]string[] Options,&lt;br /&gt;
			int OptionsCount);&lt;br /&gt;
&lt;br /&gt;
		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]&lt;br /&gt;
		delegate int VarChangedCallback(IntPtr vlc, String variable, vlc_value_t old_val, &lt;br /&gt;
			vlc_value_t new_val, IntPtr param);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int __var_AddCallback(IntPtr vlc, String variable, VarChangedCallback cb, &lt;br /&gt;
			IntPtr param);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int __var_DelCallback(IntPtr vlc, String variable, VarChangedCallback cb, &lt;br /&gt;
			IntPtr param);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;, CallingConvention = CallingConvention.Cdecl, CharSet=CharSet.Ansi)]&lt;br /&gt;
		static extern VlcError input_Control(IntPtr input_thread_t, input_query_e i_query, String category, String name,&lt;br /&gt;
			ref IntPtr result);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;, CallingConvention = CallingConvention.Cdecl)]&lt;br /&gt;
		static extern void __vout_OSDMessage(IntPtr p_input, int i_channel, String message);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr config_FindConfig(IntPtr vlc, String name);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __config_PutInt(IntPtr vlc, String name, int value);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __config_PutFloat(IntPtr vlc, String name, float value);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __config_PutPsz(IntPtr vlc, String name, String value);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int __config_GetInt(IntPtr vlc, String name);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern float __config_GetFloat(IntPtr vlc, String name);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern String __config_GetPsz(IntPtr vlc, String name);&lt;br /&gt;
&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
		static NativeLibVlc()&lt;br /&gt;
		{&lt;br /&gt;
			NativeLibVlc.vlcInstallDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase).Substring(6);&lt;br /&gt;
			//NativeLibVlc.vlcInstallDirectory = Environment.CurrentDirectory;&lt;br /&gt;
			//NativeLibVlc.vlcInstallDirectory = QueryVlcInstallPath();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public NativeLibVlc()&lt;br /&gt;
        {&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        #region IDisposable&lt;br /&gt;
        public void Dispose()&lt;br /&gt;
        {&lt;br /&gt;
            if(vlcHandle != -1)&lt;br /&gt;
            {&lt;br /&gt;
                try&lt;br /&gt;
                {&lt;br /&gt;
					if(this.gch.IsAllocated)&lt;br /&gt;
					{&lt;br /&gt;
						UnhookPlaylistChanges();&lt;br /&gt;
					}&lt;br /&gt;
					VideoOutput = null;&lt;br /&gt;
					VLC_CleanUp(this.vlcHandle);&lt;br /&gt;
                    VLC_Destroy(this.vlcHandle);&lt;br /&gt;
                }&lt;br /&gt;
                catch { }&lt;br /&gt;
            }&lt;br /&gt;
            vlcHandle = -1;&lt;br /&gt;
        }&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
		#region internal Vlc interop helper classes&lt;br /&gt;
		internal class VlcObject : IDisposable&lt;br /&gt;
		{&lt;br /&gt;
			IntPtr vlc = IntPtr.Zero;&lt;br /&gt;
			IntPtr subObject = IntPtr.Zero;&lt;br /&gt;
			bool isDisposed;&lt;br /&gt;
&lt;br /&gt;
			public VlcObject(int vlcHandle, ObjectType objectType)&lt;br /&gt;
			{&lt;br /&gt;
				vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
				if(IntPtr.Zero != vlc)&lt;br /&gt;
				{&lt;br /&gt;
					if(objectType == ObjectType.VLC_OBJECT_VLC)&lt;br /&gt;
					{&lt;br /&gt;
						subObject = vlc;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						subObject = __vlc_object_find(vlc, objectType, ObjectSearchMode.FIND_CHILD);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			public IntPtr Vlc { get { return this.vlc; } }&lt;br /&gt;
			public IntPtr SubObject { get { return this.subObject; } }&lt;br /&gt;
&lt;br /&gt;
			public void Dispose()&lt;br /&gt;
			{&lt;br /&gt;
				Dispose(true);&lt;br /&gt;
				GC.SuppressFinalize(this);&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			protected virtual void Dispose(bool disposing)&lt;br /&gt;
			{&lt;br /&gt;
				if(!this.isDisposed)&lt;br /&gt;
				{&lt;br /&gt;
					this.isDisposed = true;&lt;br /&gt;
					if((IntPtr.Zero != subObject) &amp;amp;&amp;amp; (subObject != vlc))&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(subObject);&lt;br /&gt;
					}&lt;br /&gt;
					if(IntPtr.Zero != vlc)&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(vlc);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			protected bool IsDisposed { get { return this.isDisposed; } }&lt;br /&gt;
&lt;br /&gt;
			~VlcObject()&lt;br /&gt;
			{&lt;br /&gt;
				Dispose(false);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private class VlcPlaylistObject : VlcObject&lt;br /&gt;
		{&lt;br /&gt;
			public libvlc_instance_t libvlc;&lt;br /&gt;
			public libvlc_exception_t exception;&lt;br /&gt;
&lt;br /&gt;
			public VlcPlaylistObject(int vlcHandle)&lt;br /&gt;
				: base(vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST)&lt;br /&gt;
			{&lt;br /&gt;
				if(this.SubObject != IntPtr.Zero)&lt;br /&gt;
				{&lt;br /&gt;
					this.libvlc = new libvlc_instance_t(this.Vlc, this.SubObject, vlcHandle);&lt;br /&gt;
					this.exception.Init();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
		#region public Vlc interop helper functions&lt;br /&gt;
		public VlcObject OpenVlcObject(ObjectType objectType)&lt;br /&gt;
		{&lt;br /&gt;
			return new VlcObject(this.vlcHandle, objectType);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int GetVlcObjectInt(ObjectType objectType, String propertyName, int errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t intValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref intValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return intValue.i_int;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectInt(ObjectType objectType, String propertyName, int value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t intValue = new vlc_value_t();&lt;br /&gt;
						intValue.i_int = value;&lt;br /&gt;
						return __var_Set(vobj.SubObject, propertyName, intValue);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public long GetVlcObjectLong(ObjectType objectType, String propertyName, long errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t longValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref longValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return longValue.i_time;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectLong(ObjectType objectType, String propertyName, long value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t longValue = new vlc_value_t();&lt;br /&gt;
						longValue.i_time = value;&lt;br /&gt;
						return __var_Set(vobj.SubObject, propertyName, longValue);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public float GetVlcObjectFloat(ObjectType objectType, String propertyName, float errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t floatValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref floatValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return floatValue.f_float;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectFloat(ObjectType objectType, String propertyName, float value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t floatValue = new vlc_value_t();&lt;br /&gt;
						floatValue.f_float = value;&lt;br /&gt;
						return __var_Set(vobj.SubObject, propertyName, floatValue);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String GetVlcObjectString(ObjectType objectType, String propertyName, String errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t stringValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref stringValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return Marshal.PtrToStringAnsi(stringValue.psz_string);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectString(ObjectType objectType, String propertyName, String value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t stringValue = new vlc_value_t();&lt;br /&gt;
						IntPtr valuePtr = Marshal.StringToCoTaskMemAnsi(value);&lt;br /&gt;
						stringValue.psz_string = valuePtr;&lt;br /&gt;
						VlcError ret = __var_Set(vobj.SubObject, propertyName, stringValue);&lt;br /&gt;
						Marshal.ZeroFreeCoTaskMemAnsi(valuePtr);&lt;br /&gt;
						return ret;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError GetVlcVariableChoiceList(ObjectType objectType, String propertyName,&lt;br /&gt;
			out int[] choiceIds, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t idValues = new vlc_value_t();&lt;br /&gt;
						vlc_value_t textValues = new vlc_value_t();&lt;br /&gt;
						if(VlcError.Success == __var_Change(vobj.SubObject, propertyName,&lt;br /&gt;
							VarFlags.VLC_VAR_GETLIST, ref idValues, ref textValues))&lt;br /&gt;
						{&lt;br /&gt;
							try&lt;br /&gt;
							{&lt;br /&gt;
								vlc_list_t idList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									idValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
								vlc_list_t textList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									textValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
&lt;br /&gt;
								int choiceCount = idList.i_count;&lt;br /&gt;
								choiceIds = new Int32[choiceCount];&lt;br /&gt;
								choiceText = new String[choiceCount];&lt;br /&gt;
&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceCount; index++)&lt;br /&gt;
								{&lt;br /&gt;
									IntPtr idPtr = new IntPtr(idList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t idValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										idPtr, typeof(vlc_value_t));&lt;br /&gt;
									choiceIds[index] = idValue.i_int;&lt;br /&gt;
&lt;br /&gt;
									IntPtr textPtr = new IntPtr(textList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t textValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										textPtr, typeof(vlc_value_t));&lt;br /&gt;
									choiceText[index] = Marshal.PtrToStringAnsi(textValue.psz_string);&lt;br /&gt;
								}&lt;br /&gt;
								return VlcError.Success;&lt;br /&gt;
							}&lt;br /&gt;
							finally&lt;br /&gt;
							{&lt;br /&gt;
								__var_Change(vobj.SubObject, propertyName, VarFlags.VLC_VAR_FREELIST,&lt;br /&gt;
									ref idValues, ref textValues);&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			choiceIds = new int[0];&lt;br /&gt;
			choiceText = new string[0];&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError GetVlcVariableChoiceList(ObjectType objectType, String propertyName,&lt;br /&gt;
			out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t idValues = new vlc_value_t();&lt;br /&gt;
						vlc_value_t textValues = new vlc_value_t();&lt;br /&gt;
						if(VlcError.Success == __var_Change(vobj.SubObject, propertyName,&lt;br /&gt;
							VarFlags.VLC_VAR_GETLIST, ref idValues, ref textValues))&lt;br /&gt;
						{&lt;br /&gt;
							try&lt;br /&gt;
							{&lt;br /&gt;
								vlc_list_t idList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									idValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
								vlc_list_t textList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									textValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
&lt;br /&gt;
								int choiceCount = idList.i_count;&lt;br /&gt;
								List&amp;lt;String&amp;gt; choiceList = new List&amp;lt;string&amp;gt;(choiceCount);&lt;br /&gt;
								List&amp;lt;String&amp;gt; choiceTextList = new List&amp;lt;string&amp;gt;(choiceCount);&lt;br /&gt;
								Dictionary&amp;lt;String, int&amp;gt; choiceDict = new Dictionary&amp;lt;string, int&amp;gt;(choiceCount);&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceCount; index++)&lt;br /&gt;
								{&lt;br /&gt;
									IntPtr idPtr = new IntPtr(idList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t idValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										idPtr, typeof(vlc_value_t));&lt;br /&gt;
									String choice = Marshal.PtrToStringAnsi(idValue.psz_name);&lt;br /&gt;
									choiceList.Add(choice);&lt;br /&gt;
									if(choiceDict.ContainsKey(choice))&lt;br /&gt;
									{&lt;br /&gt;
										choiceDict[choice] = choiceDict[choice] + 1;&lt;br /&gt;
									}&lt;br /&gt;
									else&lt;br /&gt;
									{&lt;br /&gt;
										choiceDict[choice] = 1;&lt;br /&gt;
									}&lt;br /&gt;
&lt;br /&gt;
									IntPtr textPtr = new IntPtr(textList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t textValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										textPtr, typeof(vlc_value_t));&lt;br /&gt;
									choiceTextList.Add(Marshal.PtrToStringAnsi(textValue.psz_string));&lt;br /&gt;
								}&lt;br /&gt;
&lt;br /&gt;
								int listIndex = 0;&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceCount; index++)&lt;br /&gt;
								{&lt;br /&gt;
									String choice = choiceList[listIndex];&lt;br /&gt;
									if((choiceDict[choice] &amp;gt; 1) &amp;amp;&amp;amp; (choiceTextList[listIndex] == null))&lt;br /&gt;
									{&lt;br /&gt;
										choiceList.RemoveAt(listIndex);&lt;br /&gt;
										choiceTextList.RemoveAt(listIndex);&lt;br /&gt;
										choiceDict[choice] = choiceDict[choice] - 1;&lt;br /&gt;
									}&lt;br /&gt;
									else&lt;br /&gt;
									{&lt;br /&gt;
										listIndex++;&lt;br /&gt;
									}&lt;br /&gt;
								}&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceList.Count; index++)&lt;br /&gt;
								{&lt;br /&gt;
									if(choiceTextList[index] == null)&lt;br /&gt;
									{&lt;br /&gt;
										choiceTextList[index] = choiceList[index];&lt;br /&gt;
									}&lt;br /&gt;
								}&lt;br /&gt;
&lt;br /&gt;
								choices = choiceList.ToArray();&lt;br /&gt;
								choiceText = choiceTextList.ToArray();&lt;br /&gt;
								return VlcError.Success;&lt;br /&gt;
							}&lt;br /&gt;
							finally&lt;br /&gt;
							{&lt;br /&gt;
								__var_Change(vobj.SubObject, propertyName, VarFlags.VLC_VAR_FREELIST,&lt;br /&gt;
									ref idValues, ref textValues);&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			choices = new string[0];&lt;br /&gt;
			choiceText = new string[0];&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
        #region public Properties&lt;br /&gt;
        public static string VlcInstallDir&lt;br /&gt;
        {&lt;br /&gt;
            get{ return vlcInstallDirectory; }&lt;br /&gt;
            set{ vlcInstallDirectory = value; }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public bool IsInitialized&lt;br /&gt;
        {&lt;br /&gt;
            get{return (vlcHandle != -1);}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public Control VideoOutput&lt;br /&gt;
        {&lt;br /&gt;
            get { return outputWindow; }&lt;br /&gt;
            set&lt;br /&gt;
            {&lt;br /&gt;
				if(value == null)&lt;br /&gt;
				{&lt;br /&gt;
					if(outputWindow != null)&lt;br /&gt;
					{&lt;br /&gt;
						outputWindow = null;&lt;br /&gt;
						if(vlcHandle != -1)&lt;br /&gt;
						{&lt;br /&gt;
							SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;drawable&amp;quot;, 0);&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					outputWindow = value;&lt;br /&gt;
					if(vlcHandle != -1)&lt;br /&gt;
					{&lt;br /&gt;
						SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;drawable&amp;quot;, outputWindow.Handle.ToInt32());&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public string LastError&lt;br /&gt;
        {&lt;br /&gt;
            get{return lastErrorMessage;}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public event MetaDataEventHandler NowPlaying;&lt;br /&gt;
&lt;br /&gt;
		protected virtual void OnNowPlaying(MetaDataUpdateEventArgs args)&lt;br /&gt;
		{&lt;br /&gt;
			if(this.NowPlaying != null)&lt;br /&gt;
			{&lt;br /&gt;
				this.NowPlaying(this, args);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		protected delegate void HandleNowPlaying(MetaDataUpdateEventArgs args);&lt;br /&gt;
&lt;br /&gt;
		protected virtual void VlcNowPlayingChanged(String newText)&lt;br /&gt;
		{&lt;br /&gt;
			// switch out of the Vlc thread to our User Interface thread if possible&lt;br /&gt;
			if(this.VideoOutput != null)&lt;br /&gt;
			{&lt;br /&gt;
				this.VideoOutput.BeginInvoke(new HandleNowPlaying(OnNowPlaying),&lt;br /&gt;
					new MetaDataUpdateEventArgs(MetaData.NowPlaying, newText));&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				OnNowPlaying(new MetaDataUpdateEventArgs(MetaData.NowPlaying, newText));&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public int Length&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				if(this.artificialLength != 0)&lt;br /&gt;
				{&lt;br /&gt;
					return this.artificialLength;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return Convert.ToInt32(GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;length&amp;quot;, 0) / 1000000L);&lt;br /&gt;
				}&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public void SetArtificialLength(int newLength)&lt;br /&gt;
		{&lt;br /&gt;
			this.artificialLength = newLength;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public int Time&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				int time = Convert.ToInt32(GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;time&amp;quot;, 0) / 1000000L);&lt;br /&gt;
				if((time == 0) &amp;amp;&amp;amp; (this.artificialLength != 0))&lt;br /&gt;
				{&lt;br /&gt;
					time = Convert.ToInt32(Position * this.artificialLength + .5d);&lt;br /&gt;
				}&lt;br /&gt;
				if(this.timeScaling != 0.0d)&lt;br /&gt;
				{&lt;br /&gt;
					time = Convert.ToInt32(time / this.timeScaling);&lt;br /&gt;
				}&lt;br /&gt;
				return time;&lt;br /&gt;
            }&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.artificialLength != 0)&lt;br /&gt;
				{&lt;br /&gt;
					float position = Convert.ToSingle(value) / Convert.ToSingle(this.artificialLength);&lt;br /&gt;
					if(this.timeScaling != 0.0d)&lt;br /&gt;
					{&lt;br /&gt;
						position = Convert.ToSingle(position * this.timeScaling);&lt;br /&gt;
					}&lt;br /&gt;
					Debug.WriteLine(String.Format(&amp;quot;Set Position {0}&amp;quot;, position));&lt;br /&gt;
					SetVlcObjectFloat(ObjectType.VLC_OBJECT_INPUT, &amp;quot;position&amp;quot;, position);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					long time = Convert.ToInt64(value) * 1000000L;&lt;br /&gt;
					if(this.timeScaling != 0.0d)&lt;br /&gt;
					{&lt;br /&gt;
						time = Convert.ToInt64(time * this.timeScaling);&lt;br /&gt;
					}&lt;br /&gt;
					Debug.WriteLine(String.Format(&amp;quot;Set Time {0}&amp;quot;, time));&lt;br /&gt;
					SetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;time&amp;quot;, time);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public double TimeScaling&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.timeScaling; }&lt;br /&gt;
			set { this.timeScaling = value; }&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public double Position&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				double position = GetVlcObjectFloat(ObjectType.VLC_OBJECT_INPUT, &amp;quot;position&amp;quot;, 0.0f);&lt;br /&gt;
				if(this.timeScaling != 0.0d)&lt;br /&gt;
				{&lt;br /&gt;
					position = position / this.timeScaling;&lt;br /&gt;
				}&lt;br /&gt;
				return position;&lt;br /&gt;
            }&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				double position = value;&lt;br /&gt;
				if(this.timeScaling != 0.0d)&lt;br /&gt;
				{&lt;br /&gt;
					position = position * this.timeScaling;&lt;br /&gt;
				}&lt;br /&gt;
				Debug.WriteLine(String.Format(&amp;quot;Set Position {0}&amp;quot;, position));&lt;br /&gt;
				SetVlcObjectFloat(ObjectType.VLC_OBJECT_INPUT, &amp;quot;position&amp;quot;, Convert.ToSingle(position));&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public int Volume&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				IntPtr vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
				if(IntPtr.Zero != vlc)&lt;br /&gt;
				{&lt;br /&gt;
					try&lt;br /&gt;
					{&lt;br /&gt;
						Int16 aoutVol = 0;&lt;br /&gt;
						if(__aout_VolumeGet(vlc, ref aoutVol) == VlcError.Success)&lt;br /&gt;
						{&lt;br /&gt;
							return (aoutVol * VOLUME_MAX + AOUT_VOLUME_MAX / 2) / AOUT_VOLUME_MAX;&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
					catch(Exception)&lt;br /&gt;
					{&lt;br /&gt;
					}&lt;br /&gt;
					finally&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(vlc);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				return 0;&lt;br /&gt;
            }&lt;br /&gt;
            set&lt;br /&gt;
            {&lt;br /&gt;
				IntPtr vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
				if(IntPtr.Zero != vlc)&lt;br /&gt;
				{&lt;br /&gt;
					try&lt;br /&gt;
					{&lt;br /&gt;
						Int16 aoutVol = Convert.ToInt16((value * AOUT_VOLUME_MAX + VOLUME_MAX / 2) / VOLUME_MAX);&lt;br /&gt;
						__aout_VolumeSet(vlc, aoutVol);&lt;br /&gt;
					}&lt;br /&gt;
					catch(Exception)&lt;br /&gt;
					{&lt;br /&gt;
					}&lt;br /&gt;
					finally&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(vlc);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public bool Fullscreen&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				int isFullScreen = GetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;fullscreen&amp;quot;, -666);&lt;br /&gt;
				if((isFullScreen != -666) &amp;amp;&amp;amp; (isFullScreen != 0))&lt;br /&gt;
				{&lt;br /&gt;
					return true;&lt;br /&gt;
				}&lt;br /&gt;
                return false;&lt;br /&gt;
               &lt;br /&gt;
            }&lt;br /&gt;
            set&lt;br /&gt;
            {&lt;br /&gt;
				SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;fullscreen&amp;quot;, value ? 1 : 0);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public int PlaylistIndex&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return VLC_PlaylistIndex(this.vlcHandle);&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception ex)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = ex.Message;&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int PlaylistCount&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return VLC_PlaylistNumberOfItems(this.vlcHandle);&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception ex)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = ex.Message;&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
        #region public Methods&lt;br /&gt;
        public bool Initialize()&lt;br /&gt;
        {&lt;br /&gt;
            // check if already initializes&lt;br /&gt;
            if(vlcHandle != -1)&lt;br /&gt;
                return true;&lt;br /&gt;
&lt;br /&gt;
			string oldDir = Environment.CurrentDirectory;&lt;br /&gt;
			// try init&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				// create instance&lt;br /&gt;
				Environment.CurrentDirectory = NativeLibVlc.vlcInstallDirectory;&lt;br /&gt;
				this.vlcHandle = VLC_Create();&lt;br /&gt;
&lt;br /&gt;
				if(this.vlcHandle &amp;lt; 0)&lt;br /&gt;
				{&lt;br /&gt;
					lastErrorMessage = &amp;quot;Failed to create VLC instance&amp;quot;;&lt;br /&gt;
					return false;&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				string[] initOptions = {	NativeLibVlc.vlcInstallDirectory,&lt;br /&gt;
											&amp;quot;:no-one-instance&amp;quot;,&lt;br /&gt;
											&amp;quot;:no-loop&amp;quot;,&lt;br /&gt;
											&amp;quot;:no-drop-late-frames&amp;quot;,&lt;br /&gt;
											&amp;quot;:disable-screensaver&amp;quot;,&lt;br /&gt;
											&amp;quot;:vout=vout_directx&amp;quot;,&lt;br /&gt;
											&amp;quot;--plugin-path=&amp;quot; + NativeLibVlc.vlcInstallDirectory + @&amp;quot;\plugins&amp;quot;,&lt;br /&gt;
					};&lt;br /&gt;
&lt;br /&gt;
				// init libvlc&lt;br /&gt;
				VlcError errVlcLib = VLC_Init(vlcHandle, initOptions.Length, initOptions);&lt;br /&gt;
				if(errVlcLib != VlcError.Success)&lt;br /&gt;
				{&lt;br /&gt;
					VLC_Destroy(vlcHandle);&lt;br /&gt;
					lastErrorMessage = &amp;quot;Failed to initialise VLC&amp;quot;;&lt;br /&gt;
					this.vlcHandle = -1;&lt;br /&gt;
					return false;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch&lt;br /&gt;
			{&lt;br /&gt;
				lastErrorMessage = &amp;quot;Could not find libvlc&amp;quot;;&lt;br /&gt;
				return false;&lt;br /&gt;
			}&lt;br /&gt;
			finally&lt;br /&gt;
			{&lt;br /&gt;
				Environment.CurrentDirectory = oldDir;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
            // check output window&lt;br /&gt;
            if(outputWindow != null)&lt;br /&gt;
            {&lt;br /&gt;
				SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;drawable&amp;quot;, outputWindow.Handle.ToInt32());&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		// there&#039;s an overhead to supporting Vlc events, a memory leak, so we need to have them off by default&lt;br /&gt;
		public bool ProducingEvents&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.gch.IsAllocated; }&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(value)&lt;br /&gt;
				{&lt;br /&gt;
					if(!this.gch.IsAllocated)&lt;br /&gt;
					{&lt;br /&gt;
						HookPlaylistChanges();&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					if(this.gch.IsAllocated)&lt;br /&gt;
					{&lt;br /&gt;
						UnhookPlaylistChanges();&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private static String AdjustFilterString(String current, String filter, bool add)&lt;br /&gt;
		{&lt;br /&gt;
			String newFilter = null;&lt;br /&gt;
			int findFilter = current.IndexOf(filter);&lt;br /&gt;
			if(findFilter == -1)&lt;br /&gt;
			{&lt;br /&gt;
				if(add)&lt;br /&gt;
				{&lt;br /&gt;
					if(current.Length == 0)&lt;br /&gt;
					{&lt;br /&gt;
						newFilter = filter;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						newFilter = String.Format(&amp;quot;{0}:{1}&amp;quot;, current, filter);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				if(!add)&lt;br /&gt;
				{&lt;br /&gt;
					int colonAfterAdjust = current.IndexOf(&#039;:&#039;, findFilter + 1);&lt;br /&gt;
					if(findFilter == 0)&lt;br /&gt;
					{&lt;br /&gt;
						if(colonAfterAdjust == -1)&lt;br /&gt;
						{&lt;br /&gt;
							newFilter = String.Empty;&lt;br /&gt;
						}&lt;br /&gt;
						else&lt;br /&gt;
						{&lt;br /&gt;
							newFilter = current.Substring(colonAfterAdjust + 1);&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						if(colonAfterAdjust == -1)&lt;br /&gt;
						{&lt;br /&gt;
							newFilter = current.Substring(0, findFilter - 1);&lt;br /&gt;
						}&lt;br /&gt;
						else&lt;br /&gt;
						{&lt;br /&gt;
							newFilter = current.Substring(0, findFilter - 1) +&lt;br /&gt;
								current.Substring(colonAfterAdjust);&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			return newFilter;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		const String VideoFilterList = &amp;quot;vout-filter&amp;quot;;&lt;br /&gt;
		const String AdjustFilter = &amp;quot;adjust&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
		public bool AllowVideoAdjustments&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				String voutFilter = GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, VideoFilterList, null);&lt;br /&gt;
				if(voutFilter == null)&lt;br /&gt;
				{&lt;br /&gt;
					GetConfigVariable(VideoFilterList, out voutFilter);&lt;br /&gt;
				}&lt;br /&gt;
				if(voutFilter != null)&lt;br /&gt;
				{&lt;br /&gt;
					return voutFilter.IndexOf(AdjustFilter) != -1;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return false;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				bool useConfig = false;&lt;br /&gt;
				String voutFilter = GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, VideoFilterList, null);&lt;br /&gt;
				if(voutFilter == null)&lt;br /&gt;
				{&lt;br /&gt;
					using(VlcObject vlc = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_VLC))&lt;br /&gt;
					{&lt;br /&gt;
						GetConfigVariable(VideoFilterList, out voutFilter);&lt;br /&gt;
						useConfig = true;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				if(voutFilter != null)&lt;br /&gt;
				{&lt;br /&gt;
					String newVoutFilter = AdjustFilterString(voutFilter, AdjustFilter, value);&lt;br /&gt;
					if(newVoutFilter != null)&lt;br /&gt;
					{&lt;br /&gt;
						if(useConfig)&lt;br /&gt;
						{&lt;br /&gt;
							SetConfigVariable(VideoFilterList, newVoutFilter);&lt;br /&gt;
						}&lt;br /&gt;
						else&lt;br /&gt;
						{&lt;br /&gt;
							SetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, VideoFilterList, newVoutFilter);&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError AddTarget(string target, ref int itemId)&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						VlcError enmErr = playlist_AddExt(vobj.SubObject, target, target, Mode.Append, &lt;br /&gt;
							EndOfPlaylist, -1L, null, 0);&lt;br /&gt;
						if(enmErr &amp;gt;= VlcError.Success)&lt;br /&gt;
						{&lt;br /&gt;
							itemId = (int)enmErr;&lt;br /&gt;
						}&lt;br /&gt;
						return enmErr;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError AddTarget(string target, string[] options, ref int itemId)&lt;br /&gt;
        {&lt;br /&gt;
            int optionsCount = 0;&lt;br /&gt;
			if(options != null)&lt;br /&gt;
			{&lt;br /&gt;
				optionsCount = options.Length;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						VlcError enmErr = playlist_AddExt(vobj.SubObject, target, target, Mode.Append,&lt;br /&gt;
							EndOfPlaylist, -1L, options, optionsCount);&lt;br /&gt;
						if(enmErr &amp;gt;= VlcError.Success)&lt;br /&gt;
						{&lt;br /&gt;
							itemId = (int)enmErr;&lt;br /&gt;
						}&lt;br /&gt;
						return enmErr;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public Size VideoSize&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					using(VlcPlaylistObject vpobj = new VlcPlaylistObject(this.vlcHandle))&lt;br /&gt;
					{&lt;br /&gt;
						if(vpobj.SubObject != IntPtr.Zero)&lt;br /&gt;
						{&lt;br /&gt;
							IntPtr p_input = libvlc_playlist_get_input(ref vpobj.libvlc, ref vpobj.exception);&lt;br /&gt;
							if(vpobj.exception.WasExceptionRaised())&lt;br /&gt;
							{&lt;br /&gt;
								this.lastErrorMessage = Marshal.PtrToStringAnsi(vpobj.exception.psz_message);&lt;br /&gt;
							}&lt;br /&gt;
							else&lt;br /&gt;
							{&lt;br /&gt;
								try&lt;br /&gt;
								{&lt;br /&gt;
									int width = libvlc_video_get_width(p_input, ref vpobj.exception);&lt;br /&gt;
									if(!vpobj.exception.WasExceptionRaised())&lt;br /&gt;
									{&lt;br /&gt;
										int height = libvlc_video_get_height(p_input, ref vpobj.exception);&lt;br /&gt;
										if(!vpobj.exception.WasExceptionRaised())&lt;br /&gt;
										{&lt;br /&gt;
											return new Size(width, height);&lt;br /&gt;
										}&lt;br /&gt;
									}&lt;br /&gt;
								}&lt;br /&gt;
								finally&lt;br /&gt;
								{&lt;br /&gt;
									libvlc_input_free(p_input);&lt;br /&gt;
								}&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception ex)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = ex.Message;&lt;br /&gt;
				}&lt;br /&gt;
				return new Size();&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError Play(int itemId)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				this.artificialLength = 0;&lt;br /&gt;
				this.timeScaling = 0.0d;&lt;br /&gt;
				using(VlcPlaylistObject vpobj = new VlcPlaylistObject(this.vlcHandle))&lt;br /&gt;
				{&lt;br /&gt;
					if(vpobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						libvlc_playlist_play(ref vpobj.libvlc, itemId, 0, IntPtr.Zero, &lt;br /&gt;
							ref vpobj.exception);&lt;br /&gt;
						if(vpobj.exception.WasExceptionRaised())&lt;br /&gt;
						{&lt;br /&gt;
							return VlcError.Generic;&lt;br /&gt;
						}&lt;br /&gt;
						return VlcError.Success;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public VlcError Play()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_LockControl(vobj.SubObject, playlist_command.PLAYLIST_PLAY);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError Pause()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_LockControl(vobj.SubObject, playlist_command.PLAYLIST_PAUSE);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError Stop()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_LockControl(vobj.SubObject, playlist_command.PLAYLIST_STOP);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public VlcError PlaylistClear()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_Clear(vobj.SubObject);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError ToggleVolumeMute()&lt;br /&gt;
        {&lt;br /&gt;
			IntPtr vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
			if(IntPtr.Zero != vlc)&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return __aout_VolumeMute(vlc, IntPtr.Zero);&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception)&lt;br /&gt;
				{&lt;br /&gt;
				}&lt;br /&gt;
				finally&lt;br /&gt;
				{&lt;br /&gt;
					__vlc_object_release(vlc);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
            return VlcError.NoObj;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError PressKey(string strKey)&lt;br /&gt;
        {&lt;br /&gt;
			int key = GetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, strKey, -666);&lt;br /&gt;
			if(key != -666)&lt;br /&gt;
			{&lt;br /&gt;
				return SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;key-pressed&amp;quot;, key);&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoVar;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError ShowMessage(String message)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_INPUT))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						__vout_OSDMessage(vobj.SubObject, DEFAULT_CHAN, message);&lt;br /&gt;
						return VlcError.Success;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError GetConfigVariable(String name, out String value)&lt;br /&gt;
		{&lt;br /&gt;
			value = null;&lt;br /&gt;
			using(VlcObject vlc = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_VLC))&lt;br /&gt;
			{&lt;br /&gt;
				if(IntPtr.Zero == vlc.SubObject)&lt;br /&gt;
				{&lt;br /&gt;
					return VlcError.NoObj;&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				IntPtr p_item = config_FindConfig(vlc.SubObject, name);&lt;br /&gt;
				if(IntPtr.Zero == p_item)&lt;br /&gt;
				{&lt;br /&gt;
					return VlcError.NoVar;&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					module_config_t mod = (module_config_t)Marshal.PtrToStructure(p_item, typeof(module_config_t));&lt;br /&gt;
					switch(mod.i_type)&lt;br /&gt;
					{&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_BOOL:&lt;br /&gt;
						{&lt;br /&gt;
							bool result = (__config_GetInt(vlc.SubObject, name) == 0);&lt;br /&gt;
							value = result.ToString();&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_INTEGER:&lt;br /&gt;
						{&lt;br /&gt;
							int intResult = __config_GetInt(vlc.SubObject, name);&lt;br /&gt;
							value = intResult.ToString();&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_FLOAT:&lt;br /&gt;
						{&lt;br /&gt;
							float floatResult = __config_GetFloat(vlc.SubObject, name);&lt;br /&gt;
							value = floatResult.ToString();&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_STRING:&lt;br /&gt;
						value = __config_GetPsz(vlc.SubObject, name);&lt;br /&gt;
						break;&lt;br /&gt;
					default:&lt;br /&gt;
						return VlcError.BadVar;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception e)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = e.Message;&lt;br /&gt;
					return VlcError.Exception;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.Success;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetConfigVariable(String name, String value)&lt;br /&gt;
		{&lt;br /&gt;
			using(VlcObject vlc = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_VLC))&lt;br /&gt;
			{&lt;br /&gt;
				if(IntPtr.Zero == vlc.SubObject)&lt;br /&gt;
				{&lt;br /&gt;
					return VlcError.NoObj;&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				IntPtr p_item = config_FindConfig(vlc.SubObject, name);&lt;br /&gt;
				if(IntPtr.Zero == p_item)&lt;br /&gt;
				{&lt;br /&gt;
					return VlcError.NoVar;&lt;br /&gt;
				}&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					module_config_t mod = (module_config_t)Marshal.PtrToStructure(p_item, typeof(module_config_t));&lt;br /&gt;
					switch(mod.i_type)&lt;br /&gt;
					{&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_BOOL:&lt;br /&gt;
						{&lt;br /&gt;
							bool boolResult;&lt;br /&gt;
							if(Boolean.TryParse(value, out boolResult))&lt;br /&gt;
							{&lt;br /&gt;
								__config_PutInt(vlc.SubObject, name, boolResult ? 1 : 0);&lt;br /&gt;
							}&lt;br /&gt;
							else&lt;br /&gt;
							{&lt;br /&gt;
								return VlcError.BadVar;&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_INTEGER:&lt;br /&gt;
						{&lt;br /&gt;
							int intResult;&lt;br /&gt;
							if(Int32.TryParse(value, out intResult))&lt;br /&gt;
							{&lt;br /&gt;
								__config_PutInt(vlc.SubObject, name, intResult);&lt;br /&gt;
							}&lt;br /&gt;
							else&lt;br /&gt;
							{&lt;br /&gt;
								return VlcError.BadVar;&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_FLOAT:&lt;br /&gt;
						{&lt;br /&gt;
							float floatResult;&lt;br /&gt;
							if(Single.TryParse(value, out floatResult))&lt;br /&gt;
							{&lt;br /&gt;
								__config_PutFloat(vlc.SubObject, name, floatResult);&lt;br /&gt;
							}&lt;br /&gt;
							else&lt;br /&gt;
							{&lt;br /&gt;
								return VlcError.BadVar;&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_STRING:&lt;br /&gt;
						__config_PutPsz(vlc.SubObject, name, value);&lt;br /&gt;
						break;&lt;br /&gt;
					default:&lt;br /&gt;
						return VlcError.BadVar;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception e)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = e.Message;&lt;br /&gt;
					return VlcError.Exception;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.Success;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
		#region private members, properties and methods&lt;br /&gt;
&lt;br /&gt;
		private static string vlcInstallDirectory = &amp;quot;&amp;quot;;&lt;br /&gt;
		private int vlcHandle = -1;&lt;br /&gt;
		private Control outputWindow = null;&lt;br /&gt;
		private string lastErrorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
		private int artificialLength;&lt;br /&gt;
		private double timeScaling;&lt;br /&gt;
		private GCHandle gch;&lt;br /&gt;
		private VarChangedCallback currentTrackCallback;&lt;br /&gt;
		private string previousNowPlaying = String.Empty;&lt;br /&gt;
&lt;br /&gt;
        /// -------------------------------------------------------------------&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// Method name      :   QueryVlcInstallPath&lt;br /&gt;
        /// Author         :   Odysee&lt;br /&gt;
        ///   Date         :   10.11.2006&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        /// -------------------------------------------------------------------&lt;br /&gt;
        private static string QueryVlcInstallPath()&lt;br /&gt;
        {&lt;br /&gt;
            // open registry&lt;br /&gt;
            RegistryKey regkeyVlcInstallPathKey = Registry.LocalMachine.OpenSubKey(@&amp;quot;SOFTWARE\VideoLAN\VLC&amp;quot;);&lt;br /&gt;
            if(regkeyVlcInstallPathKey == null)&lt;br /&gt;
                return &amp;quot;&amp;quot;;&lt;br /&gt;
            return (string)regkeyVlcInstallPathKey.GetValue(&amp;quot;InstallDir&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		private void HookPlaylistChanges()&lt;br /&gt;
		{&lt;br /&gt;
			using(VlcObject vlc = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
			{&lt;br /&gt;
				if(vlc.SubObject != IntPtr.Zero)&lt;br /&gt;
				{&lt;br /&gt;
					this.gch = GCHandle.Alloc(this);&lt;br /&gt;
					this.currentTrackCallback = new VarChangedCallback(CurrentTrackChanged);&lt;br /&gt;
&lt;br /&gt;
					int isSet = __var_AddCallback(vlc.SubObject, Playlist_Current,&lt;br /&gt;
						this.currentTrackCallback, (IntPtr)this.gch);&lt;br /&gt;
					//Debug.WriteLine(&amp;quot;__var_AddCallback playlistObject = &amp;quot; + isSet.ToString());&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void UnhookPlaylistChanges()&lt;br /&gt;
		{&lt;br /&gt;
			using(VlcObject vlc = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
			{&lt;br /&gt;
				if(vlc.SubObject != IntPtr.Zero)&lt;br /&gt;
				{&lt;br /&gt;
					__var_DelCallback(vlc.SubObject, Playlist_Current,&lt;br /&gt;
						this.currentTrackCallback, (IntPtr)this.gch);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			this.gch.Free();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private static int CurrentTrackChanged(IntPtr vlc, String variable, vlc_value_t old_val,&lt;br /&gt;
			vlc_value_t new_val, IntPtr param)&lt;br /&gt;
		{&lt;br /&gt;
			//Debug.WriteLine(&amp;quot;CurrentTrackChanged: &amp;quot; + new_val.i_int.ToString());&lt;br /&gt;
			GCHandle gch = (GCHandle)param;&lt;br /&gt;
			NativeLibVlc thisVlc = (NativeLibVlc)gch.Target;&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(thisVlc.vlcHandle, ObjectType.VLC_OBJECT_INPUT))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						IntPtr resultString = IntPtr.Zero;&lt;br /&gt;
						input_Control(vobj.SubObject, input_query_e.INPUT_GET_INFO,&lt;br /&gt;
							Meta_information, Now_Playing, ref resultString);&lt;br /&gt;
						String nowPlaying = Marshal.PtrToStringAnsi(resultString);&lt;br /&gt;
						if(nowPlaying != thisVlc.previousNowPlaying)&lt;br /&gt;
						{&lt;br /&gt;
							thisVlc.previousNowPlaying = nowPlaying;&lt;br /&gt;
							Debug.WriteLine(String.Format(&amp;quot;nowPlaying: {0}&amp;quot;, nowPlaying));&lt;br /&gt;
							thisVlc.VlcNowPlayingChanged(nowPlaying);&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				thisVlc.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return (int)VlcError.Success;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        #endregion&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/* future features&lt;br /&gt;
&lt;br /&gt;
    add_bool( &amp;quot;brightness-threshold&amp;quot;, 0, NULL,&lt;br /&gt;
              THRES_TEXT, THRES_LONGTEXT, VLC_FALSE );&lt;br /&gt;
	 */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Test.html&amp;diff=7290</id>
		<title>.Net Test.html</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Test.html&amp;diff=7290"/>
		<updated>2007-01-17T00:38:45Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.0 Transitional//EN&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;META HTTP-EQUIV=&#039;Content-Type&#039; CONTENT=&#039;text/html; charset=iso-8859-1&#039; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HTML&amp;gt;&lt;br /&gt;
	&amp;lt;HEAD&amp;gt;&lt;br /&gt;
		&amp;lt;TITLE&amp;gt;Sink managed event in Internet Explorer&amp;lt;/TITLE&amp;gt;&lt;br /&gt;
	&amp;lt;/HEAD&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;BODY&amp;gt;&lt;br /&gt;
		&lt;br /&gt;
		&amp;lt;OBJECT id=&amp;quot;myVLan&amp;quot; classid=&amp;quot;clsid:FB99D376-ED98-4ac0-B2C9-F2E974E0849F&amp;quot; width=&amp;quot;720&amp;quot; height=&amp;quot;480&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/OBJECT&amp;gt;&lt;br /&gt;
		&amp;lt;br /&amp;gt;&lt;br /&gt;
		&amp;lt;SCRIPT LANGUAGE=&amp;quot;JScript&amp;quot;&amp;gt;&lt;br /&gt;
			var selectionsEmpty = true;&lt;br /&gt;
			&lt;br /&gt;
            function myVLan::NowPlayingEvent(a, b)&lt;br /&gt;
            {&lt;br /&gt;
				document.getElementById(&#039;nowPlaying&#039;).innerText = b;&lt;br /&gt;
                //alert(b);&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
			function FillSelectionList(choiceArray, selectedChoice, selectId)&lt;br /&gt;
			{&lt;br /&gt;
				var selectElement = document.getElementById(selectId);&lt;br /&gt;
				while(selectElement.hasChildNodes())&lt;br /&gt;
				{&lt;br /&gt;
					selectElement.removeChild(selectElement.lastChild);&lt;br /&gt;
				}&lt;br /&gt;
				&lt;br /&gt;
				for(index = 0; index &amp;lt; choiceArray.length; index += 2)&lt;br /&gt;
				{&lt;br /&gt;
					var choice = choiceArray[index];&lt;br /&gt;
					var choiceText = choiceArray[index + 1];&lt;br /&gt;
					var newOption = document.createElement(&#039;option&#039;);&lt;br /&gt;
					newOption.value = choice;&lt;br /&gt;
					newOption.appendChild(document.createTextNode(choiceText));&lt;br /&gt;
					if(choice == selectedChoice)&lt;br /&gt;
					{&lt;br /&gt;
						newOption.selected = &#039;selected&#039;;&lt;br /&gt;
					}&lt;br /&gt;
					selectElement.appendChild(newOption);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			function FillSelectionsWhenPlaying()&lt;br /&gt;
			{&lt;br /&gt;
				if(selectionsEmpty &amp;amp;&amp;amp; (myVLan.State != 0))&lt;br /&gt;
				{&lt;br /&gt;
					selectionsEmpty = false;&lt;br /&gt;
					var audioTracks = myVLan.AudioTracksAsString();&lt;br /&gt;
					FillSelectionList(audioTracks.split(&#039;\n&#039;), myVLan.AudioTrack, &#039;AudioTracks&#039;);&lt;br /&gt;
					var subTracks = myVLan.SubTitleTracksAsString();&lt;br /&gt;
					FillSelectionList(subTracks.split(&#039;\n&#039;), myVLan.SubTitleTrack, &#039;SubTitleTracks&#039;);&lt;br /&gt;
					var deints = myVLan.DeinterlaceModesAsString();&lt;br /&gt;
					FillSelectionList(deints.split(&#039;\n&#039;), myVLan.DeinterlaceMode, &#039;DeinterlaceModes&#039;);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			&lt;br /&gt;
			function EnableVideoAdjustments()&lt;br /&gt;
			{&lt;br /&gt;
				var vidCheck = document.getElementById(&amp;quot;VideoAdjustmentCheck&amp;quot;);&lt;br /&gt;
				if(vidCheck.checked)&lt;br /&gt;
				{&lt;br /&gt;
					myVLan.AllowVideoAdjustments = true;&lt;br /&gt;
					document.getElementById(&amp;quot;Gamma&amp;quot;).disabled = false;&lt;br /&gt;
					document.getElementById(&amp;quot;Gamma&amp;quot;).value = &#039;&#039;;&lt;br /&gt;
					document.getElementById(&amp;quot;Saturation&amp;quot;).disabled = false;&lt;br /&gt;
					document.getElementById(&amp;quot;Saturation&amp;quot;).value = &#039;&#039;;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					myVLan.AllowVideoAdjustments = false;&lt;br /&gt;
					document.getElementById(&amp;quot;Gamma&amp;quot;).disabled = true;&lt;br /&gt;
					document.getElementById(&amp;quot;Saturation&amp;quot;).disabled = true;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			myVLan.ProducingEvents = true;&lt;br /&gt;
			var options = new Array(&amp;quot;:ffmpeg-pp-q=6&amp;quot;, &amp;quot;:no-loop&amp;quot;);&lt;br /&gt;
			////////////////////////////////////////////////////////////////&lt;br /&gt;
			// CHANGE THE NEXT LINE TO A MEDIA FILE ON YOUR OWN HARD-DISK&lt;br /&gt;
			////////////////////////////////////////////////////////////////&lt;br /&gt;
			myVLan.AddAndPlay(&amp;quot;X:\\Kiki.mpg&amp;quot;, options.join(&#039;\n&#039;));&lt;br /&gt;
			var timerId = setInterval(FillSelectionsWhenPlaying, 1000);&lt;br /&gt;
			//myVLan.AddAndPlay(&amp;quot;http://66.225.205.8:80&amp;quot;, options.join(&#039;\n&#039;));&lt;br /&gt;
		&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;
		&amp;lt;div style=&#039;float:left;margin:5px&#039;&amp;gt;&lt;br /&gt;
			Audio Track&amp;lt;br /&amp;gt;&lt;br /&gt;
			&amp;lt;select id=&amp;quot;AudioTracks&amp;quot; onclick=&amp;quot;myVLan.AudioTrack=document.getElementById(&#039;AudioTracks&#039;).value&amp;quot;&amp;gt;&amp;lt;/select&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div style=&#039;float:left;margin:5px&#039;&amp;gt;&lt;br /&gt;
			Subtitle Track&amp;lt;br /&amp;gt;&lt;br /&gt;
			&amp;lt;select id=&amp;quot;SubTitleTracks&amp;quot; onclick=&amp;quot;myVLan.SubTitleTrack=document.getElementById(&#039;SubTitleTracks&#039;).value&amp;quot;&amp;gt;&amp;lt;/select&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div style=&#039;float:left;margin:5px&#039;&amp;gt;&lt;br /&gt;
			Deinterlace Mode&amp;lt;br /&amp;gt;&lt;br /&gt;
			&amp;lt;select id=&amp;quot;DeinterlaceModes&amp;quot; onclick=&amp;quot;myVLan.DeinterlaceMode=document.getElementById(&#039;DeinterlaceModes&#039;).value;&amp;quot;&amp;gt;&amp;lt;/select&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div style=&#039;float:left;margin:5px&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;VideoAdjustmentCheck&amp;quot; onclick=&amp;quot;EnableVideoAdjustments();&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;label for=&amp;quot;VideoAdjustmentCheck&amp;quot;&amp;gt;Enable Video Adjustments&amp;lt;/label&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
			Gamma&amp;lt;br /&amp;gt;&lt;br /&gt;
			&amp;lt;select id=&amp;quot;Gamma&amp;quot; disabled=&amp;quot;true&amp;quot; onchange=&amp;quot;myVLan.Gamma=document.getElementById(&#039;Gamma&#039;).value&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;0.01&#039;&amp;gt;0.01&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;0.5&#039;&amp;gt;0.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;1.0&#039; selected=&#039;selected&#039;&amp;gt;1.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;1.5&#039;&amp;gt;1.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;2.0&#039;&amp;gt;2.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;2.5&#039;&amp;gt;2.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;3.0&#039;&amp;gt;3.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;3.5&#039;&amp;gt;3.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;4.0&#039;&amp;gt;4.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;4.5&#039;&amp;gt;4.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;5.0&#039;&amp;gt;5.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;5.5&#039;&amp;gt;5.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;6.0&#039;&amp;gt;6.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;6.5&#039;&amp;gt;6.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;7.0&#039;&amp;gt;7.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;7.5&#039;&amp;gt;7.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;8.0&#039;&amp;gt;8.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;8.5&#039;&amp;gt;8.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;9.0&#039;&amp;gt;9.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;9.5&#039;&amp;gt;9.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;10.0&#039;&amp;gt;10.0&amp;lt;/option&amp;gt;&lt;br /&gt;
			&amp;lt;/select&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
			Saturation&amp;lt;br /&amp;gt;&lt;br /&gt;
			&amp;lt;select id=&amp;quot;Saturation&amp;quot; disabled=&amp;quot;true&amp;quot; onchange=&amp;quot;myVLan.Saturation=document.getElementById(&#039;Saturation&#039;).value&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;0&#039;&amp;gt;0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;0.5&#039;&amp;gt;0.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;1&#039; selected=&#039;selected&#039;&amp;gt;1&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;1.5&#039;&amp;gt;1.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;2&#039;&amp;gt;2&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;2.5&#039;&amp;gt;2.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;3&#039;&amp;gt;3&amp;lt;/option&amp;gt;&lt;br /&gt;
			&amp;lt;/select&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div id=&amp;quot;nowPlaying&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
	&amp;lt;/BODY&amp;gt;&lt;br /&gt;
&amp;lt;/HTML&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Example code]]&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7289</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7289"/>
		<updated>2007-01-17T00:32:02Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
I should say this works with VLC 0.8.6 and 0.8.6a, no guarantees for other versions. Any dll or exe you create with this code needs to be in the same directory as libvlc.dll and have the plugins sub-directory below it (copy libvlc.dll and plugins to the bin/Debug and bin/Release directories when developing C# projects).  One common error is to forget to call Initialize() on the NativeLibVlc instance (only a problem if you&#039;re using NativeLibVlc without the VlcUserControl wrapper control).  Initialize() is best called in this case from the form_OnLoad or control_OnLoad event, not in the constructor of its owner window, (see VlcUserControl.cs&#039;s constructor and function OnLoad for an example of properly initializing a NativeLibVlc object).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More hints:&#039;&#039;&#039;&lt;br /&gt;
Except for Volume and State, most Vlc properties like AudioTrack can&#039;t be set until media is actually playing in the control.  This is because Vlc is multi-threaded, so even after AddToPlaylist is called nothing will be playing for up to several seconds.  A programmer needs to poll the State property of the control waiting for Play state to set the other properties.  This isn&#039;t as big a problem as it seems, since nearly all the properties can be set using the option flags when calling AddToPlaylist or AddAndPlay. For example if you knew you wanted the 2nd audio track of a file you could add the option &amp;quot;:audio-track=1&amp;quot; when calling AddToPlaylist or AddAndPlay (see Vlc command-line options for the full list).&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
Update Jan. 16, 2007:&lt;br /&gt;
 - removed Browsability from all native Vlc properties of VlcUserControl.cs.  This allows placing the control on Forms without errors in Design mode.&lt;br /&gt;
 - files changed: VlcUserControl.cs only&lt;br /&gt;
&lt;br /&gt;
Update Jan. 11, 2007:&lt;br /&gt;
 - added ActiveX functionality&lt;br /&gt;
 - added redundant interfaces to support Javascript programming because Javascript doesn&#039;t support ActiveX arrays or Out parameters&lt;br /&gt;
 - fixed install directory dependence.  Now the directory the assembly exists in is always used as the install directory.&lt;br /&gt;
 - fixed PlaylistIndex and PlaylistCount properties&lt;br /&gt;
 - fixed Cropping&lt;br /&gt;
 - added NowPlaying event, and ProducingEvents property which controls it&lt;br /&gt;
 - added Contrast, Brightness, Hue, Saturation, Gamma properties and AllowVideoAdjustments property which controls them&lt;br /&gt;
 - added GetConfigVariable method&lt;br /&gt;
 - added VLanControl.snk file to allow the control to be signed, required by ActiveX &lt;br /&gt;
 - added .Net_Test.html file to demonstrate ActiveX usage with Javascript&lt;br /&gt;
&lt;br /&gt;
Register the dll for use as an ActiveX component by running:&lt;br /&gt;
    %WINDIR%\Microsoft.net\Framework\v2.0.50727\regasm VLanControl.dll /codebase&lt;br /&gt;
&lt;br /&gt;
If you DON&#039;T want to use this code as an ActiveX component, for example if you&#039;re writing a C# program, remove VLanControl.snk from the project and in the project properties, Signing tab, uncheck &amp;quot;Sign the assembly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.snk]] is an optional key file for use in signing the dll.&lt;br /&gt;
&lt;br /&gt;
[[.Net_Test.html]] is an optional ActiveX demonstration file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7288</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7288"/>
		<updated>2007-01-17T00:30:57Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
I should say this works with VLC 0.8.6 and 0.8.6a, no guarantees for other versions. Any dll or exe you create with this code needs to be in the same directory as libvlc.dll and have the plugins sub-directory below it (copy libvlc.dll and plugins to the bin/Debug and bin/Release directories when developing C# projects).  One common error is to forget to call Initialize() on the NativeLibVlc instance (only a problem if you&#039;re using NativeLibVlc without the VlcUserControl wrapper control).  Initialize() is best called in this case from the form_OnLoad or control_OnLoad event, not in the constructor of its owner window, (see VlcUserControl.cs&#039;s constructor and function OnLoad for an example of properly initializing a NativeLibVlc object).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More hints:&#039;&#039;&#039;&lt;br /&gt;
Except for Volume and State, most Vlc properties like AudioTrack can&#039;t be set until media is actually playing in the control.  This is because Vlc is multi-threaded, so even after AddToPlaylist is called nothing will be playing for up to several seconds.  A programmer needs to poll the State property of the control waiting for Play state to set the other properties.  This isn&#039;t as big a problem as it seems, since nearly all the properties can be set using the option flags when calling AddToPlaylist or AddAndPlay. For example if you knew you wanted the 2nd audio track of a file you could add the option &amp;quot;:audio-track=1&amp;quot; when calling AddToPlaylist or AddAndPlay (see Vlc command-line options for the full list).&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
Update Jan. 16, 2007:&lt;br /&gt;
 - removed Browsability from all native Vlc properties of VlcUserControl.cs.  This allows placing the control on Forms without errors in Design mode.&lt;br /&gt;
&lt;br /&gt;
Update Jan. 11, 2007:&lt;br /&gt;
 - added ActiveX functionality&lt;br /&gt;
 - added redundant interfaces to support Javascript programming because Javascript doesn&#039;t support ActiveX arrays or Out parameters&lt;br /&gt;
 - fixed install directory dependence.  Now the directory the assembly exists in is always used as the install directory.&lt;br /&gt;
 - fixed PlaylistIndex and PlaylistCount properties&lt;br /&gt;
 - fixed Cropping&lt;br /&gt;
 - added NowPlaying event, and ProducingEvents property which controls it&lt;br /&gt;
 - added Contrast, Brightness, Hue, Saturation, Gamma properties and AllowVideoAdjustments property which controls them&lt;br /&gt;
 - added GetConfigVariable method&lt;br /&gt;
 - added VLanControl.snk file to allow the control to be signed, required by ActiveX &lt;br /&gt;
 - added .Net_Test.html file to demonstrate ActiveX usage with Javascript&lt;br /&gt;
&lt;br /&gt;
Register the dll for use as an ActiveX component by running:&lt;br /&gt;
    %WINDIR%\Microsoft.net\Framework\v2.0.50727\regasm VLanControl.dll /codebase&lt;br /&gt;
&lt;br /&gt;
If you DON&#039;T want to use this code as an ActiveX component, for example if you&#039;re writing a C# program, remove VLanControl.snk from the project and in the project properties, Signing tab, uncheck &amp;quot;Sign the assembly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.snk]] is an optional key file for use in signing the dll.&lt;br /&gt;
&lt;br /&gt;
[[.Net_Test.html]] is an optional ActiveX demonstration file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bindings]]&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VlcUserControl.cs&amp;diff=7287</id>
		<title>VlcUserControl.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VlcUserControl.cs&amp;diff=7287"/>
		<updated>2007-01-17T00:10:39Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * VlcUserControl.cs: VlcUserControl partial class definition&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Diagnostics;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
&lt;br /&gt;
namespace VLanControl&lt;br /&gt;
{&lt;br /&gt;
	public delegate void NowPlayingEventHandler(MetaData data, String text);&lt;br /&gt;
&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]&lt;br /&gt;
	[Guid(&amp;quot;98029A85-9804-47d6-9430-F90933AE8650&amp;quot;)]&lt;br /&gt;
	public interface IVlcUserControlEvents&lt;br /&gt;
	{&lt;br /&gt;
		[DispIdAttribute(0x60020000)]&lt;br /&gt;
		void NowPlayingEvent(MetaData data, String text);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	[ClassInterface(ClassInterfaceType.None), ComSourceInterfaces(typeof(IVlcUserControlEvents))]&lt;br /&gt;
	[Guid(&amp;quot;FB99D376-ED98-4ac0-B2C9-F2E974E0849F&amp;quot;)]&lt;br /&gt;
	public partial class VlcUserControl : UserControl, IPlayer2&lt;br /&gt;
	{&lt;br /&gt;
		private bool isPaused;&lt;br /&gt;
		private NativeLibVlc nativeVlc = new NativeLibVlc();&lt;br /&gt;
		private bool useMpegVbrOffset;&lt;br /&gt;
		private bool usingPausedPosition;&lt;br /&gt;
		private int pausedTime;&lt;br /&gt;
		private double pausedPosition;&lt;br /&gt;
		private int shuttleSeconds;&lt;br /&gt;
		private bool useVlcCrop = false;&lt;br /&gt;
		private int cropTop;&lt;br /&gt;
		private int cropBottom;&lt;br /&gt;
		private int cropLeft;&lt;br /&gt;
		private int cropRight;&lt;br /&gt;
&lt;br /&gt;
		const long SavingPostionTimespan = 5000000L;	// .5 seconds in ticks&lt;br /&gt;
&lt;br /&gt;
		public VlcUserControl()&lt;br /&gt;
		{&lt;br /&gt;
			InitializeComponent();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		protected override void OnLoad(EventArgs e)&lt;br /&gt;
		{&lt;br /&gt;
			base.OnLoad(e);&lt;br /&gt;
			this.nativeVlc.Initialize();&lt;br /&gt;
			this.innerVlc.Bounds = this.ClientRectangle;&lt;br /&gt;
			this.nativeVlc.VideoOutput = this.innerVlc;&lt;br /&gt;
			this.nativeVlc.NowPlaying += this.NowPlayingUpdate;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// there&#039;s an overhead to supporting Vlc events, a memory leak, so we need to have them off by default&lt;br /&gt;
		// you can hook to the events before doing this, but none will occur&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public bool ProducingEvents&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.nativeVlc.ProducingEvents; }&lt;br /&gt;
			set { this.nativeVlc.ProducingEvents = value; }&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void DisplayMessage(String message)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.ShowMessage(message);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public Size VideoSize&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.VideoSize;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PrecomputeCrop(Size videoSize, int cropLeft, int cropRight, int cropTop, int cropBottom)&lt;br /&gt;
		{&lt;br /&gt;
			this.cropTop = cropTop;&lt;br /&gt;
			this.cropBottom = cropBottom;&lt;br /&gt;
			this.cropLeft = cropLeft;&lt;br /&gt;
			this.cropRight = cropRight;&lt;br /&gt;
			ComputeCrop(videoSize);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool ComputeCrop()&lt;br /&gt;
		{&lt;br /&gt;
			if(!this.useVlcCrop &amp;amp;&amp;amp; this.IsHandleCreated &amp;amp;&amp;amp; (this.nativeVlc.VideoOutput != null) &amp;amp;&amp;amp; &lt;br /&gt;
				(this.State != PlayerState.None))&lt;br /&gt;
			{&lt;br /&gt;
				Size vidSize = this.nativeVlc.VideoSize;&lt;br /&gt;
				if(!vidSize.IsEmpty)&lt;br /&gt;
				{&lt;br /&gt;
					ComputeCrop(this.nativeVlc.VideoSize);&lt;br /&gt;
					return true;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void ComputeCrop(Size videoSize)&lt;br /&gt;
		{&lt;br /&gt;
			Size mySize = ClientSize;&lt;br /&gt;
			Debug.WriteLine(&amp;quot;Video Sizes = &amp;quot; + videoSize.ToString() + &amp;quot;, &amp;quot; + mySize.ToString());&lt;br /&gt;
			Debug.WriteLine(&amp;quot;Crop = &amp;quot; + cropLeft.ToString() + &amp;quot;, &amp;quot; + cropTop.ToString()&lt;br /&gt;
				 + &amp;quot;, &amp;quot; + cropRight.ToString() + &amp;quot;, &amp;quot; + cropBottom.ToString());&lt;br /&gt;
			this.topBlocker.Visible = false;&lt;br /&gt;
			this.bottomBlocker.Visible = false;&lt;br /&gt;
			this.leftBlocker.Visible = false;&lt;br /&gt;
			this.rightBlocker.Visible = false;&lt;br /&gt;
&lt;br /&gt;
			double myAspect = Convert.ToDouble(mySize.Width) / Convert.ToDouble(mySize.Height);&lt;br /&gt;
			if((this.cropTop == 0) &amp;amp;&amp;amp; (this.cropBottom == 0) &amp;amp;&amp;amp; (this.cropLeft == 0) &amp;amp;&amp;amp; (this.cropRight == 0))&lt;br /&gt;
			{&lt;br /&gt;
				double vlcAspect = Convert.ToDouble(videoSize.Width) / Convert.ToDouble(videoSize.Height);&lt;br /&gt;
				if(vlcAspect &amp;gt; myAspect)&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the top and bottom&lt;br /&gt;
					int perfectHeight = Convert.ToInt32(mySize.Width / vlcAspect);&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point(0, (mySize.Height - perfectHeight) / 2),&lt;br /&gt;
						new Size(mySize.Width, perfectHeight));&lt;br /&gt;
					//Debug.WriteLine(&amp;quot;vlcAspect &amp;gt; myAspect &amp;quot; + this.innerVlc.Bounds.ToString());&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the left and right&lt;br /&gt;
					int perfectWidth = Convert.ToInt32(mySize.Height * vlcAspect);&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point((mySize.Width - perfectWidth) / 2, 0),&lt;br /&gt;
						new Size(perfectWidth, mySize.Height));&lt;br /&gt;
					//Debug.WriteLine(&amp;quot;vlcAspect &amp;lt; myAspect &amp;quot; + this.innerVlc.Bounds.ToString());&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				double realVlcAspect = Convert.ToDouble(videoSize.Width - this.cropRight - this.cropLeft) / &lt;br /&gt;
					Convert.ToDouble(videoSize.Height - this.cropTop - this.cropBottom);&lt;br /&gt;
				if(realVlcAspect &amp;gt; myAspect)&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the top and bottom, and possible blocking panels&lt;br /&gt;
					// first, position and size the innerVlc as if there was no top or bottom cropping&lt;br /&gt;
					int videoPixelWidth = videoSize.Width - this.cropRight - this.cropLeft;&lt;br /&gt;
					double fakeVlcAspect = Convert.ToDouble(videoPixelWidth) / Convert.ToDouble(videoSize.Height);&lt;br /&gt;
					int perfectHeight = Convert.ToInt32(mySize.Width / fakeVlcAspect);&lt;br /&gt;
					Debug.WriteLine(&amp;quot;perfectHeight = &amp;quot; + perfectHeight.ToString());&lt;br /&gt;
&lt;br /&gt;
					double scalingFactor = Convert.ToDouble(mySize.Width) / Convert.ToDouble(videoPixelWidth);&lt;br /&gt;
					int innerVlcLeft = -Convert.ToInt32(Convert.ToDouble(this.cropLeft) * scalingFactor);&lt;br /&gt;
					int innerVlcWidth = Convert.ToInt32(Convert.ToDouble(videoSize.Width) * scalingFactor);&lt;br /&gt;
&lt;br /&gt;
					int offTheTop = Convert.ToInt32(Convert.ToDouble(this.cropTop) * scalingFactor);&lt;br /&gt;
					int offTheBottom = Convert.ToInt32(Convert.ToDouble(this.cropBottom) * scalingFactor);&lt;br /&gt;
					int innerVlcTop = (mySize.Height - (perfectHeight - offTheTop - offTheBottom)) / 2;&lt;br /&gt;
					innerVlcTop -= offTheTop;&lt;br /&gt;
&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point(innerVlcLeft, innerVlcTop),&lt;br /&gt;
						new Size(innerVlcWidth, perfectHeight));&lt;br /&gt;
					Debug.WriteLine(&amp;quot;toowide innerVlc.Bounds = &amp;quot; + this.innerVlc.Bounds.ToString());&lt;br /&gt;
&lt;br /&gt;
					// then, add blocking panels if necessary for the top and bottom cropping&lt;br /&gt;
					if(this.cropTop != 0)&lt;br /&gt;
					{&lt;br /&gt;
						if(offTheTop + innerVlcTop &amp;gt; 0)&lt;br /&gt;
						{&lt;br /&gt;
							this.topBlocker.Bounds = new Rectangle(&lt;br /&gt;
								new Point(0, innerVlcTop),&lt;br /&gt;
								new Size(mySize.Width, offTheTop));&lt;br /&gt;
							this.topBlocker.Visible = true;&lt;br /&gt;
							Debug.WriteLine(&amp;quot;topBlocker.Bounds = &amp;quot; + this.topBlocker.Bounds.ToString());&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
					if(this.cropBottom != 0)&lt;br /&gt;
					{&lt;br /&gt;
						if(innerVlcTop + perfectHeight - offTheBottom &amp;lt; mySize.Height)&lt;br /&gt;
						{&lt;br /&gt;
							this.bottomBlocker.Bounds = new Rectangle(&lt;br /&gt;
								new Point(0, innerVlcTop + perfectHeight - offTheBottom),&lt;br /&gt;
								new Size(mySize.Width, offTheBottom));&lt;br /&gt;
							this.bottomBlocker.Visible = true;&lt;br /&gt;
							Debug.WriteLine(&amp;quot;bottomBlocker.Bounds = &amp;quot; + this.bottomBlocker.Bounds.ToString());&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the left and right, and possible blocking panels&lt;br /&gt;
					// first, position and size the innerVlc as if there was no left or right cropping&lt;br /&gt;
					int videoPixelHeight = videoSize.Height - this.cropBottom - this.cropTop;&lt;br /&gt;
					double fakeVlcAspect = Convert.ToDouble(videoSize.Width) / Convert.ToDouble(videoPixelHeight);&lt;br /&gt;
					int perfectWidth = Convert.ToInt32(mySize.Height * fakeVlcAspect);&lt;br /&gt;
					Debug.WriteLine(&amp;quot;perfectWidth = &amp;quot; + perfectWidth.ToString());&lt;br /&gt;
&lt;br /&gt;
					double scalingFactor = Convert.ToDouble(mySize.Height) / Convert.ToDouble(videoPixelHeight);&lt;br /&gt;
					int innerVlcTop = -Convert.ToInt32(Convert.ToDouble(this.cropTop) * scalingFactor);&lt;br /&gt;
					int innerVlcHeight = Convert.ToInt32(Convert.ToDouble(videoSize.Height) * scalingFactor);&lt;br /&gt;
&lt;br /&gt;
					int offTheLeft = Convert.ToInt32(Convert.ToDouble(this.cropLeft) * scalingFactor);&lt;br /&gt;
					int offTheRight = Convert.ToInt32(Convert.ToDouble(this.cropRight) * scalingFactor);&lt;br /&gt;
					int innerVlcLeft = (mySize.Width - (perfectWidth - offTheLeft - offTheRight)) / 2;&lt;br /&gt;
					innerVlcLeft -= offTheLeft;&lt;br /&gt;
&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point(innerVlcLeft, innerVlcTop),&lt;br /&gt;
						new Size(perfectWidth, innerVlcHeight));&lt;br /&gt;
					Debug.WriteLine(&amp;quot;toohigh innerVlc.Bounds = &amp;quot; + this.innerVlc.Bounds.ToString());&lt;br /&gt;
&lt;br /&gt;
					// then, add blocking panels if necessary for the left and right cropping&lt;br /&gt;
					if(this.cropLeft != 0)&lt;br /&gt;
					{&lt;br /&gt;
						if(offTheLeft + innerVlcLeft &amp;gt; 0)&lt;br /&gt;
						{&lt;br /&gt;
							this.leftBlocker.Bounds = new Rectangle(&lt;br /&gt;
								new Point(innerVlcLeft, 0),&lt;br /&gt;
								new Size(offTheLeft, mySize.Height));&lt;br /&gt;
							this.leftBlocker.Visible = true;&lt;br /&gt;
							Debug.WriteLine(&amp;quot;leftBlocker.Bounds = &amp;quot; + this.leftBlocker.Bounds.ToString());&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
					if(this.cropRight != 0)&lt;br /&gt;
					{&lt;br /&gt;
						if(innerVlcLeft + perfectWidth - offTheRight &amp;lt; mySize.Width)&lt;br /&gt;
						{&lt;br /&gt;
							this.rightBlocker.Bounds = new Rectangle(&lt;br /&gt;
								new Point(innerVlcLeft + perfectWidth - offTheRight, 0),&lt;br /&gt;
								new Size(offTheRight, mySize.Height));&lt;br /&gt;
							this.rightBlocker.Visible = true;&lt;br /&gt;
							Debug.WriteLine(&amp;quot;rightBlocker.Bounds = &amp;quot; + this.rightBlocker.Bounds.ToString());&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String GetConfigVariable(String name, String returnOnError)&lt;br /&gt;
		{&lt;br /&gt;
			String value;&lt;br /&gt;
			if(this.nativeVlc.GetConfigVariable(name, out value) == VlcError.Success)&lt;br /&gt;
			{&lt;br /&gt;
				return value;&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				return returnOnError;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool SetConfigVariable(String name, String value)&lt;br /&gt;
		{&lt;br /&gt;
			return this.nativeVlc.SetConfigVariable(name, value) == VlcError.Success;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int Time&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.Time;&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception)&lt;br /&gt;
				{&lt;br /&gt;
					return 0;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public double Position&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.Position;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void MoveToPosition(TrackPosition newTrackPosition)&lt;br /&gt;
		{&lt;br /&gt;
			if((newTrackPosition.position &amp;gt;= 0.0d) &amp;amp;&amp;amp; (newTrackPosition.position &amp;lt; 1.0d))&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.Position = newTrackPosition.position;&lt;br /&gt;
				if(this.IsPaused)&lt;br /&gt;
				{&lt;br /&gt;
					this.usingPausedPosition = true;&lt;br /&gt;
					this.pausedTime = newTrackPosition.time;&lt;br /&gt;
					this.pausedPosition = newTrackPosition.position;&lt;br /&gt;
					this.shuttleSeconds = 0;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private TrackPosition CalculateShuttle(int origTime, double origPosition, int offsetSeconds)&lt;br /&gt;
		{&lt;br /&gt;
			int newTime = origTime + offsetSeconds;&lt;br /&gt;
&lt;br /&gt;
			double positionPerTime;&lt;br /&gt;
			if(origPosition &amp;gt; .5d)&lt;br /&gt;
			{&lt;br /&gt;
				positionPerTime = origPosition / Convert.ToDouble(origTime);&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				positionPerTime = (1.0d - origPosition) / &lt;br /&gt;
					Convert.ToDouble(this.nativeVlc.Length - origTime);&lt;br /&gt;
			}&lt;br /&gt;
			double newPosition = origPosition + Convert.ToDouble(offsetSeconds) * positionPerTime;&lt;br /&gt;
&lt;br /&gt;
			//Debug.WriteLine(String.Format(&amp;quot;CalculateShuttle time={0} pos={1}&amp;quot;, newTime, newPosition));&lt;br /&gt;
&lt;br /&gt;
			return new TrackPosition(newTime, newPosition);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public TrackPosition Shuttle(int offsetSeconds)&lt;br /&gt;
		{&lt;br /&gt;
			if(!this.IsPaused)&lt;br /&gt;
			{&lt;br /&gt;
				TrackPosition newPosition = CalculateShuttle(this.nativeVlc.Time, this.nativeVlc.Position,&lt;br /&gt;
					offsetSeconds);&lt;br /&gt;
				if(this.useMpegVbrOffset)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Position = newPosition.position;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Time = newPosition.time;&lt;br /&gt;
				}&lt;br /&gt;
				return newPosition;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			if(!this.usingPausedPosition)&lt;br /&gt;
			{&lt;br /&gt;
				this.usingPausedPosition = true;&lt;br /&gt;
				this.pausedTime = this.nativeVlc.Time;&lt;br /&gt;
				this.pausedPosition = this.nativeVlc.Position;&lt;br /&gt;
				this.shuttleSeconds = 0;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			this.shuttleSeconds += offsetSeconds;&lt;br /&gt;
			return CalculateShuttle(this.pausedTime, this.pausedPosition, this.shuttleSeconds);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int Volume&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.Volume;&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.Volume = value;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		const int MinRate = -2;&lt;br /&gt;
		const int MaxRate = 2;&lt;br /&gt;
		const int NormalRate = 0;&lt;br /&gt;
&lt;br /&gt;
		public void GetRates(out int minRate, out int maxRate, out int normalRate)&lt;br /&gt;
		{&lt;br /&gt;
			minRate = MinRate;&lt;br /&gt;
			maxRate = MaxRate;&lt;br /&gt;
			normalRate = NormalRate;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int Rate&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				// 1000 is normal, 2000 is half speed, 500 is double speed, etc.&lt;br /&gt;
				int bigRate = this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;rate&amp;quot;, 1000);&lt;br /&gt;
				if(bigRate &amp;gt; 3000)&lt;br /&gt;
				{&lt;br /&gt;
					return -2;&lt;br /&gt;
				}&lt;br /&gt;
				if(bigRate &amp;gt; 1500)&lt;br /&gt;
				{&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
				if(bigRate &amp;gt; 750)&lt;br /&gt;
				{&lt;br /&gt;
					return 0;&lt;br /&gt;
				}&lt;br /&gt;
				if(bigRate &amp;gt; 400)&lt;br /&gt;
				{&lt;br /&gt;
					return 1;&lt;br /&gt;
				}&lt;br /&gt;
				return 2;&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				int newRate = NormalRate;&lt;br /&gt;
				switch(value)&lt;br /&gt;
				{&lt;br /&gt;
				case 2:&lt;br /&gt;
					newRate = 250;&lt;br /&gt;
					break;&lt;br /&gt;
				case 1:&lt;br /&gt;
					newRate = 500;&lt;br /&gt;
					break;&lt;br /&gt;
				case 0:&lt;br /&gt;
					newRate = 1000;&lt;br /&gt;
					break;&lt;br /&gt;
				case -1:&lt;br /&gt;
					newRate = 2000;&lt;br /&gt;
					break;&lt;br /&gt;
				case -2:&lt;br /&gt;
					newRate = 4000;&lt;br /&gt;
					break;&lt;br /&gt;
				default:&lt;br /&gt;
					throw new ArgumentOutOfRangeException();&lt;br /&gt;
				}&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;rate&amp;quot;, newRate);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int Length&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.Length;&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception)&lt;br /&gt;
				{&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetArtificialLength(value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public double TimeScaling&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.nativeVlc.TimeScaling; }&lt;br /&gt;
			set { this.nativeVlc.TimeScaling = value; }&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public PlayerState State&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				int state = this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &lt;br /&gt;
					&amp;quot;state&amp;quot;, (int)InputState.INIT_S);&lt;br /&gt;
				switch((InputState)state)&lt;br /&gt;
				{&lt;br /&gt;
				case InputState.PAUSE_S:&lt;br /&gt;
					return PlayerState.Paused;&lt;br /&gt;
				case InputState.PLAYING_S:&lt;br /&gt;
					return PlayerState.Playing;&lt;br /&gt;
				default:&lt;br /&gt;
					return PlayerState.None;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public bool IsPlaying { get { return this.State == PlayerState.Playing; } }&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public bool IsPaused { get { return this.State == PlayerState.Paused; } }&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public bool IsMute { get { return (this.nativeVlc.Volume == 0); } }&lt;br /&gt;
&lt;br /&gt;
		public void ToggleMute()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.ToggleVolumeMute();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private String JoinArraysWithCR(Array data, String[] dataText)&lt;br /&gt;
		{&lt;br /&gt;
			StringBuilder sb = new StringBuilder();&lt;br /&gt;
			for(int index = 0; index &amp;lt; data.Length; index++)&lt;br /&gt;
			{&lt;br /&gt;
				if(index != 0)&lt;br /&gt;
				{&lt;br /&gt;
					sb.Append(&amp;quot;\n&amp;quot;);&lt;br /&gt;
				}&lt;br /&gt;
				sb.Append(data.GetValue(index).ToString());&lt;br /&gt;
				sb.Append(&amp;quot;\n&amp;quot;);&lt;br /&gt;
				sb.Append(dataText[index]);&lt;br /&gt;
			}&lt;br /&gt;
			return sb.ToString();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String DeinterlaceModesAsString()&lt;br /&gt;
		{&lt;br /&gt;
			String[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;deinterlace&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void DeinterlaceModes(out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;deinterlace&amp;quot;, out choices, out choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public String DeinterlaceMode&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;deinterlace&amp;quot;, String.Empty);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;deinterlace&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String AspectRatiosAsString()&lt;br /&gt;
		{&lt;br /&gt;
			String[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;aspect-ratio&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void AspectRatios(out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;aspect-ratio&amp;quot;, out choices, out choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public String AspectRatio&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;aspect-ratio&amp;quot;, String.Empty);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;aspect-ratio&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String CropModesAsString()&lt;br /&gt;
		{&lt;br /&gt;
			String[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;crop&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropModes(out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;crop&amp;quot;, out choices, out choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public String CropMode &lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop&amp;quot;, String.Empty);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int CroppingLeft&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-left&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropLeft;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-left&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropLeft = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int CroppingRight&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-right&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropRight;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-right&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropRight = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int CroppingTop&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-top&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropTop;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-top&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropTop = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int CroppingBottom&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-bottom&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropBottom;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-bottom&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropBottom = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String AudioTracksAsString()&lt;br /&gt;
		{&lt;br /&gt;
			int[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;audio-es&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void AudioTracks(out int[] trackIds, out String[] trackNames)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;audio-es&amp;quot;, out trackIds, out trackNames);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int AudioTrack&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-es&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-es&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String SubTitleTracksAsString()&lt;br /&gt;
		{&lt;br /&gt;
			int[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;spu-es&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void SubTitleTracks(out int[] trackIds, out String[] trackNames)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;spu-es&amp;quot;, out trackIds, out trackNames);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int SubTitleTrack&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-es&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-es&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String ProgramsAsString()&lt;br /&gt;
		{&lt;br /&gt;
			int[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;program&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void Programs(out int[] trackIds, out String[] trackNames)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;program&amp;quot;, out trackIds, out trackNames);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int Program&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;program&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;program&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public bool AllowVideoAdjustments&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.AllowVideoAdjustments;&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.AllowVideoAdjustments = value;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public float Contrast&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;contrast&amp;quot;, 1.0f);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				VlcError err = this.nativeVlc.SetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;contrast&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public float Brightness&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;brightness&amp;quot;, 1.0f);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				VlcError err = this.nativeVlc.SetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;brightness&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int Hue&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;hue&amp;quot;, 0);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				VlcError err = this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;hue&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public float Saturation&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;saturation&amp;quot;, 1.0f);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				VlcError err = this.nativeVlc.SetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;saturation&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public float Gamma&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;gamma&amp;quot;, 1.0f);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				VlcError err = this.nativeVlc.SetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;gamma&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateCropModes()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-crop&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int AudioDelay&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				long delay = this.nativeVlc.GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-delay&amp;quot;, 0L);&lt;br /&gt;
				return Convert.ToInt32(delay / 1000L);&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				long delay = Convert.ToInt64(value) * 1000L;&lt;br /&gt;
				this.nativeVlc.SetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-delay&amp;quot;, delay);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int SubTitleDelay&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				long delay = this.nativeVlc.GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-delay&amp;quot;, 0L);&lt;br /&gt;
				return Convert.ToInt32(delay / 1000L);&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				long delay = Convert.ToInt64(value) * 1000L;&lt;br /&gt;
				this.nativeVlc.SetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-delay&amp;quot;, delay);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int ChapterCount&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				int[] chapterIds;&lt;br /&gt;
				String[] chapterText;&lt;br /&gt;
				this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
					&amp;quot;chapter&amp;quot;, out chapterIds, out chapterText);&lt;br /&gt;
				return (chapterIds.Length &amp;gt; 0) ? chapterIds.Length - 1 : 0;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Browsable(false)]&lt;br /&gt;
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]&lt;br /&gt;
		public int Chapter&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;chapter&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;chapter&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void RepositionAfterPause()&lt;br /&gt;
		{&lt;br /&gt;
			if(this.usingPausedPosition &amp;amp;&amp;amp; (this.shuttleSeconds != 0))&lt;br /&gt;
			{&lt;br /&gt;
				TrackPosition newPosition = CalculateShuttle(this.pausedTime, this.pausedPosition,&lt;br /&gt;
					this.shuttleSeconds);&lt;br /&gt;
				if(this.useMpegVbrOffset)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Position = newPosition.position;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Time = newPosition.time;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void Play()&lt;br /&gt;
		{&lt;br /&gt;
			this.isPaused = false;&lt;br /&gt;
			this.nativeVlc.Play();&lt;br /&gt;
			RepositionAfterPause();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void ClearPlayList()&lt;br /&gt;
		{&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			//Debug.WriteLine(&amp;quot;ClearPlayList&amp;quot;);&lt;br /&gt;
			this.nativeVlc.PlaylistClear();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void AddAndPlay(String fileName, String options)&lt;br /&gt;
		{&lt;br /&gt;
			String[] optionsArray = options.Split(&#039;\n&#039;);&lt;br /&gt;
			int id = AddToPlayList(fileName, &amp;quot;&amp;quot;, optionsArray);&lt;br /&gt;
			PlayItem(id);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int AddToPlayList(String fileName, String title, String[] options)&lt;br /&gt;
		{&lt;br /&gt;
			//MessageBox.Show(fileName);&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			int index = 0;&lt;br /&gt;
			this.nativeVlc.AddTarget(fileName, options, ref index);&lt;br /&gt;
			Debug.WriteLine(&amp;quot;Added to Playlist &amp;quot; + fileName);&lt;br /&gt;
			Debug.WriteLine(&amp;quot;index = &amp;quot; + index.ToString());&lt;br /&gt;
			return index;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PlayItem(int itemId)&lt;br /&gt;
		{&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			this.isPaused = false;&lt;br /&gt;
			this.nativeVlc.SetArtificialLength(0);&lt;br /&gt;
			this.nativeVlc.TimeScaling = 0.0d;&lt;br /&gt;
&lt;br /&gt;
			int currentIndex = this.nativeVlc.PlaylistIndex;&lt;br /&gt;
			Debug.WriteLine(&amp;quot;PlayItem index = &amp;quot; + itemId.ToString(), &amp;quot; currentIndex = &amp;quot; + currentIndex.ToString());&lt;br /&gt;
			if(currentIndex &amp;lt; 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.Play();&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				//this.nativeVlc.PlaylistPrevious();&lt;br /&gt;
				this.nativeVlc.Play(itemId);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void Stop()&lt;br /&gt;
		{&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			this.nativeVlc.Stop();&lt;br /&gt;
			this.isPaused = false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void TogglePause()&lt;br /&gt;
		{&lt;br /&gt;
			bool wasPaused = this.IsPaused;&lt;br /&gt;
			this.nativeVlc.Pause();&lt;br /&gt;
			if(wasPaused)&lt;br /&gt;
			{&lt;br /&gt;
				RepositionAfterPause();&lt;br /&gt;
			}&lt;br /&gt;
			this.isPaused = !wasPaused;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateSubtitles()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-subtitle-track&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateAudioTrack()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-audio-track&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateDeinterlaceMode()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-deinterlace&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateAspectRatio()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-aspect-ratio&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropTop()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-top&amp;quot;);&lt;br /&gt;
			this.CroppingTop = this.CroppingTop + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropTop()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-top&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingTop - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingTop = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropBottom()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-bottom&amp;quot;);&lt;br /&gt;
			this.CroppingBottom = this.CroppingBottom + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropBottom()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-bottom&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingBottom - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingBottom = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropLeft()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-left&amp;quot;);&lt;br /&gt;
			this.CroppingLeft = this.CroppingLeft + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropLeft()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-left&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingLeft - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingLeft = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropRight()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-right&amp;quot;);&lt;br /&gt;
			this.CroppingRight = this.CroppingRight + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropRight()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-right&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingRight - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingRight = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool UseMpegVbrOffset&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.useMpegVbrOffset; }&lt;br /&gt;
			set { this.useMpegVbrOffset = value; }&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void NextDvdTrack()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-title-next&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PreviousDvdTrack()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-title-prev&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void NextDvdChapter()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-chapter-next&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PreviousDvdChapter()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-chapter-prev&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public event MetaDataEventHandler NowPlaying;&lt;br /&gt;
		// this 2nd event is a non-standard prototype needed for Com Interop event sourcing&lt;br /&gt;
		public event NowPlayingEventHandler NowPlayingEvent;&lt;br /&gt;
&lt;br /&gt;
		private void OnNowPlaying(MetaDataUpdateEventArgs args)&lt;br /&gt;
		{&lt;br /&gt;
			if(this.NowPlaying != null)&lt;br /&gt;
			{&lt;br /&gt;
				this.NowPlaying(this, args);&lt;br /&gt;
			}&lt;br /&gt;
			if(this.NowPlayingEvent != null)&lt;br /&gt;
			{&lt;br /&gt;
				this.NowPlayingEvent(args.Data, args.Text);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void NowPlayingUpdate(object sender, MetaDataUpdateEventArgs args)&lt;br /&gt;
		{&lt;br /&gt;
			OnNowPlaying(args);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		protected override void OnResize(EventArgs e)&lt;br /&gt;
		{&lt;br /&gt;
			base.OnResize(e);&lt;br /&gt;
			if(!ComputeCrop())&lt;br /&gt;
			{&lt;br /&gt;
				this.innerVlc.Bounds = this.ClientRectangle;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Example code]]&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7035</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7035"/>
		<updated>2007-01-12T21:23:24Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
I should say this works with VLC 0.8.6 and 0.8.6a, no guarantees for other versions. Any dll or exe you create with this code needs to be in the same directory as libvlc.dll and have the plugins sub-directory below it.  One common error is to forget to call Initialize() on the VlcUserControl instance, which must be done after the control has been parented to a form and the form is visible (the form_OnLoad or control_OnLoad event is best, see VlcUserControl.cs&#039;s constructor and function OnLoad for an example of properly initializing a NativeLibVlc object).&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
Update Jan. 11, 2007:&lt;br /&gt;
 - added ActiveX functionality&lt;br /&gt;
 - added redundant interfaces to support Javascript programming because Javascript doesn&#039;t support ActiveX arrays or Out parameters&lt;br /&gt;
 - fixed install directory dependence.  Now the directory the assembly exists in is always used as the install directory.&lt;br /&gt;
 - fixed PlaylistIndex and PlaylistCount properties&lt;br /&gt;
 - fixed Cropping&lt;br /&gt;
 - added NowPlaying event, and ProducingEvents property which controls it&lt;br /&gt;
 - added Contrast, Brightness, Hue, Saturation, Gamma properties and AllowVideoAdjustments property which controls them&lt;br /&gt;
 - added GetConfigVariable method&lt;br /&gt;
 - added VLanControl.snk file to allow the control to be signed, required by ActiveX &lt;br /&gt;
 - added .Net_Test.html file to demonstrate ActiveX usage with Javascript&lt;br /&gt;
&lt;br /&gt;
Register the dll for use as an ActiveX component by running:&lt;br /&gt;
    %WINDIR%\Microsoft.net\Framework\v2.0.50727\regasm VLanControl.dll /codebase&lt;br /&gt;
&lt;br /&gt;
If you DON&#039;T want to use this code as an ActiveX component, for example if you&#039;re writing a C# program, remove VLanControl.snk from the project and in the project properties, Signing tab, uncheck &amp;quot;Sign the assembly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.snk]] is an optional key file for use in signing the dll.&lt;br /&gt;
&lt;br /&gt;
[[.Net_Test.html]] is an optional ActiveX demonstration file.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7034</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7034"/>
		<updated>2007-01-12T21:21:38Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
I should say this works with VLC 0.8.6 and 0.8.6a, no guarantees for other versions. Any dll or exe you create with this code needs to be in the same directory as libvlc.dll and have the plugins sub-directory below it.  One common error is to forget to call Initialize() on the VlcUserControl instance, which must be done after the control has been parented to a form and the form is visible (the form_OnLoad or control_OnLoad event is best, see VlcUserControl.cs function OnLoad for an example of properly initializing a NativeLibVlc object).&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
Update Jan. 11, 2007:&lt;br /&gt;
 - added ActiveX functionality&lt;br /&gt;
 - added redundant interfaces to support Javascript programming because Javascript doesn&#039;t support ActiveX arrays or Out parameters&lt;br /&gt;
 - fixed install directory dependence.  Now the directory the assembly exists in is always used as the install directory.&lt;br /&gt;
 - fixed PlaylistIndex and PlaylistCount properties&lt;br /&gt;
 - fixed Cropping&lt;br /&gt;
 - added NowPlaying event, and ProducingEvents property which controls it&lt;br /&gt;
 - added Contrast, Brightness, Hue, Saturation, Gamma properties and AllowVideoAdjustments property which controls them&lt;br /&gt;
 - added GetConfigVariable method&lt;br /&gt;
 - added VLanControl.snk file to allow the control to be signed, required by ActiveX &lt;br /&gt;
 - added .Net_Test.html file to demonstrate ActiveX usage with Javascript&lt;br /&gt;
&lt;br /&gt;
Register the dll for use as an ActiveX component by running:&lt;br /&gt;
    %WINDIR%\Microsoft.net\Framework\v2.0.50727\regasm VLanControl.dll /codebase&lt;br /&gt;
&lt;br /&gt;
If you DON&#039;T want to use this code as an ActiveX component, for example if you&#039;re writing a C# program, remove VLanControl.snk from the project and in the project properties, Signing tab, uncheck &amp;quot;Sign the assembly&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.snk]] is an optional key file for use in signing the dll.&lt;br /&gt;
&lt;br /&gt;
[[.Net_Test.html]] is an optional ActiveX demonstration file.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7033</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7033"/>
		<updated>2007-01-12T21:16:19Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
I should say this works with VLC 0.8.6 and 0.8.6a, no guarantees for other versions. Any dll or exe you create with this code needs to be in the same directory as libvlc.dll and have the plugins sub-directory below it.  One common error is to forget to call Initialize() on the VlcUserControl instance, which must be done after the control has been parented to a form and the form is visible (the form_OnLoad or control_OnLoad event is best, see VlcUserControl.cs function OnLoad for an example of properly initializing a NativeLibVlc object).&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
Update Jan. 11, 2007:&lt;br /&gt;
 - added ActiveX functionality&lt;br /&gt;
 - added redundant interfaces to support Javascript programming because Javascript doesn&#039;t support ActiveX arrays or Out parameters&lt;br /&gt;
 - fixed install directory dependence.  Now the directory the assembly exists in is always used as the install directory.&lt;br /&gt;
 - fixed PlaylistIndex and PlaylistCount properties&lt;br /&gt;
 - fixed Cropping&lt;br /&gt;
 - added NowPlaying event, and ProducingEvents property which controls it&lt;br /&gt;
 - added Contrast, Brightness, Hue, Saturation, Gamma properties and AllowVideoAdjustments property which controls them&lt;br /&gt;
 - added GetConfigVariable method&lt;br /&gt;
 - added VLanControl.snk file to allow the control to be signed, required by ActiveX &lt;br /&gt;
 - added .Net_Test.html file to demonstrate ActiveX usage with Javascript&lt;br /&gt;
&lt;br /&gt;
Register the dll for use as an ActiveX component by running:&lt;br /&gt;
    %WINDIR%\Microsoft.net\Framework\v2.0.50727\regasm VLanControl.dll /codebase&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.snk]] is an optional key file for use in signing the dll.&lt;br /&gt;
&lt;br /&gt;
[[.Net_Test.html]] is an optional ActiveX demonstration file.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7032</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7032"/>
		<updated>2007-01-12T21:14:33Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
I should say this works with VLC 0.8.6 and 0.8.6a, no guarantees for other versions. Any dll or exe you create with this code needs to be in the same directory as libvlc.dll and have the plugins sub-directory below it.  One common error is to forget to call Initialize() on the VlcUserControl instance, which must be done after the control has been parented to a form and the form is visible (the form_OnLoad or control_OnLoad event is best, see VlcUserControl.cs function OnLoad for an example of properly initializing a NativeLibVlc object).&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
Update Jan. 11, 2007:&lt;br /&gt;
 - added ActiveX functionality&lt;br /&gt;
 - added redundant interfaces to support Javascript programming because Javascript doesn&#039;t support ActiveX arrays or Out parameters&lt;br /&gt;
 - fixed install directory dependence.  Now the directory the assembly exists in is always used as the install directory.&lt;br /&gt;
 - fixed PlaylistIndex and PlaylistCount properties&lt;br /&gt;
 - fixed Cropping&lt;br /&gt;
 - added NowPlaying event, and ProducingEvents property which controls it&lt;br /&gt;
 - added Contrast, Brightness, Hue, Saturation, Gamma properties and AllowVideoAdjustments property which controls them&lt;br /&gt;
 - added GetConfigVariable method&lt;br /&gt;
 - added VLanControl.snk file to allow the control to be signed, required by ActiveX &lt;br /&gt;
 - added Test.html file to demonstrate ActiveX usage&lt;br /&gt;
&lt;br /&gt;
Register the dll for use as an ActiveX component by running:&lt;br /&gt;
    %WINDIR%\Microsoft.net\Framework\v2.0.50727\regasm VLanControl.dll /codebase&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.snk]] is an optional key file for use in signing the dll.&lt;br /&gt;
&lt;br /&gt;
[[.Net_Test.html]] is an optional ActiveX demonstration file.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Test.html&amp;diff=7024</id>
		<title>.Net Test.html</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Test.html&amp;diff=7024"/>
		<updated>2007-01-12T01:12:01Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//W3C//DTD HTML 4.0 Transitional//EN&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;META HTTP-EQUIV=&#039;Content-Type&#039; CONTENT=&#039;text/html; charset=iso-8859-1&#039; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;HTML&amp;gt;&lt;br /&gt;
	&amp;lt;HEAD&amp;gt;&lt;br /&gt;
		&amp;lt;TITLE&amp;gt;Sink managed event in Internet Explorer&amp;lt;/TITLE&amp;gt;&lt;br /&gt;
	&amp;lt;/HEAD&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;BODY&amp;gt;&lt;br /&gt;
		&lt;br /&gt;
		&amp;lt;OBJECT id=&amp;quot;myVLan&amp;quot; classid=&amp;quot;clsid:FB99D376-ED98-4ac0-B2C9-F2E974E0849F&amp;quot; width=&amp;quot;720&amp;quot; height=&amp;quot;480&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/OBJECT&amp;gt;&lt;br /&gt;
		&amp;lt;br /&amp;gt;&lt;br /&gt;
		&amp;lt;SCRIPT LANGUAGE=&amp;quot;JScript&amp;quot;&amp;gt;&lt;br /&gt;
			var selectionsEmpty = true;&lt;br /&gt;
			&lt;br /&gt;
            function myVLan::NowPlayingEvent(a, b)&lt;br /&gt;
            {&lt;br /&gt;
				document.getElementById(&#039;nowPlaying&#039;).innerText = b;&lt;br /&gt;
                //alert(b);&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
			function FillSelectionList(choiceArray, selectedChoice, selectId)&lt;br /&gt;
			{&lt;br /&gt;
				var selectElement = document.getElementById(selectId);&lt;br /&gt;
				while(selectElement.hasChildNodes())&lt;br /&gt;
				{&lt;br /&gt;
					selectElement.removeChild(selectElement.lastChild);&lt;br /&gt;
				}&lt;br /&gt;
				&lt;br /&gt;
				for(index = 0; index &amp;lt; choiceArray.length; index += 2)&lt;br /&gt;
				{&lt;br /&gt;
					var choice = choiceArray[index];&lt;br /&gt;
					var choiceText = choiceArray[index + 1];&lt;br /&gt;
					var newOption = document.createElement(&#039;option&#039;);&lt;br /&gt;
					newOption.value = choice;&lt;br /&gt;
					newOption.appendChild(document.createTextNode(choiceText));&lt;br /&gt;
					if(choice == selectedChoice)&lt;br /&gt;
					{&lt;br /&gt;
						newOption.selected = &#039;selected&#039;;&lt;br /&gt;
					}&lt;br /&gt;
					selectElement.appendChild(newOption);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			function FillSelectionsWhenPlaying()&lt;br /&gt;
			{&lt;br /&gt;
				if(selectionsEmpty &amp;amp;&amp;amp; (myVLan.State != 0))&lt;br /&gt;
				{&lt;br /&gt;
					selectionsEmpty = false;&lt;br /&gt;
					var audioTracks = myVLan.AudioTracksAsString();&lt;br /&gt;
					FillSelectionList(audioTracks.split(&#039;\n&#039;), myVLan.AudioTrack, &#039;AudioTracks&#039;);&lt;br /&gt;
					var subTracks = myVLan.SubTitleTracksAsString();&lt;br /&gt;
					FillSelectionList(subTracks.split(&#039;\n&#039;), myVLan.SubTitleTrack, &#039;SubTitleTracks&#039;);&lt;br /&gt;
					var deints = myVLan.DeinterlaceModesAsString();&lt;br /&gt;
					FillSelectionList(deints.split(&#039;\n&#039;), myVLan.DeinterlaceMode, &#039;DeinterlaceModes&#039;);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			&lt;br /&gt;
			function EnableVideoAdjustments()&lt;br /&gt;
			{&lt;br /&gt;
				var vidCheck = document.getElementById(&amp;quot;VideoAdjustmentCheck&amp;quot;);&lt;br /&gt;
				if(vidCheck.checked)&lt;br /&gt;
				{&lt;br /&gt;
					myVLan.AllowVideoAdjustments = true;&lt;br /&gt;
					document.getElementById(&amp;quot;Gamma&amp;quot;).disabled = false;&lt;br /&gt;
					document.getElementById(&amp;quot;Gamma&amp;quot;).value = &#039;&#039;;&lt;br /&gt;
					document.getElementById(&amp;quot;Saturation&amp;quot;).disabled = false;&lt;br /&gt;
					document.getElementById(&amp;quot;Saturation&amp;quot;).value = &#039;&#039;;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					myVLan.AllowVideoAdjustments = false;&lt;br /&gt;
					document.getElementById(&amp;quot;Gamma&amp;quot;).disabled = true;&lt;br /&gt;
					document.getElementById(&amp;quot;Saturation&amp;quot;).disabled = true;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			myVLan.ProducingEvents = true;&lt;br /&gt;
			var options = new Array(&amp;quot;:ffmpeg-pp-q=6&amp;quot;, &amp;quot;:no-loop&amp;quot;);&lt;br /&gt;
			myVLan.AddAndPlay(&amp;quot;X:\\Kiki.mpg&amp;quot;, options.join(&#039;\n&#039;));&lt;br /&gt;
			var timerId = setInterval(FillSelectionsWhenPlaying, 1000);&lt;br /&gt;
			//myVLan.AddAndPlay(&amp;quot;http://66.225.205.8:80&amp;quot;, options.join(&#039;\n&#039;));&lt;br /&gt;
		&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;
		&amp;lt;div style=&#039;float:left;margin:5px&#039;&amp;gt;&lt;br /&gt;
			Audio Track&amp;lt;br /&amp;gt;&lt;br /&gt;
			&amp;lt;select id=&amp;quot;AudioTracks&amp;quot; onclick=&amp;quot;myVLan.AudioTrack=document.getElementById(&#039;AudioTracks&#039;).value&amp;quot;&amp;gt;&amp;lt;/select&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div style=&#039;float:left;margin:5px&#039;&amp;gt;&lt;br /&gt;
			Subtitle Track&amp;lt;br /&amp;gt;&lt;br /&gt;
			&amp;lt;select id=&amp;quot;SubTitleTracks&amp;quot; onclick=&amp;quot;myVLan.SubTitleTrack=document.getElementById(&#039;SubTitleTracks&#039;).value&amp;quot;&amp;gt;&amp;lt;/select&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div style=&#039;float:left;margin:5px&#039;&amp;gt;&lt;br /&gt;
			Deinterlace Mode&amp;lt;br /&amp;gt;&lt;br /&gt;
			&amp;lt;select id=&amp;quot;DeinterlaceModes&amp;quot; onclick=&amp;quot;myVLan.DeinterlaceMode=document.getElementById(&#039;DeinterlaceModes&#039;).value;&amp;quot;&amp;gt;&amp;lt;/select&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div style=&#039;float:left;margin:5px&#039;&amp;gt;&lt;br /&gt;
			&amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;VideoAdjustmentCheck&amp;quot; onclick=&amp;quot;EnableVideoAdjustments();&amp;quot; /&amp;gt;&lt;br /&gt;
			&amp;lt;label for=&amp;quot;VideoAdjustmentCheck&amp;quot;&amp;gt;Enable Video Adjustments&amp;lt;/label&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
			Gamma&amp;lt;br /&amp;gt;&lt;br /&gt;
			&amp;lt;select id=&amp;quot;Gamma&amp;quot; disabled=&amp;quot;true&amp;quot; onchange=&amp;quot;myVLan.Gamma=document.getElementById(&#039;Gamma&#039;).value&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;0.01&#039;&amp;gt;0.01&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;0.5&#039;&amp;gt;0.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;1.0&#039; selected=&#039;selected&#039;&amp;gt;1.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;1.5&#039;&amp;gt;1.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;2.0&#039;&amp;gt;2.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;2.5&#039;&amp;gt;2.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;3.0&#039;&amp;gt;3.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;3.5&#039;&amp;gt;3.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;4.0&#039;&amp;gt;4.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;4.5&#039;&amp;gt;4.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;5.0&#039;&amp;gt;5.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;5.5&#039;&amp;gt;5.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;6.0&#039;&amp;gt;6.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;6.5&#039;&amp;gt;6.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;7.0&#039;&amp;gt;7.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;7.5&#039;&amp;gt;7.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;8.0&#039;&amp;gt;8.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;8.5&#039;&amp;gt;8.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;9.0&#039;&amp;gt;9.0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;9.5&#039;&amp;gt;9.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;10.0&#039;&amp;gt;10.0&amp;lt;/option&amp;gt;&lt;br /&gt;
			&amp;lt;/select&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
			Saturation&amp;lt;br /&amp;gt;&lt;br /&gt;
			&amp;lt;select id=&amp;quot;Saturation&amp;quot; disabled=&amp;quot;true&amp;quot; onchange=&amp;quot;myVLan.Saturation=document.getElementById(&#039;Saturation&#039;).value&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;0&#039;&amp;gt;0&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;0.5&#039;&amp;gt;0.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;1&#039; selected=&#039;selected&#039;&amp;gt;1&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;1.5&#039;&amp;gt;1.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;2&#039;&amp;gt;2&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;2.5&#039;&amp;gt;2.5&amp;lt;/option&amp;gt;&lt;br /&gt;
				&amp;lt;option value=&#039;3&#039;&amp;gt;3&amp;lt;/option&amp;gt;&lt;br /&gt;
			&amp;lt;/select&amp;gt;&lt;br /&gt;
		&amp;lt;/div&amp;gt;&lt;br /&gt;
		&amp;lt;div id=&amp;quot;nowPlaying&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
	&amp;lt;/BODY&amp;gt;&lt;br /&gt;
&amp;lt;/HTML&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLanControl.snk&amp;diff=7023</id>
		<title>VLanControl.snk</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLanControl.snk&amp;diff=7023"/>
		<updated>2007-01-12T01:11:09Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a binary file, so I can&#039;t post it.&lt;br /&gt;
&lt;br /&gt;
It needs to be generated with the Microsoft Strong Name tool (sn.exe) which comes with the free Windows SDK and perhaps some of the free compilers.  The command to generate the file is:&lt;br /&gt;
&lt;br /&gt;
sn -k VLanControl.snk&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLanControl.csproj&amp;diff=7022</id>
		<title>VLanControl.csproj</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLanControl.csproj&amp;diff=7022"/>
		<updated>2007-01-12T01:05:31Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;Project DefaultTargets=&amp;quot;Build&amp;quot; xmlns=&amp;quot;http://schemas.microsoft.com/developer/msbuild/2003&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;PropertyGroup&amp;gt;&lt;br /&gt;
    &amp;lt;Configuration Condition=&amp;quot; &#039;$(Configuration)&#039; == &#039;&#039; &amp;quot;&amp;gt;Debug&amp;lt;/Configuration&amp;gt;&lt;br /&gt;
    &amp;lt;Platform Condition=&amp;quot; &#039;$(Platform)&#039; == &#039;&#039; &amp;quot;&amp;gt;AnyCPU&amp;lt;/Platform&amp;gt;&lt;br /&gt;
    &amp;lt;ProductVersion&amp;gt;8.0.50727&amp;lt;/ProductVersion&amp;gt;&lt;br /&gt;
    &amp;lt;SchemaVersion&amp;gt;2.0&amp;lt;/SchemaVersion&amp;gt;&lt;br /&gt;
    &amp;lt;ProjectGuid&amp;gt;{4E5BE39D-D764-494F-80DB-C32854595A08}&amp;lt;/ProjectGuid&amp;gt;&lt;br /&gt;
    &amp;lt;OutputType&amp;gt;Library&amp;lt;/OutputType&amp;gt;&lt;br /&gt;
    &amp;lt;AppDesignerFolder&amp;gt;Properties&amp;lt;/AppDesignerFolder&amp;gt;&lt;br /&gt;
    &amp;lt;RootNamespace&amp;gt;VLanControl&amp;lt;/RootNamespace&amp;gt;&lt;br /&gt;
    &amp;lt;AssemblyName&amp;gt;VLanControl&amp;lt;/AssemblyName&amp;gt;&lt;br /&gt;
    &amp;lt;SignAssembly&amp;gt;true&amp;lt;/SignAssembly&amp;gt;&lt;br /&gt;
    &amp;lt;AssemblyOriginatorKeyFile&amp;gt;VLanControl.snk&amp;lt;/AssemblyOriginatorKeyFile&amp;gt;&lt;br /&gt;
  &amp;lt;/PropertyGroup&amp;gt;&lt;br /&gt;
  &amp;lt;PropertyGroup Condition=&amp;quot; &#039;$(Configuration)|$(Platform)&#039; == &#039;Debug|AnyCPU&#039; &amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;DebugSymbols&amp;gt;true&amp;lt;/DebugSymbols&amp;gt;&lt;br /&gt;
    &amp;lt;DebugType&amp;gt;full&amp;lt;/DebugType&amp;gt;&lt;br /&gt;
    &amp;lt;Optimize&amp;gt;false&amp;lt;/Optimize&amp;gt;&lt;br /&gt;
    &amp;lt;OutputPath&amp;gt;bin\Debug\&amp;lt;/OutputPath&amp;gt;&lt;br /&gt;
    &amp;lt;DefineConstants&amp;gt;DEBUG;TRACE&amp;lt;/DefineConstants&amp;gt;&lt;br /&gt;
    &amp;lt;ErrorReport&amp;gt;prompt&amp;lt;/ErrorReport&amp;gt;&lt;br /&gt;
    &amp;lt;WarningLevel&amp;gt;4&amp;lt;/WarningLevel&amp;gt;&lt;br /&gt;
    &amp;lt;AllowUnsafeBlocks&amp;gt;false&amp;lt;/AllowUnsafeBlocks&amp;gt;&lt;br /&gt;
    &amp;lt;RegisterForComInterop&amp;gt;false&amp;lt;/RegisterForComInterop&amp;gt;&lt;br /&gt;
  &amp;lt;/PropertyGroup&amp;gt;&lt;br /&gt;
  &amp;lt;PropertyGroup Condition=&amp;quot; &#039;$(Configuration)|$(Platform)&#039; == &#039;Release|AnyCPU&#039; &amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;DebugType&amp;gt;pdbonly&amp;lt;/DebugType&amp;gt;&lt;br /&gt;
    &amp;lt;Optimize&amp;gt;true&amp;lt;/Optimize&amp;gt;&lt;br /&gt;
    &amp;lt;OutputPath&amp;gt;bin\Release\&amp;lt;/OutputPath&amp;gt;&lt;br /&gt;
    &amp;lt;DefineConstants&amp;gt;TRACE&amp;lt;/DefineConstants&amp;gt;&lt;br /&gt;
    &amp;lt;ErrorReport&amp;gt;prompt&amp;lt;/ErrorReport&amp;gt;&lt;br /&gt;
    &amp;lt;WarningLevel&amp;gt;4&amp;lt;/WarningLevel&amp;gt;&lt;br /&gt;
    &amp;lt;AllowUnsafeBlocks&amp;gt;false&amp;lt;/AllowUnsafeBlocks&amp;gt;&lt;br /&gt;
    &amp;lt;RegisterForComInterop&amp;gt;false&amp;lt;/RegisterForComInterop&amp;gt;&lt;br /&gt;
  &amp;lt;/PropertyGroup&amp;gt;&lt;br /&gt;
  &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
    &amp;lt;Reference Include=&amp;quot;System&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Reference Include=&amp;quot;System.Data&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Reference Include=&amp;quot;System.Drawing&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Reference Include=&amp;quot;System.Windows.Forms&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Reference Include=&amp;quot;System.Xml&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
  &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;InnerVlcWindow.cs&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;SubType&amp;gt;UserControl&amp;lt;/SubType&amp;gt;&lt;br /&gt;
    &amp;lt;/Compile&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;InnerVlcWindow.Designer.cs&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;DependentUpon&amp;gt;InnerVlcWindow.cs&amp;lt;/DependentUpon&amp;gt;&lt;br /&gt;
    &amp;lt;/Compile&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;IPlayer.cs&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;NativeLibVlc.cs&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;Properties\AssemblyInfo.cs&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;VlcUserControl.cs&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;SubType&amp;gt;UserControl&amp;lt;/SubType&amp;gt;&lt;br /&gt;
    &amp;lt;/Compile&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;VlcUserControl.Designer.cs&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;DependentUpon&amp;gt;VlcUserControl.cs&amp;lt;/DependentUpon&amp;gt;&lt;br /&gt;
    &amp;lt;/Compile&amp;gt;&lt;br /&gt;
  &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
  &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
    &amp;lt;EmbeddedResource Include=&amp;quot;VlcUserControl.resx&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;SubType&amp;gt;Designer&amp;lt;/SubType&amp;gt;&lt;br /&gt;
      &amp;lt;DependentUpon&amp;gt;VlcUserControl.cs&amp;lt;/DependentUpon&amp;gt;&lt;br /&gt;
    &amp;lt;/EmbeddedResource&amp;gt;&lt;br /&gt;
  &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
  &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
    &amp;lt;None Include=&amp;quot;VLanControl.snk&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
  &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
    &amp;lt;Content Include=&amp;quot;Test.html&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
  &amp;lt;Import Project=&amp;quot;$(MSBuildBinPath)\Microsoft.CSharp.targets&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;!-- To modify your build process, add your task inside one of the targets below and uncomment it. &lt;br /&gt;
       Other similar extension points exist, see Microsoft.Common.targets.&lt;br /&gt;
  &amp;lt;Target Name=&amp;quot;BeforeBuild&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;/Target&amp;gt;&lt;br /&gt;
  &amp;lt;Target Name=&amp;quot;AfterBuild&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;/Target&amp;gt;&lt;br /&gt;
  --&amp;gt;&lt;br /&gt;
&amp;lt;/Project&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=AssemblyInfo.cs&amp;diff=7021</id>
		<title>AssemblyInfo.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=AssemblyInfo.cs&amp;diff=7021"/>
		<updated>2007-01-12T01:05:01Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * AssemblyInfo.cs: VLanControl.dll assembly specification&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using System.Runtime.CompilerServices;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
&lt;br /&gt;
// General Information about an assembly is controlled through the following &lt;br /&gt;
// set of attributes. Change these attribute values to modify the information&lt;br /&gt;
// associated with an assembly.&lt;br /&gt;
[assembly: AssemblyTitle(&amp;quot;VLanControl&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyDescription(&amp;quot;&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyConfiguration(&amp;quot;&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyCompany(&amp;quot;&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyProduct(&amp;quot;VLanControl&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyCopyright(&amp;quot;Copyright ©  2006&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyTrademark(&amp;quot;&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyCulture(&amp;quot;&amp;quot;)]&lt;br /&gt;
&lt;br /&gt;
// Setting ComVisible to false makes the types in this assembly not visible &lt;br /&gt;
// to COM components.  If you need to access a type in this assembly from &lt;br /&gt;
// COM, set the ComVisible attribute to true on that type.&lt;br /&gt;
[assembly: ComVisible(false)]&lt;br /&gt;
&lt;br /&gt;
// The following GUID is for the ID of the typelib if this project is exposed to COM&lt;br /&gt;
//[assembly: Guid(&amp;quot;918fbf83-6909-4d20-ab1c-ac617a7b420d&amp;quot;)]&lt;br /&gt;
&lt;br /&gt;
[assembly: CLSCompliant(true)]&lt;br /&gt;
&lt;br /&gt;
// Version information for an assembly consists of the following four values:&lt;br /&gt;
//&lt;br /&gt;
//      Major Version&lt;br /&gt;
//      Minor Version &lt;br /&gt;
//      Build Number&lt;br /&gt;
//      Revision&lt;br /&gt;
//&lt;br /&gt;
// You can specify all the values or you can default the Revision and Build Numbers &lt;br /&gt;
// by using the &#039;*&#039; as shown below:&lt;br /&gt;
[assembly: AssemblyVersion(&amp;quot;1.0.0.0&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyFileVersion(&amp;quot;1.0.0.0&amp;quot;)]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VlcUserControl.cs&amp;diff=7020</id>
		<title>VlcUserControl.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VlcUserControl.cs&amp;diff=7020"/>
		<updated>2007-01-12T01:03:05Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * VlcUserControl.cs: VlcUserControl partial class definition&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Diagnostics;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
&lt;br /&gt;
namespace VLanControl&lt;br /&gt;
{&lt;br /&gt;
	public delegate void NowPlayingEventHandler(MetaData data, String text);&lt;br /&gt;
&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]&lt;br /&gt;
	[Guid(&amp;quot;98029A85-9804-47d6-9430-F90933AE8650&amp;quot;)]&lt;br /&gt;
	public interface IVlcUserControlEvents&lt;br /&gt;
	{&lt;br /&gt;
		[DispIdAttribute(0x60020000)]&lt;br /&gt;
		void NowPlayingEvent(MetaData data, String text);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	[ClassInterface(ClassInterfaceType.None), ComSourceInterfaces(typeof(IVlcUserControlEvents))]&lt;br /&gt;
	[Guid(&amp;quot;FB99D376-ED98-4ac0-B2C9-F2E974E0849F&amp;quot;)]&lt;br /&gt;
	public partial class VlcUserControl : UserControl, IPlayer2&lt;br /&gt;
	{&lt;br /&gt;
		private bool isPaused;&lt;br /&gt;
		private NativeLibVlc nativeVlc = new NativeLibVlc();&lt;br /&gt;
		private bool useMpegVbrOffset;&lt;br /&gt;
		private bool usingPausedPosition;&lt;br /&gt;
		private int pausedTime;&lt;br /&gt;
		private double pausedPosition;&lt;br /&gt;
		private int shuttleSeconds;&lt;br /&gt;
		private bool useVlcCrop = false;&lt;br /&gt;
		private int cropTop;&lt;br /&gt;
		private int cropBottom;&lt;br /&gt;
		private int cropLeft;&lt;br /&gt;
		private int cropRight;&lt;br /&gt;
&lt;br /&gt;
		const long SavingPostionTimespan = 5000000L;	// .5 seconds in ticks&lt;br /&gt;
&lt;br /&gt;
		public VlcUserControl()&lt;br /&gt;
		{&lt;br /&gt;
			InitializeComponent();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		protected override void OnLoad(EventArgs e)&lt;br /&gt;
		{&lt;br /&gt;
			base.OnLoad(e);&lt;br /&gt;
			this.nativeVlc.Initialize();&lt;br /&gt;
			this.innerVlc.Bounds = this.ClientRectangle;&lt;br /&gt;
			this.nativeVlc.VideoOutput = this.innerVlc;&lt;br /&gt;
			this.nativeVlc.NowPlaying += this.NowPlayingUpdate;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// there&#039;s an overhead to supporting Vlc events, a memory leak, so we need to have them off by default&lt;br /&gt;
		// you can hook to the events before doing this, but none will occur&lt;br /&gt;
		public bool ProducingEvents&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.nativeVlc.ProducingEvents; }&lt;br /&gt;
			set { this.nativeVlc.ProducingEvents = value; }&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void DisplayMessage(String message)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.ShowMessage(message);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public Size VideoSize&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.VideoSize;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PrecomputeCrop(Size videoSize, int cropLeft, int cropRight, int cropTop, int cropBottom)&lt;br /&gt;
		{&lt;br /&gt;
			this.cropTop = cropTop;&lt;br /&gt;
			this.cropBottom = cropBottom;&lt;br /&gt;
			this.cropLeft = cropLeft;&lt;br /&gt;
			this.cropRight = cropRight;&lt;br /&gt;
			ComputeCrop(videoSize);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool ComputeCrop()&lt;br /&gt;
		{&lt;br /&gt;
			if(!this.useVlcCrop &amp;amp;&amp;amp; this.IsHandleCreated &amp;amp;&amp;amp; (this.nativeVlc.VideoOutput != null) &amp;amp;&amp;amp; &lt;br /&gt;
				(this.State != PlayerState.None))&lt;br /&gt;
			{&lt;br /&gt;
				Size vidSize = this.nativeVlc.VideoSize;&lt;br /&gt;
				if(!vidSize.IsEmpty)&lt;br /&gt;
				{&lt;br /&gt;
					ComputeCrop(this.nativeVlc.VideoSize);&lt;br /&gt;
					return true;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void ComputeCrop(Size videoSize)&lt;br /&gt;
		{&lt;br /&gt;
			Size mySize = ClientSize;&lt;br /&gt;
			Debug.WriteLine(&amp;quot;Video Sizes = &amp;quot; + videoSize.ToString() + &amp;quot;, &amp;quot; + mySize.ToString());&lt;br /&gt;
			Debug.WriteLine(&amp;quot;Crop = &amp;quot; + cropLeft.ToString() + &amp;quot;, &amp;quot; + cropTop.ToString()&lt;br /&gt;
				 + &amp;quot;, &amp;quot; + cropRight.ToString() + &amp;quot;, &amp;quot; + cropBottom.ToString());&lt;br /&gt;
			this.topBlocker.Visible = false;&lt;br /&gt;
			this.bottomBlocker.Visible = false;&lt;br /&gt;
			this.leftBlocker.Visible = false;&lt;br /&gt;
			this.rightBlocker.Visible = false;&lt;br /&gt;
&lt;br /&gt;
			double myAspect = Convert.ToDouble(mySize.Width) / Convert.ToDouble(mySize.Height);&lt;br /&gt;
			if((this.cropTop == 0) &amp;amp;&amp;amp; (this.cropBottom == 0) &amp;amp;&amp;amp; (this.cropLeft == 0) &amp;amp;&amp;amp; (this.cropRight == 0))&lt;br /&gt;
			{&lt;br /&gt;
				double vlcAspect = Convert.ToDouble(videoSize.Width) / Convert.ToDouble(videoSize.Height);&lt;br /&gt;
				if(vlcAspect &amp;gt; myAspect)&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the top and bottom&lt;br /&gt;
					int perfectHeight = Convert.ToInt32(mySize.Width / vlcAspect);&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point(0, (mySize.Height - perfectHeight) / 2),&lt;br /&gt;
						new Size(mySize.Width, perfectHeight));&lt;br /&gt;
					//Debug.WriteLine(&amp;quot;vlcAspect &amp;gt; myAspect &amp;quot; + this.innerVlc.Bounds.ToString());&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the left and right&lt;br /&gt;
					int perfectWidth = Convert.ToInt32(mySize.Height * vlcAspect);&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point((mySize.Width - perfectWidth) / 2, 0),&lt;br /&gt;
						new Size(perfectWidth, mySize.Height));&lt;br /&gt;
					//Debug.WriteLine(&amp;quot;vlcAspect &amp;lt; myAspect &amp;quot; + this.innerVlc.Bounds.ToString());&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				double realVlcAspect = Convert.ToDouble(videoSize.Width - this.cropRight - this.cropLeft) / &lt;br /&gt;
					Convert.ToDouble(videoSize.Height - this.cropTop - this.cropBottom);&lt;br /&gt;
				if(realVlcAspect &amp;gt; myAspect)&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the top and bottom, and possible blocking panels&lt;br /&gt;
					// first, position and size the innerVlc as if there was no top or bottom cropping&lt;br /&gt;
					int videoPixelWidth = videoSize.Width - this.cropRight - this.cropLeft;&lt;br /&gt;
					double fakeVlcAspect = Convert.ToDouble(videoPixelWidth) / Convert.ToDouble(videoSize.Height);&lt;br /&gt;
					int perfectHeight = Convert.ToInt32(mySize.Width / fakeVlcAspect);&lt;br /&gt;
					Debug.WriteLine(&amp;quot;perfectHeight = &amp;quot; + perfectHeight.ToString());&lt;br /&gt;
&lt;br /&gt;
					double scalingFactor = Convert.ToDouble(mySize.Width) / Convert.ToDouble(videoPixelWidth);&lt;br /&gt;
					int innerVlcLeft = -Convert.ToInt32(Convert.ToDouble(this.cropLeft) * scalingFactor);&lt;br /&gt;
					int innerVlcWidth = Convert.ToInt32(Convert.ToDouble(videoSize.Width) * scalingFactor);&lt;br /&gt;
&lt;br /&gt;
					int offTheTop = Convert.ToInt32(Convert.ToDouble(this.cropTop) * scalingFactor);&lt;br /&gt;
					int offTheBottom = Convert.ToInt32(Convert.ToDouble(this.cropBottom) * scalingFactor);&lt;br /&gt;
					int innerVlcTop = (mySize.Height - (perfectHeight - offTheTop - offTheBottom)) / 2;&lt;br /&gt;
					innerVlcTop -= offTheTop;&lt;br /&gt;
&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point(innerVlcLeft, innerVlcTop),&lt;br /&gt;
						new Size(innerVlcWidth, perfectHeight));&lt;br /&gt;
					Debug.WriteLine(&amp;quot;toowide innerVlc.Bounds = &amp;quot; + this.innerVlc.Bounds.ToString());&lt;br /&gt;
&lt;br /&gt;
					// then, add blocking panels if necessary for the top and bottom cropping&lt;br /&gt;
					if(this.cropTop != 0)&lt;br /&gt;
					{&lt;br /&gt;
						if(offTheTop + innerVlcTop &amp;gt; 0)&lt;br /&gt;
						{&lt;br /&gt;
							this.topBlocker.Bounds = new Rectangle(&lt;br /&gt;
								new Point(0, innerVlcTop),&lt;br /&gt;
								new Size(mySize.Width, offTheTop));&lt;br /&gt;
							this.topBlocker.Visible = true;&lt;br /&gt;
							Debug.WriteLine(&amp;quot;topBlocker.Bounds = &amp;quot; + this.topBlocker.Bounds.ToString());&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
					if(this.cropBottom != 0)&lt;br /&gt;
					{&lt;br /&gt;
						if(innerVlcTop + perfectHeight - offTheBottom &amp;lt; mySize.Height)&lt;br /&gt;
						{&lt;br /&gt;
							this.bottomBlocker.Bounds = new Rectangle(&lt;br /&gt;
								new Point(0, innerVlcTop + perfectHeight - offTheBottom),&lt;br /&gt;
								new Size(mySize.Width, offTheBottom));&lt;br /&gt;
							this.bottomBlocker.Visible = true;&lt;br /&gt;
							Debug.WriteLine(&amp;quot;bottomBlocker.Bounds = &amp;quot; + this.bottomBlocker.Bounds.ToString());&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the left and right, and possible blocking panels&lt;br /&gt;
					// first, position and size the innerVlc as if there was no left or right cropping&lt;br /&gt;
					int videoPixelHeight = videoSize.Height - this.cropBottom - this.cropTop;&lt;br /&gt;
					double fakeVlcAspect = Convert.ToDouble(videoSize.Width) / Convert.ToDouble(videoPixelHeight);&lt;br /&gt;
					int perfectWidth = Convert.ToInt32(mySize.Height * fakeVlcAspect);&lt;br /&gt;
					Debug.WriteLine(&amp;quot;perfectWidth = &amp;quot; + perfectWidth.ToString());&lt;br /&gt;
&lt;br /&gt;
					double scalingFactor = Convert.ToDouble(mySize.Height) / Convert.ToDouble(videoPixelHeight);&lt;br /&gt;
					int innerVlcTop = -Convert.ToInt32(Convert.ToDouble(this.cropTop) * scalingFactor);&lt;br /&gt;
					int innerVlcHeight = Convert.ToInt32(Convert.ToDouble(videoSize.Height) * scalingFactor);&lt;br /&gt;
&lt;br /&gt;
					int offTheLeft = Convert.ToInt32(Convert.ToDouble(this.cropLeft) * scalingFactor);&lt;br /&gt;
					int offTheRight = Convert.ToInt32(Convert.ToDouble(this.cropRight) * scalingFactor);&lt;br /&gt;
					int innerVlcLeft = (mySize.Width - (perfectWidth - offTheLeft - offTheRight)) / 2;&lt;br /&gt;
					innerVlcLeft -= offTheLeft;&lt;br /&gt;
&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point(innerVlcLeft, innerVlcTop),&lt;br /&gt;
						new Size(perfectWidth, innerVlcHeight));&lt;br /&gt;
					Debug.WriteLine(&amp;quot;toohigh innerVlc.Bounds = &amp;quot; + this.innerVlc.Bounds.ToString());&lt;br /&gt;
&lt;br /&gt;
					// then, add blocking panels if necessary for the left and right cropping&lt;br /&gt;
					if(this.cropLeft != 0)&lt;br /&gt;
					{&lt;br /&gt;
						if(offTheLeft + innerVlcLeft &amp;gt; 0)&lt;br /&gt;
						{&lt;br /&gt;
							this.leftBlocker.Bounds = new Rectangle(&lt;br /&gt;
								new Point(innerVlcLeft, 0),&lt;br /&gt;
								new Size(offTheLeft, mySize.Height));&lt;br /&gt;
							this.leftBlocker.Visible = true;&lt;br /&gt;
							Debug.WriteLine(&amp;quot;leftBlocker.Bounds = &amp;quot; + this.leftBlocker.Bounds.ToString());&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
					if(this.cropRight != 0)&lt;br /&gt;
					{&lt;br /&gt;
						if(innerVlcLeft + perfectWidth - offTheRight &amp;lt; mySize.Width)&lt;br /&gt;
						{&lt;br /&gt;
							this.rightBlocker.Bounds = new Rectangle(&lt;br /&gt;
								new Point(innerVlcLeft + perfectWidth - offTheRight, 0),&lt;br /&gt;
								new Size(offTheRight, mySize.Height));&lt;br /&gt;
							this.rightBlocker.Visible = true;&lt;br /&gt;
							Debug.WriteLine(&amp;quot;rightBlocker.Bounds = &amp;quot; + this.rightBlocker.Bounds.ToString());&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String GetConfigVariable(String name, String returnOnError)&lt;br /&gt;
		{&lt;br /&gt;
			String value;&lt;br /&gt;
			if(this.nativeVlc.GetConfigVariable(name, out value) == VlcError.Success)&lt;br /&gt;
			{&lt;br /&gt;
				return value;&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				return returnOnError;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool SetConfigVariable(String name, String value)&lt;br /&gt;
		{&lt;br /&gt;
			return this.nativeVlc.SetConfigVariable(name, value) == VlcError.Success;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Time&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.Time;&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception)&lt;br /&gt;
				{&lt;br /&gt;
					return 0;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public double Position&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.Position;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void MoveToPosition(TrackPosition newTrackPosition)&lt;br /&gt;
		{&lt;br /&gt;
			if((newTrackPosition.position &amp;gt;= 0.0d) &amp;amp;&amp;amp; (newTrackPosition.position &amp;lt; 1.0d))&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.Position = newTrackPosition.position;&lt;br /&gt;
				if(this.IsPaused)&lt;br /&gt;
				{&lt;br /&gt;
					this.usingPausedPosition = true;&lt;br /&gt;
					this.pausedTime = newTrackPosition.time;&lt;br /&gt;
					this.pausedPosition = newTrackPosition.position;&lt;br /&gt;
					this.shuttleSeconds = 0;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private TrackPosition CalculateShuttle(int origTime, double origPosition, int offsetSeconds)&lt;br /&gt;
		{&lt;br /&gt;
			int newTime = origTime + offsetSeconds;&lt;br /&gt;
&lt;br /&gt;
			double positionPerTime;&lt;br /&gt;
			if(origPosition &amp;gt; .5d)&lt;br /&gt;
			{&lt;br /&gt;
				positionPerTime = origPosition / Convert.ToDouble(origTime);&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				positionPerTime = (1.0d - origPosition) / &lt;br /&gt;
					Convert.ToDouble(this.nativeVlc.Length - origTime);&lt;br /&gt;
			}&lt;br /&gt;
			double newPosition = origPosition + Convert.ToDouble(offsetSeconds) * positionPerTime;&lt;br /&gt;
&lt;br /&gt;
			//Debug.WriteLine(String.Format(&amp;quot;CalculateShuttle time={0} pos={1}&amp;quot;, newTime, newPosition));&lt;br /&gt;
&lt;br /&gt;
			return new TrackPosition(newTime, newPosition);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public TrackPosition Shuttle(int offsetSeconds)&lt;br /&gt;
		{&lt;br /&gt;
			if(!this.IsPaused)&lt;br /&gt;
			{&lt;br /&gt;
				TrackPosition newPosition = CalculateShuttle(this.nativeVlc.Time, this.nativeVlc.Position,&lt;br /&gt;
					offsetSeconds);&lt;br /&gt;
				if(this.useMpegVbrOffset)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Position = newPosition.position;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Time = newPosition.time;&lt;br /&gt;
				}&lt;br /&gt;
				return newPosition;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			if(!this.usingPausedPosition)&lt;br /&gt;
			{&lt;br /&gt;
				this.usingPausedPosition = true;&lt;br /&gt;
				this.pausedTime = this.nativeVlc.Time;&lt;br /&gt;
				this.pausedPosition = this.nativeVlc.Position;&lt;br /&gt;
				this.shuttleSeconds = 0;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			this.shuttleSeconds += offsetSeconds;&lt;br /&gt;
			return CalculateShuttle(this.pausedTime, this.pausedPosition, this.shuttleSeconds);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Volume&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.Volume;&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.Volume = value;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		const int MinRate = -2;&lt;br /&gt;
		const int MaxRate = 2;&lt;br /&gt;
		const int NormalRate = 0;&lt;br /&gt;
&lt;br /&gt;
		public void GetRates(out int minRate, out int maxRate, out int normalRate)&lt;br /&gt;
		{&lt;br /&gt;
			minRate = MinRate;&lt;br /&gt;
			maxRate = MaxRate;&lt;br /&gt;
			normalRate = NormalRate;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Rate&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				// 1000 is normal, 2000 is half speed, 500 is double speed, etc.&lt;br /&gt;
				int bigRate = this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;rate&amp;quot;, 1000);&lt;br /&gt;
				if(bigRate &amp;gt; 3000)&lt;br /&gt;
				{&lt;br /&gt;
					return -2;&lt;br /&gt;
				}&lt;br /&gt;
				if(bigRate &amp;gt; 1500)&lt;br /&gt;
				{&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
				if(bigRate &amp;gt; 750)&lt;br /&gt;
				{&lt;br /&gt;
					return 0;&lt;br /&gt;
				}&lt;br /&gt;
				if(bigRate &amp;gt; 400)&lt;br /&gt;
				{&lt;br /&gt;
					return 1;&lt;br /&gt;
				}&lt;br /&gt;
				return 2;&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				int newRate = NormalRate;&lt;br /&gt;
				switch(value)&lt;br /&gt;
				{&lt;br /&gt;
				case 2:&lt;br /&gt;
					newRate = 250;&lt;br /&gt;
					break;&lt;br /&gt;
				case 1:&lt;br /&gt;
					newRate = 500;&lt;br /&gt;
					break;&lt;br /&gt;
				case 0:&lt;br /&gt;
					newRate = 1000;&lt;br /&gt;
					break;&lt;br /&gt;
				case -1:&lt;br /&gt;
					newRate = 2000;&lt;br /&gt;
					break;&lt;br /&gt;
				case -2:&lt;br /&gt;
					newRate = 4000;&lt;br /&gt;
					break;&lt;br /&gt;
				default:&lt;br /&gt;
					throw new ArgumentOutOfRangeException();&lt;br /&gt;
				}&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;rate&amp;quot;, newRate);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Length&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.Length;&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception)&lt;br /&gt;
				{&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetArtificialLength(value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public double TimeScaling&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.nativeVlc.TimeScaling; }&lt;br /&gt;
			set { this.nativeVlc.TimeScaling = value; }&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public PlayerState State&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				int state = this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &lt;br /&gt;
					&amp;quot;state&amp;quot;, (int)InputState.INIT_S);&lt;br /&gt;
				switch((InputState)state)&lt;br /&gt;
				{&lt;br /&gt;
				case InputState.PAUSE_S:&lt;br /&gt;
					return PlayerState.Paused;&lt;br /&gt;
				case InputState.PLAYING_S:&lt;br /&gt;
					return PlayerState.Playing;&lt;br /&gt;
				default:&lt;br /&gt;
					return PlayerState.None;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool IsPlaying { get { return this.State == PlayerState.Playing; } }&lt;br /&gt;
&lt;br /&gt;
		public bool IsPaused { get { return this.State == PlayerState.Paused; } }&lt;br /&gt;
&lt;br /&gt;
		public bool IsMute { get { return (this.nativeVlc.Volume == 0); } }&lt;br /&gt;
&lt;br /&gt;
		public void ToggleMute()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.ToggleVolumeMute();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private String JoinArraysWithCR(Array data, String[] dataText)&lt;br /&gt;
		{&lt;br /&gt;
			StringBuilder sb = new StringBuilder();&lt;br /&gt;
			for(int index = 0; index &amp;lt; data.Length; index++)&lt;br /&gt;
			{&lt;br /&gt;
				if(index != 0)&lt;br /&gt;
				{&lt;br /&gt;
					sb.Append(&amp;quot;\n&amp;quot;);&lt;br /&gt;
				}&lt;br /&gt;
				sb.Append(data.GetValue(index).ToString());&lt;br /&gt;
				sb.Append(&amp;quot;\n&amp;quot;);&lt;br /&gt;
				sb.Append(dataText[index]);&lt;br /&gt;
			}&lt;br /&gt;
			return sb.ToString();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String DeinterlaceModesAsString()&lt;br /&gt;
		{&lt;br /&gt;
			String[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;deinterlace&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void DeinterlaceModes(out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;deinterlace&amp;quot;, out choices, out choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String DeinterlaceMode&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;deinterlace&amp;quot;, String.Empty);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;deinterlace&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String AspectRatiosAsString()&lt;br /&gt;
		{&lt;br /&gt;
			String[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;aspect-ratio&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void AspectRatios(out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;aspect-ratio&amp;quot;, out choices, out choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String AspectRatio&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;aspect-ratio&amp;quot;, String.Empty);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;aspect-ratio&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String CropModesAsString()&lt;br /&gt;
		{&lt;br /&gt;
			String[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;crop&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropModes(out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;crop&amp;quot;, out choices, out choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String CropMode &lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop&amp;quot;, String.Empty);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int CroppingLeft&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-left&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropLeft;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-left&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropLeft = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int CroppingRight&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-right&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropRight;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-right&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropRight = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int CroppingTop&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-top&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropTop;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-top&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropTop = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int CroppingBottom&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-bottom&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropBottom;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-bottom&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropBottom = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String AudioTracksAsString()&lt;br /&gt;
		{&lt;br /&gt;
			int[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;audio-es&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void AudioTracks(out int[] trackIds, out String[] trackNames)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;audio-es&amp;quot;, out trackIds, out trackNames);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int AudioTrack&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-es&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-es&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String SubTitleTracksAsString()&lt;br /&gt;
		{&lt;br /&gt;
			int[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;spu-es&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void SubTitleTracks(out int[] trackIds, out String[] trackNames)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;spu-es&amp;quot;, out trackIds, out trackNames);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int SubTitleTrack&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-es&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-es&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String ProgramsAsString()&lt;br /&gt;
		{&lt;br /&gt;
			int[] choices;&lt;br /&gt;
			String[] choiceText;&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;program&amp;quot;, out choices, out choiceText);&lt;br /&gt;
			return JoinArraysWithCR(choices, choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void Programs(out int[] trackIds, out String[] trackNames)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;program&amp;quot;, out trackIds, out trackNames);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Program&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;program&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;program&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool AllowVideoAdjustments&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.AllowVideoAdjustments;&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.AllowVideoAdjustments = value;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public float Contrast&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;contrast&amp;quot;, 1.0f);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				VlcError err = this.nativeVlc.SetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;contrast&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public float Brightness&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;brightness&amp;quot;, 1.0f);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				VlcError err = this.nativeVlc.SetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;brightness&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Hue&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;hue&amp;quot;, 0);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				VlcError err = this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;hue&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public float Saturation&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;saturation&amp;quot;, 1.0f);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				VlcError err = this.nativeVlc.SetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;saturation&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public float Gamma&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;gamma&amp;quot;, 1.0f);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				VlcError err = this.nativeVlc.SetVlcObjectFloat(ObjectType.VLC_OBJECT_VOUT, &amp;quot;gamma&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateCropModes()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-crop&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int AudioDelay&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				long delay = this.nativeVlc.GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-delay&amp;quot;, 0L);&lt;br /&gt;
				return Convert.ToInt32(delay / 1000L);&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				long delay = Convert.ToInt64(value) * 1000L;&lt;br /&gt;
				this.nativeVlc.SetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-delay&amp;quot;, delay);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int SubTitleDelay&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				long delay = this.nativeVlc.GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-delay&amp;quot;, 0L);&lt;br /&gt;
				return Convert.ToInt32(delay / 1000L);&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				long delay = Convert.ToInt64(value) * 1000L;&lt;br /&gt;
				this.nativeVlc.SetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-delay&amp;quot;, delay);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int ChapterCount&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				int[] chapterIds;&lt;br /&gt;
				String[] chapterText;&lt;br /&gt;
				this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
					&amp;quot;chapter&amp;quot;, out chapterIds, out chapterText);&lt;br /&gt;
				return (chapterIds.Length &amp;gt; 0) ? chapterIds.Length - 1 : 0;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Chapter&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;chapter&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;chapter&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void RepositionAfterPause()&lt;br /&gt;
		{&lt;br /&gt;
			if(this.usingPausedPosition &amp;amp;&amp;amp; (this.shuttleSeconds != 0))&lt;br /&gt;
			{&lt;br /&gt;
				TrackPosition newPosition = CalculateShuttle(this.pausedTime, this.pausedPosition,&lt;br /&gt;
					this.shuttleSeconds);&lt;br /&gt;
				if(this.useMpegVbrOffset)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Position = newPosition.position;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Time = newPosition.time;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void Play()&lt;br /&gt;
		{&lt;br /&gt;
			this.isPaused = false;&lt;br /&gt;
			this.nativeVlc.Play();&lt;br /&gt;
			RepositionAfterPause();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void ClearPlayList()&lt;br /&gt;
		{&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			//Debug.WriteLine(&amp;quot;ClearPlayList&amp;quot;);&lt;br /&gt;
			this.nativeVlc.PlaylistClear();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void AddAndPlay(String fileName, String options)&lt;br /&gt;
		{&lt;br /&gt;
			String[] optionsArray = options.Split(&#039;\n&#039;);&lt;br /&gt;
			int id = AddToPlayList(fileName, &amp;quot;&amp;quot;, optionsArray);&lt;br /&gt;
			PlayItem(id);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int AddToPlayList(String fileName, String title, String[] options)&lt;br /&gt;
		{&lt;br /&gt;
			//MessageBox.Show(fileName);&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			int index = 0;&lt;br /&gt;
			this.nativeVlc.AddTarget(fileName, options, ref index);&lt;br /&gt;
			Debug.WriteLine(&amp;quot;Added to Playlist &amp;quot; + fileName);&lt;br /&gt;
			Debug.WriteLine(&amp;quot;index = &amp;quot; + index.ToString());&lt;br /&gt;
			return index;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PlayItem(int itemId)&lt;br /&gt;
		{&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			this.isPaused = false;&lt;br /&gt;
			this.nativeVlc.SetArtificialLength(0);&lt;br /&gt;
			this.nativeVlc.TimeScaling = 0.0d;&lt;br /&gt;
&lt;br /&gt;
			int currentIndex = this.nativeVlc.PlaylistIndex;&lt;br /&gt;
			Debug.WriteLine(&amp;quot;PlayItem index = &amp;quot; + itemId.ToString(), &amp;quot; currentIndex = &amp;quot; + currentIndex.ToString());&lt;br /&gt;
			if(currentIndex &amp;lt; 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.Play();&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				//this.nativeVlc.PlaylistPrevious();&lt;br /&gt;
				this.nativeVlc.Play(itemId);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void Stop()&lt;br /&gt;
		{&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			this.nativeVlc.Stop();&lt;br /&gt;
			this.isPaused = false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void TogglePause()&lt;br /&gt;
		{&lt;br /&gt;
			bool wasPaused = this.IsPaused;&lt;br /&gt;
			this.nativeVlc.Pause();&lt;br /&gt;
			if(wasPaused)&lt;br /&gt;
			{&lt;br /&gt;
				RepositionAfterPause();&lt;br /&gt;
			}&lt;br /&gt;
			this.isPaused = !wasPaused;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateSubtitles()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-subtitle-track&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateAudioTrack()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-audio-track&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateDeinterlaceMode()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-deinterlace&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateAspectRatio()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-aspect-ratio&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropTop()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-top&amp;quot;);&lt;br /&gt;
			this.CroppingTop = this.CroppingTop + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropTop()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-top&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingTop - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingTop = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropBottom()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-bottom&amp;quot;);&lt;br /&gt;
			this.CroppingBottom = this.CroppingBottom + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropBottom()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-bottom&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingBottom - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingBottom = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropLeft()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-left&amp;quot;);&lt;br /&gt;
			this.CroppingLeft = this.CroppingLeft + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropLeft()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-left&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingLeft - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingLeft = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropRight()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-right&amp;quot;);&lt;br /&gt;
			this.CroppingRight = this.CroppingRight + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropRight()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-right&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingRight - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingRight = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool UseMpegVbrOffset&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.useMpegVbrOffset; }&lt;br /&gt;
			set { this.useMpegVbrOffset = value; }&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void NextDvdTrack()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-title-next&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PreviousDvdTrack()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-title-prev&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void NextDvdChapter()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-chapter-next&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PreviousDvdChapter()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-chapter-prev&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public event MetaDataEventHandler NowPlaying;&lt;br /&gt;
		// this 2nd event is a non-standard prototype needed for Com Interop event sourcing&lt;br /&gt;
		public event NowPlayingEventHandler NowPlayingEvent;&lt;br /&gt;
&lt;br /&gt;
		private void OnNowPlaying(MetaDataUpdateEventArgs args)&lt;br /&gt;
		{&lt;br /&gt;
			if(this.NowPlaying != null)&lt;br /&gt;
			{&lt;br /&gt;
				this.NowPlaying(this, args);&lt;br /&gt;
			}&lt;br /&gt;
			if(this.NowPlayingEvent != null)&lt;br /&gt;
			{&lt;br /&gt;
				this.NowPlayingEvent(args.Data, args.Text);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void NowPlayingUpdate(object sender, MetaDataUpdateEventArgs args)&lt;br /&gt;
		{&lt;br /&gt;
			OnNowPlaying(args);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void VlcUserControl_Resize(object sender, EventArgs e)&lt;br /&gt;
		{&lt;br /&gt;
			if(!ComputeCrop())&lt;br /&gt;
			{&lt;br /&gt;
				this.innerVlc.Bounds = this.ClientRectangle;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=NativeLibVlc.cs&amp;diff=7019</id>
		<title>NativeLibVlc.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=NativeLibVlc.cs&amp;diff=7019"/>
		<updated>2007-01-12T01:02:36Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * NativeLibVlc.cs: NativeLibVlc class definition&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Diagnostics;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.IO;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using Microsoft.Win32;&lt;br /&gt;
&lt;br /&gt;
namespace VLanControl&lt;br /&gt;
{&lt;br /&gt;
	internal enum ObjectType : int&lt;br /&gt;
	{&lt;br /&gt;
		VLC_OBJECT_ROOT = (-1),&lt;br /&gt;
		VLC_OBJECT_VLC = (-2),&lt;br /&gt;
		VLC_OBJECT_MODULE = (-3),&lt;br /&gt;
		VLC_OBJECT_INTF = (-4),&lt;br /&gt;
		VLC_OBJECT_PLAYLIST = (-5),&lt;br /&gt;
		VLC_OBJECT_ITEM = (-6),&lt;br /&gt;
		VLC_OBJECT_INPUT = (-7),&lt;br /&gt;
		VLC_OBJECT_DECODER = (-8),&lt;br /&gt;
		VLC_OBJECT_VOUT = (-9),&lt;br /&gt;
		VLC_OBJECT_AOUT = (-10),&lt;br /&gt;
		VLC_OBJECT_SOUT = (-11),&lt;br /&gt;
		VLC_OBJECT_HTTPD = (-12),&lt;br /&gt;
		VLC_OBJECT_PACKETIZER = (-13),&lt;br /&gt;
		VLC_OBJECT_ENCODER = (-14),&lt;br /&gt;
		VLC_OBJECT_DIALOGS = (-15),&lt;br /&gt;
		VLC_OBJECT_VLM = (-16),&lt;br /&gt;
		VLC_OBJECT_ANNOUNCE = (-17),&lt;br /&gt;
		VLC_OBJECT_DEMUX = (-18),&lt;br /&gt;
		VLC_OBJECT_ACCESS = (-19),&lt;br /&gt;
		VLC_OBJECT_STREAM = (-20),&lt;br /&gt;
		VLC_OBJECT_OPENGL = (-21),&lt;br /&gt;
		VLC_OBJECT_FILTER = (-22),&lt;br /&gt;
		VLC_OBJECT_VOD = (-23),&lt;br /&gt;
		VLC_OBJECT_SPU = (-24),&lt;br /&gt;
		VLC_OBJECT_TLS = (-25),&lt;br /&gt;
		VLC_OBJECT_SD = (-26),&lt;br /&gt;
		VLC_OBJECT_XML = (-27),&lt;br /&gt;
		VLC_OBJECT_OSDMENU = (-28),&lt;br /&gt;
		VLC_OBJECT_STATS = (-29),&lt;br /&gt;
		VLC_OBJECT_HTTPD_HOST = (-30),&lt;br /&gt;
&lt;br /&gt;
		VLC_OBJECT_GENERIC = (-666),&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	internal enum VlcError : int&lt;br /&gt;
	{&lt;br /&gt;
		Success = -0,&lt;br /&gt;
		NoMem = -1,&lt;br /&gt;
		Thread = -2,&lt;br /&gt;
		Timeout = -3,&lt;br /&gt;
&lt;br /&gt;
		NoMod = -10,&lt;br /&gt;
&lt;br /&gt;
		NoObj = -20,&lt;br /&gt;
		BadObj = -21,&lt;br /&gt;
&lt;br /&gt;
		NoVar = -30,&lt;br /&gt;
		BadVar = -31,&lt;br /&gt;
&lt;br /&gt;
		Exit = -255,&lt;br /&gt;
		Generic = -666,&lt;br /&gt;
&lt;br /&gt;
		Exception = -998,&lt;br /&gt;
		NoInit = -999,&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	internal enum InputState : int&lt;br /&gt;
	{&lt;br /&gt;
		INIT_S = 0,&lt;br /&gt;
		OPENING_S = 1,&lt;br /&gt;
		BUFFERING_S = 2,&lt;br /&gt;
		PLAYING_S = 3,&lt;br /&gt;
		PAUSE_S = 4,&lt;br /&gt;
		END_S = 5,&lt;br /&gt;
		ERROR_S = 6,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	internal class NativeLibVlc : IDisposable&lt;br /&gt;
	{&lt;br /&gt;
        #region private vlc enums&lt;br /&gt;
&lt;br /&gt;
        enum Mode : int&lt;br /&gt;
        {&lt;br /&gt;
            Insert      = 0x01,&lt;br /&gt;
            Replace     = 0x02,&lt;br /&gt;
            Append      = 0x04,&lt;br /&gt;
            Go          = 0x08,&lt;br /&gt;
            CheckInsert = 0x10&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
		public const Int32 EndOfPlaylist = -666;&lt;br /&gt;
&lt;br /&gt;
		[Flags]&lt;br /&gt;
		enum ObjectSearchMode : int&lt;br /&gt;
		{&lt;br /&gt;
			FIND_PARENT         = 0x0001,&lt;br /&gt;
			FIND_CHILD          = 0x0002,&lt;br /&gt;
			FIND_ANYWHERE       = 0x0003,&lt;br /&gt;
			FIND_STRICT         = 0x0010,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Flags]&lt;br /&gt;
		enum VarFlags : int&lt;br /&gt;
		{&lt;br /&gt;
			/** \defgroup var_flags Additive flags&lt;br /&gt;
			 * These flags are added to the type field of the variable. Most as a result of&lt;br /&gt;
			 * a __var_Change() call, but some may be added at creation time&lt;br /&gt;
			 * @{&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_HASCHOICE     = 0x0100,&lt;br /&gt;
			VLC_VAR_HASMIN        = 0x0200,&lt;br /&gt;
			VLC_VAR_HASMAX        = 0x0400,&lt;br /&gt;
			VLC_VAR_HASSTEP       = 0x0800,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_ISLIST        = 0x1000,&lt;br /&gt;
			VLC_VAR_ISCOMMAND     = 0x2000,&lt;br /&gt;
			VLC_VAR_ISCONFIG      = 0x2000,&lt;br /&gt;
&lt;br /&gt;
			/** Creation flag */&lt;br /&gt;
			VLC_VAR_DOINHERIT     = 0x8000,&lt;br /&gt;
&lt;br /&gt;
			/**&lt;br /&gt;
			 * \defgroup var_action Variable actions&lt;br /&gt;
			 * These are the different actions that can be used with __var_Change().&lt;br /&gt;
			 * The parameters given are the meaning of the two last parameters of&lt;br /&gt;
			 * __var_Change() when this action is being used.&lt;br /&gt;
			 * @{&lt;br /&gt;
			 */&lt;br /&gt;
&lt;br /&gt;
			/**&lt;br /&gt;
			 * Set the minimum value of this variable&lt;br /&gt;
			 * \param p_val The new minimum value&lt;br /&gt;
			 * \param p_val2 Unused&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_SETMIN              = 0x0010,&lt;br /&gt;
			/**&lt;br /&gt;
			 * Set the maximum value of this variable&lt;br /&gt;
			 * \param p_val The new maximum value&lt;br /&gt;
			 * \param p_val2 Unused&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_SETMAX              = 0x0011,&lt;br /&gt;
			VLC_VAR_SETSTEP             = 0x0012,&lt;br /&gt;
			/**&lt;br /&gt;
			 * Set the value of this variable without triggering any callbacks&lt;br /&gt;
			 * \param p_val The new value&lt;br /&gt;
			 * \param p_val2 Unused&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_SETVALUE            = 0x0013,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_SETTEXT             = 0x0014,&lt;br /&gt;
			VLC_VAR_GETTEXT             = 0x0015,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_ADDCHOICE           = 0x0020,&lt;br /&gt;
			VLC_VAR_DELCHOICE           = 0x0021,&lt;br /&gt;
			VLC_VAR_CLEARCHOICES        = 0x0022,&lt;br /&gt;
			VLC_VAR_SETDEFAULT          = 0x0023,&lt;br /&gt;
			VLC_VAR_GETCHOICES          = 0x0024,&lt;br /&gt;
			VLC_VAR_FREECHOICES         = 0x0025,&lt;br /&gt;
			VLC_VAR_GETLIST             = 0x0026,&lt;br /&gt;
			VLC_VAR_FREELIST            = 0x0027,&lt;br /&gt;
			VLC_VAR_CHOICESCOUNT        = 0x0028,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_INHERITVALUE        = 0x0030,&lt;br /&gt;
			VLC_VAR_TRIGGER_CALLBACKS   = 0x0035,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		enum playlist_command : int&lt;br /&gt;
		{&lt;br /&gt;
			PLAYLIST_PLAY = 0,      /**&amp;lt; No arg.                            res=can fail*/&lt;br /&gt;
			PLAYLIST_AUTOPLAY = 1,  /**&amp;lt; No arg.                            res=cant fail*/&lt;br /&gt;
			PLAYLIST_VIEWPLAY = 2,  /**&amp;lt; arg1= int, arg2= playlist_item_t*,*/&lt;br /&gt;
								/**  arg3 = playlist_item_t*          , res=can fail */&lt;br /&gt;
			PLAYLIST_ITEMPLAY = 3,  /** &amp;lt;arg1 = playlist_item_t *         , res=can fail */&lt;br /&gt;
			PLAYLIST_PAUSE = 4,     /**&amp;lt; No arg                             res=can fail*/&lt;br /&gt;
			PLAYLIST_STOP = 5,      /**&amp;lt; No arg                             res=can fail*/&lt;br /&gt;
			PLAYLIST_SKIP = 6,      /**&amp;lt; arg1=int,                          res=can fail*/&lt;br /&gt;
			PLAYLIST_GOTO = 7,      /**&amp;lt; arg1=int                           res=can fail */&lt;br /&gt;
			PLAYLIST_VIEWGOTO = 8   /**&amp;lt; arg1=int                           res=can fail */&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		enum CONFIG_ITEM : int&lt;br /&gt;
		{&lt;br /&gt;
			CONFIG_ITEM_STRING = 0x0010,&lt;br /&gt;
			CONFIG_ITEM_FILE = 0x0020,&lt;br /&gt;
			CONFIG_ITEM_MODULE = 0x0030,&lt;br /&gt;
			CONFIG_ITEM_INTEGER = 0x0040,&lt;br /&gt;
			CONFIG_ITEM_BOOL = 0x0050,&lt;br /&gt;
			CONFIG_ITEM_FLOAT = 0x0060,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		enum input_query_e : int&lt;br /&gt;
		{&lt;br /&gt;
			/* input variable &amp;quot;position&amp;quot; */&lt;br /&gt;
			INPUT_GET_POSITION = 0,         /* arg1= double *       res=    */&lt;br /&gt;
			INPUT_SET_POSITION,         /* arg1= double         res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* input variable &amp;quot;length&amp;quot; */&lt;br /&gt;
			INPUT_GET_LENGTH,           /* arg1= int64_t *      res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* input variable &amp;quot;time&amp;quot; */&lt;br /&gt;
			INPUT_GET_TIME,             /* arg1= int64_t *      res=    */&lt;br /&gt;
			INPUT_SET_TIME,             /* arg1= int64_t        res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* input variable &amp;quot;rate&amp;quot; (1 is DEFAULT_RATE) */&lt;br /&gt;
			INPUT_GET_RATE,             /* arg1= int *          res=    */&lt;br /&gt;
			INPUT_SET_RATE,             /* arg1= int            res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* input variable &amp;quot;state&amp;quot; */&lt;br /&gt;
			INPUT_GET_STATE,            /* arg1= int *          res=    */&lt;br /&gt;
			INPUT_SET_STATE,            /* arg1= int            res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* input variable &amp;quot;audio-delay&amp;quot; and &amp;quot;sub-delay&amp;quot; */&lt;br /&gt;
			INPUT_GET_AUDIO_DELAY,      /* arg1 = int* res=can fail */&lt;br /&gt;
			INPUT_SET_AUDIO_DELAY,      /* arg1 = int  res=can fail */&lt;br /&gt;
			INPUT_GET_SPU_DELAY,        /* arg1 = int* res=can fail */&lt;br /&gt;
			INPUT_SET_SPU_DELAY,        /* arg1 = int  res=can fail */&lt;br /&gt;
&lt;br /&gt;
			/* Meta datas */&lt;br /&gt;
			INPUT_ADD_INFO,   /* arg1= char* arg2= char* arg3=...     res=can fail */&lt;br /&gt;
			INPUT_GET_INFO,   /* arg1= char* arg2= char* arg3= char** res=can fail */&lt;br /&gt;
			INPUT_DEL_INFO,   /* arg1= char* arg2= char*              res=can fail */&lt;br /&gt;
			INPUT_SET_NAME,   /* arg1= char* res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* Input config options */&lt;br /&gt;
			INPUT_ADD_OPTION,      /* arg1= char * arg2= char *  res=can fail*/&lt;br /&gt;
&lt;br /&gt;
			/* Input properties */&lt;br /&gt;
			INPUT_GET_BYTE_POSITION,     /* arg1= int64_t *       res=    */&lt;br /&gt;
			INPUT_SET_BYTE_SIZE,         /* arg1= int64_t *       res=    */&lt;br /&gt;
&lt;br /&gt;
			/* bookmarks */&lt;br /&gt;
			INPUT_GET_BOOKMARKS,   /* arg1= seekpoint_t *** arg2= int * res=can fail */&lt;br /&gt;
			INPUT_CLEAR_BOOKMARKS, /* res=can fail */&lt;br /&gt;
			INPUT_ADD_BOOKMARK,    /* arg1= seekpoint_t *  res=can fail   */&lt;br /&gt;
			INPUT_CHANGE_BOOKMARK, /* arg1= seekpoint_t * arg2= int * res=can fail   */&lt;br /&gt;
			INPUT_DEL_BOOKMARK,    /* arg1= seekpoint_t *  res=can fail   */&lt;br /&gt;
			INPUT_SET_BOOKMARK,    /* arg1= int  res=can fail    */&lt;br /&gt;
&lt;br /&gt;
			/* On the fly input slave */&lt;br /&gt;
			INPUT_ADD_SLAVE        /* arg1= char * */&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
        #region private vlc structs&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct libvlc_exception_t&lt;br /&gt;
		{&lt;br /&gt;
			public Int32 b_raised;&lt;br /&gt;
			public IntPtr psz_message;&lt;br /&gt;
&lt;br /&gt;
			public void Init()&lt;br /&gt;
			{&lt;br /&gt;
				libvlc_exception_init(out this);&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			public bool WasExceptionRaised()&lt;br /&gt;
			{&lt;br /&gt;
				if(0 != libvlc_exception_raised(ref this))&lt;br /&gt;
				{&lt;br /&gt;
					libvlc_exception_clear(ref this);&lt;br /&gt;
					return true;&lt;br /&gt;
				}&lt;br /&gt;
				return false;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct libvlc_instance_t&lt;br /&gt;
		{&lt;br /&gt;
			public IntPtr p_vlc;&lt;br /&gt;
			public IntPtr p_playlist;&lt;br /&gt;
			public IntPtr p_vlm;&lt;br /&gt;
			public Int32 i_vlc_id;&lt;br /&gt;
&lt;br /&gt;
			public libvlc_instance_t(IntPtr vlc, IntPtr playlist, int vlcHandle)&lt;br /&gt;
			{&lt;br /&gt;
				this.p_vlc = vlc;&lt;br /&gt;
				this.p_playlist = playlist;&lt;br /&gt;
				this.p_vlm = IntPtr.Zero;&lt;br /&gt;
				this.i_vlc_id = vlcHandle;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct vlc_list_t&lt;br /&gt;
		{&lt;br /&gt;
			public Int32 i_count;&lt;br /&gt;
			public IntPtr p_values;&lt;br /&gt;
			public IntPtr pi_types;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        [StructLayout( LayoutKind.Explicit )]&lt;br /&gt;
        struct vlc_value_t&lt;br /&gt;
        {&lt;br /&gt;
            [FieldOffset( 0 )]  public Int32   i_int;&lt;br /&gt;
            [FieldOffset( 0 )]  public Int32   b_bool;&lt;br /&gt;
            [FieldOffset( 0 )][MarshalAs(UnmanagedType.R4)]  public float   f_float;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  psz_string;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  p_address;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  p_object;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  p_list;&lt;br /&gt;
            [FieldOffset( 0 )][MarshalAs(UnmanagedType.I8)]  public Int64   i_time;&lt;br /&gt;
&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  psz_name;&lt;br /&gt;
            [FieldOffset( 4 )]  public Int32   i_object_id;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct module_config_t&lt;br /&gt;
		{&lt;br /&gt;
			public CONFIG_ITEM i_type;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
		#region vlc api interop&lt;br /&gt;
		const int AOUT_VOLUME_MAX = 1024;&lt;br /&gt;
		const int VOLUME_MAX = 200;&lt;br /&gt;
		const int DEFAULT_CHAN = 1;&lt;br /&gt;
		const String Playlist_Current = &amp;quot;item-change&amp;quot;;&lt;br /&gt;
		const String Now_Playing = &amp;quot;Now Playing&amp;quot;;&lt;br /&gt;
		const String Meta_information = &amp;quot;Meta-information&amp;quot;;&lt;br /&gt;
		const String Meta_title = &amp;quot;meta-title&amp;quot;;&lt;br /&gt;
		const String Meta_author = &amp;quot;meta-author&amp;quot;;&lt;br /&gt;
		const String Meta_artist = &amp;quot;meta-artist&amp;quot;;&lt;br /&gt;
		const String Meta_genre = &amp;quot;meta-genre&amp;quot;;&lt;br /&gt;
		const String Meta_description = &amp;quot;meta-description&amp;quot;;&lt;br /&gt;
		const String Meta_url = &amp;quot;meta-url&amp;quot;;&lt;br /&gt;
		&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern int VLC_Create();&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError VLC_Init(int iVLC, int Argc, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)]string[] Argv);&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern string VLC_Version();&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern VlcError VLC_CleanUp(int iVLC);&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern VlcError VLC_Destroy(int iVLC);&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern string VLC_Error(int i_err);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr vlc_current_object(int i_object);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr __vlc_object_find(IntPtr p_vlc, ObjectType objectType, ObjectSearchMode mode);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __vlc_object_release(IntPtr p_vlc);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __var_Set(IntPtr p_vlc, String name, vlc_value_t value);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __var_Get(IntPtr p_this, String name, ref vlc_value_t value);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __var_Change(IntPtr p_this, String name, VarFlags varFlags,&lt;br /&gt;
			ref vlc_value_t value, ref vlc_value_t value2);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __aout_VolumeGet(IntPtr p_vlc, ref Int16 volume);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __aout_VolumeSet(IntPtr p_vlc, Int16 volume);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __aout_VolumeMute(IntPtr p_vlc, IntPtr alwaysNull);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_exception_init(out libvlc_exception_t p_exception);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern Int32 libvlc_exception_raised(ref libvlc_exception_t p_exception);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_exception_clear(ref libvlc_exception_t p_exception);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_playlist_play(ref libvlc_instance_t libvlc, Int32 id, &lt;br /&gt;
			Int32 optionsCount, IntPtr optionsAlwaysNull, ref libvlc_exception_t p_exception);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr libvlc_playlist_get_input(ref libvlc_instance_t libvlc, ref libvlc_exception_t p_exception);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int VLC_PlaylistIndex(int vlcObject);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int VLC_PlaylistNumberOfItems(int vlcObject);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_input_free(IntPtr p_input);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int libvlc_video_get_width(IntPtr p_input, ref libvlc_exception_t p_exception);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int libvlc_video_get_height(IntPtr p_input, ref libvlc_exception_t p_exception);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;, CallingConvention=CallingConvention.Cdecl)]&lt;br /&gt;
		static extern VlcError playlist_LockControl(IntPtr p_playlist, playlist_command i_query);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;, CallingConvention = CallingConvention.Cdecl)]&lt;br /&gt;
		static extern VlcError playlist_LockControl(IntPtr p_playlist, playlist_command i_query, Int32 arg1);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError playlist_Clear(IntPtr p_playlist);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError playlist_AddExt(IntPtr p_playlist, String mrl, String mrlDuplicate, &lt;br /&gt;
			Mode mode, Int32 pos, Int64 mtime_t, &lt;br /&gt;
			[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr)]string[] Options,&lt;br /&gt;
			int OptionsCount);&lt;br /&gt;
&lt;br /&gt;
		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]&lt;br /&gt;
		delegate int VarChangedCallback(IntPtr vlc, String variable, vlc_value_t old_val, &lt;br /&gt;
			vlc_value_t new_val, IntPtr param);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int __var_AddCallback(IntPtr vlc, String variable, VarChangedCallback cb, &lt;br /&gt;
			IntPtr param);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int __var_DelCallback(IntPtr vlc, String variable, VarChangedCallback cb, &lt;br /&gt;
			IntPtr param);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;, CallingConvention = CallingConvention.Cdecl, CharSet=CharSet.Ansi)]&lt;br /&gt;
		static extern VlcError input_Control(IntPtr input_thread_t, input_query_e i_query, String category, String name,&lt;br /&gt;
			ref IntPtr result);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;, CallingConvention = CallingConvention.Cdecl)]&lt;br /&gt;
		static extern void __vout_OSDMessage(IntPtr p_input, int i_channel, String message);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr config_FindConfig(IntPtr vlc, String name);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __config_PutInt(IntPtr vlc, String name, int value);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __config_PutFloat(IntPtr vlc, String name, float value);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __config_PutPsz(IntPtr vlc, String name, String value);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int __config_GetInt(IntPtr vlc, String name);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern float __config_GetFloat(IntPtr vlc, String name);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern String __config_GetPsz(IntPtr vlc, String name);&lt;br /&gt;
&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
		static NativeLibVlc()&lt;br /&gt;
		{&lt;br /&gt;
			NativeLibVlc.vlcInstallDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase).Substring(6);&lt;br /&gt;
			//NativeLibVlc.vlcInstallDirectory = Environment.CurrentDirectory;&lt;br /&gt;
			//NativeLibVlc.vlcInstallDirectory = QueryVlcInstallPath();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public NativeLibVlc()&lt;br /&gt;
        {&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        #region IDisposable&lt;br /&gt;
        public void Dispose()&lt;br /&gt;
        {&lt;br /&gt;
            if(vlcHandle != -1)&lt;br /&gt;
            {&lt;br /&gt;
                try&lt;br /&gt;
                {&lt;br /&gt;
					if(this.gch.IsAllocated)&lt;br /&gt;
					{&lt;br /&gt;
						UnhookPlaylistChanges();&lt;br /&gt;
					}&lt;br /&gt;
					VideoOutput = null;&lt;br /&gt;
					VLC_CleanUp(this.vlcHandle);&lt;br /&gt;
                    VLC_Destroy(this.vlcHandle);&lt;br /&gt;
                }&lt;br /&gt;
                catch { }&lt;br /&gt;
            }&lt;br /&gt;
            vlcHandle = -1;&lt;br /&gt;
        }&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
		#region internal Vlc interop helper classes&lt;br /&gt;
		internal class VlcObject : IDisposable&lt;br /&gt;
		{&lt;br /&gt;
			IntPtr vlc = IntPtr.Zero;&lt;br /&gt;
			IntPtr subObject = IntPtr.Zero;&lt;br /&gt;
			bool isDisposed;&lt;br /&gt;
&lt;br /&gt;
			public VlcObject(int vlcHandle, ObjectType objectType)&lt;br /&gt;
			{&lt;br /&gt;
				vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
				if(IntPtr.Zero != vlc)&lt;br /&gt;
				{&lt;br /&gt;
					if(objectType == ObjectType.VLC_OBJECT_VLC)&lt;br /&gt;
					{&lt;br /&gt;
						subObject = vlc;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						subObject = __vlc_object_find(vlc, objectType, ObjectSearchMode.FIND_CHILD);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			public IntPtr Vlc { get { return this.vlc; } }&lt;br /&gt;
			public IntPtr SubObject { get { return this.subObject; } }&lt;br /&gt;
&lt;br /&gt;
			public void Dispose()&lt;br /&gt;
			{&lt;br /&gt;
				Dispose(true);&lt;br /&gt;
				GC.SuppressFinalize(this);&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			protected virtual void Dispose(bool disposing)&lt;br /&gt;
			{&lt;br /&gt;
				if(!this.isDisposed)&lt;br /&gt;
				{&lt;br /&gt;
					this.isDisposed = true;&lt;br /&gt;
					if((IntPtr.Zero != subObject) &amp;amp;&amp;amp; (subObject != vlc))&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(subObject);&lt;br /&gt;
					}&lt;br /&gt;
					if(IntPtr.Zero != vlc)&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(vlc);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			protected bool IsDisposed { get { return this.isDisposed; } }&lt;br /&gt;
&lt;br /&gt;
			~VlcObject()&lt;br /&gt;
			{&lt;br /&gt;
				Dispose(false);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private class VlcPlaylistObject : VlcObject&lt;br /&gt;
		{&lt;br /&gt;
			public libvlc_instance_t libvlc;&lt;br /&gt;
			public libvlc_exception_t exception;&lt;br /&gt;
&lt;br /&gt;
			public VlcPlaylistObject(int vlcHandle)&lt;br /&gt;
				: base(vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST)&lt;br /&gt;
			{&lt;br /&gt;
				if(this.SubObject != IntPtr.Zero)&lt;br /&gt;
				{&lt;br /&gt;
					this.libvlc = new libvlc_instance_t(this.Vlc, this.SubObject, vlcHandle);&lt;br /&gt;
					this.exception.Init();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
		#region public Vlc interop helper functions&lt;br /&gt;
		public VlcObject OpenVlcObject(ObjectType objectType)&lt;br /&gt;
		{&lt;br /&gt;
			return new VlcObject(this.vlcHandle, objectType);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int GetVlcObjectInt(ObjectType objectType, String propertyName, int errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t intValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref intValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return intValue.i_int;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectInt(ObjectType objectType, String propertyName, int value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t intValue = new vlc_value_t();&lt;br /&gt;
						intValue.i_int = value;&lt;br /&gt;
						return __var_Set(vobj.SubObject, propertyName, intValue);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public long GetVlcObjectLong(ObjectType objectType, String propertyName, long errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t longValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref longValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return longValue.i_time;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectLong(ObjectType objectType, String propertyName, long value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t longValue = new vlc_value_t();&lt;br /&gt;
						longValue.i_time = value;&lt;br /&gt;
						return __var_Set(vobj.SubObject, propertyName, longValue);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public float GetVlcObjectFloat(ObjectType objectType, String propertyName, float errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t floatValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref floatValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return floatValue.f_float;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectFloat(ObjectType objectType, String propertyName, float value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t floatValue = new vlc_value_t();&lt;br /&gt;
						floatValue.f_float = value;&lt;br /&gt;
						return __var_Set(vobj.SubObject, propertyName, floatValue);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String GetVlcObjectString(ObjectType objectType, String propertyName, String errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t stringValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref stringValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return Marshal.PtrToStringAnsi(stringValue.psz_string);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectString(ObjectType objectType, String propertyName, String value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t stringValue = new vlc_value_t();&lt;br /&gt;
						IntPtr valuePtr = Marshal.StringToCoTaskMemAnsi(value);&lt;br /&gt;
						stringValue.psz_string = valuePtr;&lt;br /&gt;
						VlcError ret = __var_Set(vobj.SubObject, propertyName, stringValue);&lt;br /&gt;
						Marshal.ZeroFreeCoTaskMemAnsi(valuePtr);&lt;br /&gt;
						return ret;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError GetVlcVariableChoiceList(ObjectType objectType, String propertyName,&lt;br /&gt;
			out int[] choiceIds, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t idValues = new vlc_value_t();&lt;br /&gt;
						vlc_value_t textValues = new vlc_value_t();&lt;br /&gt;
						if(VlcError.Success == __var_Change(vobj.SubObject, propertyName,&lt;br /&gt;
							VarFlags.VLC_VAR_GETLIST, ref idValues, ref textValues))&lt;br /&gt;
						{&lt;br /&gt;
							try&lt;br /&gt;
							{&lt;br /&gt;
								vlc_list_t idList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									idValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
								vlc_list_t textList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									textValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
&lt;br /&gt;
								int choiceCount = idList.i_count;&lt;br /&gt;
								choiceIds = new Int32[choiceCount];&lt;br /&gt;
								choiceText = new String[choiceCount];&lt;br /&gt;
&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceCount; index++)&lt;br /&gt;
								{&lt;br /&gt;
									IntPtr idPtr = new IntPtr(idList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t idValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										idPtr, typeof(vlc_value_t));&lt;br /&gt;
									choiceIds[index] = idValue.i_int;&lt;br /&gt;
&lt;br /&gt;
									IntPtr textPtr = new IntPtr(textList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t textValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										textPtr, typeof(vlc_value_t));&lt;br /&gt;
									choiceText[index] = Marshal.PtrToStringAnsi(textValue.psz_string);&lt;br /&gt;
								}&lt;br /&gt;
								return VlcError.Success;&lt;br /&gt;
							}&lt;br /&gt;
							finally&lt;br /&gt;
							{&lt;br /&gt;
								__var_Change(vobj.SubObject, propertyName, VarFlags.VLC_VAR_FREELIST,&lt;br /&gt;
									ref idValues, ref textValues);&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			choiceIds = new int[0];&lt;br /&gt;
			choiceText = new string[0];&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError GetVlcVariableChoiceList(ObjectType objectType, String propertyName,&lt;br /&gt;
			out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t idValues = new vlc_value_t();&lt;br /&gt;
						vlc_value_t textValues = new vlc_value_t();&lt;br /&gt;
						if(VlcError.Success == __var_Change(vobj.SubObject, propertyName,&lt;br /&gt;
							VarFlags.VLC_VAR_GETLIST, ref idValues, ref textValues))&lt;br /&gt;
						{&lt;br /&gt;
							try&lt;br /&gt;
							{&lt;br /&gt;
								vlc_list_t idList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									idValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
								vlc_list_t textList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									textValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
&lt;br /&gt;
								int choiceCount = idList.i_count;&lt;br /&gt;
								List&amp;lt;String&amp;gt; choiceList = new List&amp;lt;string&amp;gt;(choiceCount);&lt;br /&gt;
								List&amp;lt;String&amp;gt; choiceTextList = new List&amp;lt;string&amp;gt;(choiceCount);&lt;br /&gt;
								Dictionary&amp;lt;String, int&amp;gt; choiceDict = new Dictionary&amp;lt;string, int&amp;gt;(choiceCount);&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceCount; index++)&lt;br /&gt;
								{&lt;br /&gt;
									IntPtr idPtr = new IntPtr(idList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t idValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										idPtr, typeof(vlc_value_t));&lt;br /&gt;
									String choice = Marshal.PtrToStringAnsi(idValue.psz_name);&lt;br /&gt;
									choiceList.Add(choice);&lt;br /&gt;
									if(choiceDict.ContainsKey(choice))&lt;br /&gt;
									{&lt;br /&gt;
										choiceDict[choice] = choiceDict[choice] + 1;&lt;br /&gt;
									}&lt;br /&gt;
									else&lt;br /&gt;
									{&lt;br /&gt;
										choiceDict[choice] = 1;&lt;br /&gt;
									}&lt;br /&gt;
&lt;br /&gt;
									IntPtr textPtr = new IntPtr(textList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t textValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										textPtr, typeof(vlc_value_t));&lt;br /&gt;
									choiceTextList.Add(Marshal.PtrToStringAnsi(textValue.psz_string));&lt;br /&gt;
								}&lt;br /&gt;
&lt;br /&gt;
								int listIndex = 0;&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceCount; index++)&lt;br /&gt;
								{&lt;br /&gt;
									String choice = choiceList[listIndex];&lt;br /&gt;
									if((choiceDict[choice] &amp;gt; 1) &amp;amp;&amp;amp; (choiceTextList[listIndex] == null))&lt;br /&gt;
									{&lt;br /&gt;
										choiceList.RemoveAt(listIndex);&lt;br /&gt;
										choiceTextList.RemoveAt(listIndex);&lt;br /&gt;
										choiceDict[choice] = choiceDict[choice] - 1;&lt;br /&gt;
									}&lt;br /&gt;
									else&lt;br /&gt;
									{&lt;br /&gt;
										listIndex++;&lt;br /&gt;
									}&lt;br /&gt;
								}&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceList.Count; index++)&lt;br /&gt;
								{&lt;br /&gt;
									if(choiceTextList[index] == null)&lt;br /&gt;
									{&lt;br /&gt;
										choiceTextList[index] = choiceList[index];&lt;br /&gt;
									}&lt;br /&gt;
								}&lt;br /&gt;
&lt;br /&gt;
								choices = choiceList.ToArray();&lt;br /&gt;
								choiceText = choiceTextList.ToArray();&lt;br /&gt;
								return VlcError.Success;&lt;br /&gt;
							}&lt;br /&gt;
							finally&lt;br /&gt;
							{&lt;br /&gt;
								__var_Change(vobj.SubObject, propertyName, VarFlags.VLC_VAR_FREELIST,&lt;br /&gt;
									ref idValues, ref textValues);&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			choices = new string[0];&lt;br /&gt;
			choiceText = new string[0];&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
        #region public Properties&lt;br /&gt;
        public static string VlcInstallDir&lt;br /&gt;
        {&lt;br /&gt;
            get{ return vlcInstallDirectory; }&lt;br /&gt;
            set{ vlcInstallDirectory = value; }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public bool IsInitialized&lt;br /&gt;
        {&lt;br /&gt;
            get{return (vlcHandle != -1);}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public Control VideoOutput&lt;br /&gt;
        {&lt;br /&gt;
            get { return outputWindow; }&lt;br /&gt;
            set&lt;br /&gt;
            {&lt;br /&gt;
				if(value == null)&lt;br /&gt;
				{&lt;br /&gt;
					if(outputWindow != null)&lt;br /&gt;
					{&lt;br /&gt;
						outputWindow = null;&lt;br /&gt;
						if(vlcHandle != -1)&lt;br /&gt;
						{&lt;br /&gt;
							SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;drawable&amp;quot;, 0);&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					outputWindow = value;&lt;br /&gt;
					if(vlcHandle != -1)&lt;br /&gt;
					{&lt;br /&gt;
						SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;drawable&amp;quot;, outputWindow.Handle.ToInt32());&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public string LastError&lt;br /&gt;
        {&lt;br /&gt;
            get{return lastErrorMessage;}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public event MetaDataEventHandler NowPlaying;&lt;br /&gt;
&lt;br /&gt;
		protected virtual void OnNowPlaying(MetaDataUpdateEventArgs args)&lt;br /&gt;
		{&lt;br /&gt;
			if(this.NowPlaying != null)&lt;br /&gt;
			{&lt;br /&gt;
				this.NowPlaying(this, args);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		protected delegate void HandleNowPlaying(MetaDataUpdateEventArgs args);&lt;br /&gt;
&lt;br /&gt;
		protected virtual void VlcNowPlayingChanged(String newText)&lt;br /&gt;
		{&lt;br /&gt;
			// switch out of the Vlc thread to our User Interface thread if possible&lt;br /&gt;
			if(this.VideoOutput != null)&lt;br /&gt;
			{&lt;br /&gt;
				this.VideoOutput.BeginInvoke(new HandleNowPlaying(OnNowPlaying),&lt;br /&gt;
					new MetaDataUpdateEventArgs(MetaData.NowPlaying, newText));&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				OnNowPlaying(new MetaDataUpdateEventArgs(MetaData.NowPlaying, newText));&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public int Length&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				if(this.artificialLength != 0)&lt;br /&gt;
				{&lt;br /&gt;
					return this.artificialLength;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return Convert.ToInt32(GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;length&amp;quot;, 0) / 1000000L);&lt;br /&gt;
				}&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public void SetArtificialLength(int newLength)&lt;br /&gt;
		{&lt;br /&gt;
			this.artificialLength = newLength;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public int Time&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				int time = Convert.ToInt32(GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;time&amp;quot;, 0) / 1000000L);&lt;br /&gt;
				if((time == 0) &amp;amp;&amp;amp; (this.artificialLength != 0))&lt;br /&gt;
				{&lt;br /&gt;
					time = Convert.ToInt32(Position * this.artificialLength + .5d);&lt;br /&gt;
				}&lt;br /&gt;
				if(this.timeScaling != 0.0d)&lt;br /&gt;
				{&lt;br /&gt;
					time = Convert.ToInt32(time / this.timeScaling);&lt;br /&gt;
				}&lt;br /&gt;
				return time;&lt;br /&gt;
            }&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.artificialLength != 0)&lt;br /&gt;
				{&lt;br /&gt;
					float position = Convert.ToSingle(value) / Convert.ToSingle(this.artificialLength);&lt;br /&gt;
					if(this.timeScaling != 0.0d)&lt;br /&gt;
					{&lt;br /&gt;
						position = Convert.ToSingle(position * this.timeScaling);&lt;br /&gt;
					}&lt;br /&gt;
					Debug.WriteLine(String.Format(&amp;quot;Set Position {0}&amp;quot;, position));&lt;br /&gt;
					SetVlcObjectFloat(ObjectType.VLC_OBJECT_INPUT, &amp;quot;position&amp;quot;, position);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					long time = Convert.ToInt64(value) * 1000000L;&lt;br /&gt;
					if(this.timeScaling != 0.0d)&lt;br /&gt;
					{&lt;br /&gt;
						time = Convert.ToInt64(time * this.timeScaling);&lt;br /&gt;
					}&lt;br /&gt;
					Debug.WriteLine(String.Format(&amp;quot;Set Time {0}&amp;quot;, time));&lt;br /&gt;
					SetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;time&amp;quot;, time);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public double TimeScaling&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.timeScaling; }&lt;br /&gt;
			set { this.timeScaling = value; }&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public double Position&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				double position = GetVlcObjectFloat(ObjectType.VLC_OBJECT_INPUT, &amp;quot;position&amp;quot;, 0.0f);&lt;br /&gt;
				if(this.timeScaling != 0.0d)&lt;br /&gt;
				{&lt;br /&gt;
					position = position / this.timeScaling;&lt;br /&gt;
				}&lt;br /&gt;
				return position;&lt;br /&gt;
            }&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				double position = value;&lt;br /&gt;
				if(this.timeScaling != 0.0d)&lt;br /&gt;
				{&lt;br /&gt;
					position = position * this.timeScaling;&lt;br /&gt;
				}&lt;br /&gt;
				Debug.WriteLine(String.Format(&amp;quot;Set Position {0}&amp;quot;, position));&lt;br /&gt;
				SetVlcObjectFloat(ObjectType.VLC_OBJECT_INPUT, &amp;quot;position&amp;quot;, Convert.ToSingle(position));&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public int Volume&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				IntPtr vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
				if(IntPtr.Zero != vlc)&lt;br /&gt;
				{&lt;br /&gt;
					try&lt;br /&gt;
					{&lt;br /&gt;
						Int16 aoutVol = 0;&lt;br /&gt;
						if(__aout_VolumeGet(vlc, ref aoutVol) == VlcError.Success)&lt;br /&gt;
						{&lt;br /&gt;
							return (aoutVol * VOLUME_MAX + AOUT_VOLUME_MAX / 2) / AOUT_VOLUME_MAX;&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
					catch(Exception)&lt;br /&gt;
					{&lt;br /&gt;
					}&lt;br /&gt;
					finally&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(vlc);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				return 0;&lt;br /&gt;
            }&lt;br /&gt;
            set&lt;br /&gt;
            {&lt;br /&gt;
				IntPtr vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
				if(IntPtr.Zero != vlc)&lt;br /&gt;
				{&lt;br /&gt;
					try&lt;br /&gt;
					{&lt;br /&gt;
						Int16 aoutVol = Convert.ToInt16((value * AOUT_VOLUME_MAX + VOLUME_MAX / 2) / VOLUME_MAX);&lt;br /&gt;
						__aout_VolumeSet(vlc, aoutVol);&lt;br /&gt;
					}&lt;br /&gt;
					catch(Exception)&lt;br /&gt;
					{&lt;br /&gt;
					}&lt;br /&gt;
					finally&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(vlc);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public bool Fullscreen&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				int isFullScreen = GetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;fullscreen&amp;quot;, -666);&lt;br /&gt;
				if((isFullScreen != -666) &amp;amp;&amp;amp; (isFullScreen != 0))&lt;br /&gt;
				{&lt;br /&gt;
					return true;&lt;br /&gt;
				}&lt;br /&gt;
                return false;&lt;br /&gt;
               &lt;br /&gt;
            }&lt;br /&gt;
            set&lt;br /&gt;
            {&lt;br /&gt;
				SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;fullscreen&amp;quot;, value ? 1 : 0);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public int PlaylistIndex&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return VLC_PlaylistIndex(this.vlcHandle);&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception ex)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = ex.Message;&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int PlaylistCount&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return VLC_PlaylistNumberOfItems(this.vlcHandle);&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception ex)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = ex.Message;&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
        #region public Methods&lt;br /&gt;
        public bool Initialize()&lt;br /&gt;
        {&lt;br /&gt;
            // check if already initializes&lt;br /&gt;
            if(vlcHandle != -1)&lt;br /&gt;
                return true;&lt;br /&gt;
&lt;br /&gt;
			string oldDir = Environment.CurrentDirectory;&lt;br /&gt;
			// try init&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				// create instance&lt;br /&gt;
				Environment.CurrentDirectory = NativeLibVlc.vlcInstallDirectory;&lt;br /&gt;
				this.vlcHandle = VLC_Create();&lt;br /&gt;
&lt;br /&gt;
				if(this.vlcHandle &amp;lt; 0)&lt;br /&gt;
				{&lt;br /&gt;
					lastErrorMessage = &amp;quot;Failed to create VLC instance&amp;quot;;&lt;br /&gt;
					return false;&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				string[] initOptions = {	NativeLibVlc.vlcInstallDirectory,&lt;br /&gt;
											&amp;quot;:no-one-instance&amp;quot;,&lt;br /&gt;
											&amp;quot;:no-loop&amp;quot;,&lt;br /&gt;
											&amp;quot;:no-drop-late-frames&amp;quot;,&lt;br /&gt;
											&amp;quot;:disable-screensaver&amp;quot;,&lt;br /&gt;
											&amp;quot;:vout=vout_directx&amp;quot;,&lt;br /&gt;
											&amp;quot;--plugin-path=&amp;quot; + NativeLibVlc.vlcInstallDirectory + @&amp;quot;\plugins&amp;quot;,&lt;br /&gt;
					};&lt;br /&gt;
&lt;br /&gt;
				// init libvlc&lt;br /&gt;
				VlcError errVlcLib = VLC_Init(vlcHandle, initOptions.Length, initOptions);&lt;br /&gt;
				if(errVlcLib != VlcError.Success)&lt;br /&gt;
				{&lt;br /&gt;
					VLC_Destroy(vlcHandle);&lt;br /&gt;
					lastErrorMessage = &amp;quot;Failed to initialise VLC&amp;quot;;&lt;br /&gt;
					this.vlcHandle = -1;&lt;br /&gt;
					return false;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch&lt;br /&gt;
			{&lt;br /&gt;
				lastErrorMessage = &amp;quot;Could not find libvlc&amp;quot;;&lt;br /&gt;
				return false;&lt;br /&gt;
			}&lt;br /&gt;
			finally&lt;br /&gt;
			{&lt;br /&gt;
				Environment.CurrentDirectory = oldDir;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
            // check output window&lt;br /&gt;
            if(outputWindow != null)&lt;br /&gt;
            {&lt;br /&gt;
				SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;drawable&amp;quot;, outputWindow.Handle.ToInt32());&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		// there&#039;s an overhead to supporting Vlc events, a memory leak, so we need to have them off by default&lt;br /&gt;
		public bool ProducingEvents&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.gch.IsAllocated; }&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(value)&lt;br /&gt;
				{&lt;br /&gt;
					if(!this.gch.IsAllocated)&lt;br /&gt;
					{&lt;br /&gt;
						HookPlaylistChanges();&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					if(this.gch.IsAllocated)&lt;br /&gt;
					{&lt;br /&gt;
						UnhookPlaylistChanges();&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private static String AdjustFilterString(String current, String filter, bool add)&lt;br /&gt;
		{&lt;br /&gt;
			String newFilter = null;&lt;br /&gt;
			int findFilter = current.IndexOf(filter);&lt;br /&gt;
			if(findFilter == -1)&lt;br /&gt;
			{&lt;br /&gt;
				if(add)&lt;br /&gt;
				{&lt;br /&gt;
					if(current.Length == 0)&lt;br /&gt;
					{&lt;br /&gt;
						newFilter = filter;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						newFilter = String.Format(&amp;quot;{0}:{1}&amp;quot;, current, filter);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				if(!add)&lt;br /&gt;
				{&lt;br /&gt;
					int colonAfterAdjust = current.IndexOf(&#039;:&#039;, findFilter + 1);&lt;br /&gt;
					if(findFilter == 0)&lt;br /&gt;
					{&lt;br /&gt;
						if(colonAfterAdjust == -1)&lt;br /&gt;
						{&lt;br /&gt;
							newFilter = String.Empty;&lt;br /&gt;
						}&lt;br /&gt;
						else&lt;br /&gt;
						{&lt;br /&gt;
							newFilter = current.Substring(colonAfterAdjust + 1);&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						if(colonAfterAdjust == -1)&lt;br /&gt;
						{&lt;br /&gt;
							newFilter = current.Substring(0, findFilter - 1);&lt;br /&gt;
						}&lt;br /&gt;
						else&lt;br /&gt;
						{&lt;br /&gt;
							newFilter = current.Substring(0, findFilter - 1) +&lt;br /&gt;
								current.Substring(colonAfterAdjust);&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			return newFilter;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		const String VideoFilterList = &amp;quot;vout-filter&amp;quot;;&lt;br /&gt;
		const String AdjustFilter = &amp;quot;adjust&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
		public bool AllowVideoAdjustments&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				String voutFilter = GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, VideoFilterList, null);&lt;br /&gt;
				if(voutFilter == null)&lt;br /&gt;
				{&lt;br /&gt;
					GetConfigVariable(VideoFilterList, out voutFilter);&lt;br /&gt;
				}&lt;br /&gt;
				if(voutFilter != null)&lt;br /&gt;
				{&lt;br /&gt;
					return voutFilter.IndexOf(AdjustFilter) != -1;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return false;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				bool useConfig = false;&lt;br /&gt;
				String voutFilter = GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, VideoFilterList, null);&lt;br /&gt;
				if(voutFilter == null)&lt;br /&gt;
				{&lt;br /&gt;
					using(VlcObject vlc = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_VLC))&lt;br /&gt;
					{&lt;br /&gt;
						GetConfigVariable(VideoFilterList, out voutFilter);&lt;br /&gt;
						useConfig = true;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				if(voutFilter != null)&lt;br /&gt;
				{&lt;br /&gt;
					String newVoutFilter = AdjustFilterString(voutFilter, AdjustFilter, value);&lt;br /&gt;
					if(newVoutFilter != null)&lt;br /&gt;
					{&lt;br /&gt;
						if(useConfig)&lt;br /&gt;
						{&lt;br /&gt;
							SetConfigVariable(VideoFilterList, newVoutFilter);&lt;br /&gt;
						}&lt;br /&gt;
						else&lt;br /&gt;
						{&lt;br /&gt;
							SetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, VideoFilterList, newVoutFilter);&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError AddTarget(string target, ref int itemId)&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						VlcError enmErr = playlist_AddExt(vobj.SubObject, target, target, Mode.Append, &lt;br /&gt;
							EndOfPlaylist, -1L, null, 0);&lt;br /&gt;
						if(enmErr &amp;gt;= VlcError.Success)&lt;br /&gt;
						{&lt;br /&gt;
							itemId = (int)enmErr;&lt;br /&gt;
						}&lt;br /&gt;
						return enmErr;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError AddTarget(string target, string[] options, ref int itemId)&lt;br /&gt;
        {&lt;br /&gt;
            int optionsCount = 0;&lt;br /&gt;
			if(options != null)&lt;br /&gt;
			{&lt;br /&gt;
				optionsCount = options.Length;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						VlcError enmErr = playlist_AddExt(vobj.SubObject, target, target, Mode.Append,&lt;br /&gt;
							EndOfPlaylist, -1L, options, optionsCount);&lt;br /&gt;
						if(enmErr &amp;gt;= VlcError.Success)&lt;br /&gt;
						{&lt;br /&gt;
							itemId = (int)enmErr;&lt;br /&gt;
						}&lt;br /&gt;
						return enmErr;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public Size VideoSize&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					using(VlcPlaylistObject vpobj = new VlcPlaylistObject(this.vlcHandle))&lt;br /&gt;
					{&lt;br /&gt;
						if(vpobj.SubObject != IntPtr.Zero)&lt;br /&gt;
						{&lt;br /&gt;
							IntPtr p_input = libvlc_playlist_get_input(ref vpobj.libvlc, ref vpobj.exception);&lt;br /&gt;
							if(vpobj.exception.WasExceptionRaised())&lt;br /&gt;
							{&lt;br /&gt;
								this.lastErrorMessage = Marshal.PtrToStringAnsi(vpobj.exception.psz_message);&lt;br /&gt;
							}&lt;br /&gt;
							else&lt;br /&gt;
							{&lt;br /&gt;
								try&lt;br /&gt;
								{&lt;br /&gt;
									int width = libvlc_video_get_width(p_input, ref vpobj.exception);&lt;br /&gt;
									if(!vpobj.exception.WasExceptionRaised())&lt;br /&gt;
									{&lt;br /&gt;
										int height = libvlc_video_get_height(p_input, ref vpobj.exception);&lt;br /&gt;
										if(!vpobj.exception.WasExceptionRaised())&lt;br /&gt;
										{&lt;br /&gt;
											return new Size(width, height);&lt;br /&gt;
										}&lt;br /&gt;
									}&lt;br /&gt;
								}&lt;br /&gt;
								finally&lt;br /&gt;
								{&lt;br /&gt;
									libvlc_input_free(p_input);&lt;br /&gt;
								}&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception ex)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = ex.Message;&lt;br /&gt;
				}&lt;br /&gt;
				return new Size();&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError Play(int itemId)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				this.artificialLength = 0;&lt;br /&gt;
				this.timeScaling = 0.0d;&lt;br /&gt;
				using(VlcPlaylistObject vpobj = new VlcPlaylistObject(this.vlcHandle))&lt;br /&gt;
				{&lt;br /&gt;
					if(vpobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						libvlc_playlist_play(ref vpobj.libvlc, itemId, 0, IntPtr.Zero, &lt;br /&gt;
							ref vpobj.exception);&lt;br /&gt;
						if(vpobj.exception.WasExceptionRaised())&lt;br /&gt;
						{&lt;br /&gt;
							return VlcError.Generic;&lt;br /&gt;
						}&lt;br /&gt;
						return VlcError.Success;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public VlcError Play()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_LockControl(vobj.SubObject, playlist_command.PLAYLIST_PLAY);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError Pause()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_LockControl(vobj.SubObject, playlist_command.PLAYLIST_PAUSE);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError Stop()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_LockControl(vobj.SubObject, playlist_command.PLAYLIST_PAUSE);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public VlcError PlaylistClear()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_Clear(vobj.SubObject);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError ToggleVolumeMute()&lt;br /&gt;
        {&lt;br /&gt;
			IntPtr vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
			if(IntPtr.Zero != vlc)&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return __aout_VolumeMute(vlc, IntPtr.Zero);&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception)&lt;br /&gt;
				{&lt;br /&gt;
				}&lt;br /&gt;
				finally&lt;br /&gt;
				{&lt;br /&gt;
					__vlc_object_release(vlc);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
            return VlcError.NoObj;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError PressKey(string strKey)&lt;br /&gt;
        {&lt;br /&gt;
			int key = GetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, strKey, -666);&lt;br /&gt;
			if(key != -666)&lt;br /&gt;
			{&lt;br /&gt;
				return SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;key-pressed&amp;quot;, key);&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoVar;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError ShowMessage(String message)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_INPUT))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						__vout_OSDMessage(vobj.SubObject, DEFAULT_CHAN, message);&lt;br /&gt;
						return VlcError.Success;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError GetConfigVariable(String name, out String value)&lt;br /&gt;
		{&lt;br /&gt;
			value = null;&lt;br /&gt;
			using(VlcObject vlc = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_VLC))&lt;br /&gt;
			{&lt;br /&gt;
				if(IntPtr.Zero == vlc.SubObject)&lt;br /&gt;
				{&lt;br /&gt;
					return VlcError.NoObj;&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				IntPtr p_item = config_FindConfig(vlc.SubObject, name);&lt;br /&gt;
				if(IntPtr.Zero == p_item)&lt;br /&gt;
				{&lt;br /&gt;
					return VlcError.NoVar;&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					module_config_t mod = (module_config_t)Marshal.PtrToStructure(p_item, typeof(module_config_t));&lt;br /&gt;
					switch(mod.i_type)&lt;br /&gt;
					{&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_BOOL:&lt;br /&gt;
						{&lt;br /&gt;
							bool result = (__config_GetInt(vlc.SubObject, name) == 0);&lt;br /&gt;
							value = result.ToString();&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_INTEGER:&lt;br /&gt;
						{&lt;br /&gt;
							int intResult = __config_GetInt(vlc.SubObject, name);&lt;br /&gt;
							value = intResult.ToString();&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_FLOAT:&lt;br /&gt;
						{&lt;br /&gt;
							float floatResult = __config_GetFloat(vlc.SubObject, name);&lt;br /&gt;
							value = floatResult.ToString();&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_STRING:&lt;br /&gt;
						value = __config_GetPsz(vlc.SubObject, name);&lt;br /&gt;
						break;&lt;br /&gt;
					default:&lt;br /&gt;
						return VlcError.BadVar;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception e)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = e.Message;&lt;br /&gt;
					return VlcError.Exception;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.Success;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetConfigVariable(String name, String value)&lt;br /&gt;
		{&lt;br /&gt;
			using(VlcObject vlc = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_VLC))&lt;br /&gt;
			{&lt;br /&gt;
				if(IntPtr.Zero == vlc.SubObject)&lt;br /&gt;
				{&lt;br /&gt;
					return VlcError.NoObj;&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				IntPtr p_item = config_FindConfig(vlc.SubObject, name);&lt;br /&gt;
				if(IntPtr.Zero == p_item)&lt;br /&gt;
				{&lt;br /&gt;
					return VlcError.NoVar;&lt;br /&gt;
				}&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					module_config_t mod = (module_config_t)Marshal.PtrToStructure(p_item, typeof(module_config_t));&lt;br /&gt;
					switch(mod.i_type)&lt;br /&gt;
					{&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_BOOL:&lt;br /&gt;
						{&lt;br /&gt;
							bool boolResult;&lt;br /&gt;
							if(Boolean.TryParse(value, out boolResult))&lt;br /&gt;
							{&lt;br /&gt;
								__config_PutInt(vlc.SubObject, name, boolResult ? 1 : 0);&lt;br /&gt;
							}&lt;br /&gt;
							else&lt;br /&gt;
							{&lt;br /&gt;
								return VlcError.BadVar;&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_INTEGER:&lt;br /&gt;
						{&lt;br /&gt;
							int intResult;&lt;br /&gt;
							if(Int32.TryParse(value, out intResult))&lt;br /&gt;
							{&lt;br /&gt;
								__config_PutInt(vlc.SubObject, name, intResult);&lt;br /&gt;
							}&lt;br /&gt;
							else&lt;br /&gt;
							{&lt;br /&gt;
								return VlcError.BadVar;&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_FLOAT:&lt;br /&gt;
						{&lt;br /&gt;
							float floatResult;&lt;br /&gt;
							if(Single.TryParse(value, out floatResult))&lt;br /&gt;
							{&lt;br /&gt;
								__config_PutFloat(vlc.SubObject, name, floatResult);&lt;br /&gt;
							}&lt;br /&gt;
							else&lt;br /&gt;
							{&lt;br /&gt;
								return VlcError.BadVar;&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
						break;&lt;br /&gt;
					case CONFIG_ITEM.CONFIG_ITEM_STRING:&lt;br /&gt;
						__config_PutPsz(vlc.SubObject, name, value);&lt;br /&gt;
						break;&lt;br /&gt;
					default:&lt;br /&gt;
						return VlcError.BadVar;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception e)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = e.Message;&lt;br /&gt;
					return VlcError.Exception;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.Success;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
		#region private members, properties and methods&lt;br /&gt;
&lt;br /&gt;
		private static string vlcInstallDirectory = &amp;quot;&amp;quot;;&lt;br /&gt;
		private int vlcHandle = -1;&lt;br /&gt;
		private Control outputWindow = null;&lt;br /&gt;
		private string lastErrorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
		private int artificialLength;&lt;br /&gt;
		private double timeScaling;&lt;br /&gt;
		private GCHandle gch;&lt;br /&gt;
		private VarChangedCallback currentTrackCallback;&lt;br /&gt;
		private string previousNowPlaying = String.Empty;&lt;br /&gt;
&lt;br /&gt;
        /// -------------------------------------------------------------------&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// Method name      :   QueryVlcInstallPath&lt;br /&gt;
        /// Author         :   Odysee&lt;br /&gt;
        ///   Date         :   10.11.2006&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        /// -------------------------------------------------------------------&lt;br /&gt;
        private static string QueryVlcInstallPath()&lt;br /&gt;
        {&lt;br /&gt;
            // open registry&lt;br /&gt;
            RegistryKey regkeyVlcInstallPathKey = Registry.LocalMachine.OpenSubKey(@&amp;quot;SOFTWARE\VideoLAN\VLC&amp;quot;);&lt;br /&gt;
            if(regkeyVlcInstallPathKey == null)&lt;br /&gt;
                return &amp;quot;&amp;quot;;&lt;br /&gt;
            return (string)regkeyVlcInstallPathKey.GetValue(&amp;quot;InstallDir&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		private void HookPlaylistChanges()&lt;br /&gt;
		{&lt;br /&gt;
			using(VlcObject vlc = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
			{&lt;br /&gt;
				if(vlc.SubObject != IntPtr.Zero)&lt;br /&gt;
				{&lt;br /&gt;
					this.gch = GCHandle.Alloc(this);&lt;br /&gt;
					this.currentTrackCallback = new VarChangedCallback(CurrentTrackChanged);&lt;br /&gt;
&lt;br /&gt;
					int isSet = __var_AddCallback(vlc.SubObject, Playlist_Current,&lt;br /&gt;
						this.currentTrackCallback, (IntPtr)this.gch);&lt;br /&gt;
					//Debug.WriteLine(&amp;quot;__var_AddCallback playlistObject = &amp;quot; + isSet.ToString());&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void UnhookPlaylistChanges()&lt;br /&gt;
		{&lt;br /&gt;
			using(VlcObject vlc = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
			{&lt;br /&gt;
				if(vlc.SubObject != IntPtr.Zero)&lt;br /&gt;
				{&lt;br /&gt;
					__var_DelCallback(vlc.SubObject, Playlist_Current,&lt;br /&gt;
						this.currentTrackCallback, (IntPtr)this.gch);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			this.gch.Free();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private static int CurrentTrackChanged(IntPtr vlc, String variable, vlc_value_t old_val,&lt;br /&gt;
			vlc_value_t new_val, IntPtr param)&lt;br /&gt;
		{&lt;br /&gt;
			//Debug.WriteLine(&amp;quot;CurrentTrackChanged: &amp;quot; + new_val.i_int.ToString());&lt;br /&gt;
			GCHandle gch = (GCHandle)param;&lt;br /&gt;
			NativeLibVlc thisVlc = (NativeLibVlc)gch.Target;&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(thisVlc.vlcHandle, ObjectType.VLC_OBJECT_INPUT))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						IntPtr resultString = IntPtr.Zero;&lt;br /&gt;
						input_Control(vobj.SubObject, input_query_e.INPUT_GET_INFO,&lt;br /&gt;
							Meta_information, Now_Playing, ref resultString);&lt;br /&gt;
						String nowPlaying = Marshal.PtrToStringAnsi(resultString);&lt;br /&gt;
						if(nowPlaying != thisVlc.previousNowPlaying)&lt;br /&gt;
						{&lt;br /&gt;
							thisVlc.previousNowPlaying = nowPlaying;&lt;br /&gt;
							Debug.WriteLine(String.Format(&amp;quot;nowPlaying: {0}&amp;quot;, nowPlaying));&lt;br /&gt;
							thisVlc.VlcNowPlayingChanged(nowPlaying);&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				thisVlc.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return (int)VlcError.Success;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        #endregion&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/* future features&lt;br /&gt;
&lt;br /&gt;
    add_bool( &amp;quot;brightness-threshold&amp;quot;, 0, NULL,&lt;br /&gt;
              THRES_TEXT, THRES_LONGTEXT, VLC_FALSE );&lt;br /&gt;
	 */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=IPlayer.cs&amp;diff=7018</id>
		<title>IPlayer.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=IPlayer.cs&amp;diff=7018"/>
		<updated>2007-01-12T01:02:07Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * IPlayer.cs: IPlayer, IPlayer2 interface definitions&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
&lt;br /&gt;
namespace VLanControl&lt;br /&gt;
{&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	[Guid(&amp;quot;B5A4F6A1-B8C8-4f4f-B9CD-396DCDCAC4C3&amp;quot;)]&lt;br /&gt;
	public struct TrackPosition : IComparable&amp;lt;TrackPosition&amp;gt;&lt;br /&gt;
	{&lt;br /&gt;
		public int time;&lt;br /&gt;
		public double position;&lt;br /&gt;
&lt;br /&gt;
		public TrackPosition(int time, double position)&lt;br /&gt;
		{&lt;br /&gt;
			this.time = time;&lt;br /&gt;
			this.position = position;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public TrackPosition(TrackPosition other)&lt;br /&gt;
		{&lt;br /&gt;
			this.time = other.time;&lt;br /&gt;
			this.position = other.position;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		#region IComparable&amp;lt;TrackPosition&amp;gt; Members&lt;br /&gt;
&lt;br /&gt;
		public int CompareTo(TrackPosition other)&lt;br /&gt;
		{&lt;br /&gt;
			return this.time.CompareTo(other.time);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		#endregion&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	public enum PlayerState&lt;br /&gt;
	{&lt;br /&gt;
		None = 0,&lt;br /&gt;
		Playing = 1,&lt;br /&gt;
		Paused = 2,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	public enum MetaData&lt;br /&gt;
	{&lt;br /&gt;
		NowPlaying = 0,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public class MetaDataUpdateEventArgs : EventArgs&lt;br /&gt;
	{&lt;br /&gt;
		MetaData data;&lt;br /&gt;
		String text;&lt;br /&gt;
&lt;br /&gt;
		public MetaDataUpdateEventArgs(MetaData data, String text)&lt;br /&gt;
		{&lt;br /&gt;
			this.data = data;&lt;br /&gt;
			this.text = text;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public MetaData Data { get { return this.data; } }&lt;br /&gt;
		public String Text { get { return this.text; } }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	public delegate void MetaDataEventHandler(object sender, MetaDataUpdateEventArgs args);&lt;br /&gt;
&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	[Guid(&amp;quot;2EA6BBFA-8BDE-4023-AEE8-916694614B25&amp;quot;)]&lt;br /&gt;
	[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]&lt;br /&gt;
	public interface IPlayer : IDisposable&lt;br /&gt;
	{&lt;br /&gt;
		bool Visible { get; set; }&lt;br /&gt;
		Control Parent { get; set; }&lt;br /&gt;
		Rectangle Bounds { get; set; }&lt;br /&gt;
		Point Location { get; set; }&lt;br /&gt;
		Size Size { get; set; }&lt;br /&gt;
		Size VideoSize { get; }&lt;br /&gt;
		int Time { get; }&lt;br /&gt;
		double Position { get; }&lt;br /&gt;
		void MoveToPosition(TrackPosition newTrackPosition);&lt;br /&gt;
		int Volume { get; set; }&lt;br /&gt;
		int Rate { get; set; }&lt;br /&gt;
		void GetRates(out int minRate, out int maxRate, out int normalRate);&lt;br /&gt;
		bool IsPlaying { get; }&lt;br /&gt;
		bool IsPaused { get; }&lt;br /&gt;
		bool IsMute { get; }&lt;br /&gt;
		int Length { get; set; }&lt;br /&gt;
		PlayerState State { get; }&lt;br /&gt;
		double TimeScaling { get; set; }&lt;br /&gt;
&lt;br /&gt;
		void Play();&lt;br /&gt;
		void ToggleMute();&lt;br /&gt;
		void TogglePause();&lt;br /&gt;
		void RotateSubtitles();&lt;br /&gt;
		void RotateAudioTrack();&lt;br /&gt;
		void RotateDeinterlaceMode();&lt;br /&gt;
		void RotateAspectRatio();&lt;br /&gt;
		void RotateCropModes();&lt;br /&gt;
		bool UseMpegVbrOffset { get; set; }&lt;br /&gt;
		void CropTop();&lt;br /&gt;
		void UnCropTop();&lt;br /&gt;
		void CropBottom();&lt;br /&gt;
		void UnCropBottom();&lt;br /&gt;
		void CropLeft();&lt;br /&gt;
		void UnCropLeft();&lt;br /&gt;
		void CropRight();&lt;br /&gt;
		void UnCropRight();&lt;br /&gt;
		void NextDvdTrack();&lt;br /&gt;
		void PreviousDvdTrack();&lt;br /&gt;
		void NextDvdChapter();&lt;br /&gt;
		void PreviousDvdChapter();&lt;br /&gt;
		TrackPosition Shuttle(int offsetSeconds);&lt;br /&gt;
		void ClearPlayList();&lt;br /&gt;
		int AddToPlayList(String fileName, String title, String[] options);&lt;br /&gt;
		void PlayItem(int index);&lt;br /&gt;
		void Stop();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	[Guid(&amp;quot;5CCB86E4-FFD0-49a0-8805-EE16A79CED50&amp;quot;)]&lt;br /&gt;
	[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]&lt;br /&gt;
	public interface IPlayer2 : IPlayer&lt;br /&gt;
	{&lt;br /&gt;
		String DeinterlaceMode { get; set; }&lt;br /&gt;
		String AspectRatio { get; set; }&lt;br /&gt;
		String CropMode { get; set; }&lt;br /&gt;
		int CroppingLeft { get; set; }&lt;br /&gt;
		int CroppingRight { get; set; }&lt;br /&gt;
		int CroppingTop { get; set; }&lt;br /&gt;
		int CroppingBottom { get; set; }&lt;br /&gt;
		int AudioTrack { get; set; }&lt;br /&gt;
		int SubTitleTrack { get; set; }&lt;br /&gt;
		// in ms&lt;br /&gt;
		int AudioDelay { get; set; }&lt;br /&gt;
		int SubTitleDelay { get; set; }&lt;br /&gt;
		int ChapterCount { get; }&lt;br /&gt;
		int Chapter { get; set; }&lt;br /&gt;
		int Program { get; set; }&lt;br /&gt;
&lt;br /&gt;
		bool AllowVideoAdjustments { get; set; }	// needs to be on to allow Contrast, Brightness, etc. to be adjusted&lt;br /&gt;
		float Contrast { get; set; }	// range from 0 to 2, default 1&lt;br /&gt;
		float Brightness { get; set; }	// range from 0 to 2, default 1&lt;br /&gt;
		int Hue { get; set; }			// range from 0 to 360, default 0&lt;br /&gt;
		float Saturation { get; set; }	// range from 0 to 3, default 1&lt;br /&gt;
		float Gamma { get; set; }		// range from .01 to 10, default 1&lt;br /&gt;
&lt;br /&gt;
		void AddAndPlay(String fileName, String options);&lt;br /&gt;
&lt;br /&gt;
		String DeinterlaceModesAsString();&lt;br /&gt;
		void DeinterlaceModes(out String[] choices, out String[] choiceText);&lt;br /&gt;
		String AspectRatiosAsString();&lt;br /&gt;
		void AspectRatios(out String[] choices, out String[] choiceText);&lt;br /&gt;
		String CropModesAsString();&lt;br /&gt;
		void CropModes(out String[] choices, out String[] choiceText);&lt;br /&gt;
		String AudioTracksAsString();&lt;br /&gt;
		void AudioTracks(out int[] trackIds, out String[] trackNames);&lt;br /&gt;
		String SubTitleTracksAsString();&lt;br /&gt;
		void SubTitleTracks(out int[] trackIds, out String[] trackNames);&lt;br /&gt;
		String ProgramsAsString();&lt;br /&gt;
		void Programs(out int[] trackIds, out String[] trackNames);&lt;br /&gt;
		void DisplayMessage(String message);&lt;br /&gt;
		String GetConfigVariable(String name, String returnOnError);&lt;br /&gt;
		bool SetConfigVariable(String name, String value);&lt;br /&gt;
		void PrecomputeCrop(Size videoSize, int cropLeft, int cropRight, int cropTop, int cropBottom);&lt;br /&gt;
		bool ComputeCrop();&lt;br /&gt;
&lt;br /&gt;
		event MetaDataEventHandler NowPlaying;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7017</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7017"/>
		<updated>2007-01-12T01:01:40Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
I should say this works with VLC 0.8.6 and 0.8.6a, no guarantees for other versions. Any dll or exe you create with this code needs to be in the same directory as libvlc.dll and have the plugins sub-directory below it.  One common error is to forget to call Initialize() on the VlcUserControl instance, which must be done after the control has been parented to a form and the form is visible (the form_OnLoad event is best).&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
Update Jan. 11, 2007:&lt;br /&gt;
 - added ActiveX functionality&lt;br /&gt;
 - added redundant interfaces to support Javascript programming because Javascript doesn&#039;t support ActiveX arrays or Out parameters&lt;br /&gt;
 - fixed install directory dependence.  Now the directory the assembly exists in is always used as the install directory.&lt;br /&gt;
 - fixed PlaylistIndex and PlaylistCount properties&lt;br /&gt;
 - fixed Cropping&lt;br /&gt;
 - added NowPlaying event, and ProducingEvents property which controls it&lt;br /&gt;
 - added Contrast, Brightness, Hue, Saturation, Gamma properties and AllowVideoAdjustments property which controls them&lt;br /&gt;
 - added GetConfigVariable method&lt;br /&gt;
 - added VLanControl.snk file to allow the control to be signed, required by ActiveX &lt;br /&gt;
 - added Test.html file to demonstrate ActiveX usage&lt;br /&gt;
&lt;br /&gt;
Register the dll for use as an ActiveX component by running:&lt;br /&gt;
    %WINDIR%\Microsoft.net\Framework\v2.0.50727\regasm VLanControl.dll /codebase&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.snk]] is an optional key file for use in signing the dll.&lt;br /&gt;
&lt;br /&gt;
[[Test.html]] is an optional ActiveX demonstration file.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7016</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7016"/>
		<updated>2007-01-12T00:59:52Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
I should say this works with VLC 0.8.6 and 0.8.6a, no guarantees for other versions. Any dll or exe you create with this code needs to be in the same directory as libvlc.dll and have the plugins sub-directory below it.  One common error is to forget to call Initialize() on the VlcUserControl instance, which must be done after the control has been parented to a form and the form is visible (the form_OnLoad event is best).&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
Update Jan. 11, 2007:&lt;br /&gt;
 - added ActiveX functionality&lt;br /&gt;
 - added redundant interfaces to support Javascript programming because Javascript doesn&#039;t support ActiveX arrays or Out parameters&lt;br /&gt;
 - fixed PlaylistIndex and PlaylistCount properties&lt;br /&gt;
 - fixed Cropping&lt;br /&gt;
 - added NowPlaying event, and ProducingEvents property which controls it&lt;br /&gt;
 - added Contrast, Brightness, Hue, Saturation, Gamma properties and AllowVideoAdjustments property which controls them&lt;br /&gt;
 - added GetConfigVariable method&lt;br /&gt;
 - added VLanControl.snk file to allow the control to be signed, required by ActiveX &lt;br /&gt;
 - added Test.html file to demonstrate ActiveX usage&lt;br /&gt;
&lt;br /&gt;
Register the dll for use as an ActiveX component by running:&lt;br /&gt;
    %WINDIR%\Microsoft.net\Framework\v2.0.50727\regasm VLanControl.dll /codebase&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.snk]] is an optional key file for use in signing the dll.&lt;br /&gt;
&lt;br /&gt;
[[Test.html]] is an optional ActiveX demonstration file.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7015</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=7015"/>
		<updated>2007-01-12T00:58:23Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
I should say this works with VLC 0.8.6 and 0.8.6a, no guarantees for other versions. Any dll or exe you create with this code needs to be in the same directory as libvlc.dll and have the plugins sub-directory below it.  One common error is to forget to call Initialize() on the VlcUserControl instance, which must be done after the control has been parented to a form and the form is visible (the form_OnLoad event is best).&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
Update Jan. 11, 2007:&lt;br /&gt;
- added ActiveX functionality&lt;br /&gt;
- added redundant interfaces to support Javascript programming because Javascript doesn&#039;t support ActiveX arrays or Out parameters&lt;br /&gt;
- fixed PlaylistIndex and PlaylistCount properties&lt;br /&gt;
- fixed Cropping&lt;br /&gt;
- added NowPlaying event, and ProducingEvents property which controls it&lt;br /&gt;
- added Contrast, Brightness, Hue, Saturation, Gamma properties and AllowVideoAdjustments property which controls them&lt;br /&gt;
- added GetConfigVariable method&lt;br /&gt;
- added VLanControl.snk file to allow the control to be signed, required by ActiveX &lt;br /&gt;
- added Test.html file to demonstrate ActiveX usage&lt;br /&gt;
&lt;br /&gt;
Register the dll for use as an ActiveX component by running:&lt;br /&gt;
    %WINDIR%\Microsoft.net\Framework\v2.0.50727\regasm VLanControl.dll /codebase&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.snk]] is an optional key file for use in signing the dll.&lt;br /&gt;
&lt;br /&gt;
[[Test.html]] is an optional ActiveX demonstration file.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6951</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6951"/>
		<updated>2007-01-01T01:47:16Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
I should say this works with VLC 0.8.6, no guarantees for other versions. Any dll or exe you create with this code needs to be in the same directory as libvlc.dll and have the plugins sub-directory below it.  One common error is to forget to call Initialize() on the VlcUserControl instance, which must be done after the control has been parented to a form and the form is visible (the form_OnLoad event is best).&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLanControl.csproj&amp;diff=6950</id>
		<title>VLanControl.csproj</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLanControl.csproj&amp;diff=6950"/>
		<updated>2007-01-01T01:40:30Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;Project DefaultTargets=&amp;quot;Build&amp;quot; xmlns=&amp;quot;http://schemas.microsoft.com/developer/msbuild/2003&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;PropertyGroup&amp;gt;&lt;br /&gt;
    &amp;lt;Configuration Condition=&amp;quot; &#039;$(Configuration)&#039; == &#039;&#039; &amp;quot;&amp;gt;Debug&amp;lt;/Configuration&amp;gt;&lt;br /&gt;
    &amp;lt;Platform Condition=&amp;quot; &#039;$(Platform)&#039; == &#039;&#039; &amp;quot;&amp;gt;AnyCPU&amp;lt;/Platform&amp;gt;&lt;br /&gt;
    &amp;lt;ProductVersion&amp;gt;8.0.50727&amp;lt;/ProductVersion&amp;gt;&lt;br /&gt;
    &amp;lt;SchemaVersion&amp;gt;2.0&amp;lt;/SchemaVersion&amp;gt;&lt;br /&gt;
    &amp;lt;ProjectGuid&amp;gt;{4E5BE39D-D764-494F-80DB-C32854595A08}&amp;lt;/ProjectGuid&amp;gt;&lt;br /&gt;
    &amp;lt;OutputType&amp;gt;Library&amp;lt;/OutputType&amp;gt;&lt;br /&gt;
    &amp;lt;AppDesignerFolder&amp;gt;Properties&amp;lt;/AppDesignerFolder&amp;gt;&lt;br /&gt;
    &amp;lt;RootNamespace&amp;gt;VLanControl&amp;lt;/RootNamespace&amp;gt;&lt;br /&gt;
    &amp;lt;AssemblyName&amp;gt;VLanControl&amp;lt;/AssemblyName&amp;gt;&lt;br /&gt;
  &amp;lt;/PropertyGroup&amp;gt;&lt;br /&gt;
  &amp;lt;PropertyGroup Condition=&amp;quot; &#039;$(Configuration)|$(Platform)&#039; == &#039;Debug|AnyCPU&#039; &amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;DebugSymbols&amp;gt;true&amp;lt;/DebugSymbols&amp;gt;&lt;br /&gt;
    &amp;lt;DebugType&amp;gt;full&amp;lt;/DebugType&amp;gt;&lt;br /&gt;
    &amp;lt;Optimize&amp;gt;false&amp;lt;/Optimize&amp;gt;&lt;br /&gt;
    &amp;lt;OutputPath&amp;gt;bin\Debug\&amp;lt;/OutputPath&amp;gt;&lt;br /&gt;
    &amp;lt;DefineConstants&amp;gt;DEBUG;TRACE&amp;lt;/DefineConstants&amp;gt;&lt;br /&gt;
    &amp;lt;ErrorReport&amp;gt;prompt&amp;lt;/ErrorReport&amp;gt;&lt;br /&gt;
    &amp;lt;WarningLevel&amp;gt;4&amp;lt;/WarningLevel&amp;gt;&lt;br /&gt;
    &amp;lt;AllowUnsafeBlocks&amp;gt;false&amp;lt;/AllowUnsafeBlocks&amp;gt;&lt;br /&gt;
  &amp;lt;/PropertyGroup&amp;gt;&lt;br /&gt;
  &amp;lt;PropertyGroup Condition=&amp;quot; &#039;$(Configuration)|$(Platform)&#039; == &#039;Release|AnyCPU&#039; &amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;DebugType&amp;gt;pdbonly&amp;lt;/DebugType&amp;gt;&lt;br /&gt;
    &amp;lt;Optimize&amp;gt;true&amp;lt;/Optimize&amp;gt;&lt;br /&gt;
    &amp;lt;OutputPath&amp;gt;bin\Release\&amp;lt;/OutputPath&amp;gt;&lt;br /&gt;
    &amp;lt;DefineConstants&amp;gt;TRACE&amp;lt;/DefineConstants&amp;gt;&lt;br /&gt;
    &amp;lt;ErrorReport&amp;gt;prompt&amp;lt;/ErrorReport&amp;gt;&lt;br /&gt;
    &amp;lt;WarningLevel&amp;gt;4&amp;lt;/WarningLevel&amp;gt;&lt;br /&gt;
    &amp;lt;AllowUnsafeBlocks&amp;gt;false&amp;lt;/AllowUnsafeBlocks&amp;gt;&lt;br /&gt;
  &amp;lt;/PropertyGroup&amp;gt;&lt;br /&gt;
  &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
    &amp;lt;Reference Include=&amp;quot;System&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Reference Include=&amp;quot;System.Data&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Reference Include=&amp;quot;System.Drawing&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Reference Include=&amp;quot;System.Windows.Forms&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Reference Include=&amp;quot;System.Xml&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
  &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;InnerVlcWindow.cs&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;SubType&amp;gt;UserControl&amp;lt;/SubType&amp;gt;&lt;br /&gt;
    &amp;lt;/Compile&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;InnerVlcWindow.Designer.cs&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;DependentUpon&amp;gt;InnerVlcWindow.cs&amp;lt;/DependentUpon&amp;gt;&lt;br /&gt;
    &amp;lt;/Compile&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;IPlayer.cs&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;NativeLibVlc.cs&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;Properties\AssemblyInfo.cs&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;VlcUserControl.cs&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;SubType&amp;gt;UserControl&amp;lt;/SubType&amp;gt;&lt;br /&gt;
    &amp;lt;/Compile&amp;gt;&lt;br /&gt;
    &amp;lt;Compile Include=&amp;quot;VlcUserControl.Designer.cs&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;DependentUpon&amp;gt;VlcUserControl.cs&amp;lt;/DependentUpon&amp;gt;&lt;br /&gt;
    &amp;lt;/Compile&amp;gt;&lt;br /&gt;
  &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
  &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;
    &amp;lt;EmbeddedResource Include=&amp;quot;VlcUserControl.resx&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;SubType&amp;gt;Designer&amp;lt;/SubType&amp;gt;&lt;br /&gt;
      &amp;lt;DependentUpon&amp;gt;VlcUserControl.cs&amp;lt;/DependentUpon&amp;gt;&lt;br /&gt;
    &amp;lt;/EmbeddedResource&amp;gt;&lt;br /&gt;
  &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;
  &amp;lt;Import Project=&amp;quot;$(MSBuildBinPath)\Microsoft.CSharp.targets&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;!-- To modify your build process, add your task inside one of the targets below and uncomment it. &lt;br /&gt;
       Other similar extension points exist, see Microsoft.Common.targets.&lt;br /&gt;
  &amp;lt;Target Name=&amp;quot;BeforeBuild&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;/Target&amp;gt;&lt;br /&gt;
  &amp;lt;Target Name=&amp;quot;AfterBuild&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;/Target&amp;gt;&lt;br /&gt;
  --&amp;gt;&lt;br /&gt;
&amp;lt;/Project&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=AssemblyInfo.cs&amp;diff=6949</id>
		<title>AssemblyInfo.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=AssemblyInfo.cs&amp;diff=6949"/>
		<updated>2007-01-01T01:39:11Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * AssemblyInfo.cs: VLanControl.dll assembly specification&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using System.Runtime.CompilerServices;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
&lt;br /&gt;
// General Information about an assembly is controlled through the following &lt;br /&gt;
// set of attributes. Change these attribute values to modify the information&lt;br /&gt;
// associated with an assembly.&lt;br /&gt;
[assembly: AssemblyTitle(&amp;quot;VLanControl&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyDescription(&amp;quot;&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyConfiguration(&amp;quot;&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyCompany(&amp;quot;&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyProduct(&amp;quot;VLanControl&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyCopyright(&amp;quot;Copyright ©  2006&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyTrademark(&amp;quot;&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyCulture(&amp;quot;&amp;quot;)]&lt;br /&gt;
&lt;br /&gt;
// Setting ComVisible to false makes the types in this assembly not visible &lt;br /&gt;
// to COM components.  If you need to access a type in this assembly from &lt;br /&gt;
// COM, set the ComVisible attribute to true on that type.&lt;br /&gt;
[assembly: ComVisible(false)]&lt;br /&gt;
&lt;br /&gt;
// The following GUID is for the ID of the typelib if this project is exposed to COM&lt;br /&gt;
[assembly: Guid(&amp;quot;918fbf83-6909-4d20-ab1c-ac617a7b420d&amp;quot;)]&lt;br /&gt;
&lt;br /&gt;
[assembly: CLSCompliant(true)]&lt;br /&gt;
&lt;br /&gt;
// Version information for an assembly consists of the following four values:&lt;br /&gt;
//&lt;br /&gt;
//      Major Version&lt;br /&gt;
//      Minor Version &lt;br /&gt;
//      Build Number&lt;br /&gt;
//      Revision&lt;br /&gt;
//&lt;br /&gt;
// You can specify all the values or you can default the Revision and Build Numbers &lt;br /&gt;
// by using the &#039;*&#039; as shown below:&lt;br /&gt;
[assembly: AssemblyVersion(&amp;quot;1.0.0.0&amp;quot;)]&lt;br /&gt;
[assembly: AssemblyFileVersion(&amp;quot;1.0.0.0&amp;quot;)]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=InnerVlcWindow.Designer.cs&amp;diff=6948</id>
		<title>InnerVlcWindow.Designer.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=InnerVlcWindow.Designer.cs&amp;diff=6948"/>
		<updated>2007-01-01T01:38:29Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * InnerVlcWindow.Designer.cs: InnerVlcWindow class definition&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
namespace VLanControl&lt;br /&gt;
{&lt;br /&gt;
	partial class InnerVlcWindow&lt;br /&gt;
	{&lt;br /&gt;
		/// &amp;lt;summary&amp;gt; &lt;br /&gt;
		/// Required designer variable.&lt;br /&gt;
		/// &amp;lt;/summary&amp;gt;&lt;br /&gt;
		private System.ComponentModel.IContainer components = null;&lt;br /&gt;
&lt;br /&gt;
		/// &amp;lt;summary&amp;gt; &lt;br /&gt;
		/// Clean up any resources being used.&lt;br /&gt;
		/// &amp;lt;/summary&amp;gt;&lt;br /&gt;
		/// &amp;lt;param name=&amp;quot;disposing&amp;quot;&amp;gt;true if managed resources should be disposed; otherwise, false.&amp;lt;/param&amp;gt;&lt;br /&gt;
		protected override void Dispose(bool disposing)&lt;br /&gt;
		{&lt;br /&gt;
			if(disposing &amp;amp;&amp;amp; (components != null))&lt;br /&gt;
			{&lt;br /&gt;
				components.Dispose();&lt;br /&gt;
			}&lt;br /&gt;
			base.Dispose(disposing);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		#region Component Designer generated code&lt;br /&gt;
&lt;br /&gt;
		/// &amp;lt;summary&amp;gt; &lt;br /&gt;
		/// Required method for Designer support - do not modify &lt;br /&gt;
		/// the contents of this method with the code editor.&lt;br /&gt;
		/// &amp;lt;/summary&amp;gt;&lt;br /&gt;
		private void InitializeComponent()&lt;br /&gt;
		{&lt;br /&gt;
			components = new System.ComponentModel.Container();&lt;br /&gt;
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		#endregion&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=InnerVlcWindow.cs&amp;diff=6947</id>
		<title>InnerVlcWindow.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=InnerVlcWindow.cs&amp;diff=6947"/>
		<updated>2007-01-01T01:38:02Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * InnerVlcWindow.cs: InnerVlcWindow class definition&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
&lt;br /&gt;
namespace VLanControl&lt;br /&gt;
{&lt;br /&gt;
	public partial class InnerVlcWindow : UserControl&lt;br /&gt;
	{&lt;br /&gt;
		public InnerVlcWindow()&lt;br /&gt;
		{&lt;br /&gt;
			InitializeComponent();&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VlcUserControl.resx&amp;diff=6946</id>
		<title>VlcUserControl.resx</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VlcUserControl.resx&amp;diff=6946"/>
		<updated>2007-01-01T01:37:36Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
  &amp;lt;!-- &lt;br /&gt;
	 * VlcUserControl.resx: VlcUserControl resource definition&lt;br /&gt;
	 *****************************************************************************&lt;br /&gt;
	 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
	 *&lt;br /&gt;
	 * Authors: Chris Meadowcroft&lt;br /&gt;
	 *&lt;br /&gt;
	 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
	 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
	 * the Free Software Foundation.&lt;br /&gt;
	 *&lt;br /&gt;
	 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
	 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
	 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
	 * GNU General Public License for more details.&lt;br /&gt;
	 *&lt;br /&gt;
	 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
	 * along with this program; if not, write to the Free Software&lt;br /&gt;
	 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
&lt;br /&gt;
	Microsoft ResX Schema &lt;br /&gt;
    &lt;br /&gt;
    Version 2.0&lt;br /&gt;
    &lt;br /&gt;
    The primary goals of this format is to allow a simple XML format &lt;br /&gt;
    that is mostly human readable. The generation and parsing of the &lt;br /&gt;
    various data types are done through the TypeConverter classes &lt;br /&gt;
    associated with the data types.&lt;br /&gt;
    &lt;br /&gt;
    Example:&lt;br /&gt;
    &lt;br /&gt;
    ... ado.net/XML headers &amp;amp; schema ...&lt;br /&gt;
    &amp;lt;resheader name=&amp;quot;resmimetype&amp;quot;&amp;gt;text/microsoft-resx&amp;lt;/resheader&amp;gt;&lt;br /&gt;
    &amp;lt;resheader name=&amp;quot;version&amp;quot;&amp;gt;2.0&amp;lt;/resheader&amp;gt;&lt;br /&gt;
    &amp;lt;resheader name=&amp;quot;reader&amp;quot;&amp;gt;System.Resources.ResXResourceReader, System.Windows.Forms, ...&amp;lt;/resheader&amp;gt;&lt;br /&gt;
    &amp;lt;resheader name=&amp;quot;writer&amp;quot;&amp;gt;System.Resources.ResXResourceWriter, System.Windows.Forms, ...&amp;lt;/resheader&amp;gt;&lt;br /&gt;
    &amp;lt;data name=&amp;quot;Name1&amp;quot;&amp;gt;&amp;lt;value&amp;gt;this is my long string&amp;lt;/value&amp;gt;&amp;lt;comment&amp;gt;this is a comment&amp;lt;/comment&amp;gt;&amp;lt;/data&amp;gt;&lt;br /&gt;
    &amp;lt;data name=&amp;quot;Color1&amp;quot; type=&amp;quot;System.Drawing.Color, System.Drawing&amp;quot;&amp;gt;Blue&amp;lt;/data&amp;gt;&lt;br /&gt;
    &amp;lt;data name=&amp;quot;Bitmap1&amp;quot; mimetype=&amp;quot;application/x-microsoft.net.object.binary.base64&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;value&amp;gt;[base64 mime encoded serialized .NET Framework object]&amp;lt;/value&amp;gt;&lt;br /&gt;
    &amp;lt;/data&amp;gt;&lt;br /&gt;
    &amp;lt;data name=&amp;quot;Icon1&amp;quot; type=&amp;quot;System.Drawing.Icon, System.Drawing&amp;quot; mimetype=&amp;quot;application/x-microsoft.net.object.bytearray.base64&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;value&amp;gt;[base64 mime encoded string representing a byte array form of the .NET Framework object]&amp;lt;/value&amp;gt;&lt;br /&gt;
        &amp;lt;comment&amp;gt;This is a comment&amp;lt;/comment&amp;gt;&lt;br /&gt;
    &amp;lt;/data&amp;gt;&lt;br /&gt;
                &lt;br /&gt;
    There are any number of &amp;quot;resheader&amp;quot; rows that contain simple &lt;br /&gt;
    name/value pairs.&lt;br /&gt;
    &lt;br /&gt;
    Each data row contains a name, and value. The row also contains a &lt;br /&gt;
    type or mimetype. Type corresponds to a .NET class that support &lt;br /&gt;
    text/value conversion through the TypeConverter architecture. &lt;br /&gt;
    Classes that don&#039;t support this are serialized and stored with the &lt;br /&gt;
    mimetype set.&lt;br /&gt;
    &lt;br /&gt;
    The mimetype is used for serialized objects, and tells the &lt;br /&gt;
    ResXResourceReader how to depersist the object. This is currently not &lt;br /&gt;
    extensible. For a given mimetype the value must be set accordingly:&lt;br /&gt;
    &lt;br /&gt;
    Note - application/x-microsoft.net.object.binary.base64 is the format &lt;br /&gt;
    that the ResXResourceWriter will generate, however the reader can &lt;br /&gt;
    read any of the formats listed below.&lt;br /&gt;
    &lt;br /&gt;
    mimetype: application/x-microsoft.net.object.binary.base64&lt;br /&gt;
    value   : The object must be serialized with &lt;br /&gt;
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter&lt;br /&gt;
            : and then encoded with base64 encoding.&lt;br /&gt;
    &lt;br /&gt;
    mimetype: application/x-microsoft.net.object.soap.base64&lt;br /&gt;
    value   : The object must be serialized with &lt;br /&gt;
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter&lt;br /&gt;
            : and then encoded with base64 encoding.&lt;br /&gt;
&lt;br /&gt;
    mimetype: application/x-microsoft.net.object.bytearray.base64&lt;br /&gt;
    value   : The object must be serialized into a byte array &lt;br /&gt;
            : using a System.ComponentModel.TypeConverter&lt;br /&gt;
            : and then encoded with base64 encoding.&lt;br /&gt;
    --&amp;gt;&lt;br /&gt;
  &amp;lt;xsd:schema id=&amp;quot;root&amp;quot; xmlns=&amp;quot;&amp;quot; xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:msdata=&amp;quot;urn:schemas-microsoft-com:xml-msdata&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:import namespace=&amp;quot;http://www.w3.org/XML/1998/namespace&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;xsd:element name=&amp;quot;root&amp;quot; msdata:IsDataSet=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;xsd:complexType&amp;gt;&lt;br /&gt;
        &amp;lt;xsd:choice maxOccurs=&amp;quot;unbounded&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;xsd:element name=&amp;quot;metadata&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;xsd:complexType&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:sequence&amp;gt;&lt;br /&gt;
                &amp;lt;xsd:element name=&amp;quot;value&amp;quot; type=&amp;quot;xsd:string&amp;quot; minOccurs=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
              &amp;lt;/xsd:sequence&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:attribute name=&amp;quot;name&amp;quot; use=&amp;quot;required&amp;quot; type=&amp;quot;xsd:string&amp;quot; /&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:attribute name=&amp;quot;type&amp;quot; type=&amp;quot;xsd:string&amp;quot; /&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:attribute name=&amp;quot;mimetype&amp;quot; type=&amp;quot;xsd:string&amp;quot; /&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:attribute ref=&amp;quot;xml:space&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
          &amp;lt;/xsd:element&amp;gt;&lt;br /&gt;
          &amp;lt;xsd:element name=&amp;quot;assembly&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;xsd:complexType&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:attribute name=&amp;quot;alias&amp;quot; type=&amp;quot;xsd:string&amp;quot; /&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:attribute name=&amp;quot;name&amp;quot; type=&amp;quot;xsd:string&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
          &amp;lt;/xsd:element&amp;gt;&lt;br /&gt;
          &amp;lt;xsd:element name=&amp;quot;data&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;xsd:complexType&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:sequence&amp;gt;&lt;br /&gt;
                &amp;lt;xsd:element name=&amp;quot;value&amp;quot; type=&amp;quot;xsd:string&amp;quot; minOccurs=&amp;quot;0&amp;quot; msdata:Ordinal=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;xsd:element name=&amp;quot;comment&amp;quot; type=&amp;quot;xsd:string&amp;quot; minOccurs=&amp;quot;0&amp;quot; msdata:Ordinal=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
              &amp;lt;/xsd:sequence&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:attribute name=&amp;quot;name&amp;quot; type=&amp;quot;xsd:string&amp;quot; use=&amp;quot;required&amp;quot; msdata:Ordinal=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:attribute name=&amp;quot;type&amp;quot; type=&amp;quot;xsd:string&amp;quot; msdata:Ordinal=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:attribute name=&amp;quot;mimetype&amp;quot; type=&amp;quot;xsd:string&amp;quot; msdata:Ordinal=&amp;quot;4&amp;quot; /&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:attribute ref=&amp;quot;xml:space&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
          &amp;lt;/xsd:element&amp;gt;&lt;br /&gt;
          &amp;lt;xsd:element name=&amp;quot;resheader&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;xsd:complexType&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:sequence&amp;gt;&lt;br /&gt;
                &amp;lt;xsd:element name=&amp;quot;value&amp;quot; type=&amp;quot;xsd:string&amp;quot; minOccurs=&amp;quot;0&amp;quot; msdata:Ordinal=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
              &amp;lt;/xsd:sequence&amp;gt;&lt;br /&gt;
              &amp;lt;xsd:attribute name=&amp;quot;name&amp;quot; type=&amp;quot;xsd:string&amp;quot; use=&amp;quot;required&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
          &amp;lt;/xsd:element&amp;gt;&lt;br /&gt;
        &amp;lt;/xsd:choice&amp;gt;&lt;br /&gt;
      &amp;lt;/xsd:complexType&amp;gt;&lt;br /&gt;
    &amp;lt;/xsd:element&amp;gt;&lt;br /&gt;
  &amp;lt;/xsd:schema&amp;gt;&lt;br /&gt;
  &amp;lt;resheader name=&amp;quot;resmimetype&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;value&amp;gt;text/microsoft-resx&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/resheader&amp;gt;&lt;br /&gt;
  &amp;lt;resheader name=&amp;quot;version&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;value&amp;gt;2.0&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/resheader&amp;gt;&lt;br /&gt;
  &amp;lt;resheader name=&amp;quot;reader&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;value&amp;gt;System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/resheader&amp;gt;&lt;br /&gt;
  &amp;lt;resheader name=&amp;quot;writer&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;value&amp;gt;System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;lt;/value&amp;gt;&lt;br /&gt;
  &amp;lt;/resheader&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6945</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6945"/>
		<updated>2007-01-01T01:36:26Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6944</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6944"/>
		<updated>2007-01-01T01:36:05Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Work from Tappen and Odyssee on the forum.&lt;br /&gt;
&lt;br /&gt;
I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
Tappen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VlcUserControl.Designer.cs&amp;diff=6943</id>
		<title>VlcUserControl.Designer.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VlcUserControl.Designer.cs&amp;diff=6943"/>
		<updated>2007-01-01T01:34:37Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * VlcUserControl.cs: VlcUserControl partial class definition&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
namespace VLanControl&lt;br /&gt;
{&lt;br /&gt;
	partial class VlcUserControl&lt;br /&gt;
	{&lt;br /&gt;
		/// &amp;lt;summary&amp;gt; &lt;br /&gt;
		/// Required designer variable.&lt;br /&gt;
		/// &amp;lt;/summary&amp;gt;&lt;br /&gt;
		private System.ComponentModel.IContainer components = null;&lt;br /&gt;
&lt;br /&gt;
		/// &amp;lt;summary&amp;gt; &lt;br /&gt;
		/// Clean up any resources being used.&lt;br /&gt;
		/// &amp;lt;/summary&amp;gt;&lt;br /&gt;
		/// &amp;lt;param name=&amp;quot;disposing&amp;quot;&amp;gt;true if managed resources should be disposed; otherwise, false.&amp;lt;/param&amp;gt;&lt;br /&gt;
		protected override void Dispose(bool disposing)&lt;br /&gt;
		{&lt;br /&gt;
			if(disposing)&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.Dispose();&lt;br /&gt;
				if(components != null)&lt;br /&gt;
				{&lt;br /&gt;
					components.Dispose();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			base.Dispose(disposing);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		#region Component Designer generated code&lt;br /&gt;
&lt;br /&gt;
		/// &amp;lt;summary&amp;gt; &lt;br /&gt;
		/// Required method for Designer support - do not modify &lt;br /&gt;
		/// the contents of this method with the code editor.&lt;br /&gt;
		/// &amp;lt;/summary&amp;gt;&lt;br /&gt;
		private void InitializeComponent()&lt;br /&gt;
		{&lt;br /&gt;
			this.innerVlc = new VLanControl.InnerVlcWindow();&lt;br /&gt;
			this.topBlocker = new System.Windows.Forms.Panel();&lt;br /&gt;
			this.leftBlocker = new System.Windows.Forms.Panel();&lt;br /&gt;
			this.rightBlocker = new System.Windows.Forms.Panel();&lt;br /&gt;
			this.bottomBlocker = new System.Windows.Forms.Panel();&lt;br /&gt;
			this.SuspendLayout();&lt;br /&gt;
			// &lt;br /&gt;
			// innerVlc&lt;br /&gt;
			// &lt;br /&gt;
			this.innerVlc.Location = new System.Drawing.Point(31, 36);&lt;br /&gt;
			this.innerVlc.Name = &amp;quot;innerVlc&amp;quot;;&lt;br /&gt;
			this.innerVlc.Size = new System.Drawing.Size(82, 64);&lt;br /&gt;
			this.innerVlc.TabIndex = 0;&lt;br /&gt;
			// &lt;br /&gt;
			// topBlocker&lt;br /&gt;
			// &lt;br /&gt;
			this.topBlocker.Location = new System.Drawing.Point(26, 10);&lt;br /&gt;
			this.topBlocker.Name = &amp;quot;topBlocker&amp;quot;;&lt;br /&gt;
			this.topBlocker.Size = new System.Drawing.Size(100, 17);&lt;br /&gt;
			this.topBlocker.TabIndex = 1;&lt;br /&gt;
			this.topBlocker.Visible = false;&lt;br /&gt;
			// &lt;br /&gt;
			// leftBlocker&lt;br /&gt;
			// &lt;br /&gt;
			this.leftBlocker.Location = new System.Drawing.Point(8, 33);&lt;br /&gt;
			this.leftBlocker.Name = &amp;quot;leftBlocker&amp;quot;;&lt;br /&gt;
			this.leftBlocker.Size = new System.Drawing.Size(18, 83);&lt;br /&gt;
			this.leftBlocker.TabIndex = 2;&lt;br /&gt;
			this.leftBlocker.Visible = false;&lt;br /&gt;
			// &lt;br /&gt;
			// rightBlocker&lt;br /&gt;
			// &lt;br /&gt;
			this.rightBlocker.Location = new System.Drawing.Point(126, 29);&lt;br /&gt;
			this.rightBlocker.Name = &amp;quot;rightBlocker&amp;quot;;&lt;br /&gt;
			this.rightBlocker.Size = new System.Drawing.Size(18, 78);&lt;br /&gt;
			this.rightBlocker.TabIndex = 2;&lt;br /&gt;
			this.rightBlocker.Visible = false;&lt;br /&gt;
			// &lt;br /&gt;
			// bottomBlocker&lt;br /&gt;
			// &lt;br /&gt;
			this.bottomBlocker.Location = new System.Drawing.Point(30, 118);&lt;br /&gt;
			this.bottomBlocker.Name = &amp;quot;bottomBlocker&amp;quot;;&lt;br /&gt;
			this.bottomBlocker.Size = new System.Drawing.Size(100, 17);&lt;br /&gt;
			this.bottomBlocker.TabIndex = 2;&lt;br /&gt;
			this.bottomBlocker.Visible = false;&lt;br /&gt;
			// &lt;br /&gt;
			// VlcUserControl&lt;br /&gt;
			// &lt;br /&gt;
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);&lt;br /&gt;
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;&lt;br /&gt;
			this.Controls.Add(this.rightBlocker);&lt;br /&gt;
			this.Controls.Add(this.leftBlocker);&lt;br /&gt;
			this.Controls.Add(this.bottomBlocker);&lt;br /&gt;
			this.Controls.Add(this.topBlocker);&lt;br /&gt;
			this.Controls.Add(this.innerVlc);&lt;br /&gt;
			this.Name = &amp;quot;VlcUserControl&amp;quot;;&lt;br /&gt;
			this.Resize += new System.EventHandler(this.VlcUserControl_Resize);&lt;br /&gt;
			this.ResumeLayout(false);&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
		private InnerVlcWindow innerVlc;&lt;br /&gt;
		private System.Windows.Forms.Panel topBlocker;&lt;br /&gt;
		private System.Windows.Forms.Panel leftBlocker;&lt;br /&gt;
		private System.Windows.Forms.Panel rightBlocker;&lt;br /&gt;
		private System.Windows.Forms.Panel bottomBlocker;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VlcUserControl.cs&amp;diff=6942</id>
		<title>VlcUserControl.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VlcUserControl.cs&amp;diff=6942"/>
		<updated>2007-01-01T01:33:48Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * VlcUserControl.cs: VlcUserControl partial class definition&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ComponentModel;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Diagnostics;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
&lt;br /&gt;
namespace VLanControl&lt;br /&gt;
{&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	[ClassInterface(ClassInterfaceType.None)]&lt;br /&gt;
	public partial class VlcUserControl : UserControl, IPlayer2&lt;br /&gt;
	{&lt;br /&gt;
		private bool isPaused;&lt;br /&gt;
		private NativeLibVlc nativeVlc = new NativeLibVlc();&lt;br /&gt;
		private bool useMpegVbrOffset;&lt;br /&gt;
		private bool usingPausedPosition;&lt;br /&gt;
		private int pausedTime;&lt;br /&gt;
		private double pausedPosition;&lt;br /&gt;
		private int shuttleSeconds;&lt;br /&gt;
		private bool useVlcCrop = false;&lt;br /&gt;
		private int cropTop;&lt;br /&gt;
		private int cropBottom;&lt;br /&gt;
		private int cropLeft;&lt;br /&gt;
		private int cropRight;&lt;br /&gt;
&lt;br /&gt;
		const long SavingPostionTimespan = 5000000L;	// .5 seconds in ticks&lt;br /&gt;
&lt;br /&gt;
		public VlcUserControl()&lt;br /&gt;
		{&lt;br /&gt;
			InitializeComponent();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		protected override void OnLoad(EventArgs e)&lt;br /&gt;
		{&lt;br /&gt;
			base.OnLoad(e);&lt;br /&gt;
			this.nativeVlc.Initialize();&lt;br /&gt;
			this.innerVlc.Bounds = this.ClientRectangle;&lt;br /&gt;
			this.nativeVlc.VideoOutput = this.innerVlc;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void DisplayMessage(String message)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.ShowMessage(message);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public Size VideoSize&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.VideoSize;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PrecomputeCrop(Size videoSize, int cropLeft, int cropRight, int cropTop, int cropBottom)&lt;br /&gt;
		{&lt;br /&gt;
			this.cropTop = cropTop;&lt;br /&gt;
			this.cropBottom = cropBottom;&lt;br /&gt;
			this.cropLeft = cropLeft;&lt;br /&gt;
			this.cropRight = cropRight;&lt;br /&gt;
			ComputeCrop(videoSize);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool ComputeCrop()&lt;br /&gt;
		{&lt;br /&gt;
			if(!this.useVlcCrop &amp;amp;&amp;amp; this.IsHandleCreated &amp;amp;&amp;amp; (this.nativeVlc.VideoOutput != null) &amp;amp;&amp;amp; &lt;br /&gt;
				(this.State != PlayerState.None))&lt;br /&gt;
			{&lt;br /&gt;
				Size vidSize = this.nativeVlc.VideoSize;&lt;br /&gt;
				if(!vidSize.IsEmpty)&lt;br /&gt;
				{&lt;br /&gt;
					ComputeCrop(this.nativeVlc.VideoSize);&lt;br /&gt;
					return true;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			return false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void ComputeCrop(Size videoSize)&lt;br /&gt;
		{&lt;br /&gt;
			Size mySize = ClientSize;&lt;br /&gt;
			Debug.WriteLine(&amp;quot;Video Sizes = &amp;quot; + videoSize.ToString() + &amp;quot;, &amp;quot; + mySize.ToString());&lt;br /&gt;
			this.topBlocker.Visible = false;&lt;br /&gt;
			this.bottomBlocker.Visible = false;&lt;br /&gt;
			this.leftBlocker.Visible = false;&lt;br /&gt;
			this.rightBlocker.Visible = false;&lt;br /&gt;
&lt;br /&gt;
			double myAspect = Convert.ToDouble(mySize.Width) / Convert.ToDouble(mySize.Height);&lt;br /&gt;
			if((this.cropTop == 0) &amp;amp;&amp;amp; (this.cropBottom == 0) &amp;amp;&amp;amp; (this.cropLeft == 0) &amp;amp;&amp;amp; (this.cropRight == 0))&lt;br /&gt;
			{&lt;br /&gt;
				double vlcAspect = Convert.ToDouble(videoSize.Width) / Convert.ToDouble(videoSize.Height);&lt;br /&gt;
				if(vlcAspect &amp;gt; myAspect)&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the top and bottom&lt;br /&gt;
					int perfectHeight = Convert.ToInt32(mySize.Width / vlcAspect);&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point(0, (mySize.Height - perfectHeight) / 2),&lt;br /&gt;
						new Size(mySize.Width, perfectHeight));&lt;br /&gt;
					Debug.WriteLine(&amp;quot;vlcAspect &amp;gt; myAspect &amp;quot; + this.innerVlc.Bounds.ToString());&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the left and right&lt;br /&gt;
					int perfectWidth = Convert.ToInt32(mySize.Height * vlcAspect);&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point((mySize.Width - perfectWidth) / 2, 0),&lt;br /&gt;
						new Size(perfectWidth, mySize.Height));&lt;br /&gt;
					Debug.WriteLine(&amp;quot;vlcAspect &amp;lt; myAspect &amp;quot; + this.innerVlc.Bounds.ToString());&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				double realVlcAspect = Convert.ToDouble(videoSize.Width - this.cropRight - this.cropLeft) / &lt;br /&gt;
					Convert.ToDouble(videoSize.Height - this.cropTop - this.cropBottom);&lt;br /&gt;
				if(realVlcAspect &amp;gt; myAspect)&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the top and bottom, and possible blocking panels&lt;br /&gt;
					// first, position and size the innerVlc as if there was no top or bottom cropping&lt;br /&gt;
					int videoPixelWidth = videoSize.Width - this.cropRight - this.cropLeft;&lt;br /&gt;
					double fakeVlcAspect = Convert.ToDouble(videoPixelWidth) / Convert.ToDouble(videoSize.Height);&lt;br /&gt;
					int perfectHeight = Convert.ToInt32(mySize.Width / fakeVlcAspect);&lt;br /&gt;
&lt;br /&gt;
					double widthScaling = Convert.ToDouble(mySize.Width) / Convert.ToDouble(videoPixelWidth);&lt;br /&gt;
					int innerVlcLeft = -Convert.ToInt32(Convert.ToDouble(this.cropLeft) * widthScaling);&lt;br /&gt;
					int innerVlcWidth = Convert.ToInt32(Convert.ToDouble(videoSize.Width) * widthScaling);&lt;br /&gt;
&lt;br /&gt;
					int videoTop = (mySize.Height - perfectHeight) / 2;&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point(innerVlcLeft, videoTop),&lt;br /&gt;
						new Size(innerVlcWidth, perfectHeight));&lt;br /&gt;
&lt;br /&gt;
					// then, add blocking panels if necessary for the top and bottom cropping&lt;br /&gt;
					if(this.cropTop != 0)&lt;br /&gt;
					{&lt;br /&gt;
						double heightScaling = Convert.ToDouble(perfectHeight) / Convert.ToDouble(videoSize.Height);&lt;br /&gt;
						int blockerHeight = Convert.ToInt32(Convert.ToDouble(this.cropTop) * heightScaling);&lt;br /&gt;
						this.topBlocker.Bounds = new Rectangle(&lt;br /&gt;
							new Point(0, videoTop), &lt;br /&gt;
							new Size(mySize.Width, blockerHeight));&lt;br /&gt;
						this.topBlocker.Visible = true;&lt;br /&gt;
					}&lt;br /&gt;
					if(this.cropBottom != 0)&lt;br /&gt;
					{&lt;br /&gt;
						double heightScaling = Convert.ToDouble(perfectHeight) / Convert.ToDouble(videoSize.Height);&lt;br /&gt;
						int blockerHeight = Convert.ToInt32(Convert.ToDouble(this.cropBottom) * heightScaling);&lt;br /&gt;
						this.bottomBlocker.Bounds = new Rectangle(&lt;br /&gt;
							new Point(0, mySize.Height - videoTop - blockerHeight),&lt;br /&gt;
							new Size(mySize.Width, blockerHeight));&lt;br /&gt;
						this.bottomBlocker.Visible = true;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					// gray borders on the left and right, and possible blocking panels&lt;br /&gt;
					// first, position and size the innerVlc as if there was no left or right cropping&lt;br /&gt;
					int videoPixelHeight = videoSize.Height - this.cropBottom - this.cropTop;&lt;br /&gt;
					double fakeVlcAspect = Convert.ToDouble(videoSize.Width) / Convert.ToDouble(videoPixelHeight);&lt;br /&gt;
					int perfectWidth = Convert.ToInt32(mySize.Height * fakeVlcAspect);&lt;br /&gt;
&lt;br /&gt;
					double heightScaling = Convert.ToDouble(mySize.Height) / Convert.ToDouble(videoPixelHeight);&lt;br /&gt;
					int innerVlcTop = -Convert.ToInt32(Convert.ToDouble(this.cropTop) * heightScaling);&lt;br /&gt;
					int innerVlcHeight = Convert.ToInt32(Convert.ToDouble(videoSize.Height) * heightScaling);&lt;br /&gt;
&lt;br /&gt;
					int videoWidth = (mySize.Width - perfectWidth) / 2;&lt;br /&gt;
					this.innerVlc.Bounds = new Rectangle(new Point(videoWidth, innerVlcTop),&lt;br /&gt;
						new Size(perfectWidth, innerVlcHeight));&lt;br /&gt;
&lt;br /&gt;
					// then, add blocking panels if necessary for the left and right cropping&lt;br /&gt;
					if(this.cropLeft != 0)&lt;br /&gt;
					{&lt;br /&gt;
						double widthScaling = Convert.ToDouble(perfectWidth) / Convert.ToDouble(videoSize.Width);&lt;br /&gt;
						int blockerWidth = Convert.ToInt32(Convert.ToDouble(this.cropLeft) * widthScaling);&lt;br /&gt;
						this.leftBlocker.Bounds = new Rectangle(&lt;br /&gt;
							new Point(videoWidth, 0),&lt;br /&gt;
							new Size(blockerWidth, mySize.Height));&lt;br /&gt;
						this.leftBlocker.Visible = true;&lt;br /&gt;
					}&lt;br /&gt;
					if(this.cropRight != 0)&lt;br /&gt;
					{&lt;br /&gt;
						double widthScaling = Convert.ToDouble(perfectWidth) / Convert.ToDouble(videoSize.Width);&lt;br /&gt;
						int blockerWidth = Convert.ToInt32(Convert.ToDouble(this.cropRight) * widthScaling);&lt;br /&gt;
						this.rightBlocker.Bounds = new Rectangle(&lt;br /&gt;
							new Point(mySize.Width - videoWidth - blockerWidth, 0),&lt;br /&gt;
							new Size(blockerWidth, mySize.Height));&lt;br /&gt;
						this.rightBlocker.Visible = true;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool SetConfigVariable(String name, String value)&lt;br /&gt;
		{&lt;br /&gt;
			return this.nativeVlc.SetConfigVariable(name, value) == VlcError.Success;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Time&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.Time;&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception)&lt;br /&gt;
				{&lt;br /&gt;
					return 0;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public double Position&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.Position;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void MoveToPosition(TrackPosition newTrackPosition)&lt;br /&gt;
		{&lt;br /&gt;
			if((newTrackPosition.position &amp;gt;= 0.0d) &amp;amp;&amp;amp; (newTrackPosition.position &amp;lt; 1.0d))&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.Position = newTrackPosition.position;&lt;br /&gt;
				if(this.IsPaused)&lt;br /&gt;
				{&lt;br /&gt;
					this.usingPausedPosition = true;&lt;br /&gt;
					this.pausedTime = newTrackPosition.time;&lt;br /&gt;
					this.pausedPosition = newTrackPosition.position;&lt;br /&gt;
					this.shuttleSeconds = 0;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private TrackPosition CalculateShuttle(int origTime, double origPosition, int offsetSeconds)&lt;br /&gt;
		{&lt;br /&gt;
			int newTime = origTime + offsetSeconds;&lt;br /&gt;
&lt;br /&gt;
			double positionPerTime;&lt;br /&gt;
			if(origPosition &amp;gt; .5d)&lt;br /&gt;
			{&lt;br /&gt;
				positionPerTime = origPosition / Convert.ToDouble(origTime);&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				positionPerTime = (1.0d - origPosition) / &lt;br /&gt;
					Convert.ToDouble(this.nativeVlc.Length - origTime);&lt;br /&gt;
			}&lt;br /&gt;
			double newPosition = origPosition + Convert.ToDouble(offsetSeconds) * positionPerTime;&lt;br /&gt;
&lt;br /&gt;
			Debug.WriteLine(String.Format(&amp;quot;CalculateShuttle time={0} pos={1}&amp;quot;, newTime, newPosition));&lt;br /&gt;
&lt;br /&gt;
			return new TrackPosition(newTime, newPosition);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public TrackPosition Shuttle(int offsetSeconds)&lt;br /&gt;
		{&lt;br /&gt;
			if(!this.IsPaused)&lt;br /&gt;
			{&lt;br /&gt;
				TrackPosition newPosition = CalculateShuttle(this.nativeVlc.Time, this.nativeVlc.Position,&lt;br /&gt;
					offsetSeconds);&lt;br /&gt;
				if(this.useMpegVbrOffset)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Position = newPosition.position;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Time = newPosition.time;&lt;br /&gt;
				}&lt;br /&gt;
				return newPosition;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			if(!this.usingPausedPosition)&lt;br /&gt;
			{&lt;br /&gt;
				this.usingPausedPosition = true;&lt;br /&gt;
				this.pausedTime = this.nativeVlc.Time;&lt;br /&gt;
				this.pausedPosition = this.nativeVlc.Position;&lt;br /&gt;
				this.shuttleSeconds = 0;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			this.shuttleSeconds += offsetSeconds;&lt;br /&gt;
			return CalculateShuttle(this.pausedTime, this.pausedPosition, this.shuttleSeconds);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Volume&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.Volume;&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.Volume = value;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		const int MinRate = -2;&lt;br /&gt;
		const int MaxRate = 2;&lt;br /&gt;
		const int NormalRate = 0;&lt;br /&gt;
&lt;br /&gt;
		public void GetRates(out int minRate, out int maxRate, out int normalRate)&lt;br /&gt;
		{&lt;br /&gt;
			minRate = MinRate;&lt;br /&gt;
			maxRate = MaxRate;&lt;br /&gt;
			normalRate = NormalRate;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Rate&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				// 1000 is normal, 2000 is half speed, 500 is double speed, etc.&lt;br /&gt;
				int bigRate = this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;rate&amp;quot;, 1000);&lt;br /&gt;
				if(bigRate &amp;gt; 3000)&lt;br /&gt;
				{&lt;br /&gt;
					return -2;&lt;br /&gt;
				}&lt;br /&gt;
				if(bigRate &amp;gt; 1500)&lt;br /&gt;
				{&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
				if(bigRate &amp;gt; 750)&lt;br /&gt;
				{&lt;br /&gt;
					return 0;&lt;br /&gt;
				}&lt;br /&gt;
				if(bigRate &amp;gt; 400)&lt;br /&gt;
				{&lt;br /&gt;
					return 1;&lt;br /&gt;
				}&lt;br /&gt;
				return 2;&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				int newRate = NormalRate;&lt;br /&gt;
				switch(value)&lt;br /&gt;
				{&lt;br /&gt;
				case 2:&lt;br /&gt;
					newRate = 250;&lt;br /&gt;
					break;&lt;br /&gt;
				case 1:&lt;br /&gt;
					newRate = 500;&lt;br /&gt;
					break;&lt;br /&gt;
				case 0:&lt;br /&gt;
					newRate = 1000;&lt;br /&gt;
					break;&lt;br /&gt;
				case -1:&lt;br /&gt;
					newRate = 2000;&lt;br /&gt;
					break;&lt;br /&gt;
				case -2:&lt;br /&gt;
					newRate = 4000;&lt;br /&gt;
					break;&lt;br /&gt;
				default:&lt;br /&gt;
					throw new ArgumentOutOfRangeException();&lt;br /&gt;
				}&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;rate&amp;quot;, newRate);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Length&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.Length;&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception)&lt;br /&gt;
				{&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetArtificialLength(value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public double TimeScaling&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.nativeVlc.TimeScaling; }&lt;br /&gt;
			set { this.nativeVlc.TimeScaling = value; }&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public PlayerState State&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				int state = this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &lt;br /&gt;
					&amp;quot;state&amp;quot;, (int)InputState.INIT_S);&lt;br /&gt;
				switch((InputState)state)&lt;br /&gt;
				{&lt;br /&gt;
				case InputState.PAUSE_S:&lt;br /&gt;
					return PlayerState.Paused;&lt;br /&gt;
				case InputState.PLAYING_S:&lt;br /&gt;
					return PlayerState.Playing;&lt;br /&gt;
				default:&lt;br /&gt;
					return PlayerState.None;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool IsPlaying { get { return this.State == PlayerState.Playing; } }&lt;br /&gt;
&lt;br /&gt;
		public bool IsPaused { get { return this.State == PlayerState.Paused; } }&lt;br /&gt;
&lt;br /&gt;
		public bool IsMute { get { return (this.nativeVlc.Volume == 0); } }&lt;br /&gt;
&lt;br /&gt;
		public void ToggleMute()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.ToggleVolumeMute();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void DeinterlaceModes(out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;deinterlace&amp;quot;, out choices, out choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String DeinterlaceMode&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;deinterlace&amp;quot;, String.Empty);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;deinterlace&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void AspectRatios(out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;aspect-ratio&amp;quot;, out choices, out choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String AspectRatio&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;aspect-ratio&amp;quot;, String.Empty);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;aspect-ratio&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropModes(out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_VOUT,&lt;br /&gt;
				&amp;quot;crop&amp;quot;, out choices, out choiceText);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String CropMode &lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop&amp;quot;, String.Empty);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectString(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int CroppingLeft&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-left&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropLeft;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-left&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropLeft = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int CroppingRight&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-right&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropRight;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-right&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropRight = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int CroppingTop&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-top&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropTop;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-top&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropTop = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int CroppingBottom&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-bottom&amp;quot;, 0);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return this.cropBottom;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.useVlcCrop)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_VOUT, &amp;quot;crop-bottom&amp;quot;, value);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.cropBottom = value;&lt;br /&gt;
					ComputeCrop();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void AudioTracks(out int[] trackIds, out String[] trackNames)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;audio-es&amp;quot;, out trackIds, out trackNames);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int AudioTrack&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-es&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-es&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void SubTitleTracks(out int[] trackIds, out String[] trackNames)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;spu-es&amp;quot;, out trackIds, out trackNames);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int SubTitleTrack&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-es&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-es&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void Programs(out int[] trackIds, out String[] trackNames)&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
				&amp;quot;program&amp;quot;, out trackIds, out trackNames);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Program&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;program&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;program&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateCropModes()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-crop&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int AudioDelay&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				long delay = this.nativeVlc.GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-delay&amp;quot;, 0L);&lt;br /&gt;
				return Convert.ToInt32(delay / 1000L);&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				long delay = Convert.ToInt64(value) * 1000L;&lt;br /&gt;
				this.nativeVlc.SetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;audio-delay&amp;quot;, delay);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int SubTitleDelay&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				long delay = this.nativeVlc.GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-delay&amp;quot;, 0L);&lt;br /&gt;
				return Convert.ToInt32(delay / 1000L);&lt;br /&gt;
&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				long delay = Convert.ToInt64(value) * 1000L;&lt;br /&gt;
				this.nativeVlc.SetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;spu-delay&amp;quot;, delay);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int ChapterCount&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				int[] chapterIds;&lt;br /&gt;
				String[] chapterText;&lt;br /&gt;
				this.nativeVlc.GetVlcVariableChoiceList(ObjectType.VLC_OBJECT_INPUT,&lt;br /&gt;
					&amp;quot;chapter&amp;quot;, out chapterIds, out chapterText);&lt;br /&gt;
				return (chapterIds.Length &amp;gt; 0) ? chapterIds.Length - 1 : 0;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int Chapter&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				return this.nativeVlc.GetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;chapter&amp;quot;, -1);&lt;br /&gt;
			}&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.SetVlcObjectInt(ObjectType.VLC_OBJECT_INPUT, &amp;quot;chapter&amp;quot;, value);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void RepositionAfterPause()&lt;br /&gt;
		{&lt;br /&gt;
			if(this.usingPausedPosition &amp;amp;&amp;amp; (this.shuttleSeconds != 0))&lt;br /&gt;
			{&lt;br /&gt;
				TrackPosition newPosition = CalculateShuttle(this.pausedTime, this.pausedPosition,&lt;br /&gt;
					this.shuttleSeconds);&lt;br /&gt;
				if(this.useMpegVbrOffset)&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Position = newPosition.position;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					this.nativeVlc.Time = newPosition.time;&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void Play()&lt;br /&gt;
		{&lt;br /&gt;
			this.isPaused = false;&lt;br /&gt;
			this.nativeVlc.Play();&lt;br /&gt;
			RepositionAfterPause();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void ClearPlayList()&lt;br /&gt;
		{&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			//Debug.WriteLine(&amp;quot;ClearPlayList&amp;quot;);&lt;br /&gt;
			this.nativeVlc.PlaylistClear();&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int AddToPlayList(String fileName, String title, String[] options)&lt;br /&gt;
		{&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			int index = 0;&lt;br /&gt;
			this.nativeVlc.AddTarget(fileName, options, ref index);&lt;br /&gt;
			Debug.WriteLine(&amp;quot;Added to Playlist &amp;quot; + fileName);&lt;br /&gt;
			Debug.WriteLine(&amp;quot;index = &amp;quot; + index.ToString());&lt;br /&gt;
			return index;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PlayItem(int itemId)&lt;br /&gt;
		{&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			this.isPaused = false;&lt;br /&gt;
&lt;br /&gt;
			int currentIndex = this.nativeVlc.PlaylistIndex;&lt;br /&gt;
			Debug.WriteLine(&amp;quot;PlayItem index = &amp;quot; + itemId.ToString(), &amp;quot; currentIndex = &amp;quot; + currentIndex.ToString());&lt;br /&gt;
			if(currentIndex &amp;lt; 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.nativeVlc.Play();&lt;br /&gt;
			}&lt;br /&gt;
			else&lt;br /&gt;
			{&lt;br /&gt;
				//this.nativeVlc.PlaylistPrevious();&lt;br /&gt;
				this.nativeVlc.Play(itemId);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void Stop()&lt;br /&gt;
		{&lt;br /&gt;
			this.usingPausedPosition = false;&lt;br /&gt;
			this.nativeVlc.Stop();&lt;br /&gt;
			this.isPaused = false;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void TogglePause()&lt;br /&gt;
		{&lt;br /&gt;
			bool wasPaused = this.IsPaused;&lt;br /&gt;
			this.nativeVlc.Pause();&lt;br /&gt;
			if(wasPaused)&lt;br /&gt;
			{&lt;br /&gt;
				RepositionAfterPause();&lt;br /&gt;
			}&lt;br /&gt;
			this.isPaused = !wasPaused;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateSubtitles()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-subtitle-track&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateAudioTrack()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-audio-track&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateDeinterlaceMode()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-deinterlace&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void RotateAspectRatio()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-aspect-ratio&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropTop()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-top&amp;quot;);&lt;br /&gt;
			this.CroppingTop = this.CroppingTop + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropTop()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-top&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingTop - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingTop = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropBottom()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-bottom&amp;quot;);&lt;br /&gt;
			this.CroppingBottom = this.CroppingBottom + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropBottom()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-bottom&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingBottom - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingBottom = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropLeft()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-left&amp;quot;);&lt;br /&gt;
			this.CroppingLeft = this.CroppingLeft + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropLeft()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-left&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingLeft - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingLeft = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void CropRight()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-crop-right&amp;quot;);&lt;br /&gt;
			this.CroppingRight = this.CroppingRight + 1;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void UnCropRight()&lt;br /&gt;
		{&lt;br /&gt;
			//this.nativeVlc.PressKey(&amp;quot;key-uncrop-right&amp;quot;);&lt;br /&gt;
			int crop = this.CroppingRight - 1;&lt;br /&gt;
			if(crop &amp;gt;= 0)&lt;br /&gt;
			{&lt;br /&gt;
				this.CroppingRight = crop;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public bool UseMpegVbrOffset&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.useMpegVbrOffset; }&lt;br /&gt;
			set { this.useMpegVbrOffset = value; }&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void NextDvdTrack()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-title-next&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PreviousDvdTrack()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-title-prev&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void NextDvdChapter()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-chapter-next&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public void PreviousDvdChapter()&lt;br /&gt;
		{&lt;br /&gt;
			this.nativeVlc.PressKey(&amp;quot;key-chapter-prev&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private void VlcUserControl_Resize(object sender, EventArgs e)&lt;br /&gt;
		{&lt;br /&gt;
			if(!ComputeCrop())&lt;br /&gt;
			{&lt;br /&gt;
				this.innerVlc.Bounds = this.ClientRectangle;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6941</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6941"/>
		<updated>2007-01-01T01:31:35Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Work from Tappen and Odyssee on the forum.&lt;br /&gt;
&lt;br /&gt;
I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.cs]] contains the non-designer part of the VlcUserControl class, derived from System.Windows.Forms.UserControl, which can be used either directly on C# forms, or as an ActiveX control if wrapped and registered in a dll.  VlcUserControl acts mostly as a wrapper for the [[NativeLibVlc.cs]] functions, but also has a few complications such as allowing multiple playback position moves in quick succession or when paused, since VLC, as an asynchronous player, will not return the correct position for a significant part of a second after a move.  VlcUserControl also handles (optionally, default is on, variable bool useVlcCrop) cropping instead of using the VLC cropping feature, (see InnerVlcWindow.cs comment below for explanation).  Thirdly, VlcUserControl attempts to minimize the inaccuracy of moving by timestamp in Mpeg-2 files since VLC doesn&#039;t do this well (optional, default is off, variable bool useMpegVbrOffset).&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.Designer.cs]] contains the designer part of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[VlcUserControl.resx]] contains the layout and resource definition of the VlcUserControl class.&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.cs]] is an essentially empty class.  One instance is created as a child window by each VlcUserControl class instance where VLC will actually draw the video.  This allows VlcUserControl to act as a &amp;quot;viewport&amp;quot; and crop the VLC output since the cropping filter of VLC leaves something to be desired when used in a player application (it can&#039;t co-exist with DeInterlace filters most importantly).&lt;br /&gt;
&lt;br /&gt;
[[InnerVlcWindow.Designer.cs]] contains the designer part of the InnerVlcWindow class.&lt;br /&gt;
&lt;br /&gt;
[[AssemblyInfo.cs]] is an optional file containing sample assembly information if the above classes are placed in a separate dll module in your code hierarchy.  As usual in .Net 2.0 projects, it should be placed in a sub-directory named &amp;quot;Properties&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[VLanControl.csproj]] is an optional project file for all the above files.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=NativeLibVlc.cs&amp;diff=6940</id>
		<title>NativeLibVlc.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=NativeLibVlc.cs&amp;diff=6940"/>
		<updated>2007-01-01T01:09:34Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * NativeLibVlc.cs: NativeLibVlc class definition&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Diagnostics;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using Microsoft.Win32;&lt;br /&gt;
&lt;br /&gt;
namespace VLanControl&lt;br /&gt;
{&lt;br /&gt;
	internal enum ObjectType : int&lt;br /&gt;
	{&lt;br /&gt;
		VLC_OBJECT_ROOT = (-1),&lt;br /&gt;
		VLC_OBJECT_VLC = (-2),&lt;br /&gt;
		VLC_OBJECT_MODULE = (-3),&lt;br /&gt;
		VLC_OBJECT_INTF = (-4),&lt;br /&gt;
		VLC_OBJECT_PLAYLIST = (-5),&lt;br /&gt;
		VLC_OBJECT_ITEM = (-6),&lt;br /&gt;
		VLC_OBJECT_INPUT = (-7),&lt;br /&gt;
		VLC_OBJECT_DECODER = (-8),&lt;br /&gt;
		VLC_OBJECT_VOUT = (-9),&lt;br /&gt;
		VLC_OBJECT_AOUT = (-10),&lt;br /&gt;
		VLC_OBJECT_SOUT = (-11),&lt;br /&gt;
		VLC_OBJECT_HTTPD = (-12),&lt;br /&gt;
		VLC_OBJECT_PACKETIZER = (-13),&lt;br /&gt;
		VLC_OBJECT_ENCODER = (-14),&lt;br /&gt;
		VLC_OBJECT_DIALOGS = (-15),&lt;br /&gt;
		VLC_OBJECT_VLM = (-16),&lt;br /&gt;
		VLC_OBJECT_ANNOUNCE = (-17),&lt;br /&gt;
		VLC_OBJECT_DEMUX = (-18),&lt;br /&gt;
		VLC_OBJECT_ACCESS = (-19),&lt;br /&gt;
		VLC_OBJECT_STREAM = (-20),&lt;br /&gt;
		VLC_OBJECT_OPENGL = (-21),&lt;br /&gt;
		VLC_OBJECT_FILTER = (-22),&lt;br /&gt;
		VLC_OBJECT_VOD = (-23),&lt;br /&gt;
		VLC_OBJECT_SPU = (-24),&lt;br /&gt;
		VLC_OBJECT_TLS = (-25),&lt;br /&gt;
		VLC_OBJECT_SD = (-26),&lt;br /&gt;
		VLC_OBJECT_XML = (-27),&lt;br /&gt;
		VLC_OBJECT_OSDMENU = (-28),&lt;br /&gt;
		VLC_OBJECT_STATS = (-29),&lt;br /&gt;
		VLC_OBJECT_HTTPD_HOST = (-30),&lt;br /&gt;
&lt;br /&gt;
		VLC_OBJECT_GENERIC = (-666),&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	internal enum VlcError : int&lt;br /&gt;
	{&lt;br /&gt;
		Success = -0,&lt;br /&gt;
		NoMem = -1,&lt;br /&gt;
		Thread = -2,&lt;br /&gt;
		Timeout = -3,&lt;br /&gt;
&lt;br /&gt;
		NoMod = -10,&lt;br /&gt;
&lt;br /&gt;
		NoObj = -20,&lt;br /&gt;
		BadObj = -21,&lt;br /&gt;
&lt;br /&gt;
		NoVar = -30,&lt;br /&gt;
		BadVar = -31,&lt;br /&gt;
&lt;br /&gt;
		Exit = -255,&lt;br /&gt;
		Generic = -666,&lt;br /&gt;
&lt;br /&gt;
		Exception = -998,&lt;br /&gt;
		NoInit = -999,&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	internal enum InputState : int&lt;br /&gt;
	{&lt;br /&gt;
		INIT_S = 0,&lt;br /&gt;
		OPENING_S = 1,&lt;br /&gt;
		BUFFERING_S = 2,&lt;br /&gt;
		PLAYING_S = 3,&lt;br /&gt;
		PAUSE_S = 4,&lt;br /&gt;
		END_S = 5,&lt;br /&gt;
		ERROR_S = 6,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	internal class NativeLibVlc : IDisposable&lt;br /&gt;
	{&lt;br /&gt;
        #region private vlc enums&lt;br /&gt;
&lt;br /&gt;
        enum Mode : int&lt;br /&gt;
        {&lt;br /&gt;
            Insert      = 0x01,&lt;br /&gt;
            Replace     = 0x02,&lt;br /&gt;
            Append      = 0x04,&lt;br /&gt;
            Go          = 0x08,&lt;br /&gt;
            CheckInsert = 0x10&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
		public const Int32 EndOfPlaylist = -666;&lt;br /&gt;
&lt;br /&gt;
		[Flags]&lt;br /&gt;
		enum ObjectSearchMode : int&lt;br /&gt;
		{&lt;br /&gt;
			FIND_PARENT         = 0x0001,&lt;br /&gt;
			FIND_CHILD          = 0x0002,&lt;br /&gt;
			FIND_ANYWHERE       = 0x0003,&lt;br /&gt;
			FIND_STRICT         = 0x0010,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[Flags]&lt;br /&gt;
		enum VarFlags : int&lt;br /&gt;
		{&lt;br /&gt;
			/** \defgroup var_flags Additive flags&lt;br /&gt;
			 * These flags are added to the type field of the variable. Most as a result of&lt;br /&gt;
			 * a __var_Change() call, but some may be added at creation time&lt;br /&gt;
			 * @{&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_HASCHOICE     = 0x0100,&lt;br /&gt;
			VLC_VAR_HASMIN        = 0x0200,&lt;br /&gt;
			VLC_VAR_HASMAX        = 0x0400,&lt;br /&gt;
			VLC_VAR_HASSTEP       = 0x0800,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_ISLIST        = 0x1000,&lt;br /&gt;
			VLC_VAR_ISCOMMAND     = 0x2000,&lt;br /&gt;
			VLC_VAR_ISCONFIG      = 0x2000,&lt;br /&gt;
&lt;br /&gt;
			/** Creation flag */&lt;br /&gt;
			VLC_VAR_DOINHERIT     = 0x8000,&lt;br /&gt;
&lt;br /&gt;
			/**&lt;br /&gt;
			 * \defgroup var_action Variable actions&lt;br /&gt;
			 * These are the different actions that can be used with __var_Change().&lt;br /&gt;
			 * The parameters given are the meaning of the two last parameters of&lt;br /&gt;
			 * __var_Change() when this action is being used.&lt;br /&gt;
			 * @{&lt;br /&gt;
			 */&lt;br /&gt;
&lt;br /&gt;
			/**&lt;br /&gt;
			 * Set the minimum value of this variable&lt;br /&gt;
			 * \param p_val The new minimum value&lt;br /&gt;
			 * \param p_val2 Unused&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_SETMIN              = 0x0010,&lt;br /&gt;
			/**&lt;br /&gt;
			 * Set the maximum value of this variable&lt;br /&gt;
			 * \param p_val The new maximum value&lt;br /&gt;
			 * \param p_val2 Unused&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_SETMAX              = 0x0011,&lt;br /&gt;
			VLC_VAR_SETSTEP             = 0x0012,&lt;br /&gt;
			/**&lt;br /&gt;
			 * Set the value of this variable without triggering any callbacks&lt;br /&gt;
			 * \param p_val The new value&lt;br /&gt;
			 * \param p_val2 Unused&lt;br /&gt;
			 */&lt;br /&gt;
			VLC_VAR_SETVALUE            = 0x0013,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_SETTEXT             = 0x0014,&lt;br /&gt;
			VLC_VAR_GETTEXT             = 0x0015,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_ADDCHOICE           = 0x0020,&lt;br /&gt;
			VLC_VAR_DELCHOICE           = 0x0021,&lt;br /&gt;
			VLC_VAR_CLEARCHOICES        = 0x0022,&lt;br /&gt;
			VLC_VAR_SETDEFAULT          = 0x0023,&lt;br /&gt;
			VLC_VAR_GETCHOICES          = 0x0024,&lt;br /&gt;
			VLC_VAR_FREECHOICES         = 0x0025,&lt;br /&gt;
			VLC_VAR_GETLIST             = 0x0026,&lt;br /&gt;
			VLC_VAR_FREELIST            = 0x0027,&lt;br /&gt;
			VLC_VAR_CHOICESCOUNT        = 0x0028,&lt;br /&gt;
&lt;br /&gt;
			VLC_VAR_INHERITVALUE        = 0x0030,&lt;br /&gt;
			VLC_VAR_TRIGGER_CALLBACKS   = 0x0035,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		enum playlist_command : int&lt;br /&gt;
		{&lt;br /&gt;
			PLAYLIST_PLAY = 0,      /**&amp;lt; No arg.                            res=can fail*/&lt;br /&gt;
			PLAYLIST_AUTOPLAY = 1,  /**&amp;lt; No arg.                            res=cant fail*/&lt;br /&gt;
			PLAYLIST_VIEWPLAY = 2,  /**&amp;lt; arg1= int, arg2= playlist_item_t*,*/&lt;br /&gt;
								/**  arg3 = playlist_item_t*          , res=can fail */&lt;br /&gt;
			PLAYLIST_ITEMPLAY = 3,  /** &amp;lt;arg1 = playlist_item_t *         , res=can fail */&lt;br /&gt;
			PLAYLIST_PAUSE = 4,     /**&amp;lt; No arg                             res=can fail*/&lt;br /&gt;
			PLAYLIST_STOP = 5,      /**&amp;lt; No arg                             res=can fail*/&lt;br /&gt;
			PLAYLIST_SKIP = 6,      /**&amp;lt; arg1=int,                          res=can fail*/&lt;br /&gt;
			PLAYLIST_GOTO = 7,      /**&amp;lt; arg1=int                           res=can fail */&lt;br /&gt;
			PLAYLIST_VIEWGOTO = 8   /**&amp;lt; arg1=int                           res=can fail */&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
        #region private vlc structs&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct libvlc_exception_t&lt;br /&gt;
		{&lt;br /&gt;
			public Int32 b_raised;&lt;br /&gt;
			public IntPtr psz_message;&lt;br /&gt;
&lt;br /&gt;
			public void Init()&lt;br /&gt;
			{&lt;br /&gt;
				libvlc_exception_init(out this);&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			public bool WasExceptionRaised()&lt;br /&gt;
			{&lt;br /&gt;
				if(0 != libvlc_exception_raised(ref this))&lt;br /&gt;
				{&lt;br /&gt;
					libvlc_exception_clear(ref this);&lt;br /&gt;
					return true;&lt;br /&gt;
				}&lt;br /&gt;
				return false;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct libvlc_instance_t&lt;br /&gt;
		{&lt;br /&gt;
			public IntPtr p_vlc;&lt;br /&gt;
			public IntPtr p_playlist;&lt;br /&gt;
			public IntPtr p_vlm;&lt;br /&gt;
			public Int32 i_vlc_id;&lt;br /&gt;
&lt;br /&gt;
			public libvlc_instance_t(IntPtr vlc, IntPtr playlist, int vlcHandle)&lt;br /&gt;
			{&lt;br /&gt;
				this.p_vlc = vlc;&lt;br /&gt;
				this.p_playlist = playlist;&lt;br /&gt;
				this.p_vlm = IntPtr.Zero;&lt;br /&gt;
				this.i_vlc_id = vlcHandle;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct vlc_list_t&lt;br /&gt;
		{&lt;br /&gt;
			public Int32 i_count;&lt;br /&gt;
			public IntPtr p_values;&lt;br /&gt;
			public IntPtr pi_types;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        [StructLayout( LayoutKind.Explicit )]&lt;br /&gt;
        struct vlc_value_t&lt;br /&gt;
        {&lt;br /&gt;
            [FieldOffset( 0 )]  public Int32   i_int;&lt;br /&gt;
            [FieldOffset( 0 )]  public Int32   b_bool;&lt;br /&gt;
            [FieldOffset( 0 )][MarshalAs(UnmanagedType.R4)]  public float   f_float;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  psz_string;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  p_address;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  p_object;&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  p_list;&lt;br /&gt;
            [FieldOffset( 0 )][MarshalAs(UnmanagedType.I8)]  public Int64   i_time;&lt;br /&gt;
&lt;br /&gt;
            [FieldOffset( 0 )]  public IntPtr  psz_name;&lt;br /&gt;
            [FieldOffset( 4 )]  public Int32   i_object_id;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct playlist_t_begin&lt;br /&gt;
		{&lt;br /&gt;
			public Int32 i_index;&lt;br /&gt;
			public Int32 i_enabled;&lt;br /&gt;
			public Int32 i_size;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
		#region vlc api interop&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern int VLC_Create();&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError VLC_Init(int iVLC, int Argc, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)]string[] Argv);&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern string VLC_Version();&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern VlcError VLC_CleanUp(int iVLC);&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern VlcError VLC_Destroy(int iVLC);&lt;br /&gt;
        [DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
        static extern string VLC_Error(int i_err);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr vlc_current_object(int i_object);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr __vlc_object_find(IntPtr p_vlc, ObjectType objectType, ObjectSearchMode mode);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __vlc_object_release(IntPtr p_vlc);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __var_Set(IntPtr p_vlc, String name, vlc_value_t value);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __var_Get(IntPtr p_this, String name, ref vlc_value_t value);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __var_Change(IntPtr p_this, String name, VarFlags varFlags,&lt;br /&gt;
			ref vlc_value_t value, ref vlc_value_t value2);&lt;br /&gt;
&lt;br /&gt;
		const int AOUT_VOLUME_MAX = 1024;&lt;br /&gt;
		const int VOLUME_MAX = 200;&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __aout_VolumeGet(IntPtr p_vlc, ref Int16 volume);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __aout_VolumeSet(IntPtr p_vlc, Int16 volume);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError __aout_VolumeMute(IntPtr p_vlc, IntPtr alwaysNull);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_exception_init(out libvlc_exception_t p_exception);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern Int32 libvlc_exception_raised(ref libvlc_exception_t p_exception);&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_exception_clear(ref libvlc_exception_t p_exception);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_playlist_play(ref libvlc_instance_t libvlc, Int32 id, &lt;br /&gt;
			Int32 optionsCount, IntPtr optionsAlwaysNull, ref libvlc_exception_t p_exception);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr libvlc_playlist_get_input(ref libvlc_instance_t libvlc, ref libvlc_exception_t p_exception);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void libvlc_input_free(IntPtr p_input);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int libvlc_video_get_width(IntPtr p_input, ref libvlc_exception_t p_exception);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern int libvlc_video_get_height(IntPtr p_input, ref libvlc_exception_t p_exception);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;, CallingConvention=CallingConvention.Cdecl)]&lt;br /&gt;
		static extern VlcError playlist_LockControl(IntPtr p_playlist, playlist_command i_query);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;, CallingConvention = CallingConvention.Cdecl)]&lt;br /&gt;
		static extern VlcError playlist_LockControl(IntPtr p_playlist, playlist_command i_query, Int32 arg1);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError playlist_Clear(IntPtr p_playlist);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern VlcError playlist_AddExt(IntPtr p_playlist, String mrl, String mrlDuplicate, &lt;br /&gt;
			Mode mode, Int32 pos, Int64 mtime_t, &lt;br /&gt;
			[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr)]string[] Options,&lt;br /&gt;
			int OptionsCount);&lt;br /&gt;
&lt;br /&gt;
		const int DEFAULT_CHAN = 1;&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;, CallingConvention = CallingConvention.Cdecl)]&lt;br /&gt;
		static extern void __vout_OSDMessage(IntPtr p_input, int i_channel, String message);&lt;br /&gt;
&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
		public NativeLibVlc()&lt;br /&gt;
        {&lt;br /&gt;
            vlcInstallDirectory = QueryVlcInstallPath();&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        #region IDisposable&lt;br /&gt;
        public void Dispose()&lt;br /&gt;
        {&lt;br /&gt;
            if(vlcHandle != -1)&lt;br /&gt;
            {&lt;br /&gt;
                try&lt;br /&gt;
                {&lt;br /&gt;
					VideoOutput = null;&lt;br /&gt;
					VLC_CleanUp(vlcHandle);&lt;br /&gt;
                    VLC_Destroy(vlcHandle);&lt;br /&gt;
                }&lt;br /&gt;
                catch { }&lt;br /&gt;
            }&lt;br /&gt;
            vlcHandle = -1;&lt;br /&gt;
        }&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
		#region internal Vlc interop helper classes&lt;br /&gt;
		internal class VlcObject : IDisposable&lt;br /&gt;
		{&lt;br /&gt;
			IntPtr vlc = IntPtr.Zero;&lt;br /&gt;
			IntPtr subObject = IntPtr.Zero;&lt;br /&gt;
			bool isDisposed;&lt;br /&gt;
&lt;br /&gt;
			public VlcObject(int vlcHandle, ObjectType objectType)&lt;br /&gt;
			{&lt;br /&gt;
				vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
				if(IntPtr.Zero != vlc)&lt;br /&gt;
				{&lt;br /&gt;
					if(objectType == ObjectType.VLC_OBJECT_VLC)&lt;br /&gt;
					{&lt;br /&gt;
						subObject = vlc;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						subObject = __vlc_object_find(vlc, objectType, ObjectSearchMode.FIND_CHILD);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			public IntPtr Vlc { get { return this.vlc; } }&lt;br /&gt;
			public IntPtr SubObject { get { return this.subObject; } }&lt;br /&gt;
&lt;br /&gt;
			public void Dispose()&lt;br /&gt;
			{&lt;br /&gt;
				Dispose(true);&lt;br /&gt;
				GC.SuppressFinalize(this);&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			protected virtual void Dispose(bool disposing)&lt;br /&gt;
			{&lt;br /&gt;
				if(!this.isDisposed)&lt;br /&gt;
				{&lt;br /&gt;
					this.isDisposed = true;&lt;br /&gt;
					if((IntPtr.Zero != subObject) &amp;amp;&amp;amp; (subObject != vlc))&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(subObject);&lt;br /&gt;
					}&lt;br /&gt;
					if(IntPtr.Zero != vlc)&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(vlc);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			protected bool IsDisposed { get { return this.isDisposed; } }&lt;br /&gt;
&lt;br /&gt;
			~VlcObject()&lt;br /&gt;
			{&lt;br /&gt;
				Dispose(false);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		private class VlcPlaylistObject : VlcObject&lt;br /&gt;
		{&lt;br /&gt;
			public libvlc_instance_t libvlc;&lt;br /&gt;
			public libvlc_exception_t exception;&lt;br /&gt;
&lt;br /&gt;
			public VlcPlaylistObject(int vlcHandle)&lt;br /&gt;
				: base(vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST)&lt;br /&gt;
			{&lt;br /&gt;
				if(this.SubObject != IntPtr.Zero)&lt;br /&gt;
				{&lt;br /&gt;
					this.libvlc = new libvlc_instance_t(this.Vlc, this.SubObject, vlcHandle);&lt;br /&gt;
					this.exception.Init();&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
		#region public Vlc interop helper functions&lt;br /&gt;
		public VlcObject OpenVlcObject(ObjectType objectType)&lt;br /&gt;
		{&lt;br /&gt;
			return new VlcObject(this.vlcHandle, objectType);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int GetVlcObjectInt(ObjectType objectType, String propertyName, int errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t intValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref intValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return intValue.i_int;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectInt(ObjectType objectType, String propertyName, int value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t intValue = new vlc_value_t();&lt;br /&gt;
						intValue.i_int = value;&lt;br /&gt;
						return __var_Set(vobj.SubObject, propertyName, intValue);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public long GetVlcObjectLong(ObjectType objectType, String propertyName, long errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t longValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref longValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return longValue.i_time;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectLong(ObjectType objectType, String propertyName, long value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t longValue = new vlc_value_t();&lt;br /&gt;
						longValue.i_time = value;&lt;br /&gt;
						return __var_Set(vobj.SubObject, propertyName, longValue);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public float GetVlcObjectFloat(ObjectType objectType, String propertyName, float errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t floatValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref floatValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return floatValue.f_float;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectFloat(ObjectType objectType, String propertyName, float value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t floatValue = new vlc_value_t();&lt;br /&gt;
						floatValue.f_float = value;&lt;br /&gt;
						return __var_Set(vobj.SubObject, propertyName, floatValue);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public String GetVlcObjectString(ObjectType objectType, String propertyName, String errorReturn)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					vlc_value_t stringValue = new vlc_value_t();&lt;br /&gt;
					if((vobj.SubObject != IntPtr.Zero) &amp;amp;&amp;amp;&lt;br /&gt;
						(VlcError.Success == __var_Get(vobj.SubObject, propertyName, ref stringValue)))&lt;br /&gt;
					{&lt;br /&gt;
						return Marshal.PtrToStringAnsi(stringValue.psz_string);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return errorReturn;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetVlcObjectString(ObjectType objectType, String propertyName, String value)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t stringValue = new vlc_value_t();&lt;br /&gt;
						IntPtr valuePtr = Marshal.StringToCoTaskMemAnsi(value);&lt;br /&gt;
						stringValue.psz_string = valuePtr;&lt;br /&gt;
						VlcError ret = __var_Set(vobj.SubObject, propertyName, stringValue);&lt;br /&gt;
						Marshal.ZeroFreeCoTaskMemAnsi(valuePtr);&lt;br /&gt;
						return ret;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError GetVlcVariableChoiceList(ObjectType objectType, String propertyName,&lt;br /&gt;
			out int[] choiceIds, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t idValues = new vlc_value_t();&lt;br /&gt;
						vlc_value_t textValues = new vlc_value_t();&lt;br /&gt;
						if(VlcError.Success == __var_Change(vobj.SubObject, propertyName,&lt;br /&gt;
							VarFlags.VLC_VAR_GETLIST, ref idValues, ref textValues))&lt;br /&gt;
						{&lt;br /&gt;
							try&lt;br /&gt;
							{&lt;br /&gt;
								vlc_list_t idList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									idValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
								vlc_list_t textList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									textValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
&lt;br /&gt;
								int choiceCount = idList.i_count;&lt;br /&gt;
								choiceIds = new Int32[choiceCount];&lt;br /&gt;
								choiceText = new String[choiceCount];&lt;br /&gt;
&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceCount; index++)&lt;br /&gt;
								{&lt;br /&gt;
									IntPtr idPtr = new IntPtr(idList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t idValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										idPtr, typeof(vlc_value_t));&lt;br /&gt;
									choiceIds[index] = idValue.i_int;&lt;br /&gt;
&lt;br /&gt;
									IntPtr textPtr = new IntPtr(textList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t textValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										textPtr, typeof(vlc_value_t));&lt;br /&gt;
									choiceText[index] = Marshal.PtrToStringAnsi(textValue.psz_string);&lt;br /&gt;
								}&lt;br /&gt;
								return VlcError.Success;&lt;br /&gt;
							}&lt;br /&gt;
							finally&lt;br /&gt;
							{&lt;br /&gt;
								__var_Change(vobj.SubObject, propertyName, VarFlags.VLC_VAR_FREELIST,&lt;br /&gt;
									ref idValues, ref textValues);&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			choiceIds = new int[0];&lt;br /&gt;
			choiceText = new string[0];&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError GetVlcVariableChoiceList(ObjectType objectType, String propertyName,&lt;br /&gt;
			out String[] choices, out String[] choiceText)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, objectType))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						vlc_value_t idValues = new vlc_value_t();&lt;br /&gt;
						vlc_value_t textValues = new vlc_value_t();&lt;br /&gt;
						if(VlcError.Success == __var_Change(vobj.SubObject, propertyName,&lt;br /&gt;
							VarFlags.VLC_VAR_GETLIST, ref idValues, ref textValues))&lt;br /&gt;
						{&lt;br /&gt;
							try&lt;br /&gt;
							{&lt;br /&gt;
								vlc_list_t idList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									idValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
								vlc_list_t textList = (vlc_list_t)Marshal.PtrToStructure(&lt;br /&gt;
									textValues.p_list, typeof(vlc_list_t));&lt;br /&gt;
&lt;br /&gt;
								int choiceCount = idList.i_count;&lt;br /&gt;
								List&amp;lt;String&amp;gt; choiceList = new List&amp;lt;string&amp;gt;(choiceCount);&lt;br /&gt;
								List&amp;lt;String&amp;gt; choiceTextList = new List&amp;lt;string&amp;gt;(choiceCount);&lt;br /&gt;
								Dictionary&amp;lt;String, int&amp;gt; choiceDict = new Dictionary&amp;lt;string, int&amp;gt;(choiceCount);&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceCount; index++)&lt;br /&gt;
								{&lt;br /&gt;
									IntPtr idPtr = new IntPtr(idList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t idValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										idPtr, typeof(vlc_value_t));&lt;br /&gt;
									String choice = Marshal.PtrToStringAnsi(idValue.psz_name);&lt;br /&gt;
									choiceList.Add(choice);&lt;br /&gt;
									if(choiceDict.ContainsKey(choice))&lt;br /&gt;
									{&lt;br /&gt;
										choiceDict[choice] = choiceDict[choice] + 1;&lt;br /&gt;
									}&lt;br /&gt;
									else&lt;br /&gt;
									{&lt;br /&gt;
										choiceDict[choice] = 1;&lt;br /&gt;
									}&lt;br /&gt;
&lt;br /&gt;
									IntPtr textPtr = new IntPtr(textList.p_values.ToInt32() +&lt;br /&gt;
										index * Marshal.SizeOf(typeof(vlc_value_t)));&lt;br /&gt;
									vlc_value_t textValue = (vlc_value_t)Marshal.PtrToStructure(&lt;br /&gt;
										textPtr, typeof(vlc_value_t));&lt;br /&gt;
									choiceTextList.Add(Marshal.PtrToStringAnsi(textValue.psz_string));&lt;br /&gt;
								}&lt;br /&gt;
&lt;br /&gt;
								int listIndex = 0;&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceCount; index++)&lt;br /&gt;
								{&lt;br /&gt;
									String choice = choiceList[listIndex];&lt;br /&gt;
									if((choiceDict[choice] &amp;gt; 1) &amp;amp;&amp;amp; (choiceTextList[listIndex] == null))&lt;br /&gt;
									{&lt;br /&gt;
										choiceList.RemoveAt(listIndex);&lt;br /&gt;
										choiceTextList.RemoveAt(listIndex);&lt;br /&gt;
										choiceDict[choice] = choiceDict[choice] - 1;&lt;br /&gt;
									}&lt;br /&gt;
									else&lt;br /&gt;
									{&lt;br /&gt;
										listIndex++;&lt;br /&gt;
									}&lt;br /&gt;
								}&lt;br /&gt;
								for(int index = 0; index &amp;lt; choiceList.Count; index++)&lt;br /&gt;
								{&lt;br /&gt;
									if(choiceTextList[index] == null)&lt;br /&gt;
									{&lt;br /&gt;
										choiceTextList[index] = choiceList[index];&lt;br /&gt;
									}&lt;br /&gt;
								}&lt;br /&gt;
&lt;br /&gt;
								choices = choiceList.ToArray();&lt;br /&gt;
								choiceText = choiceTextList.ToArray();&lt;br /&gt;
								return VlcError.Success;&lt;br /&gt;
							}&lt;br /&gt;
							finally&lt;br /&gt;
							{&lt;br /&gt;
								__var_Change(vobj.SubObject, propertyName, VarFlags.VLC_VAR_FREELIST,&lt;br /&gt;
									ref idValues, ref textValues);&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			choices = new string[0];&lt;br /&gt;
			choiceText = new string[0];&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
		#endregion&lt;br /&gt;
&lt;br /&gt;
        #region public Properties&lt;br /&gt;
        public string VlcInstallDir&lt;br /&gt;
        {&lt;br /&gt;
            get{ return vlcInstallDirectory; }&lt;br /&gt;
            set{ vlcInstallDirectory = value; }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public bool IsInitialized&lt;br /&gt;
        {&lt;br /&gt;
            get{return (vlcHandle != -1);}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public Control VideoOutput&lt;br /&gt;
        {&lt;br /&gt;
            get { return outputWindow; }&lt;br /&gt;
            set&lt;br /&gt;
            {&lt;br /&gt;
				if(value == null)&lt;br /&gt;
				{&lt;br /&gt;
					if(outputWindow != null)&lt;br /&gt;
					{&lt;br /&gt;
						outputWindow = null;&lt;br /&gt;
						if(vlcHandle != -1)&lt;br /&gt;
						{&lt;br /&gt;
							SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;drawable&amp;quot;, 0);&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					outputWindow = value;&lt;br /&gt;
					if(vlcHandle != -1)&lt;br /&gt;
					{&lt;br /&gt;
						SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;drawable&amp;quot;, outputWindow.Handle.ToInt32());&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public string LastError&lt;br /&gt;
        {&lt;br /&gt;
            get{return lastErrorMessage;}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public int Length&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				if(this.artificialLength != 0)&lt;br /&gt;
				{&lt;br /&gt;
					return this.artificialLength;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					return Convert.ToInt32(GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;length&amp;quot;, 0) / 1000000L);&lt;br /&gt;
				}&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public void SetArtificialLength(int newLength)&lt;br /&gt;
		{&lt;br /&gt;
			this.artificialLength = newLength;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public int Time&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				int time = Convert.ToInt32(GetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;time&amp;quot;, 0) / 1000000L);&lt;br /&gt;
				if((time == 0) &amp;amp;&amp;amp; (this.artificialLength != 0))&lt;br /&gt;
				{&lt;br /&gt;
					time = Convert.ToInt32(Position * this.artificialLength + .5d);&lt;br /&gt;
				}&lt;br /&gt;
				if(this.timeScaling != 0.0d)&lt;br /&gt;
				{&lt;br /&gt;
					time = Convert.ToInt32(time / this.timeScaling);&lt;br /&gt;
				}&lt;br /&gt;
				return time;&lt;br /&gt;
            }&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				if(this.artificialLength != 0)&lt;br /&gt;
				{&lt;br /&gt;
					float position = Convert.ToSingle(value) / Convert.ToSingle(this.artificialLength);&lt;br /&gt;
					if(this.timeScaling != 0.0d)&lt;br /&gt;
					{&lt;br /&gt;
						position = Convert.ToSingle(position * this.timeScaling);&lt;br /&gt;
					}&lt;br /&gt;
					Debug.WriteLine(String.Format(&amp;quot;Set Position {0}&amp;quot;, position));&lt;br /&gt;
					SetVlcObjectFloat(ObjectType.VLC_OBJECT_INPUT, &amp;quot;position&amp;quot;, position);&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					long time = Convert.ToInt64(value) * 1000000L;&lt;br /&gt;
					if(this.timeScaling != 0.0d)&lt;br /&gt;
					{&lt;br /&gt;
						time = Convert.ToInt64(time * this.timeScaling);&lt;br /&gt;
					}&lt;br /&gt;
					Debug.WriteLine(String.Format(&amp;quot;Set Time {0}&amp;quot;, time));&lt;br /&gt;
					SetVlcObjectLong(ObjectType.VLC_OBJECT_INPUT, &amp;quot;time&amp;quot;, time);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public double TimeScaling&lt;br /&gt;
		{&lt;br /&gt;
			get { return this.timeScaling; }&lt;br /&gt;
			set { this.timeScaling = value; }&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public double Position&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				double position = GetVlcObjectFloat(ObjectType.VLC_OBJECT_INPUT, &amp;quot;position&amp;quot;, 0.0f);&lt;br /&gt;
				if(this.timeScaling != 0.0d)&lt;br /&gt;
				{&lt;br /&gt;
					position = position / this.timeScaling;&lt;br /&gt;
				}&lt;br /&gt;
				return position;&lt;br /&gt;
            }&lt;br /&gt;
			set&lt;br /&gt;
			{&lt;br /&gt;
				double position = value;&lt;br /&gt;
				if(this.timeScaling != 0.0d)&lt;br /&gt;
				{&lt;br /&gt;
					position = position * this.timeScaling;&lt;br /&gt;
				}&lt;br /&gt;
				Debug.WriteLine(String.Format(&amp;quot;Set Position {0}&amp;quot;, position));&lt;br /&gt;
				SetVlcObjectFloat(ObjectType.VLC_OBJECT_INPUT, &amp;quot;position&amp;quot;, Convert.ToSingle(position));&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public int Volume&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				IntPtr vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
				if(IntPtr.Zero != vlc)&lt;br /&gt;
				{&lt;br /&gt;
					try&lt;br /&gt;
					{&lt;br /&gt;
						Int16 aoutVol = 0;&lt;br /&gt;
						if(__aout_VolumeGet(vlc, ref aoutVol) == VlcError.Success)&lt;br /&gt;
						{&lt;br /&gt;
							return (aoutVol * VOLUME_MAX + AOUT_VOLUME_MAX / 2) / AOUT_VOLUME_MAX;&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
					catch(Exception)&lt;br /&gt;
					{&lt;br /&gt;
					}&lt;br /&gt;
					finally&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(vlc);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				return 0;&lt;br /&gt;
            }&lt;br /&gt;
            set&lt;br /&gt;
            {&lt;br /&gt;
				IntPtr vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
				if(IntPtr.Zero != vlc)&lt;br /&gt;
				{&lt;br /&gt;
					try&lt;br /&gt;
					{&lt;br /&gt;
						Int16 aoutVol = Convert.ToInt16((value * AOUT_VOLUME_MAX + VOLUME_MAX / 2) / VOLUME_MAX);&lt;br /&gt;
						__aout_VolumeSet(vlc, aoutVol);&lt;br /&gt;
					}&lt;br /&gt;
					catch(Exception)&lt;br /&gt;
					{&lt;br /&gt;
					}&lt;br /&gt;
					finally&lt;br /&gt;
					{&lt;br /&gt;
						__vlc_object_release(vlc);&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public bool Fullscreen&lt;br /&gt;
        {&lt;br /&gt;
            get&lt;br /&gt;
            {&lt;br /&gt;
				int isFullScreen = GetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;fullscreen&amp;quot;, -666);&lt;br /&gt;
				if((isFullScreen != -666) &amp;amp;&amp;amp; (isFullScreen != 0))&lt;br /&gt;
				{&lt;br /&gt;
					return true;&lt;br /&gt;
				}&lt;br /&gt;
                return false;&lt;br /&gt;
               &lt;br /&gt;
            }&lt;br /&gt;
            set&lt;br /&gt;
            {&lt;br /&gt;
				SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;fullscreen&amp;quot;, value ? 1 : 0);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public int PlaylistIndex&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
					{&lt;br /&gt;
						if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
						{&lt;br /&gt;
							playlist_t_begin playlist = (playlist_t_begin)Marshal.PtrToStructure(vobj.SubObject, typeof(playlist_t_begin));&lt;br /&gt;
							return playlist.i_index;&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception ex)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = ex.Message;&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
				return -1;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public int PlaylistCount&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
					{&lt;br /&gt;
						if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
						{&lt;br /&gt;
							playlist_t_begin playlist = (playlist_t_begin)Marshal.PtrToStructure(vobj.SubObject, typeof(playlist_t_begin));&lt;br /&gt;
							return playlist.i_size;&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception ex)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = ex.Message;&lt;br /&gt;
					return -1;&lt;br /&gt;
				}&lt;br /&gt;
				return -1;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
        #region public Methods&lt;br /&gt;
        public bool Initialize()&lt;br /&gt;
        {&lt;br /&gt;
            // check if already initializes&lt;br /&gt;
            if(vlcHandle != -1)&lt;br /&gt;
                return true;&lt;br /&gt;
&lt;br /&gt;
            // try init&lt;br /&gt;
            try&lt;br /&gt;
            {&lt;br /&gt;
                // create instance&lt;br /&gt;
                vlcHandle = VLC_Create();&lt;br /&gt;
&lt;br /&gt;
                if (vlcHandle &amp;lt; 0)&lt;br /&gt;
                {&lt;br /&gt;
                    lastErrorMessage = &amp;quot;Failed to create VLC instance&amp;quot;;&lt;br /&gt;
                    return false;&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                string[] initOptions = { &amp;quot;vlc&amp;quot;,&lt;br /&gt;
                                            &amp;quot;:no-one-instance&amp;quot;,&lt;br /&gt;
                                            &amp;quot;:no-loop&amp;quot;,&lt;br /&gt;
                                            &amp;quot;:no-drop-late-frames&amp;quot;,&lt;br /&gt;
                                            &amp;quot;:disable-screensaver&amp;quot;,&lt;br /&gt;
											&amp;quot;:vout=vout_directx&amp;quot; };&lt;br /&gt;
                if(vlcInstallDirectory.Length &amp;gt; 0)&lt;br /&gt;
                    initOptions[0] = vlcInstallDirectory + @&amp;quot;\vlc&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                // init libvlc&lt;br /&gt;
                VlcError errVlcLib = VLC_Init(vlcHandle, initOptions.Length, initOptions);&lt;br /&gt;
                if (errVlcLib != VlcError.Success)&lt;br /&gt;
                {&lt;br /&gt;
                    VLC_Destroy(vlcHandle);&lt;br /&gt;
                    lastErrorMessage = &amp;quot;Failed to initialise VLC&amp;quot;;&lt;br /&gt;
                    vlcHandle   = -1;&lt;br /&gt;
                    return false;&lt;br /&gt;
                }&lt;br /&gt;
               &lt;br /&gt;
            }&lt;br /&gt;
            catch&lt;br /&gt;
            {&lt;br /&gt;
                lastErrorMessage = &amp;quot;Could not find libvlc&amp;quot;;&lt;br /&gt;
                return false;&lt;br /&gt;
            }           &lt;br /&gt;
&lt;br /&gt;
            // check output window&lt;br /&gt;
            if(outputWindow != null)&lt;br /&gt;
            {&lt;br /&gt;
				SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;drawable&amp;quot;, outputWindow.Handle.ToInt32());&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public VlcError AddTarget(string target, ref int itemId)&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						VlcError enmErr = playlist_AddExt(vobj.SubObject, target, target, Mode.Append, &lt;br /&gt;
							EndOfPlaylist, -1L, null, 0);&lt;br /&gt;
						if(enmErr &amp;gt;= VlcError.Success)&lt;br /&gt;
						{&lt;br /&gt;
							itemId = (int)enmErr;&lt;br /&gt;
						}&lt;br /&gt;
						return enmErr;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError AddTarget(string target, string[] options, ref int itemId)&lt;br /&gt;
        {&lt;br /&gt;
            int optionsCount = 0;&lt;br /&gt;
			if(options != null)&lt;br /&gt;
			{&lt;br /&gt;
				optionsCount = options.Length;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						VlcError enmErr = playlist_AddExt(vobj.SubObject, target, target, Mode.Append,&lt;br /&gt;
							EndOfPlaylist, -1L, options, optionsCount);&lt;br /&gt;
						if(enmErr &amp;gt;= VlcError.Success)&lt;br /&gt;
						{&lt;br /&gt;
							itemId = (int)enmErr;&lt;br /&gt;
						}&lt;br /&gt;
						return enmErr;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
		public Size VideoSize&lt;br /&gt;
		{&lt;br /&gt;
			get&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					using(VlcPlaylistObject vpobj = new VlcPlaylistObject(this.vlcHandle))&lt;br /&gt;
					{&lt;br /&gt;
						if(vpobj.SubObject != IntPtr.Zero)&lt;br /&gt;
						{&lt;br /&gt;
							IntPtr p_input = libvlc_playlist_get_input(ref vpobj.libvlc, ref vpobj.exception);&lt;br /&gt;
							if(vpobj.exception.WasExceptionRaised())&lt;br /&gt;
							{&lt;br /&gt;
								this.lastErrorMessage = Marshal.PtrToStringAnsi(vpobj.exception.psz_message);&lt;br /&gt;
							}&lt;br /&gt;
							else&lt;br /&gt;
							{&lt;br /&gt;
								try&lt;br /&gt;
								{&lt;br /&gt;
									int width = libvlc_video_get_width(p_input, ref vpobj.exception);&lt;br /&gt;
									if(!vpobj.exception.WasExceptionRaised())&lt;br /&gt;
									{&lt;br /&gt;
										int height = libvlc_video_get_height(p_input, ref vpobj.exception);&lt;br /&gt;
										if(!vpobj.exception.WasExceptionRaised())&lt;br /&gt;
										{&lt;br /&gt;
											return new Size(width, height);&lt;br /&gt;
										}&lt;br /&gt;
									}&lt;br /&gt;
								}&lt;br /&gt;
								finally&lt;br /&gt;
								{&lt;br /&gt;
									libvlc_input_free(p_input);&lt;br /&gt;
								}&lt;br /&gt;
							}&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception ex)&lt;br /&gt;
				{&lt;br /&gt;
					this.lastErrorMessage = ex.Message;&lt;br /&gt;
				}&lt;br /&gt;
				return new Size();&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError Play(int itemId)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				this.artificialLength = 0;&lt;br /&gt;
				this.timeScaling = 0.0d;&lt;br /&gt;
				using(VlcPlaylistObject vpobj = new VlcPlaylistObject(this.vlcHandle))&lt;br /&gt;
				{&lt;br /&gt;
					if(vpobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						libvlc_playlist_play(ref vpobj.libvlc, itemId, 0, IntPtr.Zero, &lt;br /&gt;
							ref vpobj.exception);&lt;br /&gt;
						if(vpobj.exception.WasExceptionRaised())&lt;br /&gt;
						{&lt;br /&gt;
							return VlcError.Generic;&lt;br /&gt;
						}&lt;br /&gt;
						return VlcError.Success;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoObj;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public VlcError Play()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_LockControl(vobj.SubObject, playlist_command.PLAYLIST_PLAY);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError Pause()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_LockControl(vobj.SubObject, playlist_command.PLAYLIST_PAUSE);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError Stop()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_LockControl(vobj.SubObject, playlist_command.PLAYLIST_PAUSE);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        public VlcError PlaylistClear()&lt;br /&gt;
        {&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_PLAYLIST))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						return playlist_Clear(vobj.SubObject);&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError ToggleVolumeMute()&lt;br /&gt;
        {&lt;br /&gt;
			IntPtr vlc = vlc_current_object(vlcHandle);&lt;br /&gt;
			if(IntPtr.Zero != vlc)&lt;br /&gt;
			{&lt;br /&gt;
				try&lt;br /&gt;
				{&lt;br /&gt;
					return __aout_VolumeMute(vlc, IntPtr.Zero);&lt;br /&gt;
				}&lt;br /&gt;
				catch(Exception)&lt;br /&gt;
				{&lt;br /&gt;
				}&lt;br /&gt;
				finally&lt;br /&gt;
				{&lt;br /&gt;
					__vlc_object_release(vlc);&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
            return VlcError.NoObj;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public VlcError PressKey(string strKey)&lt;br /&gt;
        {&lt;br /&gt;
			int key = GetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, strKey, -666);&lt;br /&gt;
			if(key != -666)&lt;br /&gt;
			{&lt;br /&gt;
				return SetVlcObjectInt(ObjectType.VLC_OBJECT_VLC, &amp;quot;key-pressed&amp;quot;, key);&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.NoVar;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public VlcError ShowMessage(String message)&lt;br /&gt;
		{&lt;br /&gt;
			try&lt;br /&gt;
			{&lt;br /&gt;
				using(VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_INPUT))&lt;br /&gt;
				{&lt;br /&gt;
					if(vobj.SubObject != IntPtr.Zero)&lt;br /&gt;
					{&lt;br /&gt;
						__vout_OSDMessage(vobj.SubObject, DEFAULT_CHAN, message);&lt;br /&gt;
						return VlcError.Success;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
					{&lt;br /&gt;
						return VlcError.NoObj;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			catch(Exception ex)&lt;br /&gt;
			{&lt;br /&gt;
				this.lastErrorMessage = ex.Message;&lt;br /&gt;
				return VlcError.Exception;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		enum CONFIG_ITEM : int&lt;br /&gt;
		{&lt;br /&gt;
			CONFIG_ITEM_STRING = 0x0010,&lt;br /&gt;
			CONFIG_ITEM_FILE = 0x0020,&lt;br /&gt;
			CONFIG_ITEM_MODULE = 0x0030,&lt;br /&gt;
			CONFIG_ITEM_INTEGER = 0x0040,&lt;br /&gt;
			CONFIG_ITEM_BOOL = 0x0050,&lt;br /&gt;
			CONFIG_ITEM_FLOAT = 0x0060,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[StructLayout(LayoutKind.Sequential)]&lt;br /&gt;
		struct module_config_t&lt;br /&gt;
		{&lt;br /&gt;
			public CONFIG_ITEM i_type;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern IntPtr config_FindConfig(IntPtr vlc, String name);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __config_PutInt(IntPtr vlc, String name, int value);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __config_PutFloat(IntPtr vlc, String name, float value);&lt;br /&gt;
&lt;br /&gt;
		[DllImport(&amp;quot;libvlc&amp;quot;)]&lt;br /&gt;
		static extern void __config_PutPsz(IntPtr vlc, String name, String value);&lt;br /&gt;
&lt;br /&gt;
		public VlcError SetConfigVariable(String name, String value)&lt;br /&gt;
		{&lt;br /&gt;
			using(VlcObject vlc = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_VLC))&lt;br /&gt;
			{&lt;br /&gt;
				if(IntPtr.Zero == vlc.SubObject)&lt;br /&gt;
				{&lt;br /&gt;
					return VlcError.NoObj;&lt;br /&gt;
				}&lt;br /&gt;
&lt;br /&gt;
				IntPtr p_item = config_FindConfig(vlc.SubObject, name);&lt;br /&gt;
				if(IntPtr.Zero == p_item)&lt;br /&gt;
				{&lt;br /&gt;
					return VlcError.NoVar;&lt;br /&gt;
				}&lt;br /&gt;
				else&lt;br /&gt;
				{&lt;br /&gt;
					try&lt;br /&gt;
					{&lt;br /&gt;
						module_config_t mod = (module_config_t)Marshal.PtrToStructure(p_item, typeof(module_config_t));&lt;br /&gt;
						switch(mod.i_type)&lt;br /&gt;
						{&lt;br /&gt;
						case CONFIG_ITEM.CONFIG_ITEM_BOOL:&lt;br /&gt;
							{&lt;br /&gt;
								bool boolResult;&lt;br /&gt;
								if(Boolean.TryParse(value, out boolResult))&lt;br /&gt;
								{&lt;br /&gt;
									__config_PutInt(vlc.SubObject, name, boolResult ? 1 : 0);&lt;br /&gt;
								}&lt;br /&gt;
								else&lt;br /&gt;
								{&lt;br /&gt;
									return VlcError.BadVar;&lt;br /&gt;
								}&lt;br /&gt;
							}&lt;br /&gt;
							break;&lt;br /&gt;
						case CONFIG_ITEM.CONFIG_ITEM_INTEGER:&lt;br /&gt;
							{&lt;br /&gt;
								int intResult;&lt;br /&gt;
								if(Int32.TryParse(value, out intResult))&lt;br /&gt;
								{&lt;br /&gt;
									__config_PutInt(vlc.SubObject, name, intResult);&lt;br /&gt;
								}&lt;br /&gt;
								else&lt;br /&gt;
								{&lt;br /&gt;
									return VlcError.BadVar;&lt;br /&gt;
								}&lt;br /&gt;
							}&lt;br /&gt;
							break;&lt;br /&gt;
						case CONFIG_ITEM.CONFIG_ITEM_FLOAT:&lt;br /&gt;
							{&lt;br /&gt;
								float floatResult;&lt;br /&gt;
								if(Single.TryParse(value, out floatResult))&lt;br /&gt;
								{&lt;br /&gt;
									__config_PutFloat(vlc.SubObject, name, floatResult);&lt;br /&gt;
								}&lt;br /&gt;
								else&lt;br /&gt;
								{&lt;br /&gt;
									return VlcError.BadVar;&lt;br /&gt;
								}&lt;br /&gt;
							}&lt;br /&gt;
							break;&lt;br /&gt;
						case CONFIG_ITEM.CONFIG_ITEM_STRING:&lt;br /&gt;
							__config_PutPsz(vlc.SubObject, name, value);&lt;br /&gt;
							break;&lt;br /&gt;
						default:&lt;br /&gt;
							return VlcError.NoVar;&lt;br /&gt;
						}&lt;br /&gt;
					}&lt;br /&gt;
					catch(Exception e)&lt;br /&gt;
					{&lt;br /&gt;
						this.lastErrorMessage = e.Message;&lt;br /&gt;
						return VlcError.Exception;&lt;br /&gt;
					}&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			return VlcError.Success;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
        #endregion&lt;br /&gt;
&lt;br /&gt;
		#region private members, properties and methods&lt;br /&gt;
&lt;br /&gt;
		private int vlcHandle = -1;&lt;br /&gt;
		private Control outputWindow = null;&lt;br /&gt;
		private string vlcInstallDirectory = &amp;quot;&amp;quot;;&lt;br /&gt;
		private string lastErrorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
		private int artificialLength;&lt;br /&gt;
		private double timeScaling;&lt;br /&gt;
&lt;br /&gt;
        /// -------------------------------------------------------------------&lt;br /&gt;
        /// &amp;lt;summary&amp;gt;&lt;br /&gt;
        /// Method name      :   QueryVlcInstallPath&lt;br /&gt;
        /// Author         :   Odysee&lt;br /&gt;
        ///   Date         :   10.11.2006&lt;br /&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
        /// -------------------------------------------------------------------&lt;br /&gt;
        private string QueryVlcInstallPath()&lt;br /&gt;
        {&lt;br /&gt;
            // open registry&lt;br /&gt;
            RegistryKey regkeyVlcInstallPathKey = Registry.LocalMachine.OpenSubKey(@&amp;quot;SOFTWARE\VideoLAN\VLC&amp;quot;);&lt;br /&gt;
            if(regkeyVlcInstallPathKey == null)&lt;br /&gt;
                return &amp;quot;&amp;quot;;&lt;br /&gt;
            return (string)regkeyVlcInstallPathKey.GetValue(&amp;quot;InstallDir&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        #endregion&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	/* future features&lt;br /&gt;
    add_float_with_range( &amp;quot;contrast&amp;quot;, 1.0, 0.0, 2.0, NULL,&lt;br /&gt;
                          CONT_TEXT, CONT_LONGTEXT, VLC_FALSE );&lt;br /&gt;
    add_float_with_range( &amp;quot;brightness&amp;quot;, 1.0, 0.0, 2.0, NULL,&lt;br /&gt;
                           LUM_TEXT, LUM_LONGTEXT, VLC_FALSE );&lt;br /&gt;
    add_integer_with_range( &amp;quot;hue&amp;quot;, 0, 0, 360, NULL,&lt;br /&gt;
                            HUE_TEXT, HUE_LONGTEXT, VLC_FALSE );&lt;br /&gt;
    add_float_with_range( &amp;quot;saturation&amp;quot;, 1.0, 0.0, 3.0, NULL,&lt;br /&gt;
                          SAT_TEXT, SAT_LONGTEXT, VLC_FALSE );&lt;br /&gt;
    add_float_with_range( &amp;quot;gamma&amp;quot;, 1.0, 0.01, 10.0, NULL,&lt;br /&gt;
                          GAMMA_TEXT, GAMMA_LONGTEXT, VLC_FALSE );&lt;br /&gt;
&lt;br /&gt;
    add_bool( &amp;quot;brightness-threshold&amp;quot;, 0, NULL,&lt;br /&gt;
              THRES_TEXT, THRES_LONGTEXT, VLC_FALSE );&lt;br /&gt;
	 */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6939</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6939"/>
		<updated>2007-01-01T01:08:07Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Work from Tappen and Odyssee on the forum.&lt;br /&gt;
&lt;br /&gt;
I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=IPlayer.cs&amp;diff=6938</id>
		<title>IPlayer.cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=IPlayer.cs&amp;diff=6938"/>
		<updated>2007-01-01T01:06:59Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************************************&lt;br /&gt;
 * IPlayer.cs: IPlayer, IPlayer2 interface definitions&lt;br /&gt;
 *****************************************************************************&lt;br /&gt;
 * Copyright (C) 2006 Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * Authors: Chris Meadowcroft&lt;br /&gt;
 *&lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation.&lt;br /&gt;
 *&lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.&lt;br /&gt;
 *****************************************************************************/&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
&lt;br /&gt;
namespace VLanControl&lt;br /&gt;
{&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	public struct TrackPosition : IComparable&amp;lt;TrackPosition&amp;gt;&lt;br /&gt;
	{&lt;br /&gt;
		public int time;&lt;br /&gt;
		public double position;&lt;br /&gt;
&lt;br /&gt;
		public TrackPosition(int time, double position)&lt;br /&gt;
		{&lt;br /&gt;
			this.time = time;&lt;br /&gt;
			this.position = position;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		public TrackPosition(TrackPosition other)&lt;br /&gt;
		{&lt;br /&gt;
			this.time = other.time;&lt;br /&gt;
			this.position = other.position;&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		#region IComparable&amp;lt;TrackPosition&amp;gt; Members&lt;br /&gt;
&lt;br /&gt;
		public int CompareTo(TrackPosition other)&lt;br /&gt;
		{&lt;br /&gt;
			return this.time.CompareTo(other.time);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		#endregion&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	public enum PlayerState&lt;br /&gt;
	{&lt;br /&gt;
		None = 0,&lt;br /&gt;
		Playing = 1,&lt;br /&gt;
		Paused = 2,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	public interface IPlayer : IDisposable&lt;br /&gt;
	{&lt;br /&gt;
		bool Visible { get; set; }&lt;br /&gt;
		Control Parent { get; set; }&lt;br /&gt;
		Rectangle Bounds { get; set; }&lt;br /&gt;
		Point Location { get; set; }&lt;br /&gt;
		Size Size { get; set; }&lt;br /&gt;
		Size VideoSize { get; }&lt;br /&gt;
		int Time { get; }&lt;br /&gt;
		double Position { get; }&lt;br /&gt;
		void MoveToPosition(TrackPosition newTrackPosition);&lt;br /&gt;
		int Volume { get; set; }&lt;br /&gt;
		int Rate { get; set; }&lt;br /&gt;
		void GetRates(out int minRate, out int maxRate, out int normalRate);&lt;br /&gt;
		bool IsPlaying { get; }&lt;br /&gt;
		bool IsPaused { get; }&lt;br /&gt;
		bool IsMute { get; }&lt;br /&gt;
		int Length { get; set; }&lt;br /&gt;
		PlayerState State { get; }&lt;br /&gt;
		double TimeScaling { get; set; }&lt;br /&gt;
&lt;br /&gt;
		void Play();&lt;br /&gt;
		void ToggleMute();&lt;br /&gt;
		void TogglePause();&lt;br /&gt;
		void RotateSubtitles();&lt;br /&gt;
		void RotateAudioTrack();&lt;br /&gt;
		void RotateDeinterlaceMode();&lt;br /&gt;
		void RotateAspectRatio();&lt;br /&gt;
		void RotateCropModes();&lt;br /&gt;
		bool UseMpegVbrOffset { get; set; }&lt;br /&gt;
		void CropTop();&lt;br /&gt;
		void UnCropTop();&lt;br /&gt;
		void CropBottom();&lt;br /&gt;
		void UnCropBottom();&lt;br /&gt;
		void CropLeft();&lt;br /&gt;
		void UnCropLeft();&lt;br /&gt;
		void CropRight();&lt;br /&gt;
		void UnCropRight();&lt;br /&gt;
		void NextDvdTrack();&lt;br /&gt;
		void PreviousDvdTrack();&lt;br /&gt;
		void NextDvdChapter();&lt;br /&gt;
		void PreviousDvdChapter();&lt;br /&gt;
		TrackPosition Shuttle(int offsetSeconds);&lt;br /&gt;
		void ClearPlayList();&lt;br /&gt;
		int AddToPlayList(String fileName, String title, String[] options);&lt;br /&gt;
		void PlayItem(int index);&lt;br /&gt;
		void Stop();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	[ComVisible(true)]&lt;br /&gt;
	public interface IPlayer2 : IPlayer&lt;br /&gt;
	{&lt;br /&gt;
		String DeinterlaceMode { get; set; }&lt;br /&gt;
		String AspectRatio { get; set; }&lt;br /&gt;
		String CropMode { get; set; }&lt;br /&gt;
		int CroppingLeft { get; set; }&lt;br /&gt;
		int CroppingRight { get; set; }&lt;br /&gt;
		int CroppingTop { get; set; }&lt;br /&gt;
		int CroppingBottom { get; set; }&lt;br /&gt;
		int AudioTrack { get; set; }&lt;br /&gt;
		int SubTitleTrack { get; set; }&lt;br /&gt;
		// in ms&lt;br /&gt;
		int AudioDelay { get; set; }&lt;br /&gt;
		int SubTitleDelay { get; set; }&lt;br /&gt;
		int ChapterCount { get; }&lt;br /&gt;
		int Chapter { get; set; }&lt;br /&gt;
		int Program { get; set; }&lt;br /&gt;
&lt;br /&gt;
		void DeinterlaceModes(out String[] choices, out String[] choiceText);&lt;br /&gt;
		void AspectRatios(out String[] choices, out String[] choiceText);&lt;br /&gt;
		void CropModes(out String[] choices, out String[] choiceText);&lt;br /&gt;
		void AudioTracks(out int[] trackIds, out String[] trackNames);&lt;br /&gt;
		void SubTitleTracks(out int[] trackIds, out String[] trackNames);&lt;br /&gt;
		void Programs(out int[] trackIds, out String[] trackNames);&lt;br /&gt;
		void DisplayMessage(String message);&lt;br /&gt;
		bool SetConfigVariable(String name, String value);&lt;br /&gt;
		void PrecomputeCrop(Size videoSize, int cropLeft, int cropRight, int cropTop, int cropBottom);&lt;br /&gt;
		bool ComputeCrop();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6937</id>
		<title>.Net Interface to VLC</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=.Net_Interface_to_VLC&amp;diff=6937"/>
		<updated>2007-01-01T01:00:17Z</updated>

		<summary type="html">&lt;p&gt;Tappen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Work from Tappen and Odyssee on the forum.&lt;br /&gt;
&lt;br /&gt;
I started with Odysee&#039;s work [http://forum.videolan.org/viewtopic.php?t=28553] and wrote a .Net user control that uses libvlc interfaces to do what the ActiveX control does and more, like getting info about and getting/setting audio and subtitle tracks, aspect ratios, deinterlacing filters and more. This compiles in Visual C#.Net Express, free from Microsoft [http://msdn2.microsoft.com/en-us/vcsharp].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[IPlayer|IPlayer.cs]] is the main Interface supported by VlcUserControl, since something like this deserves the Bridge pattern treatment.  [[IPlayer|IPlayer.cs]] should really be in a different assembly from the control to allow other controls to support it and be used interchange-ably with VlcUserControl but that&#039;s up to you developers.&lt;br /&gt;
&lt;br /&gt;
[[NativeLibVlc|NativeLibVlc.cs]] contains the .Net Interop versions of the native VLC C++ structures and functions, and a class which wraps these calls in C#.&lt;/div&gt;</summary>
		<author><name>Tappen</name></author>
	</entry>
</feed>