Beispiel #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 ();
       }
 }
Beispiel #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 ();
        }
Beispiel #3
0
		static extern void g_value_set_string (ref Value val, IntPtr data);
Beispiel #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 ();
   }
 }
Beispiel #5
0
		static extern uint g_value_get_flags (ref Value val);
Beispiel #6
0
		static extern uint g_value_get_uint (ref Value val);
Beispiel #7
0
		static extern IntPtr g_value_get_pointer (ref Value val);
Beispiel #8
0
		static extern IntPtr g_value_get_object (ref Value val);
Beispiel #9
0
		static extern sbyte g_value_get_char (ref Value val);
Beispiel #10
0
		static extern byte g_value_get_uchar (ref Value val);
Beispiel #11
0
		static extern bool g_value_get_boolean (ref Value val);
Beispiel #12
0
		static extern void g_value_set_flags (ref Value val, uint data);
Beispiel #13
0
		static extern void g_value_set_enum (ref Value val, int data);
Beispiel #14
0
		static extern void g_value_set_ulong (ref Value val, uint data);
Beispiel #15
0
		static extern void g_value_set_ulong (ref Value val, UIntPtr data);
Beispiel #16
0
		static extern UIntPtr g_value_get_ulong (ref Value val);
Beispiel #17
0
		static extern int g_value_get_ulong_as_uint (ref Value val);
Beispiel #18
0
		static extern IntPtr g_value_get_boxed (ref Value val);
Beispiel #19
0
		static extern IntPtr g_value_get_param (ref Value val);
Beispiel #20
0
		static extern double g_value_get_double (ref Value val);
Beispiel #21
0
		static extern IntPtr g_value_get_string (ref Value val);
Beispiel #22
0
		static extern float g_value_get_float (ref Value val);
Beispiel #23
0
		static extern int g_value_get_enum (ref Value val);
Beispiel #24
0
		static extern int g_value_get_int (ref Value val);
Beispiel #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 ();
 }
Beispiel #26
0
		static extern long g_value_get_int64 (ref Value val);
Beispiel #27
0
		static extern IntPtr g_value_get_long (ref Value val);
Beispiel #28
0
		static extern ulong g_value_get_uint64 (ref Value val);
Beispiel #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) {}
    }
Beispiel #30
0
		static extern void g_value_set_pointer (ref Value val, IntPtr data);