From: RĂ©mi Denis-Courmont Date: Sun, 21 Oct 2007 15:42:29 +0000 (+0000) Subject: "Advanced" playlist add X-Git-Tag: 0.9.0-test0~4873 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9c4f520e6526f194e27b9d293132a492de05dde8;p=vlc "Advanced" playlist add --- diff --git a/bindings/cil/Makefile b/bindings/cil/Makefile index cebae61b7b..e6b6b187ec 100644 --- a/bindings/cil/Makefile +++ b/bindings/cil/Makefile @@ -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,$^) \ diff --git a/bindings/cil/libvlc.cs b/bindings/cil/libvlc.cs index f460831062..f2fbbfb2a3 100644 --- a/bindings/cil/libvlc.cs +++ b/bindings/cil/libvlc.cs @@ -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 */