3 * @brief Bindings to LibVLC for the .NET Common Intermediate Language
6 * @defgroup API Managed interface to LibVLC
7 * This is the primary class library for .NET applications
8 * to embed and control LibVLC.
11 /**********************************************************************
12 * Copyright (C) 2007-2009 RĂ©mi Denis-Courmont. *
13 * This program is free software; you can redistribute and/or modify *
14 * it under the terms of the GNU General Public License as published *
15 * by the Free Software Foundation; version 2 of the license, or (at *
16 * your option) any later version. *
18 * This program is distributed in the hope that it will be useful, *
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
21 * See the GNU General Public License for more details. *
23 * You should have received a copy of the GNU General Public License *
24 * along with this program; if not, you can get it from: *
25 * http://www.gnu.org/copyleft/gpl.html *
26 **********************************************************************/
29 using System.Runtime.InteropServices;
31 namespace VideoLAN.LibVLC
34 * @brief InstanceHandle: unmanaged LibVLC instance pointer
37 internal sealed class InstanceHandle : NonNullHandle
39 protected override void Destroy ()
41 LibVLC.Release (handle, null);
46 * @brief VLC: VLC media player instance
49 * The VLC class provides represent a run-time instance of a media player.
50 * An instance can spawn multiple independent medias, however
51 * configuration settings, message logging, etc are common to all medias
52 * from the same instance.
54 public class VLC : BaseObject
56 internal InstanceHandle Handle
60 return handle as InstanceHandle;
65 * Loads the native LibVLC and creates a LibVLC instance.
67 * @param args VLC command line parameters for the LibVLC Instance.
69 public VLC (string[] args)
71 U8String[] argv = new U8String[args.Length];
72 for (int i = 0; i < args.Length; i++)
73 argv[i] = new U8String (args[i]);
75 handle = LibVLC.Create (argv.Length, argv, ex);
80 * Starts a VLC interface plugin.
82 * @param name name of the interface plugin (e.g. "http", "qt4", ...)
84 public void AddInterface (string name)
86 U8String uname = new U8String (name);
88 LibVLC.AddIntf (Handle, uname, ex);
93 * Waits until VLC instance exits. This can happen if a fatal error
94 * occurs (e.g. cannot parse the arguments), if the user has quit
95 * through an interface, or if the special vlc://quit item was played.
103 * The human-readable LibVLC version number.
105 public static string Version
109 return U8String.FromNative (LibVLC.GetVersion ());
114 * The human-readable LibVLC C compiler infos.
116 public static string Compiler
120 return U8String.FromNative (LibVLC.GetCompiler ());
125 * The unique commit identifier from the LibVLC source control system,
126 * or "exported" if unknown.
128 public static string ChangeSet
132 return U8String.FromNative (LibVLC.GetChangeset ());
137 * The unmanaged VLC-internal instance object.
138 * Do not use this unless you really know what you are doing.
140 public SafeHandle Object
144 return LibVLC.GetVLCInstance (Handle);