예제 #1
0
        public void GetListChoices(String name, out IList <String> choices)
        {
            if (_vlcObject.IsInvalid)
            {
                throw new ApplicationException("VLC object is NULL");
            }

            choices = new List <String>();

            vlc_value_t a = new vlc_value_t();
            vlc_value_t b = new vlc_value_t();

            __var_Change(_vlcObject, name, VlcChangeAction.GetList, ref a, ref b);

            try
            {
                vlc_list_t t = (vlc_list_t)Marshal.PtrToStructure(b.p_list, typeof(vlc_list_t));
                for (int i = 0; i < t.i_count; i++)
                {
                    IntPtr      textPtr   = new IntPtr(t.p_values.ToInt32() + i * Marshal.SizeOf(typeof(vlc_value_t)));
                    vlc_value_t textValue = (vlc_value_t)Marshal.PtrToStructure(textPtr, typeof(vlc_value_t));
                    choices.Add(Marshal.PtrToStringAnsi(textValue.psz_string));
                }
            }
            finally
            {
                __var_Change(_vlcObject, name, VlcChangeAction.FreeList, ref a, ref b);
            }
        }
예제 #2
0
        public void SetBoolValue(String name, Boolean val)
        {
            if (_vlcObject.IsInvalid)
            {
                throw new ApplicationException("VLC object is NULL");
            }

            vlc_value_t v = new vlc_value_t();

            v.b_bool = val ? 1 : 0;
            __var_Set(_vlcObject, name, ref v);
        }
예제 #3
0
        public void SetIntValue(String name, Int32 val)
        {
            if (_vlcObject.IsInvalid)
            {
                throw new ApplicationException("VLC object is NULL");
            }

            vlc_value_t v = new vlc_value_t();

            v.i_int = val;
            __var_Set(_vlcObject, name, ref v);
        }
예제 #4
0
        public Boolean GetBoolValue(string name)
        {
            if (_vlcObject.IsInvalid)
            {
                throw new ApplicationException("VLC object is NULL");
            }

            vlc_value_t v = new vlc_value_t();

            __var_Get(_vlcObject, name, ref v);

            return(v.b_bool != 0);
        }
예제 #5
0
        public Int32 GetIntValue(String name)
        {
            if (_vlcObject.IsInvalid)
            {
                throw new ApplicationException("VLC object is NULL");
            }

            vlc_value_t v = new vlc_value_t();

            __var_Get(_vlcObject, name, ref v);

            return(v.i_int);
        }
예제 #6
0
        public String GetStringValue(String name)
        {
            if (_vlcObject.IsInvalid)
            {
                throw new ApplicationException("VLC object is NULL");
            }

            vlc_value_t v = new vlc_value_t();

            __var_Get(_vlcObject, name, ref v);

            return(Marshal.PtrToStringAuto(v.psz_string));
        }
예제 #7
0
        public void SetStringValue(String name, String val)
        {
            if (_vlcObject.IsInvalid)
            {
                throw new ApplicationException("VLC object is NULL");
            }

            vlc_value_t v = new vlc_value_t();

            v.psz_string = Marshal.StringToHGlobalAnsi(val);
            try
            {
                __var_Set(_vlcObject, name, ref v);
            }
            finally
            {
                Marshal.FreeHGlobal(v.psz_string);
            }
        }
예제 #8
0
 private static extern Int32 __var_Change(VlcObjectHandle p_ojbect, [MarshalAs(UnmanagedType.LPStr)] String name, VlcChangeAction action, ref vlc_value_t valA, ref vlc_value_t valB);
예제 #9
0
 private static extern Int32 __var_Set(VlcObjectHandle p_object, [MarshalAs(UnmanagedType.LPStr)] String name, ref vlc_value_t value);