1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
7 using System.Collections;
8 using System.Collections.Generic;
9 using System.Runtime.InteropServices;
11 #region Autogenerated code
12 public partial class AudioRingBuffer : Gst.Object {
14 protected AudioRingBuffer (IntPtr raw) : base(raw) {}
16 protected AudioRingBuffer() : base(IntPtr.Zero)
18 CreateNativeObject (new string [0], new GLib.Value [0]);
21 public GLib.Cond Cond {
24 IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("cond"));
25 return new GLib.Cond((*raw_ptr));
33 bool* raw_ptr = (bool*)(((byte*)Handle) + abi_info.GetFieldOffset("open"));
39 public bool Acquired {
42 bool* raw_ptr = (bool*)(((byte*)Handle) + abi_info.GetFieldOffset("acquired"));
51 byte* raw_ptr = (byte*)(((byte*)Handle) + abi_info.GetFieldOffset("memory"));
60 UIntPtr* raw_ptr = (UIntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("size"));
61 return (ulong) (*raw_ptr);
66 public Gst.Audio.AudioRingBufferSpec Spec {
69 IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("spec"));
70 return (*raw_ptr) == IntPtr.Zero ? null : (Gst.Audio.AudioRingBufferSpec) GLib.Opaque.GetOpaque ((*raw_ptr), typeof (Gst.Audio.AudioRingBufferSpec), false);
75 public int SamplesPerSeg {
78 int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("samples_per_seg"));
84 public byte EmptySeg {
87 byte* raw_ptr = (byte*)(((byte*)Handle) + abi_info.GetFieldOffset("empty_seg"));
96 int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("state"));
105 int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("segdone"));
114 int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("segbase"));
123 int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("waiting"));
129 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
130 static extern void gst_audio_ring_buffer_set_flushing(IntPtr raw, bool flushing);
132 public bool Flushing {
134 gst_audio_ring_buffer_set_flushing(Handle, value);
138 static OpenDeviceNativeDelegate OpenDevice_cb_delegate;
139 static OpenDeviceNativeDelegate OpenDeviceVMCallback {
141 if (OpenDevice_cb_delegate == null)
142 OpenDevice_cb_delegate = new OpenDeviceNativeDelegate (OpenDevice_cb);
143 return OpenDevice_cb_delegate;
147 static void OverrideOpenDevice (GLib.GType gtype)
149 OverrideOpenDevice (gtype, OpenDeviceVMCallback);
152 static void OverrideOpenDevice (GLib.GType gtype, OpenDeviceNativeDelegate callback)
155 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("open_device"));
156 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
160 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
161 delegate bool OpenDeviceNativeDelegate (IntPtr inst);
163 static bool OpenDevice_cb (IntPtr inst)
166 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
168 __result = __obj.OnOpenDevice ();
170 } catch (Exception e) {
171 GLib.ExceptionManager.RaiseUnhandledException (e, true);
172 // NOTREACHED: above call does not return.
177 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideOpenDevice")]
178 protected virtual bool OnOpenDevice ()
180 return InternalOpenDevice ();
183 private bool InternalOpenDevice ()
185 OpenDeviceNativeDelegate unmanaged = null;
187 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("open_device"));
188 unmanaged = (OpenDeviceNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(OpenDeviceNativeDelegate));
190 if (unmanaged == null) return false;
192 bool __result = unmanaged (this.Handle);
196 static AcquireNativeDelegate Acquire_cb_delegate;
197 static AcquireNativeDelegate AcquireVMCallback {
199 if (Acquire_cb_delegate == null)
200 Acquire_cb_delegate = new AcquireNativeDelegate (Acquire_cb);
201 return Acquire_cb_delegate;
205 static void OverrideAcquire (GLib.GType gtype)
207 OverrideAcquire (gtype, AcquireVMCallback);
210 static void OverrideAcquire (GLib.GType gtype, AcquireNativeDelegate callback)
213 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("acquire"));
214 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
218 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
219 delegate bool AcquireNativeDelegate (IntPtr inst, IntPtr spec);
221 static bool Acquire_cb (IntPtr inst, IntPtr spec)
224 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
226 __result = __obj.OnAcquire (spec == IntPtr.Zero ? null : (Gst.Audio.AudioRingBufferSpec) GLib.Opaque.GetOpaque (spec, typeof (Gst.Audio.AudioRingBufferSpec), false));
228 } catch (Exception e) {
229 GLib.ExceptionManager.RaiseUnhandledException (e, true);
230 // NOTREACHED: above call does not return.
235 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideAcquire")]
236 protected virtual bool OnAcquire (Gst.Audio.AudioRingBufferSpec spec)
238 return InternalAcquire (spec);
241 private bool InternalAcquire (Gst.Audio.AudioRingBufferSpec spec)
243 AcquireNativeDelegate unmanaged = null;
245 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("acquire"));
246 unmanaged = (AcquireNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AcquireNativeDelegate));
248 if (unmanaged == null) return false;
250 bool __result = unmanaged (this.Handle, spec == null ? IntPtr.Zero : spec.Handle);
254 static ReleaseNativeDelegate Release_cb_delegate;
255 static ReleaseNativeDelegate ReleaseVMCallback {
257 if (Release_cb_delegate == null)
258 Release_cb_delegate = new ReleaseNativeDelegate (Release_cb);
259 return Release_cb_delegate;
263 static void OverrideRelease (GLib.GType gtype)
265 OverrideRelease (gtype, ReleaseVMCallback);
268 static void OverrideRelease (GLib.GType gtype, ReleaseNativeDelegate callback)
271 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("release"));
272 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
276 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
277 delegate bool ReleaseNativeDelegate (IntPtr inst);
279 static bool Release_cb (IntPtr inst)
282 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
284 __result = __obj.OnRelease ();
286 } catch (Exception e) {
287 GLib.ExceptionManager.RaiseUnhandledException (e, true);
288 // NOTREACHED: above call does not return.
293 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideRelease")]
294 protected virtual bool OnRelease ()
296 return InternalRelease ();
299 private bool InternalRelease ()
301 ReleaseNativeDelegate unmanaged = null;
303 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("release"));
304 unmanaged = (ReleaseNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ReleaseNativeDelegate));
306 if (unmanaged == null) return false;
308 bool __result = unmanaged (this.Handle);
312 static CloseDeviceNativeDelegate CloseDevice_cb_delegate;
313 static CloseDeviceNativeDelegate CloseDeviceVMCallback {
315 if (CloseDevice_cb_delegate == null)
316 CloseDevice_cb_delegate = new CloseDeviceNativeDelegate (CloseDevice_cb);
317 return CloseDevice_cb_delegate;
321 static void OverrideCloseDevice (GLib.GType gtype)
323 OverrideCloseDevice (gtype, CloseDeviceVMCallback);
326 static void OverrideCloseDevice (GLib.GType gtype, CloseDeviceNativeDelegate callback)
329 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("close_device"));
330 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
334 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
335 delegate bool CloseDeviceNativeDelegate (IntPtr inst);
337 static bool CloseDevice_cb (IntPtr inst)
340 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
342 __result = __obj.OnCloseDevice ();
344 } catch (Exception e) {
345 GLib.ExceptionManager.RaiseUnhandledException (e, true);
346 // NOTREACHED: above call does not return.
351 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideCloseDevice")]
352 protected virtual bool OnCloseDevice ()
354 return InternalCloseDevice ();
357 private bool InternalCloseDevice ()
359 CloseDeviceNativeDelegate unmanaged = null;
361 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("close_device"));
362 unmanaged = (CloseDeviceNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CloseDeviceNativeDelegate));
364 if (unmanaged == null) return false;
366 bool __result = unmanaged (this.Handle);
370 static StartNativeDelegate Start_cb_delegate;
371 static StartNativeDelegate StartVMCallback {
373 if (Start_cb_delegate == null)
374 Start_cb_delegate = new StartNativeDelegate (Start_cb);
375 return Start_cb_delegate;
379 static void OverrideStart (GLib.GType gtype)
381 OverrideStart (gtype, StartVMCallback);
384 static void OverrideStart (GLib.GType gtype, StartNativeDelegate callback)
387 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
388 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
392 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
393 delegate bool StartNativeDelegate (IntPtr inst);
395 static bool Start_cb (IntPtr inst)
398 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
400 __result = __obj.OnStart ();
402 } catch (Exception e) {
403 GLib.ExceptionManager.RaiseUnhandledException (e, true);
404 // NOTREACHED: above call does not return.
409 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideStart")]
410 protected virtual bool OnStart ()
412 return InternalStart ();
415 private bool InternalStart ()
417 StartNativeDelegate unmanaged = null;
419 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
420 unmanaged = (StartNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StartNativeDelegate));
422 if (unmanaged == null) return false;
424 bool __result = unmanaged (this.Handle);
428 static PauseNativeDelegate Pause_cb_delegate;
429 static PauseNativeDelegate PauseVMCallback {
431 if (Pause_cb_delegate == null)
432 Pause_cb_delegate = new PauseNativeDelegate (Pause_cb);
433 return Pause_cb_delegate;
437 static void OverridePause (GLib.GType gtype)
439 OverridePause (gtype, PauseVMCallback);
442 static void OverridePause (GLib.GType gtype, PauseNativeDelegate callback)
445 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("pause"));
446 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
450 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
451 delegate bool PauseNativeDelegate (IntPtr inst);
453 static bool Pause_cb (IntPtr inst)
456 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
458 __result = __obj.OnPause ();
460 } catch (Exception e) {
461 GLib.ExceptionManager.RaiseUnhandledException (e, true);
462 // NOTREACHED: above call does not return.
467 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverridePause")]
468 protected virtual bool OnPause ()
470 return InternalPause ();
473 private bool InternalPause ()
475 PauseNativeDelegate unmanaged = null;
477 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("pause"));
478 unmanaged = (PauseNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(PauseNativeDelegate));
480 if (unmanaged == null) return false;
482 bool __result = unmanaged (this.Handle);
486 static ResumeNativeDelegate Resume_cb_delegate;
487 static ResumeNativeDelegate ResumeVMCallback {
489 if (Resume_cb_delegate == null)
490 Resume_cb_delegate = new ResumeNativeDelegate (Resume_cb);
491 return Resume_cb_delegate;
495 static void OverrideResume (GLib.GType gtype)
497 OverrideResume (gtype, ResumeVMCallback);
500 static void OverrideResume (GLib.GType gtype, ResumeNativeDelegate callback)
503 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("resume"));
504 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
508 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
509 delegate bool ResumeNativeDelegate (IntPtr inst);
511 static bool Resume_cb (IntPtr inst)
514 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
516 __result = __obj.OnResume ();
518 } catch (Exception e) {
519 GLib.ExceptionManager.RaiseUnhandledException (e, true);
520 // NOTREACHED: above call does not return.
525 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideResume")]
526 protected virtual bool OnResume ()
528 return InternalResume ();
531 private bool InternalResume ()
533 ResumeNativeDelegate unmanaged = null;
535 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("resume"));
536 unmanaged = (ResumeNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ResumeNativeDelegate));
538 if (unmanaged == null) return false;
540 bool __result = unmanaged (this.Handle);
544 static StopNativeDelegate Stop_cb_delegate;
545 static StopNativeDelegate StopVMCallback {
547 if (Stop_cb_delegate == null)
548 Stop_cb_delegate = new StopNativeDelegate (Stop_cb);
549 return Stop_cb_delegate;
553 static void OverrideStop (GLib.GType gtype)
555 OverrideStop (gtype, StopVMCallback);
558 static void OverrideStop (GLib.GType gtype, StopNativeDelegate callback)
561 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
562 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
566 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
567 delegate bool StopNativeDelegate (IntPtr inst);
569 static bool Stop_cb (IntPtr inst)
572 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
574 __result = __obj.OnStop ();
576 } catch (Exception e) {
577 GLib.ExceptionManager.RaiseUnhandledException (e, true);
578 // NOTREACHED: above call does not return.
583 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideStop")]
584 protected virtual bool OnStop ()
586 return InternalStop ();
589 private bool InternalStop ()
591 StopNativeDelegate unmanaged = null;
593 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
594 unmanaged = (StopNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StopNativeDelegate));
596 if (unmanaged == null) return false;
598 bool __result = unmanaged (this.Handle);
602 static DelayNativeDelegate Delay_cb_delegate;
603 static DelayNativeDelegate DelayVMCallback {
605 if (Delay_cb_delegate == null)
606 Delay_cb_delegate = new DelayNativeDelegate (Delay_cb);
607 return Delay_cb_delegate;
611 static void OverrideDelay (GLib.GType gtype)
613 OverrideDelay (gtype, DelayVMCallback);
616 static void OverrideDelay (GLib.GType gtype, DelayNativeDelegate callback)
619 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("delay"));
620 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
624 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
625 delegate uint DelayNativeDelegate (IntPtr inst);
627 static uint Delay_cb (IntPtr inst)
630 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
632 __result = __obj.OnDelay ();
634 } catch (Exception e) {
635 GLib.ExceptionManager.RaiseUnhandledException (e, true);
636 // NOTREACHED: above call does not return.
641 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideDelay")]
642 protected virtual uint OnDelay ()
644 return InternalDelay ();
647 private uint InternalDelay ()
649 DelayNativeDelegate unmanaged = null;
651 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("delay"));
652 unmanaged = (DelayNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(DelayNativeDelegate));
654 if (unmanaged == null) return 0;
656 uint __result = unmanaged (this.Handle);
660 static ActivateNativeDelegate Activate_cb_delegate;
661 static ActivateNativeDelegate ActivateVMCallback {
663 if (Activate_cb_delegate == null)
664 Activate_cb_delegate = new ActivateNativeDelegate (Activate_cb);
665 return Activate_cb_delegate;
669 static void OverrideActivate (GLib.GType gtype)
671 OverrideActivate (gtype, ActivateVMCallback);
674 static void OverrideActivate (GLib.GType gtype, ActivateNativeDelegate callback)
677 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("activate"));
678 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
682 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
683 delegate bool ActivateNativeDelegate (IntPtr inst, bool active);
685 static bool Activate_cb (IntPtr inst, bool active)
688 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
690 __result = __obj.OnActivate (active);
692 } catch (Exception e) {
693 GLib.ExceptionManager.RaiseUnhandledException (e, true);
694 // NOTREACHED: above call does not return.
699 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideActivate")]
700 protected virtual bool OnActivate (bool active)
702 return InternalActivate (active);
705 private bool InternalActivate (bool active)
707 ActivateNativeDelegate unmanaged = null;
709 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("activate"));
710 unmanaged = (ActivateNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ActivateNativeDelegate));
712 if (unmanaged == null) return false;
714 bool __result = unmanaged (this.Handle, active);
718 static CommitNativeDelegate Commit_cb_delegate;
719 static CommitNativeDelegate CommitVMCallback {
721 if (Commit_cb_delegate == null)
722 Commit_cb_delegate = new CommitNativeDelegate (Commit_cb);
723 return Commit_cb_delegate;
727 static void OverrideCommit (GLib.GType gtype)
729 OverrideCommit (gtype, CommitVMCallback);
732 static void OverrideCommit (GLib.GType gtype, CommitNativeDelegate callback)
735 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("commit"));
736 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
740 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
741 delegate uint CommitNativeDelegate (IntPtr inst, ulong sample, byte[] data, int in_samples, int out_samples, ref int accum);
743 static uint Commit_cb (IntPtr inst, ulong sample, byte[] data, int in_samples, int out_samples, ref int accum)
746 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
748 __result = __obj.OnCommit (sample, data, in_samples, out_samples, ref accum);
750 } catch (Exception e) {
751 GLib.ExceptionManager.RaiseUnhandledException (e, true);
752 // NOTREACHED: above call does not return.
757 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideCommit")]
758 protected virtual uint OnCommit (ulong sample, byte[] data, int in_samples, int out_samples, ref int accum)
760 return InternalCommit (sample, data, in_samples, out_samples, ref accum);
763 private uint InternalCommit (ulong sample, byte[] data, int in_samples, int out_samples, ref int accum)
765 CommitNativeDelegate unmanaged = null;
767 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("commit"));
768 unmanaged = (CommitNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CommitNativeDelegate));
770 if (unmanaged == null) return 0;
772 uint __result = unmanaged (this.Handle, sample, data, in_samples, out_samples, ref accum);
776 static ClearAllNativeDelegate ClearAll_cb_delegate;
777 static ClearAllNativeDelegate ClearAllVMCallback {
779 if (ClearAll_cb_delegate == null)
780 ClearAll_cb_delegate = new ClearAllNativeDelegate (ClearAll_cb);
781 return ClearAll_cb_delegate;
785 static void OverrideClearAll (GLib.GType gtype)
787 OverrideClearAll (gtype, ClearAllVMCallback);
790 static void OverrideClearAll (GLib.GType gtype, ClearAllNativeDelegate callback)
793 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("clear_all"));
794 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
798 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
799 delegate void ClearAllNativeDelegate (IntPtr inst);
801 static void ClearAll_cb (IntPtr inst)
804 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
806 } catch (Exception e) {
807 GLib.ExceptionManager.RaiseUnhandledException (e, false);
811 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideClearAll")]
812 protected virtual void OnClearAll ()
817 private void InternalClearAll ()
819 ClearAllNativeDelegate unmanaged = null;
821 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("clear_all"));
822 unmanaged = (ClearAllNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ClearAllNativeDelegate));
824 if (unmanaged == null) return;
826 unmanaged (this.Handle);
830 // Internal representation of the wrapped structure ABI.
831 static GLib.AbiStruct _class_abi = null;
832 static public new GLib.AbiStruct class_abi {
834 if (_class_abi == null)
835 _class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{
836 new GLib.AbiField("open_device"
837 , Gst.Object.class_abi.Fields
838 , (uint) Marshal.SizeOf(typeof(IntPtr)) // open_device
841 , (uint) Marshal.SizeOf(typeof(IntPtr))
844 new GLib.AbiField("acquire"
846 , (uint) Marshal.SizeOf(typeof(IntPtr)) // acquire
849 , (uint) Marshal.SizeOf(typeof(IntPtr))
852 new GLib.AbiField("release"
854 , (uint) Marshal.SizeOf(typeof(IntPtr)) // release
857 , (uint) Marshal.SizeOf(typeof(IntPtr))
860 new GLib.AbiField("close_device"
862 , (uint) Marshal.SizeOf(typeof(IntPtr)) // close_device
865 , (uint) Marshal.SizeOf(typeof(IntPtr))
868 new GLib.AbiField("start"
870 , (uint) Marshal.SizeOf(typeof(IntPtr)) // start
873 , (uint) Marshal.SizeOf(typeof(IntPtr))
876 new GLib.AbiField("pause"
878 , (uint) Marshal.SizeOf(typeof(IntPtr)) // pause
881 , (uint) Marshal.SizeOf(typeof(IntPtr))
884 new GLib.AbiField("resume"
886 , (uint) Marshal.SizeOf(typeof(IntPtr)) // resume
889 , (uint) Marshal.SizeOf(typeof(IntPtr))
892 new GLib.AbiField("stop"
894 , (uint) Marshal.SizeOf(typeof(IntPtr)) // stop
897 , (uint) Marshal.SizeOf(typeof(IntPtr))
900 new GLib.AbiField("delay"
902 , (uint) Marshal.SizeOf(typeof(IntPtr)) // delay
905 , (uint) Marshal.SizeOf(typeof(IntPtr))
908 new GLib.AbiField("activate"
910 , (uint) Marshal.SizeOf(typeof(IntPtr)) // activate
913 , (uint) Marshal.SizeOf(typeof(IntPtr))
916 new GLib.AbiField("commit"
918 , (uint) Marshal.SizeOf(typeof(IntPtr)) // commit
921 , (uint) Marshal.SizeOf(typeof(IntPtr))
924 new GLib.AbiField("clear_all"
926 , (uint) Marshal.SizeOf(typeof(IntPtr)) // clear_all
929 , (uint) Marshal.SizeOf(typeof(IntPtr))
932 new GLib.AbiField("_gst_reserved"
934 , (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _gst_reserved
937 , (uint) Marshal.SizeOf(typeof(IntPtr))
947 // End of the ABI representation.
949 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
950 static extern IntPtr gst_audio_ring_buffer_get_type();
952 public static new GLib.GType GType {
954 IntPtr raw_ret = gst_audio_ring_buffer_get_type();
955 GLib.GType ret = new GLib.GType(raw_ret);
960 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
961 static extern void gst_audio_ring_buffer_debug_spec_buff(IntPtr spec);
963 public static void DebugSpecBuff(Gst.Audio.AudioRingBufferSpec spec) {
964 gst_audio_ring_buffer_debug_spec_buff(spec == null ? IntPtr.Zero : spec.Handle);
967 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
968 static extern void gst_audio_ring_buffer_debug_spec_caps(IntPtr spec);
970 public static void DebugSpecCaps(Gst.Audio.AudioRingBufferSpec spec) {
971 gst_audio_ring_buffer_debug_spec_caps(spec == null ? IntPtr.Zero : spec.Handle);
974 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
975 static extern bool gst_audio_ring_buffer_parse_caps(IntPtr spec, IntPtr caps);
977 public static bool ParseCaps(Gst.Audio.AudioRingBufferSpec spec, Gst.Caps caps) {
978 bool raw_ret = gst_audio_ring_buffer_parse_caps(spec == null ? IntPtr.Zero : spec.Handle, caps == null ? IntPtr.Zero : caps.Handle);
983 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
984 static extern bool gst_audio_ring_buffer_acquire(IntPtr raw, IntPtr spec);
986 public bool Acquire(Gst.Audio.AudioRingBufferSpec spec) {
987 bool raw_ret = gst_audio_ring_buffer_acquire(Handle, spec == null ? IntPtr.Zero : spec.Handle);
992 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
993 static extern bool gst_audio_ring_buffer_activate(IntPtr raw, bool active);
995 public bool Activate(bool active) {
996 bool raw_ret = gst_audio_ring_buffer_activate(Handle, active);
1001 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1002 static extern void gst_audio_ring_buffer_advance(IntPtr raw, uint advance);
1004 public void Advance(uint advance) {
1005 gst_audio_ring_buffer_advance(Handle, advance);
1008 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1009 static extern void gst_audio_ring_buffer_clear(IntPtr raw, int segment);
1011 public void Clear(int segment) {
1012 gst_audio_ring_buffer_clear(Handle, segment);
1015 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1016 static extern void gst_audio_ring_buffer_clear_all(IntPtr raw);
1018 public void ClearAll() {
1019 gst_audio_ring_buffer_clear_all(Handle);
1022 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1023 static extern bool gst_audio_ring_buffer_close_device(IntPtr raw);
1025 public bool CloseDevice() {
1026 bool raw_ret = gst_audio_ring_buffer_close_device(Handle);
1031 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1032 static extern uint gst_audio_ring_buffer_commit(IntPtr raw, ulong sample, byte[] data, int in_samples, int out_samples, ref int accum);
1034 public uint Commit(ulong sample, byte[] data, int in_samples, int out_samples, ref int accum) {
1035 uint raw_ret = gst_audio_ring_buffer_commit(Handle, sample, data, in_samples, out_samples, ref accum);
1040 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1041 static extern bool gst_audio_ring_buffer_convert(IntPtr raw, int src_fmt, long src_val, int dest_fmt, out long dest_val);
1043 public bool Convert(Gst.Format src_fmt, long src_val, Gst.Format dest_fmt, out long dest_val) {
1044 bool raw_ret = gst_audio_ring_buffer_convert(Handle, (int) src_fmt, src_val, (int) dest_fmt, out dest_val);
1049 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1050 static extern uint gst_audio_ring_buffer_delay(IntPtr raw);
1052 public uint Delay() {
1053 uint raw_ret = gst_audio_ring_buffer_delay(Handle);
1058 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1059 static extern bool gst_audio_ring_buffer_device_is_open(IntPtr raw);
1061 public bool DeviceIsOpen() {
1062 bool raw_ret = gst_audio_ring_buffer_device_is_open(Handle);
1067 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1068 static extern bool gst_audio_ring_buffer_is_acquired(IntPtr raw);
1070 public bool IsAcquired {
1072 bool raw_ret = gst_audio_ring_buffer_is_acquired(Handle);
1078 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1079 static extern bool gst_audio_ring_buffer_is_active(IntPtr raw);
1081 public bool IsActive {
1083 bool raw_ret = gst_audio_ring_buffer_is_active(Handle);
1089 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1090 static extern bool gst_audio_ring_buffer_is_flushing(IntPtr raw);
1092 public bool IsFlushing {
1094 bool raw_ret = gst_audio_ring_buffer_is_flushing(Handle);
1100 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1101 static extern void gst_audio_ring_buffer_may_start(IntPtr raw, bool allowed);
1103 public void MayStart(bool allowed) {
1104 gst_audio_ring_buffer_may_start(Handle, allowed);
1107 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1108 static extern bool gst_audio_ring_buffer_open_device(IntPtr raw);
1110 public bool OpenDevice() {
1111 bool raw_ret = gst_audio_ring_buffer_open_device(Handle);
1116 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1117 static extern bool gst_audio_ring_buffer_pause(IntPtr raw);
1119 public bool Pause() {
1120 bool raw_ret = gst_audio_ring_buffer_pause(Handle);
1125 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1126 static extern uint gst_audio_ring_buffer_read(IntPtr raw, ulong sample, byte[] data, uint len, out ulong timestamp);
1128 public uint Read(ulong sample, byte[] data, uint len, out ulong timestamp) {
1129 uint raw_ret = gst_audio_ring_buffer_read(Handle, sample, data, len, out timestamp);
1134 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1135 static extern bool gst_audio_ring_buffer_release(IntPtr raw);
1137 public bool Release() {
1138 bool raw_ret = gst_audio_ring_buffer_release(Handle);
1143 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1144 static extern ulong gst_audio_ring_buffer_samples_done(IntPtr raw);
1146 public ulong SamplesDone() {
1147 ulong raw_ret = gst_audio_ring_buffer_samples_done(Handle);
1148 ulong ret = raw_ret;
1152 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1153 static extern void gst_audio_ring_buffer_set_callback_full(IntPtr raw, Gst.AudioSharp.AudioRingBufferCallbackNative cb, IntPtr user_data, GLib.DestroyNotify notify);
1155 public Gst.Audio.AudioRingBufferCallback CallbackFull {
1157 Gst.AudioSharp.AudioRingBufferCallbackWrapper value_wrapper = new Gst.AudioSharp.AudioRingBufferCallbackWrapper (value);
1159 GLib.DestroyNotify notify;
1160 if (value == null) {
1161 user_data = IntPtr.Zero;
1164 user_data = (IntPtr) GCHandle.Alloc (value_wrapper);
1165 notify = GLib.DestroyHelper.NotifyHandler;
1167 gst_audio_ring_buffer_set_callback_full(Handle, value_wrapper.NativeDelegate, user_data, notify);
1171 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1172 static extern void gst_audio_ring_buffer_set_channel_positions(IntPtr raw, int[] position);
1174 public Gst.Audio.AudioChannelPosition[] ChannelPositions {
1176 int cnt_value = value == null ? 0 : value.Length;
1177 int[] native_value = new int [cnt_value];
1178 for (int i = 0; i < cnt_value; i++)
1179 native_value [i] = (int) value[i];
1180 gst_audio_ring_buffer_set_channel_positions(Handle, native_value);
1184 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1185 static extern void gst_audio_ring_buffer_set_sample(IntPtr raw, ulong sample);
1187 public ulong Sample {
1189 gst_audio_ring_buffer_set_sample(Handle, value);
1193 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1194 static extern void gst_audio_ring_buffer_set_timestamp(IntPtr raw, int readseg, ulong timestamp);
1196 public void SetTimestamp(int readseg, ulong timestamp) {
1197 gst_audio_ring_buffer_set_timestamp(Handle, readseg, timestamp);
1200 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1201 static extern bool gst_audio_ring_buffer_start(IntPtr raw);
1203 public bool Start() {
1204 bool raw_ret = gst_audio_ring_buffer_start(Handle);
1209 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1210 static extern bool gst_audio_ring_buffer_stop(IntPtr raw);
1212 public bool Stop() {
1213 bool raw_ret = gst_audio_ring_buffer_stop(Handle);
1219 static AudioRingBuffer ()
1221 GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
1224 // Internal representation of the wrapped structure ABI.
1225 static GLib.AbiStruct _abi_info = null;
1226 static public new GLib.AbiStruct abi_info {
1228 if (_abi_info == null)
1229 _abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{
1230 new GLib.AbiField("cond"
1231 , Gst.Object.abi_info.Fields
1232 , (uint) Marshal.SizeOf(typeof(GLib.Cond.ABI)) // cond
1235 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_condAlign), "cond")
1238 new GLib.AbiField("open"
1240 , (uint) Marshal.SizeOf(typeof(bool)) // open
1243 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_openAlign), "open")
1246 new GLib.AbiField("acquired"
1248 , (uint) Marshal.SizeOf(typeof(bool)) // acquired
1251 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_acquiredAlign), "acquired")
1254 new GLib.AbiField("memory"
1256 , (uint) Marshal.SizeOf(typeof(byte)) // memory
1259 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_memoryAlign), "memory")
1262 new GLib.AbiField("size"
1264 , (uint) Marshal.SizeOf(typeof(ulong)) // size
1267 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_sizeAlign), "size")
1270 new GLib.AbiField("timestamps"
1272 , (uint) Marshal.SizeOf(typeof(ulong)) // timestamps
1275 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_timestampsAlign), "timestamps")
1278 new GLib.AbiField("spec"
1280 , Gst.Audio.AudioRingBufferSpec.abi_info.Size // spec
1283 , Gst.Audio.AudioRingBufferSpec.abi_info.Align
1286 new GLib.AbiField("samples_per_seg"
1288 , (uint) Marshal.SizeOf(typeof(int)) // samples_per_seg
1291 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_samples_per_segAlign), "samples_per_seg")
1294 new GLib.AbiField("empty_seg"
1296 , (uint) Marshal.SizeOf(typeof(IntPtr)) // empty_seg
1299 , (uint) Marshal.SizeOf(typeof(IntPtr))
1302 new GLib.AbiField("state"
1304 , (uint) Marshal.SizeOf(typeof(int)) // state
1307 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_stateAlign), "state")
1310 new GLib.AbiField("segdone"
1312 , (uint) Marshal.SizeOf(typeof(int)) // segdone
1315 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_segdoneAlign), "segdone")
1318 new GLib.AbiField("segbase"
1320 , (uint) Marshal.SizeOf(typeof(int)) // segbase
1323 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_segbaseAlign), "segbase")
1326 new GLib.AbiField("waiting"
1328 , (uint) Marshal.SizeOf(typeof(int)) // waiting
1331 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_waitingAlign), "waiting")
1334 new GLib.AbiField("callback"
1336 , (uint) Marshal.SizeOf(typeof(IntPtr)) // callback
1339 , (uint) Marshal.SizeOf(typeof(IntPtr))
1342 new GLib.AbiField("cb_data"
1344 , (uint) Marshal.SizeOf(typeof(IntPtr)) // cb_data
1347 , (uint) Marshal.SizeOf(typeof(IntPtr))
1350 new GLib.AbiField("need_reorder"
1352 , (uint) Marshal.SizeOf(typeof(bool)) // need_reorder
1354 , "channel_reorder_map"
1355 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_need_reorderAlign), "need_reorder")
1358 new GLib.AbiField("channel_reorder_map"
1360 , (uint) Marshal.SizeOf(typeof(int)) * 64 // channel_reorder_map
1363 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_channel_reorder_mapAlign), "channel_reorder_map")
1366 new GLib.AbiField("flushing"
1368 , (uint) Marshal.SizeOf(typeof(bool)) // flushing
1369 , "channel_reorder_map"
1371 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_flushingAlign), "flushing")
1374 new GLib.AbiField("may_start"
1376 , (uint) Marshal.SizeOf(typeof(int)) // may_start
1379 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_may_startAlign), "may_start")
1382 new GLib.AbiField("active"
1384 , (uint) Marshal.SizeOf(typeof(bool)) // active
1387 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_activeAlign), "active")
1390 new GLib.AbiField("cb_data_notify"
1392 , (uint) Marshal.SizeOf(typeof(IntPtr)) // cb_data_notify
1395 , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_cb_data_notifyAlign), "cb_data_notify")
1398 new GLib.AbiField("_gst_reserved"
1400 , (uint) Marshal.SizeOf(typeof(IntPtr)) * 3 // _gst_reserved
1403 , (uint) Marshal.SizeOf(typeof(IntPtr))
1412 [StructLayout(LayoutKind.Sequential)]
1413 public struct GstAudioRingBuffer_condAlign
1416 private GLib.Cond.ABI cond;
1419 [StructLayout(LayoutKind.Sequential)]
1420 public struct GstAudioRingBuffer_openAlign
1426 [StructLayout(LayoutKind.Sequential)]
1427 public struct GstAudioRingBuffer_acquiredAlign
1430 private bool acquired;
1433 [StructLayout(LayoutKind.Sequential)]
1434 public struct GstAudioRingBuffer_memoryAlign
1437 private byte memory;
1440 [StructLayout(LayoutKind.Sequential)]
1441 public struct GstAudioRingBuffer_sizeAlign
1444 private UIntPtr size;
1447 [StructLayout(LayoutKind.Sequential)]
1448 public struct GstAudioRingBuffer_timestampsAlign
1451 private ulong timestamps;
1454 [StructLayout(LayoutKind.Sequential)]
1455 public struct GstAudioRingBuffer_samples_per_segAlign
1458 private int samples_per_seg;
1461 [StructLayout(LayoutKind.Sequential)]
1462 public struct GstAudioRingBuffer_stateAlign
1468 [StructLayout(LayoutKind.Sequential)]
1469 public struct GstAudioRingBuffer_segdoneAlign
1472 private int segdone;
1475 [StructLayout(LayoutKind.Sequential)]
1476 public struct GstAudioRingBuffer_segbaseAlign
1479 private int segbase;
1482 [StructLayout(LayoutKind.Sequential)]
1483 public struct GstAudioRingBuffer_waitingAlign
1486 private int waiting;
1489 [StructLayout(LayoutKind.Sequential)]
1490 public struct GstAudioRingBuffer_need_reorderAlign
1493 private bool need_reorder;
1496 [StructLayout(LayoutKind.Sequential)]
1497 public struct GstAudioRingBuffer_channel_reorder_mapAlign
1500 [MarshalAs (UnmanagedType.ByValArray, SizeConst=64)]
1501 private int[] channel_reorder_map;
1504 [StructLayout(LayoutKind.Sequential)]
1505 public struct GstAudioRingBuffer_flushingAlign
1508 private bool flushing;
1511 [StructLayout(LayoutKind.Sequential)]
1512 public struct GstAudioRingBuffer_may_startAlign
1515 private int may_start;
1518 [StructLayout(LayoutKind.Sequential)]
1519 public struct GstAudioRingBuffer_activeAlign
1522 private bool active;
1525 [StructLayout(LayoutKind.Sequential)]
1526 public struct GstAudioRingBuffer_cb_data_notifyAlign
1529 private GLib.DestroyNotify cb_data_notify;
1533 // End of the ABI representation.