Beispiel #1
0
        static void Initialize(IntPtr ptr, IntPtr data)
        {
            IntPtr        ifaceptr     = new IntPtr(ptr.ToInt64() + class_offset);
            GstMixerClass native_iface = (GstMixerClass)Marshal.PtrToStructure(ifaceptr, typeof(GstMixerClass));

            native_iface.ListTracks    = iface.ListTracks;
            native_iface.SetVolume     = iface.SetVolume;
            native_iface.GetVolume     = iface.GetVolume;
            native_iface.SetMute       = iface.SetMute;
            native_iface.SetRecord     = iface.SetRecord;
            native_iface.SetOption     = iface.SetOption;
            native_iface.GetOption     = iface.GetOption;
            native_iface.GetMixerFlags = iface.GetMixerFlags;

            GCHandle gch = (GCHandle)data;

            MixerAdapter     adapter     = gch.Target as MixerAdapter;
            MixerImplementor implementor = adapter.Implementor;

            if (implementor != null)
            {
                PropertyInfo pi = implementor.GetType().GetProperty("MixerType", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy);
                if (pi != null && pi.PropertyType == typeof(Gst.Interfaces.MixerType))
                {
                    native_iface.MixerType = (Gst.Interfaces.MixerType)pi.GetValue(null, null);
                }
            }

            Marshal.StructureToPtr(native_iface, ifaceptr, false);
            gch.Free();
        }
Beispiel #2
0
 static void SetOption_cb(IntPtr inst, IntPtr opts, IntPtr value)
 {
     try {
         MixerImplementor __obj = GLib.Object.GetObject(inst, false) as MixerImplementor;
         __obj.SetOption(GLib.Object.GetObject(opts) as Gst.Interfaces.MixerOptions, GLib.Marshaller.PtrToStringGFree(value));
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, false);
     }
 }
Beispiel #3
0
 static void SetRecord_cb(IntPtr inst, IntPtr track, bool record)
 {
     try {
         MixerImplementor __obj = GLib.Object.GetObject(inst, false) as MixerImplementor;
         __obj.SetRecord(GLib.Object.GetObject(track) as Gst.Interfaces.MixerTrack, record);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, false);
     }
 }
Beispiel #4
0
 static IntPtr ListTracks_cb(IntPtr inst)
 {
     try {
         MixerImplementor            __obj    = GLib.Object.GetObject(inst, false) as MixerImplementor;
         Gst.Interfaces.MixerTrack[] __result = __obj.ListTracks();
         return(new GLib.List(__result, typeof(Gst.Interfaces.MixerTrack), false, false) == null ? IntPtr.Zero : new GLib.List(__result, typeof(Gst.Interfaces.MixerTrack), false, false).Handle);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: above call does not return.
         throw e;
     }
 }
Beispiel #5
0
 public MixerAdapter(MixerImplementor implementor)
 {
     if (implementor == null)
     {
         throw new ArgumentNullException("implementor");
     }
     else if (!(implementor is GLib.Object))
     {
         throw new ArgumentException("implementor must be a subclass of GLib.Object");
     }
     this.implementor = implementor as GLib.Object;
 }
Beispiel #6
0
 static int GetMixerFlags_cb(IntPtr inst)
 {
     try {
         MixerImplementor          __obj    = GLib.Object.GetObject(inst, false) as MixerImplementor;
         Gst.Interfaces.MixerFlags __result = __obj.MixerFlags;
         return((int)__result);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: above call does not return.
         throw e;
     }
 }
Beispiel #7
0
 static IntPtr GetOption_cb(IntPtr inst, IntPtr opts)
 {
     try {
         MixerImplementor __obj    = GLib.Object.GetObject(inst, false) as MixerImplementor;
         string           __result = __obj.GetOption(GLib.Object.GetObject(opts) as Gst.Interfaces.MixerOptions);
         return(GLib.Marshaller.StringToPtrGStrdup(__result));
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: above call does not return.
         throw e;
     }
 }
Beispiel #8
0
 static void SetVolume_cb(IntPtr inst, IntPtr track, IntPtr volumes)
 {
     try {
         MixerImplementor __obj           = GLib.Object.GetObject(inst, false) as MixerImplementor;
         MixerTrack       managed_track   = GLib.Object.GetObject(track) as MixerTrack;
         int[]            managed_volumes = new int[managed_track.NumChannels];
         Marshal.Copy(volumes, managed_volumes, 0, managed_track.NumChannels);
         __obj.SetVolume(managed_track, managed_volumes);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: above call does not return.
         throw e;
     }
 }
Beispiel #9
0
		public MixerAdapter (MixerImplementor implementor)
		{
			if (implementor == null)
				throw new ArgumentNullException ("implementor");
			else if (!(implementor is Gst.GLib.Object))
				throw new ArgumentException ("implementor must be a subclass of Gst.GLib.Object");
			this.implementor = implementor as Gst.GLib.Object;
		}