Release 1.22.7
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst.Audio / AudioCdSrc.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 AudioCdSrc : Gst.Base.PushSrc, Gst.IURIHandler {
13
14                 public AudioCdSrc (IntPtr raw) : base(raw) {}
15
16                 protected AudioCdSrc() : base(IntPtr.Zero)
17                 {
18                         CreateNativeObject (new string [0], new GLib.Value [0]);
19                 }
20
21                 [GLib.Property ("device")]
22                 public string Device {
23                         get {
24                                 GLib.Value val = GetProperty ("device");
25                                 string ret = (string) val;
26                                 val.Dispose ();
27                                 return ret;
28                         }
29                         set {
30                                 GLib.Value val = new GLib.Value(value);
31                                 SetProperty("device", val);
32                                 val.Dispose ();
33                         }
34                 }
35
36                 [GLib.Property ("mode")]
37                 public Gst.Audio.AudioCdSrcMode Mode {
38                         get {
39                                 GLib.Value val = GetProperty ("mode");
40                                 Gst.Audio.AudioCdSrcMode ret = (Gst.Audio.AudioCdSrcMode) (Enum) val;
41                                 val.Dispose ();
42                                 return ret;
43                         }
44                         set {
45                                 GLib.Value val = new GLib.Value((Enum) value);
46                                 SetProperty("mode", val);
47                                 val.Dispose ();
48                         }
49                 }
50
51                 [GLib.Property ("track")]
52                 public uint Track {
53                         get {
54                                 GLib.Value val = GetProperty ("track");
55                                 uint ret = (uint) val;
56                                 val.Dispose ();
57                                 return ret;
58                         }
59                         set {
60                                 GLib.Value val = new GLib.Value(value);
61                                 SetProperty("track", val);
62                                 val.Dispose ();
63                         }
64                 }
65
66                 public Gst.TagList Tags {
67                         get {
68                                 unsafe {
69                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("tags"));
70                                         return (*raw_ptr) == IntPtr.Zero ? null : (Gst.TagList) GLib.Opaque.GetOpaque ((*raw_ptr), typeof (Gst.TagList), false);
71                                 }
72                         }
73                 }
74
75                 static OpenNativeDelegate Open_cb_delegate;
76                 static OpenNativeDelegate OpenVMCallback {
77                         get {
78                                 if (Open_cb_delegate == null)
79                                         Open_cb_delegate = new OpenNativeDelegate (Open_cb);
80                                 return Open_cb_delegate;
81                         }
82                 }
83
84                 static void OverrideOpen (GLib.GType gtype)
85                 {
86                         OverrideOpen (gtype, OpenVMCallback);
87                 }
88
89                 static void OverrideOpen (GLib.GType gtype, OpenNativeDelegate callback)
90                 {
91                         unsafe {
92                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("open"));
93                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
94                         }
95                 }
96
97                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
98                 delegate bool OpenNativeDelegate (IntPtr inst, IntPtr device);
99
100                 static bool Open_cb (IntPtr inst, IntPtr device)
101                 {
102                         try {
103                                 AudioCdSrc __obj = GLib.Object.GetObject (inst, false) as AudioCdSrc;
104                                 bool __result;
105                                 __result = __obj.OnOpen (GLib.Marshaller.Utf8PtrToString (device));
106                                 return __result;
107                         } catch (Exception e) {
108                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
109                                 // NOTREACHED: above call does not return.
110                                 throw e;
111                         }
112                 }
113
114                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioCdSrc), ConnectionMethod="OverrideOpen")]
115                 protected virtual bool OnOpen (string device)
116                 {
117                         return InternalOpen (device);
118                 }
119
120                 private bool InternalOpen (string device)
121                 {
122                         OpenNativeDelegate unmanaged = null;
123                         unsafe {
124                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("open"));
125                                 unmanaged = (OpenNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(OpenNativeDelegate));
126                         }
127                         if (unmanaged == null) return false;
128
129                         IntPtr native_device = GLib.Marshaller.StringToPtrGStrdup (device);
130                         bool __result = unmanaged (this.Handle, native_device);
131                         GLib.Marshaller.Free (native_device);
132                         return __result;
133                 }
134
135                 static CloseNativeDelegate Close_cb_delegate;
136                 static CloseNativeDelegate CloseVMCallback {
137                         get {
138                                 if (Close_cb_delegate == null)
139                                         Close_cb_delegate = new CloseNativeDelegate (Close_cb);
140                                 return Close_cb_delegate;
141                         }
142                 }
143
144                 static void OverrideClose (GLib.GType gtype)
145                 {
146                         OverrideClose (gtype, CloseVMCallback);
147                 }
148
149                 static void OverrideClose (GLib.GType gtype, CloseNativeDelegate callback)
150                 {
151                         unsafe {
152                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("close"));
153                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
154                         }
155                 }
156
157                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
158                 delegate void CloseNativeDelegate (IntPtr inst);
159
160                 static void Close_cb (IntPtr inst)
161                 {
162                         try {
163                                 AudioCdSrc __obj = GLib.Object.GetObject (inst, false) as AudioCdSrc;
164                                 __obj.OnClose ();
165                         } catch (Exception e) {
166                                 GLib.ExceptionManager.RaiseUnhandledException (e, false);
167                         }
168                 }
169
170                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioCdSrc), ConnectionMethod="OverrideClose")]
171                 protected virtual void OnClose ()
172                 {
173                         InternalClose ();
174                 }
175
176                 private void InternalClose ()
177                 {
178                         CloseNativeDelegate unmanaged = null;
179                         unsafe {
180                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("close"));
181                                 unmanaged = (CloseNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CloseNativeDelegate));
182                         }
183                         if (unmanaged == null) return;
184
185                         unmanaged (this.Handle);
186                 }
187
188                 static ReadSectorNativeDelegate ReadSector_cb_delegate;
189                 static ReadSectorNativeDelegate ReadSectorVMCallback {
190                         get {
191                                 if (ReadSector_cb_delegate == null)
192                                         ReadSector_cb_delegate = new ReadSectorNativeDelegate (ReadSector_cb);
193                                 return ReadSector_cb_delegate;
194                         }
195                 }
196
197                 static void OverrideReadSector (GLib.GType gtype)
198                 {
199                         OverrideReadSector (gtype, ReadSectorVMCallback);
200                 }
201
202                 static void OverrideReadSector (GLib.GType gtype, ReadSectorNativeDelegate callback)
203                 {
204                         unsafe {
205                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("read_sector"));
206                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
207                         }
208                 }
209
210                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
211                 delegate IntPtr ReadSectorNativeDelegate (IntPtr inst, int sector);
212
213                 static IntPtr ReadSector_cb (IntPtr inst, int sector)
214                 {
215                         try {
216                                 AudioCdSrc __obj = GLib.Object.GetObject (inst, false) as AudioCdSrc;
217                                 Gst.Buffer __result;
218                                 __result = __obj.OnReadSector (sector);
219                                 return __result == null ? IntPtr.Zero : __result.OwnedCopy;
220                         } catch (Exception e) {
221                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
222                                 // NOTREACHED: above call does not return.
223                                 throw e;
224                         }
225                 }
226
227                 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioCdSrc), ConnectionMethod="OverrideReadSector")]
228                 protected virtual Gst.Buffer OnReadSector (int sector)
229                 {
230                         return InternalReadSector (sector);
231                 }
232
233                 private Gst.Buffer InternalReadSector (int sector)
234                 {
235                         ReadSectorNativeDelegate unmanaged = null;
236                         unsafe {
237                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("read_sector"));
238                                 unmanaged = (ReadSectorNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ReadSectorNativeDelegate));
239                         }
240                         if (unmanaged == null) return null;
241
242                         IntPtr __result = unmanaged (this.Handle, sector);
243                         return __result == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (__result, typeof (Gst.Buffer), true);
244                 }
245
246
247                 // Internal representation of the wrapped structure ABI.
248                 static GLib.AbiStruct _class_abi = null;
249                 static public new GLib.AbiStruct class_abi {
250                         get {
251                                 if (_class_abi == null)
252                                         _class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
253                                                 new GLib.AbiField("open"
254                                                         , Gst.Base.PushSrc.class_abi.Fields
255                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // open
256                                                         , null
257                                                         , "close"
258                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
259                                                         , 0
260                                                         ),
261                                                 new GLib.AbiField("close"
262                                                         , -1
263                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // close
264                                                         , "open"
265                                                         , "read_sector"
266                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
267                                                         , 0
268                                                         ),
269                                                 new GLib.AbiField("read_sector"
270                                                         , -1
271                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // read_sector
272                                                         , "close"
273                                                         , "_gst_reserved"
274                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
275                                                         , 0
276                                                         ),
277                                                 new GLib.AbiField("_gst_reserved"
278                                                         , -1
279                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) * 20 // _gst_reserved
280                                                         , "read_sector"
281                                                         , null
282                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
283                                                         , 0
284                                                         ),
285                                         });
286
287                                 return _class_abi;
288                         }
289                 }
290
291
292                 // End of the ABI representation.
293
294                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
295                 static extern IntPtr gst_audio_cd_src_get_type();
296
297                 public static new GLib.GType GType { 
298                         get {
299                                 IntPtr raw_ret = gst_audio_cd_src_get_type();
300                                 GLib.GType ret = new GLib.GType(raw_ret);
301                                 return ret;
302                         }
303                 }
304
305                 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
306                 static extern bool gst_audio_cd_src_add_track(IntPtr raw, IntPtr track);
307
308                 public bool AddTrack(Gst.Audio.AudioCdSrcTrack track) {
309                         IntPtr native_track = GLib.Marshaller.StructureToPtrAlloc (track);
310                         bool raw_ret = gst_audio_cd_src_add_track(Handle, native_track);
311                         bool ret = raw_ret;
312                         Marshal.FreeHGlobal (native_track);
313                         return ret;
314                 }
315
316                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
317                 static extern IntPtr gst_uri_handler_get_uri(IntPtr raw);
318
319                 public string Uri { 
320                         get {
321                                 IntPtr raw_ret = gst_uri_handler_get_uri(Handle);
322                                 string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
323                                 return ret;
324                         }
325                 }
326
327                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
328                 static extern int gst_uri_handler_get_uri_type(IntPtr raw);
329
330                 public Gst.URIType UriType { 
331                         get {
332                                 int raw_ret = gst_uri_handler_get_uri_type(Handle);
333                                 Gst.URIType ret = (Gst.URIType) raw_ret;
334                                 return ret;
335                         }
336                 }
337
338                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
339                 static extern bool gst_uri_handler_set_uri(IntPtr raw, IntPtr uri, out IntPtr error);
340
341                 public bool SetUri(string uri) {
342                         IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
343                         IntPtr error = IntPtr.Zero;
344                         bool raw_ret = gst_uri_handler_set_uri(Handle, native_uri, out error);
345                         bool ret = raw_ret;
346                         GLib.Marshaller.Free (native_uri);
347                         if (error != IntPtr.Zero) throw new GLib.GException (error);
348                         return ret;
349                 }
350
351
352                 static AudioCdSrc ()
353                 {
354                         GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
355                 }
356
357                 // Internal representation of the wrapped structure ABI.
358                 static GLib.AbiStruct _abi_info = null;
359                 static public new GLib.AbiStruct abi_info {
360                         get {
361                                 if (_abi_info == null)
362                                         _abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
363                                                 new GLib.AbiField("tags"
364                                                         , Gst.Base.PushSrc.abi_info.Fields
365                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // tags
366                                                         , null
367                                                         , "priv"
368                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
369                                                         , 0
370                                                         ),
371                                                 new GLib.AbiField("priv"
372                                                         , -1
373                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
374                                                         , "tags"
375                                                         , "_gst_reserved1"
376                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
377                                                         , 0
378                                                         ),
379                                                 new GLib.AbiField("_gst_reserved1"
380                                                         , -1
381                                                         , (uint) Marshal.SizeOf(typeof(uint)) * 2 // _gst_reserved1
382                                                         , "priv"
383                                                         , "_gst_reserved2"
384                                                         , (long) Marshal.OffsetOf(typeof(GstAudioCdSrc__gst_reserved1Align), "_gst_reserved1")
385                                                         , 0
386                                                         ),
387                                                 new GLib.AbiField("_gst_reserved2"
388                                                         , -1
389                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) * 2 // _gst_reserved2
390                                                         , "_gst_reserved1"
391                                                         , null
392                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
393                                                         , 0
394                                                         ),
395                                         });
396
397                                 return _abi_info;
398                         }
399                 }
400
401                 [StructLayout(LayoutKind.Sequential)]
402                 public struct GstAudioCdSrc__gst_reserved1Align
403                 {
404                         sbyte f1;
405                         [MarshalAs (UnmanagedType.ByValArray, SizeConst=2)]
406                         private uint[] _gst_reserved1;
407                 }
408
409
410                 // End of the ABI representation.
411
412 #endregion
413         }
414 }