1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
7 using System.Collections;
8 using System.Collections.Generic;
9 using System.Runtime.InteropServices;
11 #region Autogenerated code
12 public partial class AudioCdSrc : Gst.Base.PushSrc, Gst.IURIHandler {
14 public AudioCdSrc (IntPtr raw) : base(raw) {}
16 protected AudioCdSrc() : base(IntPtr.Zero)
18 CreateNativeObject (new string [0], new GLib.Value [0]);
21 [GLib.Property ("device")]
22 public string Device {
24 GLib.Value val = GetProperty ("device");
25 string ret = (string) val;
30 GLib.Value val = new GLib.Value(value);
31 SetProperty("device", val);
36 [GLib.Property ("mode")]
37 public Gst.Audio.AudioCdSrcMode Mode {
39 GLib.Value val = GetProperty ("mode");
40 Gst.Audio.AudioCdSrcMode ret = (Gst.Audio.AudioCdSrcMode) (Enum) val;
45 GLib.Value val = new GLib.Value((Enum) value);
46 SetProperty("mode", val);
51 [GLib.Property ("track")]
54 GLib.Value val = GetProperty ("track");
55 uint ret = (uint) val;
60 GLib.Value val = new GLib.Value(value);
61 SetProperty("track", val);
66 public Gst.TagList Tags {
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);
75 static OpenNativeDelegate Open_cb_delegate;
76 static OpenNativeDelegate OpenVMCallback {
78 if (Open_cb_delegate == null)
79 Open_cb_delegate = new OpenNativeDelegate (Open_cb);
80 return Open_cb_delegate;
84 static void OverrideOpen (GLib.GType gtype)
86 OverrideOpen (gtype, OpenVMCallback);
89 static void OverrideOpen (GLib.GType gtype, OpenNativeDelegate callback)
92 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("open"));
93 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
97 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
98 delegate bool OpenNativeDelegate (IntPtr inst, IntPtr device);
100 static bool Open_cb (IntPtr inst, IntPtr device)
103 AudioCdSrc __obj = GLib.Object.GetObject (inst, false) as AudioCdSrc;
105 __result = __obj.OnOpen (GLib.Marshaller.Utf8PtrToString (device));
107 } catch (Exception e) {
108 GLib.ExceptionManager.RaiseUnhandledException (e, true);
109 // NOTREACHED: above call does not return.
114 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioCdSrc), ConnectionMethod="OverrideOpen")]
115 protected virtual bool OnOpen (string device)
117 return InternalOpen (device);
120 private bool InternalOpen (string device)
122 OpenNativeDelegate unmanaged = null;
124 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("open"));
125 unmanaged = (OpenNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(OpenNativeDelegate));
127 if (unmanaged == null) return false;
129 IntPtr native_device = GLib.Marshaller.StringToPtrGStrdup (device);
130 bool __result = unmanaged (this.Handle, native_device);
131 GLib.Marshaller.Free (native_device);
135 static CloseNativeDelegate Close_cb_delegate;
136 static CloseNativeDelegate CloseVMCallback {
138 if (Close_cb_delegate == null)
139 Close_cb_delegate = new CloseNativeDelegate (Close_cb);
140 return Close_cb_delegate;
144 static void OverrideClose (GLib.GType gtype)
146 OverrideClose (gtype, CloseVMCallback);
149 static void OverrideClose (GLib.GType gtype, CloseNativeDelegate callback)
152 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("close"));
153 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
157 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
158 delegate void CloseNativeDelegate (IntPtr inst);
160 static void Close_cb (IntPtr inst)
163 AudioCdSrc __obj = GLib.Object.GetObject (inst, false) as AudioCdSrc;
165 } catch (Exception e) {
166 GLib.ExceptionManager.RaiseUnhandledException (e, false);
170 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioCdSrc), ConnectionMethod="OverrideClose")]
171 protected virtual void OnClose ()
176 private void InternalClose ()
178 CloseNativeDelegate unmanaged = null;
180 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("close"));
181 unmanaged = (CloseNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CloseNativeDelegate));
183 if (unmanaged == null) return;
185 unmanaged (this.Handle);
188 static ReadSectorNativeDelegate ReadSector_cb_delegate;
189 static ReadSectorNativeDelegate ReadSectorVMCallback {
191 if (ReadSector_cb_delegate == null)
192 ReadSector_cb_delegate = new ReadSectorNativeDelegate (ReadSector_cb);
193 return ReadSector_cb_delegate;
197 static void OverrideReadSector (GLib.GType gtype)
199 OverrideReadSector (gtype, ReadSectorVMCallback);
202 static void OverrideReadSector (GLib.GType gtype, ReadSectorNativeDelegate callback)
205 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("read_sector"));
206 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
210 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
211 delegate IntPtr ReadSectorNativeDelegate (IntPtr inst, int sector);
213 static IntPtr ReadSector_cb (IntPtr inst, int sector)
216 AudioCdSrc __obj = GLib.Object.GetObject (inst, false) as AudioCdSrc;
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.
227 [GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioCdSrc), ConnectionMethod="OverrideReadSector")]
228 protected virtual Gst.Buffer OnReadSector (int sector)
230 return InternalReadSector (sector);
233 private Gst.Buffer InternalReadSector (int sector)
235 ReadSectorNativeDelegate unmanaged = null;
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));
240 if (unmanaged == null) return null;
242 IntPtr __result = unmanaged (this.Handle, sector);
243 return __result == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (__result, typeof (Gst.Buffer), true);
247 // Internal representation of the wrapped structure ABI.
248 static GLib.AbiStruct _class_abi = null;
249 static public new GLib.AbiStruct class_abi {
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
258 , (uint) Marshal.SizeOf(typeof(IntPtr))
261 new GLib.AbiField("close"
263 , (uint) Marshal.SizeOf(typeof(IntPtr)) // close
266 , (uint) Marshal.SizeOf(typeof(IntPtr))
269 new GLib.AbiField("read_sector"
271 , (uint) Marshal.SizeOf(typeof(IntPtr)) // read_sector
274 , (uint) Marshal.SizeOf(typeof(IntPtr))
277 new GLib.AbiField("_gst_reserved"
279 , (uint) Marshal.SizeOf(typeof(IntPtr)) * 20 // _gst_reserved
282 , (uint) Marshal.SizeOf(typeof(IntPtr))
292 // End of the ABI representation.
294 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
295 static extern IntPtr gst_audio_cd_src_get_type();
297 public static new GLib.GType GType {
299 IntPtr raw_ret = gst_audio_cd_src_get_type();
300 GLib.GType ret = new GLib.GType(raw_ret);
305 [DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
306 static extern bool gst_audio_cd_src_add_track(IntPtr raw, IntPtr track);
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);
312 Marshal.FreeHGlobal (native_track);
316 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
317 static extern IntPtr gst_uri_handler_get_uri(IntPtr raw);
321 IntPtr raw_ret = gst_uri_handler_get_uri(Handle);
322 string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
327 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
328 static extern int gst_uri_handler_get_uri_type(IntPtr raw);
330 public Gst.URIType UriType {
332 int raw_ret = gst_uri_handler_get_uri_type(Handle);
333 Gst.URIType ret = (Gst.URIType) raw_ret;
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);
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);
346 GLib.Marshaller.Free (native_uri);
347 if (error != IntPtr.Zero) throw new GLib.GException (error);
354 GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
357 // Internal representation of the wrapped structure ABI.
358 static GLib.AbiStruct _abi_info = null;
359 static public new GLib.AbiStruct abi_info {
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
368 , (uint) Marshal.SizeOf(typeof(IntPtr))
371 new GLib.AbiField("priv"
373 , (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
376 , (uint) Marshal.SizeOf(typeof(IntPtr))
379 new GLib.AbiField("_gst_reserved1"
381 , (uint) Marshal.SizeOf(typeof(uint)) * 2 // _gst_reserved1
384 , (long) Marshal.OffsetOf(typeof(GstAudioCdSrc__gst_reserved1Align), "_gst_reserved1")
387 new GLib.AbiField("_gst_reserved2"
389 , (uint) Marshal.SizeOf(typeof(IntPtr)) * 2 // _gst_reserved2
392 , (uint) Marshal.SizeOf(typeof(IntPtr))
401 [StructLayout(LayoutKind.Sequential)]
402 public struct GstAudioCdSrc__gst_reserved1Align
405 [MarshalAs (UnmanagedType.ByValArray, SizeConst=2)]
406 private uint[] _gst_reserved1;
410 // End of the ABI representation.