]> git.sesse.net Git - vlc/commitdiff
"Advanced" playlist add
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 21 Oct 2007 15:42:29 +0000 (15:42 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 21 Oct 2007 15:42:29 +0000 (15:42 +0000)
bindings/cil/Makefile
bindings/cil/libvlc.cs

index cebae61b7b9a7684a184c304330df84443396247..e6b6b187ec6c2a46127b5919ccd82c1af729b5be 100644 (file)
@@ -1,15 +1,15 @@
 CS = gmcs -codepage:utf8
 CSFLAGS =
 
-TARGETS = VideoLAN.VLC.Control.dll testvlc.exe
+TARGETS = VideoLAN.LibVLC.dll testvlc.exe
 
 all: $(TARGETS)
 
 clean:
-       rm -f -- $(TARGETS) *.netmodule *~
+       rm -f -- *.netmodule *.dll *.exe *~
 
-VideoLAN.VLC.Control.dll: marshal.cs ustring.cs exception.cs libvlc.cs
-testvlc.exe: testvlc.cs VideoLAN.VLC.Control.dll
+VideoLAN.LibVLC.dll: marshal.cs ustring.cs exception.cs libvlc.cs
+testvlc.exe: testvlc.cs VideoLAN.LibVLC.dll
 
 %.netmodule: %.cs Makefile
        $(CS) -target:module -out:$@ $(CSFLAGS) $(filter %.cs,$^) \
index f460831062ba3ca6c4bd3d55fbdf7b848ded097b..f2fbbfb2a39aa2708996916d55023f8b641f141e 100644 (file)
@@ -84,14 +84,14 @@ namespace VideoLAN.LibVLC
 
 
         [DllImport ("libvlc-control.dll", EntryPoint="libvlc_playlist_loop")]
-        static extern void PlaylistLoop (InstanceHandle self, int b,
+        static extern void PlaylistLoop (InstanceHandle self, bool b,
                                          NativeException ex);
         /** Sets the playlist loop flag */
         public bool Loop
         {
             set
             {
-                PlaylistLoop (self, value ? 1 : 0, ex);
+                PlaylistLoop (self, value, ex);
                 ex.Raise ();
             }
         }
@@ -171,23 +171,35 @@ namespace VideoLAN.LibVLC
             ex.Raise ();
         }
 
-        [DllImport ("libvlc-control.dll", EntryPoint="libvlc_playlist_add")]
+        [DllImport ("libvlc-control.dll",
+                    EntryPoint="libvlc_playlist_add_extended")]
         static extern void PlaylistAdd (InstanceHandle self, U8String uri,
-                                        U8String name, NativeException e);
-        /** Appends an item to the playlist */
-        public void Add (string mrl)
-        {
-            Add (mrl, null);
-        }
-        /** Appends an item to the playlist */
-        public void Add (string mrl, string name)
+                                        U8String name, int optc,
+                                        U8String[] optv, NativeException e);
+        /** Appends an item to the playlist with options */
+        public void Add (string mrl, string name, string[] opts)
         {
             U8String umrl = new U8String (mrl);
             U8String uname = new U8String (name);
+            U8String[] optv = new U8String[opts.Length];
+            for (int i = 0; i < opts.Length; i++)
+                optv[i] = new U8String (opts[i]);
 
-            PlaylistAdd (self, umrl, uname, ex);
+            PlaylistAdd (self, umrl, uname, optv.Length, optv, ex);
             ex.Raise ();
         }
+        public void Add (string mrl, string[] opts)
+        {
+            Add (mrl, null, opts);
+        }
+        public void Add (string mrl, string name)
+        {
+            Add (mrl, name, new string[0]);
+        }
+        public void Add (string mrl)
+        {
+            Add (mrl, null, new string[0]);
+        }
     };
 
     /** Safe handle for unmanaged LibVLC media descriptor */