2 * libvlc.cs - libvlc-control CIL bindings
7 /**********************************************************************
8 * Copyright (C) 2007 RĂ©mi Denis-Courmont. *
9 * This program is free software; you can redistribute and/or modify *
10 * it under the terms of the GNU General Public License as published *
11 * by the Free Software Foundation; version 2 of the license, or (at *
12 * your option) any later version. *
14 * This program is distributed in the hope that it will be useful, *
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
17 * See the GNU General Public License for more details. *
19 * You should have received a copy of the GNU General Public License *
20 * along with this program; if not, you can get it from: *
21 * http://www.gnu.org/copyleft/gpl.html *
22 **********************************************************************/
25 using System.Runtime.InteropServices;
27 namespace VideoLAN.VLC
30 public class MediaControl : IDisposable
33 * Possible player status
60 MediaControlHandle self;
62 private void CheckDisposed ()
65 throw new ObjectDisposedException ("Media controlled disposed");
69 * Creates a MediaControl with a new LibVLC instance
71 public MediaControl (string[] args)
73 NativeException e = NativeException.Prepare ();
75 U8String[] argv = new U8String[args.Length];
76 for (int i = 0; i < args.Length; i++)
77 argv[i] = new U8String (args[i]);
79 self = MediaControlAPI.New (argv.Length, argv, ref e);
84 * Creates a MediaControl from an existing LibVLC instance
86 /*public MediaControl (MediaControl instance)
88 NativeException e = NativeException.Prepare ();
89 IntPtr libvlc = mediacontrol_get_libvlc_instance (instance.self);
91 self = mediacontrol_new_from_instance (libvlc, ref e);
95 /*public void Play (from)
98 throw new NotImplementedException ();
101 public void Resume ()
104 NativeException e = NativeException.Prepare ();
106 MediaControlAPI.Resume (self, IntPtr.Zero, ref e);
113 NativeException e = NativeException.Prepare ();
115 MediaControlAPI.Pause (self, IntPtr.Zero, ref e);
123 NativeException e = NativeException.Prepare ();
124 MediaControlAPI.Stop (self, IntPtr.Zero, ref e);
128 public void AddItem (string mrl)
132 U8String nmrl = new U8String (mrl);
133 NativeException e = NativeException.Prepare ();
134 MediaControlAPI.PlaylistAddItem (self, nmrl, ref e);
142 NativeException e = NativeException.Prepare ();
143 MediaControlAPI.PlaylistClear (self, ref e);
147 public string[] Playlist
152 throw new NotImplementedException ();
156 public void NextItem ()
160 NativeException e = NativeException.Prepare ();
161 MediaControlAPI.PlaylistNextItem (self, ref e);
165 public void Dispose ()