Release 1.22.7
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst.Audio / AudioRingBuffer.cs
1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
3
4 namespace Gst.Audio {
5
6         using System;
7         using System.Collections;
8         using System.Collections.Generic;
9         using System.Runtime.InteropServices;
10
11 #region Autogenerated code
12         public partial class AudioRingBuffer : Gst.Object {
13
14                 protected AudioRingBuffer (IntPtr raw) : base(raw) {}
15
16                 protected AudioRingBuffer() : base(IntPtr.Zero)
17                 {
18                         CreateNativeObject (new string [0], new GLib.Value [0]);
19                 }
20
21                 public GLib.Cond Cond {
22                         get {
23                                 unsafe {
24                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("cond"));
25                                         return new GLib.Cond((*raw_ptr));
26                                 }
27                         }
28                 }
29
30                 public bool Open {
31                         get {
32                                 unsafe {
33                                         bool* raw_ptr = (bool*)(((byte*)Handle) + abi_info.GetFieldOffset("open"));
34                                         return (*raw_ptr);
35                                 }
36                         }
37                 }
38
39                 public bool Acquired {
40                         get {
41                                 unsafe {
42                                         bool* raw_ptr = (bool*)(((byte*)Handle) + abi_info.GetFieldOffset("acquired"));
43                                         return (*raw_ptr);
44                                 }
45                         }
46                 }
47
48                 public byte Memory {
49                         get {
50                                 unsafe {
51                                         byte* raw_ptr = (byte*)(((byte*)Handle) + abi_info.GetFieldOffset("memory"));
52                                         return (*raw_ptr);
53                                 }
54                         }
55                 }
56
57                 public ulong Size {
58                         get {
59                                 unsafe {
60                                         UIntPtr* raw_ptr = (UIntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("size"));
61                                         return (ulong) (*raw_ptr);
62                                 }
63                         }
64                 }
65
66                 public Gst.Audio.AudioRingBufferSpec Spec {
67                         get {
68                                 unsafe {
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);
71                                 }
72                         }
73                 }
74
75                 public int SamplesPerSeg {
76                         get {
77                                 unsafe {
78                                         int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("samples_per_seg"));
79                                         return (*raw_ptr);
80                                 }
81                         }
82                 }
83
84                 public byte EmptySeg {
85                         get {
86                                 unsafe {
87                                         byte* raw_ptr = (byte*)(((byte*)Handle) + abi_info.GetFieldOffset("empty_seg"));
88                                         return (*raw_ptr);
89                                 }
90                         }
91                 }
92
93                 public int State {
94                         get {
95                                 unsafe {
96                                         int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("state"));
97                                         return (*raw_ptr);
98                                 }
99                         }
100                 }
101
102                 public int Segdone {
103                         get {
104                                 unsafe {
105                                         int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("segdone"));
106                                         return (*raw_ptr);
107                                 }
108                         }
109                 }
110
111                 public int Segbase {
112                         get {
113                                 unsafe {
114                                         int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("segbase"));
115                                         return (*raw_ptr);
116                                 }
117                         }
118                 }
119
120                 public int Waiting {
121                         get {
122                                 unsafe {
123                                         int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("waiting"));
124                                         return (*raw_ptr);
125                                 }
126                         }
127                 }
128
129                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
130                 static extern void gst_audio_ring_buffer_set_flushing(IntPtr raw, bool flushing);
131
132                 public bool Flushing {
133                         set  {
134                                 gst_audio_ring_buffer_set_flushing(Handle, value);
135                         }
136                 }
137
138                 static OpenDeviceNativeDelegate OpenDevice_cb_delegate;
139                 static OpenDeviceNativeDelegate OpenDeviceVMCallback {
140                         get {
141                                 if (OpenDevice_cb_delegate == null)
142                                         OpenDevice_cb_delegate = new OpenDeviceNativeDelegate (OpenDevice_cb);
143                                 return OpenDevice_cb_delegate;
144                         }
145                 }
146
147                 static void OverrideOpenDevice (GLib.GType gtype)
148                 {
149                         OverrideOpenDevice (gtype, OpenDeviceVMCallback);
150                 }
151
152                 static void OverrideOpenDevice (GLib.GType gtype, OpenDeviceNativeDelegate callback)
153                 {
154                         unsafe {
155                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("open_device"));
156                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
157                         }
158                 }
159
160                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
161                 delegate bool OpenDeviceNativeDelegate (IntPtr inst);
162
163                 static bool OpenDevice_cb (IntPtr inst)
164                 {
165                         try {
166                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
167                                 bool __result;
168                                 __result = __obj.OnOpenDevice ();
169                                 return __result;
170                         } catch (Exception e) {
171                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
172                                 // NOTREACHED: above call does not return.
173                                 throw e;
174                         }
175                 }
176
177                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideOpenDevice")]
178                 protected virtual bool OnOpenDevice ()
179                 {
180                         return InternalOpenDevice ();
181                 }
182
183                 private bool InternalOpenDevice ()
184                 {
185                         OpenDeviceNativeDelegate unmanaged = null;
186                         unsafe {
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));
189                         }
190                         if (unmanaged == null) return false;
191
192                         bool __result = unmanaged (this.Handle);
193                         return __result;
194                 }
195
196                 static AcquireNativeDelegate Acquire_cb_delegate;
197                 static AcquireNativeDelegate AcquireVMCallback {
198                         get {
199                                 if (Acquire_cb_delegate == null)
200                                         Acquire_cb_delegate = new AcquireNativeDelegate (Acquire_cb);
201                                 return Acquire_cb_delegate;
202                         }
203                 }
204
205                 static void OverrideAcquire (GLib.GType gtype)
206                 {
207                         OverrideAcquire (gtype, AcquireVMCallback);
208                 }
209
210                 static void OverrideAcquire (GLib.GType gtype, AcquireNativeDelegate callback)
211                 {
212                         unsafe {
213                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("acquire"));
214                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
215                         }
216                 }
217
218                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
219                 delegate bool AcquireNativeDelegate (IntPtr inst, IntPtr spec);
220
221                 static bool Acquire_cb (IntPtr inst, IntPtr spec)
222                 {
223                         try {
224                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
225                                 bool __result;
226                                 __result = __obj.OnAcquire (spec == IntPtr.Zero ? null : (Gst.Audio.AudioRingBufferSpec) GLib.Opaque.GetOpaque (spec, typeof (Gst.Audio.AudioRingBufferSpec), false));
227                                 return __result;
228                         } catch (Exception e) {
229                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
230                                 // NOTREACHED: above call does not return.
231                                 throw e;
232                         }
233                 }
234
235                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideAcquire")]
236                 protected virtual bool OnAcquire (Gst.Audio.AudioRingBufferSpec spec)
237                 {
238                         return InternalAcquire (spec);
239                 }
240
241                 private bool InternalAcquire (Gst.Audio.AudioRingBufferSpec spec)
242                 {
243                         AcquireNativeDelegate unmanaged = null;
244                         unsafe {
245                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("acquire"));
246                                 unmanaged = (AcquireNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AcquireNativeDelegate));
247                         }
248                         if (unmanaged == null) return false;
249
250                         bool __result = unmanaged (this.Handle, spec == null ? IntPtr.Zero : spec.Handle);
251                         return __result;
252                 }
253
254                 static ReleaseNativeDelegate Release_cb_delegate;
255                 static ReleaseNativeDelegate ReleaseVMCallback {
256                         get {
257                                 if (Release_cb_delegate == null)
258                                         Release_cb_delegate = new ReleaseNativeDelegate (Release_cb);
259                                 return Release_cb_delegate;
260                         }
261                 }
262
263                 static void OverrideRelease (GLib.GType gtype)
264                 {
265                         OverrideRelease (gtype, ReleaseVMCallback);
266                 }
267
268                 static void OverrideRelease (GLib.GType gtype, ReleaseNativeDelegate callback)
269                 {
270                         unsafe {
271                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("release"));
272                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
273                         }
274                 }
275
276                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
277                 delegate bool ReleaseNativeDelegate (IntPtr inst);
278
279                 static bool Release_cb (IntPtr inst)
280                 {
281                         try {
282                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
283                                 bool __result;
284                                 __result = __obj.OnRelease ();
285                                 return __result;
286                         } catch (Exception e) {
287                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
288                                 // NOTREACHED: above call does not return.
289                                 throw e;
290                         }
291                 }
292
293                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideRelease")]
294                 protected virtual bool OnRelease ()
295                 {
296                         return InternalRelease ();
297                 }
298
299                 private bool InternalRelease ()
300                 {
301                         ReleaseNativeDelegate unmanaged = null;
302                         unsafe {
303                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("release"));
304                                 unmanaged = (ReleaseNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ReleaseNativeDelegate));
305                         }
306                         if (unmanaged == null) return false;
307
308                         bool __result = unmanaged (this.Handle);
309                         return __result;
310                 }
311
312                 static CloseDeviceNativeDelegate CloseDevice_cb_delegate;
313                 static CloseDeviceNativeDelegate CloseDeviceVMCallback {
314                         get {
315                                 if (CloseDevice_cb_delegate == null)
316                                         CloseDevice_cb_delegate = new CloseDeviceNativeDelegate (CloseDevice_cb);
317                                 return CloseDevice_cb_delegate;
318                         }
319                 }
320
321                 static void OverrideCloseDevice (GLib.GType gtype)
322                 {
323                         OverrideCloseDevice (gtype, CloseDeviceVMCallback);
324                 }
325
326                 static void OverrideCloseDevice (GLib.GType gtype, CloseDeviceNativeDelegate callback)
327                 {
328                         unsafe {
329                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("close_device"));
330                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
331                         }
332                 }
333
334                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
335                 delegate bool CloseDeviceNativeDelegate (IntPtr inst);
336
337                 static bool CloseDevice_cb (IntPtr inst)
338                 {
339                         try {
340                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
341                                 bool __result;
342                                 __result = __obj.OnCloseDevice ();
343                                 return __result;
344                         } catch (Exception e) {
345                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
346                                 // NOTREACHED: above call does not return.
347                                 throw e;
348                         }
349                 }
350
351                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideCloseDevice")]
352                 protected virtual bool OnCloseDevice ()
353                 {
354                         return InternalCloseDevice ();
355                 }
356
357                 private bool InternalCloseDevice ()
358                 {
359                         CloseDeviceNativeDelegate unmanaged = null;
360                         unsafe {
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));
363                         }
364                         if (unmanaged == null) return false;
365
366                         bool __result = unmanaged (this.Handle);
367                         return __result;
368                 }
369
370                 static StartNativeDelegate Start_cb_delegate;
371                 static StartNativeDelegate StartVMCallback {
372                         get {
373                                 if (Start_cb_delegate == null)
374                                         Start_cb_delegate = new StartNativeDelegate (Start_cb);
375                                 return Start_cb_delegate;
376                         }
377                 }
378
379                 static void OverrideStart (GLib.GType gtype)
380                 {
381                         OverrideStart (gtype, StartVMCallback);
382                 }
383
384                 static void OverrideStart (GLib.GType gtype, StartNativeDelegate callback)
385                 {
386                         unsafe {
387                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
388                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
389                         }
390                 }
391
392                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
393                 delegate bool StartNativeDelegate (IntPtr inst);
394
395                 static bool Start_cb (IntPtr inst)
396                 {
397                         try {
398                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
399                                 bool __result;
400                                 __result = __obj.OnStart ();
401                                 return __result;
402                         } catch (Exception e) {
403                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
404                                 // NOTREACHED: above call does not return.
405                                 throw e;
406                         }
407                 }
408
409                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideStart")]
410                 protected virtual bool OnStart ()
411                 {
412                         return InternalStart ();
413                 }
414
415                 private bool InternalStart ()
416                 {
417                         StartNativeDelegate unmanaged = null;
418                         unsafe {
419                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
420                                 unmanaged = (StartNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StartNativeDelegate));
421                         }
422                         if (unmanaged == null) return false;
423
424                         bool __result = unmanaged (this.Handle);
425                         return __result;
426                 }
427
428                 static PauseNativeDelegate Pause_cb_delegate;
429                 static PauseNativeDelegate PauseVMCallback {
430                         get {
431                                 if (Pause_cb_delegate == null)
432                                         Pause_cb_delegate = new PauseNativeDelegate (Pause_cb);
433                                 return Pause_cb_delegate;
434                         }
435                 }
436
437                 static void OverridePause (GLib.GType gtype)
438                 {
439                         OverridePause (gtype, PauseVMCallback);
440                 }
441
442                 static void OverridePause (GLib.GType gtype, PauseNativeDelegate callback)
443                 {
444                         unsafe {
445                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("pause"));
446                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
447                         }
448                 }
449
450                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
451                 delegate bool PauseNativeDelegate (IntPtr inst);
452
453                 static bool Pause_cb (IntPtr inst)
454                 {
455                         try {
456                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
457                                 bool __result;
458                                 __result = __obj.OnPause ();
459                                 return __result;
460                         } catch (Exception e) {
461                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
462                                 // NOTREACHED: above call does not return.
463                                 throw e;
464                         }
465                 }
466
467                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverridePause")]
468                 protected virtual bool OnPause ()
469                 {
470                         return InternalPause ();
471                 }
472
473                 private bool InternalPause ()
474                 {
475                         PauseNativeDelegate unmanaged = null;
476                         unsafe {
477                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("pause"));
478                                 unmanaged = (PauseNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(PauseNativeDelegate));
479                         }
480                         if (unmanaged == null) return false;
481
482                         bool __result = unmanaged (this.Handle);
483                         return __result;
484                 }
485
486                 static ResumeNativeDelegate Resume_cb_delegate;
487                 static ResumeNativeDelegate ResumeVMCallback {
488                         get {
489                                 if (Resume_cb_delegate == null)
490                                         Resume_cb_delegate = new ResumeNativeDelegate (Resume_cb);
491                                 return Resume_cb_delegate;
492                         }
493                 }
494
495                 static void OverrideResume (GLib.GType gtype)
496                 {
497                         OverrideResume (gtype, ResumeVMCallback);
498                 }
499
500                 static void OverrideResume (GLib.GType gtype, ResumeNativeDelegate callback)
501                 {
502                         unsafe {
503                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("resume"));
504                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
505                         }
506                 }
507
508                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
509                 delegate bool ResumeNativeDelegate (IntPtr inst);
510
511                 static bool Resume_cb (IntPtr inst)
512                 {
513                         try {
514                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
515                                 bool __result;
516                                 __result = __obj.OnResume ();
517                                 return __result;
518                         } catch (Exception e) {
519                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
520                                 // NOTREACHED: above call does not return.
521                                 throw e;
522                         }
523                 }
524
525                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideResume")]
526                 protected virtual bool OnResume ()
527                 {
528                         return InternalResume ();
529                 }
530
531                 private bool InternalResume ()
532                 {
533                         ResumeNativeDelegate unmanaged = null;
534                         unsafe {
535                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("resume"));
536                                 unmanaged = (ResumeNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ResumeNativeDelegate));
537                         }
538                         if (unmanaged == null) return false;
539
540                         bool __result = unmanaged (this.Handle);
541                         return __result;
542                 }
543
544                 static StopNativeDelegate Stop_cb_delegate;
545                 static StopNativeDelegate StopVMCallback {
546                         get {
547                                 if (Stop_cb_delegate == null)
548                                         Stop_cb_delegate = new StopNativeDelegate (Stop_cb);
549                                 return Stop_cb_delegate;
550                         }
551                 }
552
553                 static void OverrideStop (GLib.GType gtype)
554                 {
555                         OverrideStop (gtype, StopVMCallback);
556                 }
557
558                 static void OverrideStop (GLib.GType gtype, StopNativeDelegate callback)
559                 {
560                         unsafe {
561                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
562                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
563                         }
564                 }
565
566                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
567                 delegate bool StopNativeDelegate (IntPtr inst);
568
569                 static bool Stop_cb (IntPtr inst)
570                 {
571                         try {
572                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
573                                 bool __result;
574                                 __result = __obj.OnStop ();
575                                 return __result;
576                         } catch (Exception e) {
577                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
578                                 // NOTREACHED: above call does not return.
579                                 throw e;
580                         }
581                 }
582
583                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideStop")]
584                 protected virtual bool OnStop ()
585                 {
586                         return InternalStop ();
587                 }
588
589                 private bool InternalStop ()
590                 {
591                         StopNativeDelegate unmanaged = null;
592                         unsafe {
593                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
594                                 unmanaged = (StopNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StopNativeDelegate));
595                         }
596                         if (unmanaged == null) return false;
597
598                         bool __result = unmanaged (this.Handle);
599                         return __result;
600                 }
601
602                 static DelayNativeDelegate Delay_cb_delegate;
603                 static DelayNativeDelegate DelayVMCallback {
604                         get {
605                                 if (Delay_cb_delegate == null)
606                                         Delay_cb_delegate = new DelayNativeDelegate (Delay_cb);
607                                 return Delay_cb_delegate;
608                         }
609                 }
610
611                 static void OverrideDelay (GLib.GType gtype)
612                 {
613                         OverrideDelay (gtype, DelayVMCallback);
614                 }
615
616                 static void OverrideDelay (GLib.GType gtype, DelayNativeDelegate callback)
617                 {
618                         unsafe {
619                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("delay"));
620                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
621                         }
622                 }
623
624                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
625                 delegate uint DelayNativeDelegate (IntPtr inst);
626
627                 static uint Delay_cb (IntPtr inst)
628                 {
629                         try {
630                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
631                                 uint __result;
632                                 __result = __obj.OnDelay ();
633                                 return __result;
634                         } catch (Exception e) {
635                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
636                                 // NOTREACHED: above call does not return.
637                                 throw e;
638                         }
639                 }
640
641                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideDelay")]
642                 protected virtual uint OnDelay ()
643                 {
644                         return InternalDelay ();
645                 }
646
647                 private uint InternalDelay ()
648                 {
649                         DelayNativeDelegate unmanaged = null;
650                         unsafe {
651                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("delay"));
652                                 unmanaged = (DelayNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(DelayNativeDelegate));
653                         }
654                         if (unmanaged == null) return 0;
655
656                         uint __result = unmanaged (this.Handle);
657                         return __result;
658                 }
659
660                 static ActivateNativeDelegate Activate_cb_delegate;
661                 static ActivateNativeDelegate ActivateVMCallback {
662                         get {
663                                 if (Activate_cb_delegate == null)
664                                         Activate_cb_delegate = new ActivateNativeDelegate (Activate_cb);
665                                 return Activate_cb_delegate;
666                         }
667                 }
668
669                 static void OverrideActivate (GLib.GType gtype)
670                 {
671                         OverrideActivate (gtype, ActivateVMCallback);
672                 }
673
674                 static void OverrideActivate (GLib.GType gtype, ActivateNativeDelegate callback)
675                 {
676                         unsafe {
677                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("activate"));
678                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
679                         }
680                 }
681
682                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
683                 delegate bool ActivateNativeDelegate (IntPtr inst, bool active);
684
685                 static bool Activate_cb (IntPtr inst, bool active)
686                 {
687                         try {
688                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
689                                 bool __result;
690                                 __result = __obj.OnActivate (active);
691                                 return __result;
692                         } catch (Exception e) {
693                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
694                                 // NOTREACHED: above call does not return.
695                                 throw e;
696                         }
697                 }
698
699                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideActivate")]
700                 protected virtual bool OnActivate (bool active)
701                 {
702                         return InternalActivate (active);
703                 }
704
705                 private bool InternalActivate (bool active)
706                 {
707                         ActivateNativeDelegate unmanaged = null;
708                         unsafe {
709                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("activate"));
710                                 unmanaged = (ActivateNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ActivateNativeDelegate));
711                         }
712                         if (unmanaged == null) return false;
713
714                         bool __result = unmanaged (this.Handle, active);
715                         return __result;
716                 }
717
718                 static CommitNativeDelegate Commit_cb_delegate;
719                 static CommitNativeDelegate CommitVMCallback {
720                         get {
721                                 if (Commit_cb_delegate == null)
722                                         Commit_cb_delegate = new CommitNativeDelegate (Commit_cb);
723                                 return Commit_cb_delegate;
724                         }
725                 }
726
727                 static void OverrideCommit (GLib.GType gtype)
728                 {
729                         OverrideCommit (gtype, CommitVMCallback);
730                 }
731
732                 static void OverrideCommit (GLib.GType gtype, CommitNativeDelegate callback)
733                 {
734                         unsafe {
735                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("commit"));
736                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
737                         }
738                 }
739
740                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
741                 delegate uint CommitNativeDelegate (IntPtr inst, ulong sample, byte[] data, int in_samples, int out_samples, ref int accum);
742
743                 static uint Commit_cb (IntPtr inst, ulong sample, byte[] data, int in_samples, int out_samples, ref int accum)
744                 {
745                         try {
746                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
747                                 uint __result;
748                                 __result = __obj.OnCommit (sample, data, in_samples, out_samples, ref accum);
749                                 return __result;
750                         } catch (Exception e) {
751                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
752                                 // NOTREACHED: above call does not return.
753                                 throw e;
754                         }
755                 }
756
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)
759                 {
760                         return InternalCommit (sample, data, in_samples, out_samples, ref accum);
761                 }
762
763                 private uint InternalCommit (ulong sample, byte[] data, int in_samples, int out_samples, ref int accum)
764                 {
765                         CommitNativeDelegate unmanaged = null;
766                         unsafe {
767                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("commit"));
768                                 unmanaged = (CommitNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CommitNativeDelegate));
769                         }
770                         if (unmanaged == null) return 0;
771
772                         uint __result = unmanaged (this.Handle, sample, data, in_samples, out_samples, ref accum);
773                         return __result;
774                 }
775
776                 static ClearAllNativeDelegate ClearAll_cb_delegate;
777                 static ClearAllNativeDelegate ClearAllVMCallback {
778                         get {
779                                 if (ClearAll_cb_delegate == null)
780                                         ClearAll_cb_delegate = new ClearAllNativeDelegate (ClearAll_cb);
781                                 return ClearAll_cb_delegate;
782                         }
783                 }
784
785                 static void OverrideClearAll (GLib.GType gtype)
786                 {
787                         OverrideClearAll (gtype, ClearAllVMCallback);
788                 }
789
790                 static void OverrideClearAll (GLib.GType gtype, ClearAllNativeDelegate callback)
791                 {
792                         unsafe {
793                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("clear_all"));
794                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
795                         }
796                 }
797
798                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
799                 delegate void ClearAllNativeDelegate (IntPtr inst);
800
801                 static void ClearAll_cb (IntPtr inst)
802                 {
803                         try {
804                                 AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
805                                 __obj.OnClearAll ();
806                         } catch (Exception e) {
807                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
808                         }
809                 }
810
811                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideClearAll")]
812                 protected virtual void OnClearAll ()
813                 {
814                         InternalClearAll ();
815                 }
816
817                 private void InternalClearAll ()
818                 {
819                         ClearAllNativeDelegate unmanaged = null;
820                         unsafe {
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));
823                         }
824                         if (unmanaged == null) return;
825
826                         unmanaged (this.Handle);
827                 }
828
829
830                 // Internal representation of the wrapped structure ABI.
831                 static GLib.AbiStruct _class_abi = null;
832                 static public new GLib.AbiStruct class_abi {
833                         get {
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
839                                                         , null
840                                                         , "acquire"
841                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
842                                                         , 0
843                                                         ),
844                                                 new GLib.AbiField("acquire"
845                                                         , -1
846                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // acquire
847                                                         , "open_device"
848                                                         , "release"
849                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
850                                                         , 0
851                                                         ),
852                                                 new GLib.AbiField("release"
853                                                         , -1
854                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // release
855                                                         , "acquire"
856                                                         , "close_device"
857                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
858                                                         , 0
859                                                         ),
860                                                 new GLib.AbiField("close_device"
861                                                         , -1
862                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // close_device
863                                                         , "release"
864                                                         , "start"
865                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
866                                                         , 0
867                                                         ),
868                                                 new GLib.AbiField("start"
869                                                         , -1
870                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // start
871                                                         , "close_device"
872                                                         , "pause"
873                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
874                                                         , 0
875                                                         ),
876                                                 new GLib.AbiField("pause"
877                                                         , -1
878                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // pause
879                                                         , "start"
880                                                         , "resume"
881                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
882                                                         , 0
883                                                         ),
884                                                 new GLib.AbiField("resume"
885                                                         , -1
886                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // resume
887                                                         , "pause"
888                                                         , "stop"
889                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
890                                                         , 0
891                                                         ),
892                                                 new GLib.AbiField("stop"
893                                                         , -1
894                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // stop
895                                                         , "resume"
896                                                         , "delay"
897                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
898                                                         , 0
899                                                         ),
900                                                 new GLib.AbiField("delay"
901                                                         , -1
902                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // delay
903                                                         , "stop"
904                                                         , "activate"
905                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
906                                                         , 0
907                                                         ),
908                                                 new GLib.AbiField("activate"
909                                                         , -1
910                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // activate
911                                                         , "delay"
912                                                         , "commit"
913                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
914                                                         , 0
915                                                         ),
916                                                 new GLib.AbiField("commit"
917                                                         , -1
918                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // commit
919                                                         , "activate"
920                                                         , "clear_all"
921                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
922                                                         , 0
923                                                         ),
924                                                 new GLib.AbiField("clear_all"
925                                                         , -1
926                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // clear_all
927                                                         , "commit"
928                                                         , "_gst_reserved"
929                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
930                                                         , 0
931                                                         ),
932                                                 new GLib.AbiField("_gst_reserved"
933                                                         , -1
934                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _gst_reserved
935                                                         , "clear_all"
936                                                         , null
937                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
938                                                         , 0
939                                                         ),
940                                         });
941
942                                 return _class_abi;
943                         }
944                 }
945
946
947                 // End of the ABI representation.
948
949                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
950                 static extern IntPtr gst_audio_ring_buffer_get_type();
951
952                 public static new GLib.GType GType { 
953                         get {
954                                 IntPtr raw_ret = gst_audio_ring_buffer_get_type();
955                                 GLib.GType ret = new GLib.GType(raw_ret);
956                                 return ret;
957                         }
958                 }
959
960                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
961                 static extern void gst_audio_ring_buffer_debug_spec_buff(IntPtr spec);
962
963                 public static void DebugSpecBuff(Gst.Audio.AudioRingBufferSpec spec) {
964                         gst_audio_ring_buffer_debug_spec_buff(spec == null ? IntPtr.Zero : spec.Handle);
965                 }
966
967                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
968                 static extern void gst_audio_ring_buffer_debug_spec_caps(IntPtr spec);
969
970                 public static void DebugSpecCaps(Gst.Audio.AudioRingBufferSpec spec) {
971                         gst_audio_ring_buffer_debug_spec_caps(spec == null ? IntPtr.Zero : spec.Handle);
972                 }
973
974                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
975                 static extern bool gst_audio_ring_buffer_parse_caps(IntPtr spec, IntPtr caps);
976
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);
979                         bool ret = raw_ret;
980                         return ret;
981                 }
982
983                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
984                 static extern bool gst_audio_ring_buffer_acquire(IntPtr raw, IntPtr spec);
985
986                 public bool Acquire(Gst.Audio.AudioRingBufferSpec spec) {
987                         bool raw_ret = gst_audio_ring_buffer_acquire(Handle, spec == null ? IntPtr.Zero : spec.Handle);
988                         bool ret = raw_ret;
989                         return ret;
990                 }
991
992                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
993                 static extern bool gst_audio_ring_buffer_activate(IntPtr raw, bool active);
994
995                 public bool Activate(bool active) {
996                         bool raw_ret = gst_audio_ring_buffer_activate(Handle, active);
997                         bool ret = raw_ret;
998                         return ret;
999                 }
1000
1001                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1002                 static extern void gst_audio_ring_buffer_advance(IntPtr raw, uint advance);
1003
1004                 public void Advance(uint advance) {
1005                         gst_audio_ring_buffer_advance(Handle, advance);
1006                 }
1007
1008                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1009                 static extern void gst_audio_ring_buffer_clear(IntPtr raw, int segment);
1010
1011                 public void Clear(int segment) {
1012                         gst_audio_ring_buffer_clear(Handle, segment);
1013                 }
1014
1015                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1016                 static extern void gst_audio_ring_buffer_clear_all(IntPtr raw);
1017
1018                 public void ClearAll() {
1019                         gst_audio_ring_buffer_clear_all(Handle);
1020                 }
1021
1022                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1023                 static extern bool gst_audio_ring_buffer_close_device(IntPtr raw);
1024
1025                 public bool CloseDevice() {
1026                         bool raw_ret = gst_audio_ring_buffer_close_device(Handle);
1027                         bool ret = raw_ret;
1028                         return ret;
1029                 }
1030
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);
1033
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);
1036                         uint ret = raw_ret;
1037                         return ret;
1038                 }
1039
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);
1042
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);
1045                         bool ret = raw_ret;
1046                         return ret;
1047                 }
1048
1049                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1050                 static extern uint gst_audio_ring_buffer_delay(IntPtr raw);
1051
1052                 public uint Delay() {
1053                         uint raw_ret = gst_audio_ring_buffer_delay(Handle);
1054                         uint ret = raw_ret;
1055                         return ret;
1056                 }
1057
1058                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1059                 static extern bool gst_audio_ring_buffer_device_is_open(IntPtr raw);
1060
1061                 public bool DeviceIsOpen() {
1062                         bool raw_ret = gst_audio_ring_buffer_device_is_open(Handle);
1063                         bool ret = raw_ret;
1064                         return ret;
1065                 }
1066
1067                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1068                 static extern bool gst_audio_ring_buffer_is_acquired(IntPtr raw);
1069
1070                 public bool IsAcquired { 
1071                         get {
1072                                 bool raw_ret = gst_audio_ring_buffer_is_acquired(Handle);
1073                                 bool ret = raw_ret;
1074                                 return ret;
1075                         }
1076                 }
1077
1078                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1079                 static extern bool gst_audio_ring_buffer_is_active(IntPtr raw);
1080
1081                 public bool IsActive { 
1082                         get {
1083                                 bool raw_ret = gst_audio_ring_buffer_is_active(Handle);
1084                                 bool ret = raw_ret;
1085                                 return ret;
1086                         }
1087                 }
1088
1089                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1090                 static extern bool gst_audio_ring_buffer_is_flushing(IntPtr raw);
1091
1092                 public bool IsFlushing { 
1093                         get {
1094                                 bool raw_ret = gst_audio_ring_buffer_is_flushing(Handle);
1095                                 bool ret = raw_ret;
1096                                 return ret;
1097                         }
1098                 }
1099
1100                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1101                 static extern void gst_audio_ring_buffer_may_start(IntPtr raw, bool allowed);
1102
1103                 public void MayStart(bool allowed) {
1104                         gst_audio_ring_buffer_may_start(Handle, allowed);
1105                 }
1106
1107                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1108                 static extern bool gst_audio_ring_buffer_open_device(IntPtr raw);
1109
1110                 public bool OpenDevice() {
1111                         bool raw_ret = gst_audio_ring_buffer_open_device(Handle);
1112                         bool ret = raw_ret;
1113                         return ret;
1114                 }
1115
1116                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1117                 static extern bool gst_audio_ring_buffer_pause(IntPtr raw);
1118
1119                 public bool Pause() {
1120                         bool raw_ret = gst_audio_ring_buffer_pause(Handle);
1121                         bool ret = raw_ret;
1122                         return ret;
1123                 }
1124
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);
1127
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);
1130                         uint ret = raw_ret;
1131                         return ret;
1132                 }
1133
1134                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1135                 static extern bool gst_audio_ring_buffer_release(IntPtr raw);
1136
1137                 public bool Release() {
1138                         bool raw_ret = gst_audio_ring_buffer_release(Handle);
1139                         bool ret = raw_ret;
1140                         return ret;
1141                 }
1142
1143                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1144                 static extern ulong gst_audio_ring_buffer_samples_done(IntPtr raw);
1145
1146                 public ulong SamplesDone() {
1147                         ulong raw_ret = gst_audio_ring_buffer_samples_done(Handle);
1148                         ulong ret = raw_ret;
1149                         return ret;
1150                 }
1151
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);
1154
1155                 public Gst.Audio.AudioRingBufferCallback CallbackFull { 
1156                         set {
1157                                 Gst.AudioSharp.AudioRingBufferCallbackWrapper value_wrapper = new Gst.AudioSharp.AudioRingBufferCallbackWrapper (value);
1158                                 IntPtr user_data;
1159                                 GLib.DestroyNotify notify;
1160                                 if (value == null) {
1161                                         user_data = IntPtr.Zero;
1162                                         notify = null;
1163                                 } else {
1164                                         user_data = (IntPtr) GCHandle.Alloc (value_wrapper);
1165                                         notify = GLib.DestroyHelper.NotifyHandler;
1166                                 }
1167                                 gst_audio_ring_buffer_set_callback_full(Handle, value_wrapper.NativeDelegate, user_data, notify);
1168                         }
1169                 }
1170
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);
1173
1174                 public Gst.Audio.AudioChannelPosition[] ChannelPositions { 
1175                         set {
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);
1181                         }
1182                 }
1183
1184                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1185                 static extern void gst_audio_ring_buffer_set_sample(IntPtr raw, ulong sample);
1186
1187                 public ulong Sample { 
1188                         set {
1189                                 gst_audio_ring_buffer_set_sample(Handle, value);
1190                         }
1191                 }
1192
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);
1195
1196                 public void SetTimestamp(int readseg, ulong timestamp) {
1197                         gst_audio_ring_buffer_set_timestamp(Handle, readseg, timestamp);
1198                 }
1199
1200                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1201                 static extern bool gst_audio_ring_buffer_start(IntPtr raw);
1202
1203                 public bool Start() {
1204                         bool raw_ret = gst_audio_ring_buffer_start(Handle);
1205                         bool ret = raw_ret;
1206                         return ret;
1207                 }
1208
1209                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
1210                 static extern bool gst_audio_ring_buffer_stop(IntPtr raw);
1211
1212                 public bool Stop() {
1213                         bool raw_ret = gst_audio_ring_buffer_stop(Handle);
1214                         bool ret = raw_ret;
1215                         return ret;
1216                 }
1217
1218
1219                 static AudioRingBuffer ()
1220                 {
1221                         GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
1222                 }
1223
1224                 // Internal representation of the wrapped structure ABI.
1225                 static GLib.AbiStruct _abi_info = null;
1226                 static public new GLib.AbiStruct abi_info {
1227                         get {
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
1233                                                         , null
1234                                                         , "open"
1235                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_condAlign), "cond")
1236                                                         , 0
1237                                                         ),
1238                                                 new GLib.AbiField("open"
1239                                                         , -1
1240                                                         , (uint) Marshal.SizeOf(typeof(bool)) // open
1241                                                         , "cond"
1242                                                         , "acquired"
1243                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_openAlign), "open")
1244                                                         , 0
1245                                                         ),
1246                                                 new GLib.AbiField("acquired"
1247                                                         , -1
1248                                                         , (uint) Marshal.SizeOf(typeof(bool)) // acquired
1249                                                         , "open"
1250                                                         , "memory"
1251                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_acquiredAlign), "acquired")
1252                                                         , 0
1253                                                         ),
1254                                                 new GLib.AbiField("memory"
1255                                                         , -1
1256                                                         , (uint) Marshal.SizeOf(typeof(byte)) // memory
1257                                                         , "acquired"
1258                                                         , "size"
1259                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_memoryAlign), "memory")
1260                                                         , 0
1261                                                         ),
1262                                                 new GLib.AbiField("size"
1263                                                         , -1
1264                                                         , (uint) Marshal.SizeOf(typeof(ulong)) // size
1265                                                         , "memory"
1266                                                         , "timestamps"
1267                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_sizeAlign), "size")
1268                                                         , 0
1269                                                         ),
1270                                                 new GLib.AbiField("timestamps"
1271                                                         , -1
1272                                                         , (uint) Marshal.SizeOf(typeof(ulong)) // timestamps
1273                                                         , "size"
1274                                                         , "spec"
1275                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_timestampsAlign), "timestamps")
1276                                                         , 0
1277                                                         ),
1278                                                 new GLib.AbiField("spec"
1279                                                         , -1
1280                                                         , Gst.Audio.AudioRingBufferSpec.abi_info.Size // spec
1281                                                         , "timestamps"
1282                                                         , "samples_per_seg"
1283                                                         , Gst.Audio.AudioRingBufferSpec.abi_info.Align
1284                                                         , 0
1285                                                         ),
1286                                                 new GLib.AbiField("samples_per_seg"
1287                                                         , -1
1288                                                         , (uint) Marshal.SizeOf(typeof(int)) // samples_per_seg
1289                                                         , "spec"
1290                                                         , "empty_seg"
1291                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_samples_per_segAlign), "samples_per_seg")
1292                                                         , 0
1293                                                         ),
1294                                                 new GLib.AbiField("empty_seg"
1295                                                         , -1
1296                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // empty_seg
1297                                                         , "samples_per_seg"
1298                                                         , "state"
1299                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1300                                                         , 0
1301                                                         ),
1302                                                 new GLib.AbiField("state"
1303                                                         , -1
1304                                                         , (uint) Marshal.SizeOf(typeof(int)) // state
1305                                                         , "empty_seg"
1306                                                         , "segdone"
1307                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_stateAlign), "state")
1308                                                         , 0
1309                                                         ),
1310                                                 new GLib.AbiField("segdone"
1311                                                         , -1
1312                                                         , (uint) Marshal.SizeOf(typeof(int)) // segdone
1313                                                         , "state"
1314                                                         , "segbase"
1315                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_segdoneAlign), "segdone")
1316                                                         , 0
1317                                                         ),
1318                                                 new GLib.AbiField("segbase"
1319                                                         , -1
1320                                                         , (uint) Marshal.SizeOf(typeof(int)) // segbase
1321                                                         , "segdone"
1322                                                         , "waiting"
1323                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_segbaseAlign), "segbase")
1324                                                         , 0
1325                                                         ),
1326                                                 new GLib.AbiField("waiting"
1327                                                         , -1
1328                                                         , (uint) Marshal.SizeOf(typeof(int)) // waiting
1329                                                         , "segbase"
1330                                                         , "callback"
1331                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_waitingAlign), "waiting")
1332                                                         , 0
1333                                                         ),
1334                                                 new GLib.AbiField("callback"
1335                                                         , -1
1336                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // callback
1337                                                         , "waiting"
1338                                                         , "cb_data"
1339                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1340                                                         , 0
1341                                                         ),
1342                                                 new GLib.AbiField("cb_data"
1343                                                         , -1
1344                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // cb_data
1345                                                         , "callback"
1346                                                         , "need_reorder"
1347                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1348                                                         , 0
1349                                                         ),
1350                                                 new GLib.AbiField("need_reorder"
1351                                                         , -1
1352                                                         , (uint) Marshal.SizeOf(typeof(bool)) // need_reorder
1353                                                         , "cb_data"
1354                                                         , "channel_reorder_map"
1355                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_need_reorderAlign), "need_reorder")
1356                                                         , 0
1357                                                         ),
1358                                                 new GLib.AbiField("channel_reorder_map"
1359                                                         , -1
1360                                                         , (uint) Marshal.SizeOf(typeof(int)) * 64 // channel_reorder_map
1361                                                         , "need_reorder"
1362                                                         , "flushing"
1363                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_channel_reorder_mapAlign), "channel_reorder_map")
1364                                                         , 0
1365                                                         ),
1366                                                 new GLib.AbiField("flushing"
1367                                                         , -1
1368                                                         , (uint) Marshal.SizeOf(typeof(bool)) // flushing
1369                                                         , "channel_reorder_map"
1370                                                         , "may_start"
1371                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_flushingAlign), "flushing")
1372                                                         , 0
1373                                                         ),
1374                                                 new GLib.AbiField("may_start"
1375                                                         , -1
1376                                                         , (uint) Marshal.SizeOf(typeof(int)) // may_start
1377                                                         , "flushing"
1378                                                         , "active"
1379                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_may_startAlign), "may_start")
1380                                                         , 0
1381                                                         ),
1382                                                 new GLib.AbiField("active"
1383                                                         , -1
1384                                                         , (uint) Marshal.SizeOf(typeof(bool)) // active
1385                                                         , "may_start"
1386                                                         , "cb_data_notify"
1387                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_activeAlign), "active")
1388                                                         , 0
1389                                                         ),
1390                                                 new GLib.AbiField("cb_data_notify"
1391                                                         , -1
1392                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // cb_data_notify
1393                                                         , "active"
1394                                                         , "_gst_reserved"
1395                                                         , (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_cb_data_notifyAlign), "cb_data_notify")
1396                                                         , 0
1397                                                         ),
1398                                                 new GLib.AbiField("_gst_reserved"
1399                                                         , -1
1400                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) * 3 // _gst_reserved
1401                                                         , "cb_data_notify"
1402                                                         , null
1403                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
1404                                                         , 0
1405                                                         ),
1406                                         });
1407
1408                                 return _abi_info;
1409                         }
1410                 }
1411
1412                 [StructLayout(LayoutKind.Sequential)]
1413                 public struct GstAudioRingBuffer_condAlign
1414                 {
1415                         sbyte f1;
1416                         private GLib.Cond.ABI cond;
1417                 }
1418
1419                 [StructLayout(LayoutKind.Sequential)]
1420                 public struct GstAudioRingBuffer_openAlign
1421                 {
1422                         sbyte f1;
1423                         private bool open;
1424                 }
1425
1426                 [StructLayout(LayoutKind.Sequential)]
1427                 public struct GstAudioRingBuffer_acquiredAlign
1428                 {
1429                         sbyte f1;
1430                         private bool acquired;
1431                 }
1432
1433                 [StructLayout(LayoutKind.Sequential)]
1434                 public struct GstAudioRingBuffer_memoryAlign
1435                 {
1436                         sbyte f1;
1437                         private byte memory;
1438                 }
1439
1440                 [StructLayout(LayoutKind.Sequential)]
1441                 public struct GstAudioRingBuffer_sizeAlign
1442                 {
1443                         sbyte f1;
1444                         private UIntPtr size;
1445                 }
1446
1447                 [StructLayout(LayoutKind.Sequential)]
1448                 public struct GstAudioRingBuffer_timestampsAlign
1449                 {
1450                         sbyte f1;
1451                         private ulong timestamps;
1452                 }
1453
1454                 [StructLayout(LayoutKind.Sequential)]
1455                 public struct GstAudioRingBuffer_samples_per_segAlign
1456                 {
1457                         sbyte f1;
1458                         private int samples_per_seg;
1459                 }
1460
1461                 [StructLayout(LayoutKind.Sequential)]
1462                 public struct GstAudioRingBuffer_stateAlign
1463                 {
1464                         sbyte f1;
1465                         private int state;
1466                 }
1467
1468                 [StructLayout(LayoutKind.Sequential)]
1469                 public struct GstAudioRingBuffer_segdoneAlign
1470                 {
1471                         sbyte f1;
1472                         private int segdone;
1473                 }
1474
1475                 [StructLayout(LayoutKind.Sequential)]
1476                 public struct GstAudioRingBuffer_segbaseAlign
1477                 {
1478                         sbyte f1;
1479                         private int segbase;
1480                 }
1481
1482                 [StructLayout(LayoutKind.Sequential)]
1483                 public struct GstAudioRingBuffer_waitingAlign
1484                 {
1485                         sbyte f1;
1486                         private int waiting;
1487                 }
1488
1489                 [StructLayout(LayoutKind.Sequential)]
1490                 public struct GstAudioRingBuffer_need_reorderAlign
1491                 {
1492                         sbyte f1;
1493                         private bool need_reorder;
1494                 }
1495
1496                 [StructLayout(LayoutKind.Sequential)]
1497                 public struct GstAudioRingBuffer_channel_reorder_mapAlign
1498                 {
1499                         sbyte f1;
1500                         [MarshalAs (UnmanagedType.ByValArray, SizeConst=64)]
1501                         private int[] channel_reorder_map;
1502                 }
1503
1504                 [StructLayout(LayoutKind.Sequential)]
1505                 public struct GstAudioRingBuffer_flushingAlign
1506                 {
1507                         sbyte f1;
1508                         private bool flushing;
1509                 }
1510
1511                 [StructLayout(LayoutKind.Sequential)]
1512                 public struct GstAudioRingBuffer_may_startAlign
1513                 {
1514                         sbyte f1;
1515                         private int may_start;
1516                 }
1517
1518                 [StructLayout(LayoutKind.Sequential)]
1519                 public struct GstAudioRingBuffer_activeAlign
1520                 {
1521                         sbyte f1;
1522                         private bool active;
1523                 }
1524
1525                 [StructLayout(LayoutKind.Sequential)]
1526                 public struct GstAudioRingBuffer_cb_data_notifyAlign
1527                 {
1528                         sbyte f1;
1529                         private GLib.DestroyNotify cb_data_notify;
1530                 }
1531
1532
1533                 // End of the ABI representation.
1534
1535 #endregion
1536         }
1537 }