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
40 * NonNullHandle.Destroy
42 protected override void Destroy ()
44 LibVLC.Release (handle, null);
49 * @brief VLC: VLC media player instance
52 * The VLC class provides represent a run-time instance of a media player.
53 * An instance can spawn multiple independent medias, however
54 * configuration settings, message logging, etc are common to all medias
55 * from the same instance.
57 public class VLC : BaseObject
59 internal InstanceHandle Handle
63 return handle as InstanceHandle;
68 * Loads the native LibVLC and creates a LibVLC instance.
70 * @param args VLC command line parameters for the LibVLC Instance.
72 public VLC (string[] args)
74 U8String[] argv = new U8String[args.Length];
75 for (int i = 0; i < args.Length; i++)
76 argv[i] = new U8String (args[i]);
78 handle = LibVLC.Create (argv.Length, argv, ex);
83 * Starts a VLC interface plugin.
85 * @param name name of the interface plugin (e.g. "http", "qt4", ...)
87 public void AddInterface (string name)
89 U8String uname = new U8String (name);
91 LibVLC.AddIntf (Handle, uname, ex);
96 * Waits until VLC instance exits. This can happen if a fatal error
97 * occurs (e.g. cannot parse the arguments), if the user has quit
98 * through an interface, or if the special vlc://quit item was played.
102 LibVLC.Wait (Handle);
106 * The human-readable LibVLC version number.
108 public static string Version
112 return U8String.FromNative (LibVLC.GetVersion ());
117 * The human-readable LibVLC C compiler infos.
119 public static string Compiler
123 return U8String.FromNative (LibVLC.GetCompiler ());
128 * The unique commit identifier from the LibVLC source control system,
129 * or "exported" if unknown.
131 public static string ChangeSet
135 return U8String.FromNative (LibVLC.GetChangeset ());
140 * The unmanaged VLC-internal instance object.
141 * Do not use this unless you really know what you are doing.
143 public SafeHandle Object
147 return LibVLC.GetVLCInstance (Handle);