Example #1
0
 public object this[string property]
 {
     get {
         if (PropertyExists (property)) {
             using (GLib.Value v = GetProperty (property)) {
                 return v.Val;
             }
         } else
             throw new PropertyNotFoundException ();
       } set {
         if (PropertyExists (property)) {
             if (value == null) {
                 throw new ArgumentNullException ();
             }
             var type = value.GetType ();
             var gtype = (GLib.GType)type;
             if (gtype == null) {
                 throw new Exception ("Could not find a GType for type " + type.FullName);
             }
             GLib.Value v = new GLib.Value ((GLib.GType)value.GetType ());
             v.Val = value;
             SetProperty (property, v);
             v.Dispose ();
         } else
             throw new PropertyNotFoundException ();
       }
 }
Example #2
0
        public void Add(Gst.TagMergeMode mode, string tag, object value)
        {
            if (!Tag.Exists (tag))
                throw new ArgumentException (String.Format ("Invalid tag name '{0}'", tag));

            GLib.Value v = new GLib.Value (value);

            AddValue (mode, tag, v);
            v.Dispose ();
        }
Example #3
0
		static extern void g_value_set_string (ref Value val, IntPtr data);
Example #4
0
 public void SetGValue (ref Gst.GLib.Value val) {
   foreach (object o in content) {
     Gst.GLib.Value v = new Gst.GLib.Value (o);
     gst_value_array_append_value (ref val, ref v);
     v.Dispose ();
   }
 }
Example #5
0
		static extern uint g_value_get_flags (ref Value val);
Example #6
0
		static extern uint g_value_get_uint (ref Value val);
Example #7
0
		static extern IntPtr g_value_get_pointer (ref Value val);
Example #8
0
		static extern IntPtr g_value_get_object (ref Value val);
Example #9
0
		static extern sbyte g_value_get_char (ref Value val);
Example #10
0
		static extern byte g_value_get_uchar (ref Value val);
Example #11
0
		static extern bool g_value_get_boolean (ref Value val);
Example #12
0
		static extern void g_value_set_flags (ref Value val, uint data);
Example #13
0
		static extern void g_value_set_enum (ref Value val, int data);
Example #14
0
		static extern void g_value_set_ulong (ref Value val, uint data);
Example #15
0
		static extern void g_value_set_ulong (ref Value val, UIntPtr data);
Example #16
0
		static extern UIntPtr g_value_get_ulong (ref Value val);
Example #17
0
		static extern int g_value_get_ulong_as_uint (ref Value val);
Example #18
0
		static extern IntPtr g_value_get_boxed (ref Value val);
Example #19
0
		static extern IntPtr g_value_get_param (ref Value val);
Example #20
0
		static extern double g_value_get_double (ref Value val);
Example #21
0
		static extern IntPtr g_value_get_string (ref Value val);
Example #22
0
		static extern float g_value_get_float (ref Value val);
Example #23
0
		static extern int g_value_get_enum (ref Value val);
Example #24
0
		static extern int g_value_get_int (ref Value val);
Example #25
0
 public void SetGValue (ref Gst.GLib.Value val) {
   Gst.GLib.Value min = new Gst.GLib.Value (Min);
   Gst.GLib.Value max = new Gst.GLib.Value (Max);
   gst_value_set_fraction_range (ref val, ref min, ref max);
   min.Dispose ();
   max.Dispose ();
 }
Example #26
0
		static extern long g_value_get_int64 (ref Value val);
Example #27
0
		static extern IntPtr g_value_get_long (ref Value val);
Example #28
0
		static extern ulong g_value_get_uint64 (ref Value val);
Example #29
0
    public PropertyInfo (IntPtr pspec_ptr) {
      GParamSpec pspec = (GParamSpec) Marshal.PtrToStructure (pspec_ptr, typeof (GParamSpec));
      IntPtr name = g_param_spec_get_name (pspec_ptr);
      IntPtr nick = g_param_spec_get_nick (pspec_ptr);
      IntPtr blurb = g_param_spec_get_blurb (pspec_ptr);

      this.name = Gst.GLib.Marshaller.Utf8PtrToString (name);
      this.nick = Gst.GLib.Marshaller.Utf8PtrToString (nick);
      this.blurb = Gst.GLib.Marshaller.Utf8PtrToString (blurb);

      this.readable = ( (pspec.Flags & (1 << 0)) != 0);
      this.writeable = ( (pspec.Flags & (1 << 1)) != 0);
      this.controllable = ( (pspec.Flags & (1 << 9)) != 0);
      /* TODO: Add more flags later, like the mutable flags */

      this.gtype = new Gst.GLib.GType (pspec.ValueType);
      this.type = (System.Type) this.gtype;

      this.dflt = this.min = this.max = null;

      try {
        Gst.GLib.Value v = new Gst.GLib.Value (new Gst.GLib.GType (pspec.ValueType));
        g_param_value_set_default (pspec_ptr, ref v);
        this.dflt = v.Val;
        v.Dispose ();

        if (EnumInfo.IsEnumType (this.gtype)) {
          EnumInfo ei = new EnumInfo (this.gtype);
          this.min = ei.Min;
          this.max = ei.Max;
        } else {
          Gst.GLib.Value min = new Gst.GLib.Value (new Gst.GLib.GType (pspec.ValueType));
          Gst.GLib.Value max = new Gst.GLib.Value (new Gst.GLib.GType (pspec.ValueType));
          if (gstsharp_g_param_spec_get_range (pspec_ptr, ref min, ref max)) {
            this.min = (object) min.Val;
            this.max = (object) max.Val;
          }
          min.Dispose ();
          max.Dispose ();
        }
      } catch (Exception) {}
    }
Example #30
0
		static extern void g_value_set_pointer (ref Value val, IntPtr data);