summaryrefslogtreecommitdiff
path: root/ges/generated/GES/Project.cs
blob: 71b52ff36fcd02e3df02d12d8ed905c41e6233e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace GES {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;

#region Autogenerated code
	public partial class Project : GES.Asset {

		public Project (IntPtr raw) : base(raw) {}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr ges_project_new(IntPtr uri);

		public Project (string uri) : base (IntPtr.Zero)
		{
			if (GetType () != typeof (Project)) {
				var vals = new List<GLib.Value> ();
				var names = new List<string> ();
				names.Add ("uri");
				vals.Add (new GLib.Value (uri));
				CreateNativeObject (names.ToArray (), vals.ToArray ());
				return;
			}
			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
			Raw = ges_project_new(native_uri);
			GLib.Marshaller.Free (native_uri);
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr ges_project_get_uri(IntPtr raw);

		[GLib.Property ("uri")]
		public string Uri {
			get  {
				IntPtr raw_ret = ges_project_get_uri(Handle);
				string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
				return ret;
			}
		}

		[GLib.Signal("loaded")]
		public event GES.LoadedHandler Loaded {
			add {
				this.AddSignalHandler ("loaded", value, typeof (GES.LoadedArgs));
			}
			remove {
				this.RemoveSignalHandler ("loaded", value);
			}
		}

		[GLib.Signal("asset-added")]
		public event GES.AssetAddedHandler AssetAdded {
			add {
				this.AddSignalHandler ("asset-added", value, typeof (GES.AssetAddedArgs));
			}
			remove {
				this.RemoveSignalHandler ("asset-added", value);
			}
		}

		[GLib.Signal("asset-removed")]
		public event GES.AssetRemovedHandler AssetRemoved {
			add {
				this.AddSignalHandler ("asset-removed", value, typeof (GES.AssetRemovedArgs));
			}
			remove {
				this.RemoveSignalHandler ("asset-removed", value);
			}
		}

		[GLib.Signal("asset-loading")]
		public event GES.AssetLoadingHandler AssetLoading {
			add {
				this.AddSignalHandler ("asset-loading", value, typeof (GES.AssetLoadingArgs));
			}
			remove {
				this.RemoveSignalHandler ("asset-loading", value);
			}
		}

		static AssetAddedNativeDelegate AssetAdded_cb_delegate;
		static AssetAddedNativeDelegate AssetAddedVMCallback {
			get {
				if (AssetAdded_cb_delegate == null)
					AssetAdded_cb_delegate = new AssetAddedNativeDelegate (AssetAdded_cb);
				return AssetAdded_cb_delegate;
			}
		}

		static void OverrideAssetAdded (GLib.GType gtype)
		{
			OverrideAssetAdded (gtype, AssetAddedVMCallback);
		}

		static void OverrideAssetAdded (GLib.GType gtype, AssetAddedNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("asset_added"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void AssetAddedNativeDelegate (IntPtr inst, IntPtr asset);

		static void AssetAdded_cb (IntPtr inst, IntPtr asset)
		{
			try {
				Project __obj = GLib.Object.GetObject (inst, false) as Project;
				__obj.OnAssetAdded (GLib.Object.GetObject(asset) as GES.Asset);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(GES.Project), ConnectionMethod="OverrideAssetAdded")]
		protected virtual void OnAssetAdded (GES.Asset asset)
		{
			InternalAssetAdded (asset);
		}

		private void InternalAssetAdded (GES.Asset asset)
		{
			AssetAddedNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("asset_added"));
				unmanaged = (AssetAddedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AssetAddedNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle, asset == null ? IntPtr.Zero : asset.Handle);
		}

		static AssetLoadingNativeDelegate AssetLoading_cb_delegate;
		static AssetLoadingNativeDelegate AssetLoadingVMCallback {
			get {
				if (AssetLoading_cb_delegate == null)
					AssetLoading_cb_delegate = new AssetLoadingNativeDelegate (AssetLoading_cb);
				return AssetLoading_cb_delegate;
			}
		}

		static void OverrideAssetLoading (GLib.GType gtype)
		{
			OverrideAssetLoading (gtype, AssetLoadingVMCallback);
		}

		static void OverrideAssetLoading (GLib.GType gtype, AssetLoadingNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("asset_loading"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void AssetLoadingNativeDelegate (IntPtr inst, IntPtr asset);

		static void AssetLoading_cb (IntPtr inst, IntPtr asset)
		{
			try {
				Project __obj = GLib.Object.GetObject (inst, false) as Project;
				__obj.OnAssetLoading (GLib.Object.GetObject(asset) as GES.Asset);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(GES.Project), ConnectionMethod="OverrideAssetLoading")]
		protected virtual void OnAssetLoading (GES.Asset asset)
		{
			InternalAssetLoading (asset);
		}

		private void InternalAssetLoading (GES.Asset asset)
		{
			AssetLoadingNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("asset_loading"));
				unmanaged = (AssetLoadingNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AssetLoadingNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle, asset == null ? IntPtr.Zero : asset.Handle);
		}

		static AssetRemovedNativeDelegate AssetRemoved_cb_delegate;
		static AssetRemovedNativeDelegate AssetRemovedVMCallback {
			get {
				if (AssetRemoved_cb_delegate == null)
					AssetRemoved_cb_delegate = new AssetRemovedNativeDelegate (AssetRemoved_cb);
				return AssetRemoved_cb_delegate;
			}
		}

		static void OverrideAssetRemoved (GLib.GType gtype)
		{
			OverrideAssetRemoved (gtype, AssetRemovedVMCallback);
		}

		static void OverrideAssetRemoved (GLib.GType gtype, AssetRemovedNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("asset_removed"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void AssetRemovedNativeDelegate (IntPtr inst, IntPtr asset);

		static void AssetRemoved_cb (IntPtr inst, IntPtr asset)
		{
			try {
				Project __obj = GLib.Object.GetObject (inst, false) as Project;
				__obj.OnAssetRemoved (GLib.Object.GetObject(asset) as GES.Asset);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(GES.Project), ConnectionMethod="OverrideAssetRemoved")]
		protected virtual void OnAssetRemoved (GES.Asset asset)
		{
			InternalAssetRemoved (asset);
		}

		private void InternalAssetRemoved (GES.Asset asset)
		{
			AssetRemovedNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("asset_removed"));
				unmanaged = (AssetRemovedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AssetRemovedNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle, asset == null ? IntPtr.Zero : asset.Handle);
		}

		static LoadedNativeDelegate Loaded_cb_delegate;
		static LoadedNativeDelegate LoadedVMCallback {
			get {
				if (Loaded_cb_delegate == null)
					Loaded_cb_delegate = new LoadedNativeDelegate (Loaded_cb);
				return Loaded_cb_delegate;
			}
		}

		static void OverrideLoaded (GLib.GType gtype)
		{
			OverrideLoaded (gtype, LoadedVMCallback);
		}

		static void OverrideLoaded (GLib.GType gtype, LoadedNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("loaded"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void LoadedNativeDelegate (IntPtr inst, IntPtr timeline);

		static void Loaded_cb (IntPtr inst, IntPtr timeline)
		{
			try {
				Project __obj = GLib.Object.GetObject (inst, false) as Project;
				__obj.OnLoaded (GLib.Object.GetObject(timeline) as GES.Timeline);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(GES.Project), ConnectionMethod="OverrideLoaded")]
		protected virtual void OnLoaded (GES.Timeline timeline)
		{
			InternalLoaded (timeline);
		}

		private void InternalLoaded (GES.Timeline timeline)
		{
			LoadedNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("loaded"));
				unmanaged = (LoadedNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(LoadedNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle, timeline == null ? IntPtr.Zero : timeline.Handle);
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _class_abi = null;
		static public new GLib.AbiStruct class_abi {
			get {
				if (_class_abi == null)
					_class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("asset_added"
							, GES.Asset.class_abi.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // asset_added
							, null
							, "asset_loading"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("asset_loading"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // asset_loading
							, "asset_added"
							, "asset_removed"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("asset_removed"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // asset_removed
							, "asset_loading"
							, "missing_uri"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("missing_uri"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // missing_uri
							, "asset_removed"
							, "loading_error"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("loading_error"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // loading_error
							, "missing_uri"
							, "loaded"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("loaded"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // loaded
							, "loading_error"
							, "_ges_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_ges_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _ges_reserved
							, "loaded"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr ges_project_get_type();

		public static new GLib.GType GType { 
			get {
				IntPtr raw_ret = ges_project_get_type();
				GLib.GType ret = new GLib.GType(raw_ret);
				return ret;
			}
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern bool ges_project_add_asset(IntPtr raw, IntPtr asset);

		public bool AddAsset(GES.Asset asset) {
			bool raw_ret = ges_project_add_asset(Handle, asset == null ? IntPtr.Zero : asset.Handle);
			bool ret = raw_ret;
			return ret;
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern bool ges_project_add_encoding_profile(IntPtr raw, IntPtr profile);

		public bool AddEncodingProfile(Gst.PbUtils.EncodingProfile profile) {
			bool raw_ret = ges_project_add_encoding_profile(Handle, profile == null ? IntPtr.Zero : profile.Handle);
			bool ret = raw_ret;
			return ret;
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern bool ges_project_create_asset(IntPtr raw, IntPtr id, IntPtr extractable_type);

		public bool CreateAsset(string id, GLib.GType extractable_type) {
			IntPtr native_id = GLib.Marshaller.StringToPtrGStrdup (id);
			bool raw_ret = ges_project_create_asset(Handle, native_id, extractable_type.Val);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_id);
			return ret;
		}

		public bool CreateAsset(GLib.GType extractable_type) {
			return CreateAsset (null, extractable_type);
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe IntPtr ges_project_create_asset_sync(IntPtr raw, IntPtr id, IntPtr extractable_type, out IntPtr error);

		public unsafe GES.Asset CreateAssetSync(string id, GLib.GType extractable_type) {
			IntPtr native_id = GLib.Marshaller.StringToPtrGStrdup (id);
			IntPtr error = IntPtr.Zero;
			IntPtr raw_ret = ges_project_create_asset_sync(Handle, native_id, extractable_type.Val, out error);
			GES.Asset ret = GLib.Object.GetObject(raw_ret, true) as GES.Asset;
			GLib.Marshaller.Free (native_id);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		public GES.Asset CreateAssetSync(GLib.GType extractable_type) {
			return CreateAssetSync (null, extractable_type);
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr ges_project_get_asset(IntPtr raw, IntPtr id, IntPtr extractable_type);

		public GES.Asset GetAsset(string id, GLib.GType extractable_type) {
			IntPtr native_id = GLib.Marshaller.StringToPtrGStrdup (id);
			IntPtr raw_ret = ges_project_get_asset(Handle, native_id, extractable_type.Val);
			GES.Asset ret = GLib.Object.GetObject(raw_ret, true) as GES.Asset;
			GLib.Marshaller.Free (native_id);
			return ret;
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr ges_project_get_loading_assets(IntPtr raw);

		public GES.Asset[] LoadingAssets { 
			get {
				IntPtr raw_ret = ges_project_get_loading_assets(Handle);
				GES.Asset[] ret = (GES.Asset[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof(GLib.List), true, true, typeof(GES.Asset));
				return ret;
			}
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr ges_project_list_assets(IntPtr raw, IntPtr filter);

		public GES.Asset[] ListAssets(GLib.GType filter) {
			IntPtr raw_ret = ges_project_list_assets(Handle, filter.Val);
			GES.Asset[] ret = (GES.Asset[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof(GLib.List), true, true, typeof(GES.Asset));
			return ret;
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr ges_project_list_encoding_profiles(IntPtr raw);

		public Gst.PbUtils.EncodingProfile[] ListEncodingProfiles() {
			IntPtr raw_ret = ges_project_list_encoding_profiles(Handle);
			Gst.PbUtils.EncodingProfile[] ret = (Gst.PbUtils.EncodingProfile[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof(GLib.List), false, false, typeof(Gst.PbUtils.EncodingProfile));
			return ret;
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe bool ges_project_load(IntPtr raw, IntPtr timeline, out IntPtr error);

		public unsafe bool Load(GES.Timeline timeline) {
			IntPtr error = IntPtr.Zero;
			bool raw_ret = ges_project_load(Handle, timeline == null ? IntPtr.Zero : timeline.Handle, out error);
			bool ret = raw_ret;
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern bool ges_project_remove_asset(IntPtr raw, IntPtr asset);

		public bool RemoveAsset(GES.Asset asset) {
			bool raw_ret = ges_project_remove_asset(Handle, asset == null ? IntPtr.Zero : asset.Handle);
			bool ret = raw_ret;
			return ret;
		}

		[DllImport("ges-1.0", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe bool ges_project_save(IntPtr raw, IntPtr timeline, IntPtr uri, IntPtr formatter_asset, bool overwrite, out IntPtr error);

		public unsafe bool Save(GES.Timeline timeline, string uri, GES.Asset formatter_asset, bool overwrite) {
			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
			IntPtr error = IntPtr.Zero;
			bool raw_ret = ges_project_save(Handle, timeline == null ? IntPtr.Zero : timeline.Handle, native_uri, formatter_asset == null ? IntPtr.Zero : formatter_asset.Handle, overwrite, out error);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_uri);
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		public bool Save(GES.Timeline timeline, string uri, bool overwrite) {
			return Save (timeline, uri, null, overwrite);
		}


		static Project ()
		{
			GtkSharp.GstEditingServices.ObjectManager.Initialize ();
		}

		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public new GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("priv"
							, GES.Asset.abi_info.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
							, null
							, "__ges_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("__ges_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 20 // __ges_reserved
							, "priv"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}