Exemple #1
0
        /**
         * Starts a VLC interface plugin.
         *
         * @param name name of the interface plugin (e.g. "http", "qt4", ...)
         */
        public void AddInterface(string name)
        {
            U8String uname = new U8String(name);

            LibVLC.AddIntf(Handle, uname, ex);
            Raise();
        }
Exemple #2
0
        /**
         * Throws a managed exception if LibVLC has returned a native
         * unmanaged exception. Clears the native exception.
         */
        public void Raise()
        {
            if (raised == 0)
            {
                return;
            }

            string msg = U8String.FromNative(message);

            try
            {
                if (msg != null)
                {
                    throw new VLCException(code, msg);
                }
                else
                {
                    throw new VLCException(code);
                }
            }
            finally
            {
                LibVLC.ExceptionClear(this);
            }
        }
Exemple #3
0
        /**
         * Creates a Media object.
         *
         * @param instance VLC instance
         * @param mrl Media Resource Locator (file path or URL)
         */
        public Media(VLC instance, string mrl)
        {
            U8String umrl = new U8String(mrl);

            handle = LibVLC.MediaCreate(instance.Handle, umrl, ex);
            Raise();
            Attach();
        }
Exemple #4
0
        /**
         * Loads the native LibVLC and creates a LibVLC instance.
         *
         * @param args VLC command line parameters for the LibVLC Instance.
         */
        public VLC(string[] args)
        {
            U8String[] argv = new U8String[args.Length];
            for (int i = 0; i < args.Length; i++)
            {
                argv[i] = new U8String(args[i]);
            }

            handle = LibVLC.Create(argv.Length, argv, ex);
            Raise();
        }
Exemple #5
0
        /**
         * Add VLC input item options to the media.
         * @code
         * Media m = new Media(vlc, "http://www.example.com/music.ogg");
         * m.AddOptions(":http-user-agent=LibVLC.Net "
         *            + ":http-proxy=proxy:8080", true);
         * @endcode
         * @param options VLC options in VLC input item format
         *                (see example below)
         * @param trusted whether the options are set by a trusted agent
         *                (e.g. the local computer configuration) or not
         *                (e.g. a downloaded file).
         * @version VLC 0.9.9 if trusted is false
         */
        public void AddOptions(string options, bool trusted)
        {
            U8String uopts = new U8String(options);

            if (trusted)
            {
                LibVLC.MediaAddOption(Handle, uopts, ex);
            }
            else
            {
                LibVLC.MediaAddUntrustedOption(Handle, uopts, ex);
            }
            Raise();
        }
Exemple #6
0
        /**
         * Add VLC input item options to the media.
         * @code
         * Media m = new Media(vlc, "http://www.example.com/music.ogg");
         * m.AddOptions(":http-user-agent=LibVLC.Net "
         *            + ":http-proxy=proxy:8080", true);
         * @endcode
         * @param options VLC options in VLC input item format
         *                (see example below)
         * @param trusted whether the options are set by a trusted agent
         *                (e.g. the local computer configuration) or not
         *                (e.g. a downloaded file).
         * @version VLC 0.9.9 if trusted is false
         */
        public void AddOptions(string options, bool trusted)
        {
            U8String uopts = new U8String (options);

            if (trusted)
                LibVLC.MediaAddOption (Handle, uopts, ex);
            else
                LibVLC.MediaAddUntrustedOption (Handle, uopts, ex);
            Raise ();
        }
Exemple #7
0
        /**
         * Creates a Media object.
         *
         * @param instance VLC instance
         * @param mrl Media Resource Locator (file path or URL)
         */
        public Media(VLC instance, string mrl)
        {
            U8String umrl = new U8String (mrl);

            handle = LibVLC.MediaCreate (instance.Handle, umrl, ex);
            Raise ();
            Attach ();
        }
Exemple #8
0
        /**
         * Starts a VLC interface plugin.
         *
         * @param name name of the interface plugin (e.g. "http", "qt4", ...)
         */
        public void AddInterface(string name)
        {
            U8String uname = new U8String (name);

            LibVLC.AddIntf (Handle, uname, ex);
            Raise ();
        }
Exemple #9
0
        /**
         * Loads the native LibVLC and creates a LibVLC instance.
         *
         * @param args VLC command line parameters for the LibVLC Instance.
         */
        public VLC(string[] args)
        {
            U8String[] argv = new U8String[args.Length];
            for (int i = 0; i < args.Length; i++)
                argv[i] = new U8String (args[i]);

            handle = LibVLC.Create (argv.Length, argv, ex);
            Raise ();
        }
Exemple #10
0
 void MediaAddOption(MediaHandle media, U8String options,
                     NativeException ex);
Exemple #11
0
 MediaHandle MediaCreateAsNode(InstanceHandle inst, U8String name,
                               NativeException ex);
Exemple #12
0
 MediaHandle MediaCreate(InstanceHandle inst, U8String mrl,
                         NativeException ex);
Exemple #13
0
 void AddIntf(InstanceHandle h, U8String name, NativeException ex);
Exemple #14
0
 /**
  * Converts an heap-allocated nul-terminated UTF-8 characters array
  * into a managed string.
  * @return the resulting managed string.
  */
 public override string ToString()
 {
     return(U8String.FromNative(handle));
 }
Exemple #15
0
 void MediaAddOptionWithFlag(MediaHandle media, U8String options,
                             MediaOptionFlag flag,
                             NativeException ex);