1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
10 /// <summary>Efl media playable interface</summary>
11 [Efl.IPlayableConcrete.NativeMethods]
12 public interface IPlayable :
13 Efl.Eo.IWrapper, IDisposable
15 /// <summary>Get the length of play for the media file.</summary>
16 /// <returns>The length of the stream in seconds.</returns>
19 /// <summary>Get whether the media file is seekable.</summary>
20 /// <returns><c>true</c> if seekable.</returns>
22 /// <summary>Get the length of play for the media file.</summary>
23 /// <value>The length of the stream in seconds.</value>
30 /// <summary>Get whether the media file is seekable.</summary>
31 /// <value><c>true</c> if seekable.</value>
36 /// <summary>Efl media playable interface</summary>
37 sealed public class IPlayableConcrete :
42 ///<summary>Pointer to the native class description.</summary>
43 public override System.IntPtr NativeClass
47 if (((object)this).GetType() == typeof(IPlayableConcrete))
49 return GetEflClassStatic();
53 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
58 [System.Runtime.InteropServices.DllImport("libefl.so.1")] internal static extern System.IntPtr
59 efl_playable_interface_get();
60 /// <summary>Initializes a new instance of the <see cref="IPlayable"/> class.
61 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
62 private IPlayableConcrete(System.IntPtr raw) : base(raw)
66 /// <summary>Get the length of play for the media file.</summary>
67 /// <returns>The length of the stream in seconds.</returns>
68 public double GetLength() {
69 var _ret_var = Efl.IPlayableConcrete.NativeMethods.efl_playable_length_get_ptr.Value.Delegate(this.NativeHandle);
70 Eina.Error.RaiseIfUnhandledException();
73 public bool GetPlayable() {
74 var _ret_var = Efl.IPlayableConcrete.NativeMethods.efl_playable_get_ptr.Value.Delegate(this.NativeHandle);
75 Eina.Error.RaiseIfUnhandledException();
78 /// <summary>Get whether the media file is seekable.</summary>
79 /// <returns><c>true</c> if seekable.</returns>
80 public bool GetSeekable() {
81 var _ret_var = Efl.IPlayableConcrete.NativeMethods.efl_playable_seekable_get_ptr.Value.Delegate(this.NativeHandle);
82 Eina.Error.RaiseIfUnhandledException();
85 /// <summary>Get the length of play for the media file.</summary>
86 /// <value>The length of the stream in seconds.</value>
87 public double Length {
88 get { return GetLength(); }
90 public bool Playable {
91 get { return GetPlayable(); }
93 /// <summary>Get whether the media file is seekable.</summary>
94 /// <value><c>true</c> if seekable.</value>
95 public bool Seekable {
96 get { return GetSeekable(); }
98 private static IntPtr GetEflClassStatic()
100 return Efl.IPlayableConcrete.efl_playable_interface_get();
102 /// <summary>Wrapper for native methods and virtual method delegates.
103 /// For internal use by generated code only.</summary>
104 public class NativeMethods : Efl.Eo.NativeClass
106 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl);
107 /// <summary>Gets the list of Eo operations to override.</summary>
108 /// <returns>The list of Eo operations to be overload.</returns>
109 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
111 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
112 var methods = Efl.Eo.Globals.GetUserMethods(type);
114 if (efl_playable_length_get_static_delegate == null)
116 efl_playable_length_get_static_delegate = new efl_playable_length_get_delegate(length_get);
119 if (methods.FirstOrDefault(m => m.Name == "GetLength") != null)
121 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_playable_length_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_length_get_static_delegate) });
124 if (efl_playable_get_static_delegate == null)
126 efl_playable_get_static_delegate = new efl_playable_get_delegate(playable_get);
129 if (methods.FirstOrDefault(m => m.Name == "GetPlayable") != null)
131 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_playable_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_get_static_delegate) });
134 if (efl_playable_seekable_get_static_delegate == null)
136 efl_playable_seekable_get_static_delegate = new efl_playable_seekable_get_delegate(seekable_get);
139 if (methods.FirstOrDefault(m => m.Name == "GetSeekable") != null)
141 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_playable_seekable_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_seekable_get_static_delegate) });
146 /// <summary>Returns the Eo class for the native methods of this class.</summary>
147 /// <returns>The native class pointer.</returns>
148 public override IntPtr GetEflClass()
150 return Efl.IPlayableConcrete.efl_playable_interface_get();
153 #pragma warning disable CA1707, CS1591, SA1300, SA1600
156 private delegate double efl_playable_length_get_delegate(System.IntPtr obj, System.IntPtr pd);
159 public delegate double efl_playable_length_get_api_delegate(System.IntPtr obj);
161 public static Efl.Eo.FunctionWrapper<efl_playable_length_get_api_delegate> efl_playable_length_get_ptr = new Efl.Eo.FunctionWrapper<efl_playable_length_get_api_delegate>(Module, "efl_playable_length_get");
163 private static double length_get(System.IntPtr obj, System.IntPtr pd)
165 Eina.Log.Debug("function efl_playable_length_get was called");
166 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
169 double _ret_var = default(double);
172 _ret_var = ((IPlayable)ws.Target).GetLength();
176 Eina.Log.Warning($"Callback error: {e.ToString()}");
177 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
185 return efl_playable_length_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
189 private static efl_playable_length_get_delegate efl_playable_length_get_static_delegate;
191 [return: MarshalAs(UnmanagedType.U1)]
192 private delegate bool efl_playable_get_delegate(System.IntPtr obj, System.IntPtr pd);
194 [return: MarshalAs(UnmanagedType.U1)]
195 public delegate bool efl_playable_get_api_delegate(System.IntPtr obj);
197 public static Efl.Eo.FunctionWrapper<efl_playable_get_api_delegate> efl_playable_get_ptr = new Efl.Eo.FunctionWrapper<efl_playable_get_api_delegate>(Module, "efl_playable_get");
199 private static bool playable_get(System.IntPtr obj, System.IntPtr pd)
201 Eina.Log.Debug("function efl_playable_get was called");
202 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
205 bool _ret_var = default(bool);
208 _ret_var = ((IPlayable)ws.Target).GetPlayable();
212 Eina.Log.Warning($"Callback error: {e.ToString()}");
213 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
221 return efl_playable_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
225 private static efl_playable_get_delegate efl_playable_get_static_delegate;
227 [return: MarshalAs(UnmanagedType.U1)]
228 private delegate bool efl_playable_seekable_get_delegate(System.IntPtr obj, System.IntPtr pd);
230 [return: MarshalAs(UnmanagedType.U1)]
231 public delegate bool efl_playable_seekable_get_api_delegate(System.IntPtr obj);
233 public static Efl.Eo.FunctionWrapper<efl_playable_seekable_get_api_delegate> efl_playable_seekable_get_ptr = new Efl.Eo.FunctionWrapper<efl_playable_seekable_get_api_delegate>(Module, "efl_playable_seekable_get");
235 private static bool seekable_get(System.IntPtr obj, System.IntPtr pd)
237 Eina.Log.Debug("function efl_playable_seekable_get was called");
238 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
241 bool _ret_var = default(bool);
244 _ret_var = ((IPlayable)ws.Target).GetSeekable();
248 Eina.Log.Warning($"Callback error: {e.ToString()}");
249 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
257 return efl_playable_seekable_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
261 private static efl_playable_seekable_get_delegate efl_playable_seekable_get_static_delegate;
263 #pragma warning restore CA1707, CS1591, SA1300, SA1600