Back to development
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst / ControlBinding.cs
1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
3
4 namespace Gst {
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 ControlBinding : Gst.Object {
13
14                 protected ControlBinding (IntPtr raw) : base(raw) {}
15
16                 protected ControlBinding() : base(IntPtr.Zero)
17                 {
18                         CreateNativeObject (new string [0], new GLib.Value [0]);
19                 }
20
21                 [GLib.Property ("name")]
22                 public new string Name {
23                         get {
24                                 GLib.Value val = GetProperty ("name");
25                                 string ret = (string) val;
26                                 val.Dispose ();
27                                 return ret;
28                         }
29                 }
30
31                 [GLib.Property ("object")]
32                 public Gst.Object Object {
33                         get {
34                                 GLib.Value val = GetProperty ("object");
35                                 Gst.Object ret = (Gst.Object) val;
36                                 val.Dispose ();
37                                 return ret;
38                         }
39                 }
40
41                 public string NameField {
42                         get {
43                                 unsafe {
44                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("name"));
45                                         return GLib.Marshaller.Utf8PtrToString ((*raw_ptr));
46                                 }
47                         }
48                 }
49
50                 public IntPtr Pspec {
51                         get {
52                                 unsafe {
53                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("pspec"));
54                                         return (*raw_ptr);
55                                 }
56                         }
57                 }
58
59                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
60                 static extern void gst_control_binding_set_disabled(IntPtr raw, bool disabled);
61
62                 public bool Disabled {
63                         set  {
64                                 gst_control_binding_set_disabled(Handle, value);
65                         }
66                 }
67
68                 static SyncValuesNativeDelegate SyncValues_cb_delegate;
69                 static SyncValuesNativeDelegate SyncValuesVMCallback {
70                         get {
71                                 if (SyncValues_cb_delegate == null)
72                                         SyncValues_cb_delegate = new SyncValuesNativeDelegate (SyncValues_cb);
73                                 return SyncValues_cb_delegate;
74                         }
75                 }
76
77                 static void OverrideSyncValues (GLib.GType gtype)
78                 {
79                         OverrideSyncValues (gtype, SyncValuesVMCallback);
80                 }
81
82                 static void OverrideSyncValues (GLib.GType gtype, SyncValuesNativeDelegate callback)
83                 {
84                         unsafe {
85                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("sync_values"));
86                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
87                         }
88                 }
89
90                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
91                 delegate bool SyncValuesNativeDelegate (IntPtr inst, IntPtr _object, ulong timestamp, ulong last_sync);
92
93                 static bool SyncValues_cb (IntPtr inst, IntPtr _object, ulong timestamp, ulong last_sync)
94                 {
95                         try {
96                                 ControlBinding __obj = GLib.Object.GetObject (inst, false) as ControlBinding;
97                                 bool __result;
98                                 __result = __obj.OnSyncValues (GLib.Object.GetObject(_object) as Gst.Object, timestamp, last_sync);
99                                 return __result;
100                         } catch (Exception e) {
101                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
102                                 // NOTREACHED: above call does not return.
103                                 throw e;
104                         }
105                 }
106
107                 [GLib.DefaultSignalHandler(Type=typeof(Gst.ControlBinding), ConnectionMethod="OverrideSyncValues")]
108                 protected virtual bool OnSyncValues (Gst.Object _object, ulong timestamp, ulong last_sync)
109                 {
110                         return InternalSyncValues (_object, timestamp, last_sync);
111                 }
112
113                 private bool InternalSyncValues (Gst.Object _object, ulong timestamp, ulong last_sync)
114                 {
115                         SyncValuesNativeDelegate unmanaged = null;
116                         unsafe {
117                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("sync_values"));
118                                 unmanaged = (SyncValuesNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SyncValuesNativeDelegate));
119                         }
120                         if (unmanaged == null) return false;
121
122                         bool __result = unmanaged (this.Handle, _object == null ? IntPtr.Zero : _object.Handle, timestamp, last_sync);
123                         return __result;
124                 }
125
126                 static GetValueNativeDelegate GetValue_cb_delegate;
127                 static GetValueNativeDelegate GetValueVMCallback {
128                         get {
129                                 if (GetValue_cb_delegate == null)
130                                         GetValue_cb_delegate = new GetValueNativeDelegate (GetValue_cb);
131                                 return GetValue_cb_delegate;
132                         }
133                 }
134
135                 static void OverrideGetValue (GLib.GType gtype)
136                 {
137                         OverrideGetValue (gtype, GetValueVMCallback);
138                 }
139
140                 static void OverrideGetValue (GLib.GType gtype, GetValueNativeDelegate callback)
141                 {
142                         unsafe {
143                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("get_value"));
144                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
145                         }
146                 }
147
148                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
149                 delegate IntPtr GetValueNativeDelegate (IntPtr inst, ulong timestamp);
150
151                 static IntPtr GetValue_cb (IntPtr inst, ulong timestamp)
152                 {
153                         try {
154                                 ControlBinding __obj = GLib.Object.GetObject (inst, false) as ControlBinding;
155                                 GLib.Value __result;
156                                 __result = __obj.OnGetValue (timestamp);
157                                 return GLib.Marshaller.StructureToPtrAlloc (__result);
158                         } catch (Exception e) {
159                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
160                                 // NOTREACHED: above call does not return.
161                                 throw e;
162                         }
163                 }
164
165                 [GLib.DefaultSignalHandler(Type=typeof(Gst.ControlBinding), ConnectionMethod="OverrideGetValue")]
166                 protected virtual GLib.Value OnGetValue (ulong timestamp)
167                 {
168                         return InternalGetValue (timestamp);
169                 }
170
171                 private GLib.Value InternalGetValue (ulong timestamp)
172                 {
173                         GetValueNativeDelegate unmanaged = null;
174                         unsafe {
175                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("get_value"));
176                                 unmanaged = (GetValueNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(GetValueNativeDelegate));
177                         }
178                         if (unmanaged == null) return GLib.Value.Empty;
179
180                         IntPtr __result = unmanaged (this.Handle, timestamp);
181                         return (GLib.Value) Marshal.PtrToStructure (__result, typeof (GLib.Value));
182                 }
183
184
185                 // Internal representation of the wrapped structure ABI.
186                 static GLib.AbiStruct _class_abi = null;
187                 static public new GLib.AbiStruct class_abi {
188                         get {
189                                 if (_class_abi == null)
190                                         _class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
191                                                 new GLib.AbiField("sync_values"
192                                                         , Gst.Object.class_abi.Fields
193                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // sync_values
194                                                         , null
195                                                         , "get_value"
196                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
197                                                         , 0
198                                                         ),
199                                                 new GLib.AbiField("get_value"
200                                                         , -1
201                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // get_value
202                                                         , "sync_values"
203                                                         , "get_value_array"
204                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
205                                                         , 0
206                                                         ),
207                                                 new GLib.AbiField("get_value_array"
208                                                         , -1
209                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // get_value_array
210                                                         , "get_value"
211                                                         , "get_g_value_array"
212                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
213                                                         , 0
214                                                         ),
215                                                 new GLib.AbiField("get_g_value_array"
216                                                         , -1
217                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // get_g_value_array
218                                                         , "get_value_array"
219                                                         , "_gst_reserved"
220                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
221                                                         , 0
222                                                         ),
223                                                 new GLib.AbiField("_gst_reserved"
224                                                         , -1
225                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _gst_reserved
226                                                         , "get_g_value_array"
227                                                         , null
228                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
229                                                         , 0
230                                                         ),
231                                         });
232
233                                 return _class_abi;
234                         }
235                 }
236
237
238                 // End of the ABI representation.
239
240                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
241                 static extern IntPtr gst_control_binding_get_type();
242
243                 public static new GLib.GType GType { 
244                         get {
245                                 IntPtr raw_ret = gst_control_binding_get_type();
246                                 GLib.GType ret = new GLib.GType(raw_ret);
247                                 return ret;
248                         }
249                 }
250
251                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
252                 static extern bool gst_control_binding_get_g_value_array(IntPtr raw, ulong timestamp, ulong interval, uint n_values, IntPtr[] values);
253
254                 public bool GetGValueArray(ulong timestamp, ulong interval, GLib.Value[] values) {
255                         int cnt_values = values == null ? 0 : values.Length;
256                         IntPtr[] native_values = new IntPtr [cnt_values];
257                         for (int i = 0; i < cnt_values; i++)
258                                 native_values [i] = GLib.Marshaller.StructureToPtrAlloc (values[i]);
259                         bool raw_ret = gst_control_binding_get_g_value_array(Handle, timestamp, interval, (uint) (values == null ? 0 : values.Length), native_values);
260                         bool ret = raw_ret;
261                         for (int i = 0; i < native_values.Length; i++) {
262                                 values [i] = (GLib.Value) Marshal.PtrToStructure (native_values[i], typeof (GLib.Value));
263                                 Marshal.FreeHGlobal (native_values[i]);
264                         }
265                         return ret;
266                 }
267
268                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
269                 static extern IntPtr gst_control_binding_get_value(IntPtr raw, ulong timestamp);
270
271                 public GLib.Value GetValue(ulong timestamp) {
272                         IntPtr raw_ret = gst_control_binding_get_value(Handle, timestamp);
273                         GLib.Value ret = (GLib.Value) Marshal.PtrToStructure (raw_ret, typeof (GLib.Value));
274                         return ret;
275                 }
276
277                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
278                 static extern bool gst_control_binding_is_disabled(IntPtr raw);
279
280                 public bool IsDisabled { 
281                         get {
282                                 bool raw_ret = gst_control_binding_is_disabled(Handle);
283                                 bool ret = raw_ret;
284                                 return ret;
285                         }
286                 }
287
288                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
289                 static extern bool gst_control_binding_sync_values(IntPtr raw, IntPtr _object, ulong timestamp, ulong last_sync);
290
291                 public bool SyncValues(Gst.Object _object, ulong timestamp, ulong last_sync) {
292                         bool raw_ret = gst_control_binding_sync_values(Handle, _object == null ? IntPtr.Zero : _object.Handle, timestamp, last_sync);
293                         bool ret = raw_ret;
294                         return ret;
295                 }
296
297
298                 // Internal representation of the wrapped structure ABI.
299                 static GLib.AbiStruct _abi_info = null;
300                 static public new GLib.AbiStruct abi_info {
301                         get {
302                                 if (_abi_info == null)
303                                         _abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
304                                                 new GLib.AbiField("name"
305                                                         , Gst.Object.abi_info.Fields
306                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // name
307                                                         , null
308                                                         , "pspec"
309                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
310                                                         , 0
311                                                         ),
312                                                 new GLib.AbiField("pspec"
313                                                         , -1
314                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // pspec
315                                                         , "name"
316                                                         , "object"
317                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
318                                                         , 0
319                                                         ),
320                                                 new GLib.AbiField("object"
321                                                         , -1
322                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // object
323                                                         , "pspec"
324                                                         , "disabled"
325                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
326                                                         , 0
327                                                         ),
328                                                 new GLib.AbiField("disabled"
329                                                         , -1
330                                                         , (uint) Marshal.SizeOf(typeof(bool)) // disabled
331                                                         , "object"
332                                                         , "ABI"
333                                                         , (long) Marshal.OffsetOf(typeof(GstControlBinding_disabledAlign), "disabled")
334                                                         , 0
335                                                         ),
336                                                 // union struct ABI.abi
337                                                         new GLib.AbiField("ABI.abi.priv"
338                                                                 , -1
339                                                                 , (uint) Marshal.SizeOf(typeof(IntPtr)) // ABI.abi.priv
340                                                                 , "disabled"
341                                                                 , null
342                                                                 , (uint) Marshal.SizeOf(typeof(IntPtr))
343                                                                 , 0
344                                                                 ),
345                                                 // End ABI.abi
346
347                                                 // union struct ABI
348                                                         new GLib.AbiField("ABI._gst_reserved"
349                                                                 , -1
350                                                                 , (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // ABI._gst_reserved
351                                                                 , "disabled"
352                                                                 , null
353                                                                 , (uint) Marshal.SizeOf(typeof(IntPtr))
354                                                                 , 0
355                                                                 ),
356                                                 // End ABI
357
358                                                 new GLib.AbiField("ABI"
359                                                         , -1
360                                                         , new List<List<string>>() {  // union ABI
361                                                 new List<string>() {"ABI.abi.priv"},
362                                                 new List<string>() {"ABI._gst_reserved"}
363                                           }
364                                                         , "disabled"
365                                                         , null
366                                                         , 0
367                                                         ),
368                                         });
369
370                                 return _abi_info;
371                         }
372                 }
373
374                 [StructLayout(LayoutKind.Sequential)]
375                 public struct GstControlBinding_disabledAlign
376                 {
377                         sbyte f1;
378                         private bool disabled;
379                 }
380
381
382                 // End of the ABI representation.
383
384 #endregion
385         }
386 }