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); } }
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); }
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); }
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); }
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); }
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)); }
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); } }
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);
private static extern Int32 __var_Set(VlcObjectHandle p_object, [MarshalAs(UnmanagedType.LPStr)] String name, ref vlc_value_t value);