mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
Update GInterface override hacks
This commit is contained in:
parent
daa624932c
commit
b8b82acb41
10 changed files with 324 additions and 335 deletions
|
@ -61,7 +61,6 @@ sources = \
|
||||||
overrides = \
|
overrides = \
|
||||||
$(srcdir)/override/URIHandlerAdapter.cs \
|
$(srcdir)/override/URIHandlerAdapter.cs \
|
||||||
$(srcdir)/override/ColorBalanceAdapter.cs \
|
$(srcdir)/override/ColorBalanceAdapter.cs \
|
||||||
$(srcdir)/override/ColorBalance.cs \
|
|
||||||
$(srcdir)/override/Mixer.cs \
|
$(srcdir)/override/Mixer.cs \
|
||||||
$(srcdir)/override/MixerAdapter.cs \
|
$(srcdir)/override/MixerAdapter.cs \
|
||||||
$(srcdir)/override/PropertyProbe.cs \
|
$(srcdir)/override/PropertyProbe.cs \
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
// This file was generated by the Gtk# code generator.
|
|
||||||
// Changed to include the BalanceType property
|
|
||||||
|
|
||||||
namespace Gst.Interfaces {
|
|
||||||
|
|
||||||
using System;
|
|
||||||
|
|
||||||
#region Autogenerated code
|
|
||||||
public interface ColorBalance : GLib.IWrapper {
|
|
||||||
Gst.Interfaces.ColorBalanceType BalanceType {
|
|
||||||
get ;
|
|
||||||
}
|
|
||||||
|
|
||||||
event Gst.Interfaces.ValueChangedHandler ValueChanged;
|
|
||||||
void SetValue(Gst.Interfaces.ColorBalanceChannel channel, int value);
|
|
||||||
Gst.Interfaces.ColorBalanceChannel[] ListChannels();
|
|
||||||
int GetValue(Gst.Interfaces.ColorBalanceChannel channel);
|
|
||||||
void EmitValueChanged(Gst.Interfaces.ColorBalanceChannel channel, int value);
|
|
||||||
}
|
|
||||||
|
|
||||||
[GLib.GInterface (typeof (ColorBalanceAdapter))]
|
|
||||||
public interface ColorBalanceImplementor : GLib.IWrapper {
|
|
||||||
|
|
||||||
Gst.Interfaces.ColorBalanceChannel[] ListChannels ();
|
|
||||||
void SetValue (Gst.Interfaces.ColorBalanceChannel channel, int value);
|
|
||||||
int GetValue (Gst.Interfaces.ColorBalanceChannel channel);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
// This file was generated by the Gtk# code generator.
|
// This file was generated by the Gtk# code generator.
|
||||||
// Changed to handle the BalanceType interface field
|
// Any changes made will be lost if regenerated.
|
||||||
|
|
||||||
namespace Gst.Interfaces {
|
namespace Gst.Interfaces {
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ namespace Gst.Interfaces {
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
#region Autogenerated code
|
#region Autogenerated code
|
||||||
public class ColorBalanceAdapter : GLib.GInterfaceAdapter, Gst.Interfaces.ColorBalance {
|
public partial class ColorBalanceAdapter : Gst.GLib.GInterfaceAdapter, Gst.Interfaces.ColorBalance {
|
||||||
|
|
||||||
[StructLayout (LayoutKind.Sequential)]
|
[StructLayout (LayoutKind.Sequential)]
|
||||||
struct GstColorBalanceClass {
|
struct GstColorBalanceClass {
|
||||||
|
@ -25,52 +25,52 @@ namespace Gst.Interfaces {
|
||||||
|
|
||||||
static ColorBalanceAdapter ()
|
static ColorBalanceAdapter ()
|
||||||
{
|
{
|
||||||
GLib.GType.Register (_gtype, typeof(ColorBalanceAdapter));
|
Gst.GLib.GType.Register (_gtype, typeof(ColorBalanceAdapter));
|
||||||
iface.ListChannels = new ListChannelsNativeDelegate (ListChannels_cb);
|
iface.ListChannels = new ListChannelsNativeDelegate (ListChannels_cb);
|
||||||
iface.SetValue = new SetValueNativeDelegate (SetValue_cb);
|
iface.SetValue = new SetValueNativeDelegate (SetValue_cb);
|
||||||
iface.GetValue = new GetValueNativeDelegate (GetValue_cb);
|
iface.GetValue = new GetValueNativeDelegate (GetValue_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate IntPtr ListChannelsNativeDelegate (IntPtr inst);
|
delegate IntPtr ListChannelsNativeDelegate (IntPtr inst);
|
||||||
|
|
||||||
static IntPtr ListChannels_cb (IntPtr inst)
|
static IntPtr ListChannels_cb (IntPtr inst)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
ColorBalanceImplementor __obj = GLib.Object.GetObject (inst, false) as ColorBalanceImplementor;
|
ColorBalanceImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as ColorBalanceImplementor;
|
||||||
Gst.Interfaces.ColorBalanceChannel[] __result = __obj.ListChannels ();
|
Gst.Interfaces.ColorBalanceChannel[] __result = __obj.ListChannels ();
|
||||||
return new GLib.List(__result, typeof (Gst.Interfaces.ColorBalanceChannel), false, false) == null ? IntPtr.Zero : new GLib.List(__result, typeof (Gst.Interfaces.ColorBalanceChannel), false, false).Handle;
|
return new Gst.GLib.List(__result, typeof (Gst.Interfaces.ColorBalanceChannel), false, false) == null ? IntPtr.Zero : new Gst.GLib.List(__result, typeof (Gst.Interfaces.ColorBalanceChannel), false, false).Handle;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate void SetValueNativeDelegate (IntPtr inst, IntPtr channel, int value);
|
delegate void SetValueNativeDelegate (IntPtr inst, IntPtr channel, int value);
|
||||||
|
|
||||||
static void SetValue_cb (IntPtr inst, IntPtr channel, int value)
|
static void SetValue_cb (IntPtr inst, IntPtr channel, int value)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
ColorBalanceImplementor __obj = GLib.Object.GetObject (inst, false) as ColorBalanceImplementor;
|
ColorBalanceImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as ColorBalanceImplementor;
|
||||||
__obj.SetValue (GLib.Object.GetObject(channel) as Gst.Interfaces.ColorBalanceChannel, value);
|
__obj.SetValue (Gst.GLib.Object.GetObject(channel) as Gst.Interfaces.ColorBalanceChannel, value);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate int GetValueNativeDelegate (IntPtr inst, IntPtr channel);
|
delegate int GetValueNativeDelegate (IntPtr inst, IntPtr channel);
|
||||||
|
|
||||||
static int GetValue_cb (IntPtr inst, IntPtr channel)
|
static int GetValue_cb (IntPtr inst, IntPtr channel)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
ColorBalanceImplementor __obj = GLib.Object.GetObject (inst, false) as ColorBalanceImplementor;
|
ColorBalanceImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as ColorBalanceImplementor;
|
||||||
int __result = __obj.GetValue (GLib.Object.GetObject(channel) as Gst.Interfaces.ColorBalanceChannel);
|
int __result = __obj.GetValue (Gst.GLib.Object.GetObject(channel) as Gst.Interfaces.ColorBalanceChannel);
|
||||||
return __result;
|
return __result;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
@ -100,54 +100,59 @@ namespace Gst.Interfaces {
|
||||||
gch.Free ();
|
gch.Free ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gst.GLib.Object implementor;
|
||||||
|
|
||||||
public ColorBalanceAdapter ()
|
public ColorBalanceAdapter ()
|
||||||
{
|
{
|
||||||
InitHandler = new GLib.GInterfaceInitHandler (Initialize);
|
InitHandler = new Gst.GLib.GInterfaceInitHandler (Initialize);
|
||||||
}
|
}
|
||||||
|
|
||||||
ColorBalanceImplementor implementor;
|
|
||||||
|
|
||||||
public ColorBalanceAdapter (ColorBalanceImplementor implementor)
|
public ColorBalanceAdapter (ColorBalanceImplementor implementor)
|
||||||
{
|
{
|
||||||
if (implementor == null)
|
if (implementor == null)
|
||||||
throw new ArgumentNullException ("implementor");
|
throw new ArgumentNullException ("implementor");
|
||||||
this.implementor = implementor;
|
else if (!(implementor is Gst.GLib.Object))
|
||||||
|
throw new ArgumentException ("implementor must be a subclass of Gst.GLib.Object");
|
||||||
|
this.implementor = implementor as Gst.GLib.Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ColorBalanceAdapter (IntPtr handle)
|
public ColorBalanceAdapter (IntPtr handle)
|
||||||
{
|
{
|
||||||
if (!_gtype.IsInstance (handle))
|
if (!_gtype.IsInstance (handle))
|
||||||
throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle");
|
throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle");
|
||||||
this.handle = handle;
|
implementor = Gst.GLib.Object.GetObject (handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern IntPtr gst_color_balance_get_type();
|
static extern IntPtr gst_color_balance_get_type();
|
||||||
|
|
||||||
private static GLib.GType _gtype = new GLib.GType (gst_color_balance_get_type ());
|
private static Gst.GLib.GType _gtype = new Gst.GLib.GType (gst_color_balance_get_type ());
|
||||||
|
|
||||||
public override GLib.GType GType {
|
public override Gst.GLib.GType GType {
|
||||||
get {
|
get {
|
||||||
return _gtype;
|
return _gtype;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IntPtr handle;
|
|
||||||
public override IntPtr Handle {
|
public override IntPtr Handle {
|
||||||
get {
|
get {
|
||||||
if (handle != IntPtr.Zero)
|
return implementor.Handle;
|
||||||
return handle;
|
}
|
||||||
return implementor == null ? IntPtr.Zero : implementor.Handle;
|
}
|
||||||
|
|
||||||
|
public IntPtr OwnedHandle {
|
||||||
|
get {
|
||||||
|
return implementor.OwnedHandle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ColorBalance GetObject (IntPtr handle, bool owned)
|
public static ColorBalance GetObject (IntPtr handle, bool owned)
|
||||||
{
|
{
|
||||||
GLib.Object obj = GLib.Object.GetObject (handle, owned);
|
Gst.GLib.Object obj = Gst.GLib.Object.GetObject (handle, owned);
|
||||||
return GetObject (obj);
|
return GetObject (obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ColorBalance GetObject (GLib.Object obj)
|
public static ColorBalance GetObject (Gst.GLib.Object obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -161,39 +166,39 @@ namespace Gst.Interfaces {
|
||||||
|
|
||||||
public ColorBalanceImplementor Implementor {
|
public ColorBalanceImplementor Implementor {
|
||||||
get {
|
get {
|
||||||
return implementor;
|
return implementor as ColorBalanceImplementor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.Signal("value-changed")]
|
[Gst.GLib.Signal("value-changed")]
|
||||||
public event Gst.Interfaces.ValueChangedHandler ValueChanged {
|
public event Gst.Interfaces.ValueChangedHandler ValueChanged {
|
||||||
add {
|
add {
|
||||||
GLib.Signal sig = GLib.Signal.Lookup (GLib.Object.GetObject (Handle), "value-changed", typeof (Gst.Interfaces.ValueChangedArgs));
|
Gst.GLib.Signal sig = Gst.GLib.Signal.Lookup (Gst.GLib.Object.GetObject (Handle), "value-changed", typeof (Gst.Interfaces.ValueChangedArgs));
|
||||||
sig.AddDelegate (value);
|
sig.AddDelegate (value);
|
||||||
}
|
}
|
||||||
remove {
|
remove {
|
||||||
GLib.Signal sig = GLib.Signal.Lookup (GLib.Object.GetObject (Handle), "value-changed", typeof (Gst.Interfaces.ValueChangedArgs));
|
Gst.GLib.Signal sig = Gst.GLib.Signal.Lookup (Gst.GLib.Object.GetObject (Handle), "value-changed", typeof (Gst.Interfaces.ValueChangedArgs));
|
||||||
sig.RemoveDelegate (value);
|
sig.RemoveDelegate (value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_color_balance_set_value(IntPtr raw, IntPtr channel, int value);
|
static extern void gst_color_balance_set_value(IntPtr raw, IntPtr channel, int value);
|
||||||
|
|
||||||
public void SetValue(Gst.Interfaces.ColorBalanceChannel channel, int value) {
|
public void SetValue(Gst.Interfaces.ColorBalanceChannel channel, int value) {
|
||||||
gst_color_balance_set_value(Handle, channel == null ? IntPtr.Zero : channel.Handle, value);
|
gst_color_balance_set_value(Handle, channel == null ? IntPtr.Zero : channel.Handle, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern IntPtr gst_color_balance_list_channels(IntPtr raw);
|
static extern IntPtr gst_color_balance_list_channels(IntPtr raw);
|
||||||
|
|
||||||
public Gst.Interfaces.ColorBalanceChannel[] ListChannels() {
|
public Gst.Interfaces.ColorBalanceChannel[] ListChannels() {
|
||||||
IntPtr raw_ret = gst_color_balance_list_channels(Handle);
|
IntPtr raw_ret = gst_color_balance_list_channels(Handle);
|
||||||
Gst.Interfaces.ColorBalanceChannel[] ret = (Gst.Interfaces.ColorBalanceChannel[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof(GLib.List), false, false, typeof(Gst.Interfaces.ColorBalanceChannel));
|
Gst.Interfaces.ColorBalanceChannel[] ret = (Gst.Interfaces.ColorBalanceChannel[]) Gst.GLib.Marshaller.ListPtrToArray (raw_ret, typeof(Gst.GLib.List), false, false, typeof(Gst.Interfaces.ColorBalanceChannel));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern int gst_color_balance_get_value(IntPtr raw, IntPtr channel);
|
static extern int gst_color_balance_get_value(IntPtr raw, IntPtr channel);
|
||||||
|
|
||||||
public int GetValue(Gst.Interfaces.ColorBalanceChannel channel) {
|
public int GetValue(Gst.Interfaces.ColorBalanceChannel channel) {
|
||||||
|
@ -202,26 +207,24 @@ namespace Gst.Interfaces {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
static extern int gst_color_balance_get_balance_type(IntPtr raw);
|
||||||
|
|
||||||
|
public Gst.Interfaces.ColorBalanceType BalanceType {
|
||||||
|
get {
|
||||||
|
int raw_ret = gst_color_balance_get_balance_type(Handle);
|
||||||
|
Gst.Interfaces.ColorBalanceType ret = (Gst.Interfaces.ColorBalanceType) raw_ret;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_color_balance_value_changed(IntPtr raw, IntPtr channel, int value);
|
static extern void gst_color_balance_value_changed(IntPtr raw, IntPtr channel, int value);
|
||||||
|
|
||||||
public void EmitValueChanged(Gst.Interfaces.ColorBalanceChannel channel, int value) {
|
public void EmitValueChanged(Gst.Interfaces.ColorBalanceChannel channel, int value) {
|
||||||
gst_color_balance_value_changed(Handle, channel == null ? IntPtr.Zero : channel.Handle, value);
|
gst_color_balance_value_changed(Handle, channel == null ? IntPtr.Zero : channel.Handle, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[DllImport("libgobject-2.0-0.dll")]
|
|
||||||
static extern IntPtr g_type_interface_peek (IntPtr klass, IntPtr iface_gtype);
|
|
||||||
public Gst.Interfaces.ColorBalanceType BalanceType {
|
|
||||||
get {
|
|
||||||
IntPtr gclass = Marshal.ReadIntPtr (Handle);
|
|
||||||
IntPtr ifaceptr = g_type_interface_peek (gclass, _gtype.Val);
|
|
||||||
GstColorBalanceClass native_iface = (GstColorBalanceClass) Marshal.PtrToStructure (ifaceptr, typeof (GstColorBalanceClass));
|
|
||||||
|
|
||||||
return native_iface.BalanceType;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,26 @@
|
||||||
// This file was generated by the Gtk# code generator.
|
// This file was generated by the Gtk# code generator.
|
||||||
// Changed to include the MixerType property
|
// Any changes made will be lost if regenerated.
|
||||||
|
|
||||||
namespace Gst.Interfaces {
|
namespace Gst.Interfaces {
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
#region Autogenerated code
|
#region Autogenerated code
|
||||||
public interface Mixer : GLib.IWrapper {
|
public partial interface Mixer : Gst.GLib.IWrapper {
|
||||||
Gst.Interfaces.MixerType MixerType {
|
|
||||||
get;
|
|
||||||
}
|
|
||||||
void VolumeChanged(Gst.Interfaces.MixerTrack track, int[] volumes);
|
void VolumeChanged(Gst.Interfaces.MixerTrack track, int[] volumes);
|
||||||
Gst.Interfaces.MixerTrack[] ListTracks();
|
Gst.Interfaces.MixerTrack[] ListTracks();
|
||||||
void SetOption(Gst.Interfaces.MixerOptions opts, string value);
|
void SetOption(Gst.Interfaces.MixerOptions opts, string value);
|
||||||
void SetVolume(Gst.Interfaces.MixerTrack track, int[] volumes);
|
void SetVolume(Gst.Interfaces.MixerTrack track, int[] volumes);
|
||||||
void MuteToggled(Gst.Interfaces.MixerTrack track, bool mute);
|
Gst.Interfaces.MixerType MixerType {
|
||||||
|
get;
|
||||||
|
}
|
||||||
void OptionChanged(Gst.Interfaces.MixerOptions opts, string value);
|
void OptionChanged(Gst.Interfaces.MixerOptions opts, string value);
|
||||||
void OptionsListChanged(Gst.Interfaces.MixerOptions opts);
|
|
||||||
string GetOption(Gst.Interfaces.MixerOptions opts);
|
string GetOption(Gst.Interfaces.MixerOptions opts);
|
||||||
void SetRecord(Gst.Interfaces.MixerTrack track, bool record);
|
void SetRecord(Gst.Interfaces.MixerTrack track, bool record);
|
||||||
|
void ListChanged(Gst.Interfaces.MixerOptions opts);
|
||||||
void RecordToggled(Gst.Interfaces.MixerTrack track, bool record);
|
void RecordToggled(Gst.Interfaces.MixerTrack track, bool record);
|
||||||
|
void MuteToggled(Gst.Interfaces.MixerTrack track, bool mute);
|
||||||
int[] GetVolume(Gst.Interfaces.MixerTrack track);
|
int[] GetVolume(Gst.Interfaces.MixerTrack track);
|
||||||
Gst.Interfaces.MixerFlags MixerFlags {
|
Gst.Interfaces.MixerFlags MixerFlags {
|
||||||
get;
|
get;
|
||||||
|
@ -28,8 +29,8 @@ namespace Gst.Interfaces {
|
||||||
void SetMute(Gst.Interfaces.MixerTrack track, bool mute);
|
void SetMute(Gst.Interfaces.MixerTrack track, bool mute);
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.GInterface (typeof (MixerAdapter))]
|
[Gst.GLib.GInterface (typeof (MixerAdapter))]
|
||||||
public interface MixerImplementor : GLib.IWrapper {
|
public partial interface MixerImplementor : Gst.GLib.IWrapper {
|
||||||
|
|
||||||
Gst.Interfaces.MixerTrack[] ListTracks ();
|
Gst.Interfaces.MixerTrack[] ListTracks ();
|
||||||
void SetVolume (Gst.Interfaces.MixerTrack track, int[] volumes);
|
void SetVolume (Gst.Interfaces.MixerTrack track, int[] volumes);
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace Gst.Interfaces {
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
#region Autogenerated code
|
#region Autogenerated code
|
||||||
public class MixerAdapter : GLib.GInterfaceAdapter, Gst.Interfaces.Mixer {
|
public partial class MixerAdapter : Gst.GLib.GInterfaceAdapter, Gst.Interfaces.Mixer {
|
||||||
|
|
||||||
[StructLayout (LayoutKind.Sequential)]
|
[StructLayout (LayoutKind.Sequential)]
|
||||||
struct GstMixerClass {
|
struct GstMixerClass {
|
||||||
|
@ -18,12 +18,11 @@ namespace Gst.Interfaces {
|
||||||
public GetVolumeNativeDelegate GetVolume;
|
public GetVolumeNativeDelegate GetVolume;
|
||||||
public SetMuteNativeDelegate SetMute;
|
public SetMuteNativeDelegate SetMute;
|
||||||
public SetRecordNativeDelegate SetRecord;
|
public SetRecordNativeDelegate SetRecord;
|
||||||
IntPtr MuteToggled;
|
[MarshalAs (UnmanagedType.ByValArray, SizeConst=3)]
|
||||||
IntPtr RecordToggled;
|
private IntPtr[] Padding1;
|
||||||
IntPtr VolumeChanged;
|
|
||||||
public SetOptionNativeDelegate SetOption;
|
public SetOptionNativeDelegate SetOption;
|
||||||
public GetOptionNativeDelegate GetOption;
|
public GetOptionNativeDelegate GetOption;
|
||||||
IntPtr OptionChanged;
|
private IntPtr _padding2;
|
||||||
public GetMixerFlagsNativeDelegate GetMixerFlags;
|
public GetMixerFlagsNativeDelegate GetMixerFlags;
|
||||||
[MarshalAs (UnmanagedType.ByValArray, SizeConst=3)]
|
[MarshalAs (UnmanagedType.ByValArray, SizeConst=3)]
|
||||||
public IntPtr[] GstReserved;
|
public IntPtr[] GstReserved;
|
||||||
|
@ -33,7 +32,7 @@ namespace Gst.Interfaces {
|
||||||
|
|
||||||
static MixerAdapter ()
|
static MixerAdapter ()
|
||||||
{
|
{
|
||||||
GLib.GType.Register (_gtype, typeof(MixerAdapter));
|
Gst.GLib.GType.Register (_gtype, typeof(MixerAdapter));
|
||||||
iface.ListTracks = new ListTracksNativeDelegate (ListTracks_cb);
|
iface.ListTracks = new ListTracksNativeDelegate (ListTracks_cb);
|
||||||
iface.SetVolume = new SetVolumeNativeDelegate (SetVolume_cb);
|
iface.SetVolume = new SetVolumeNativeDelegate (SetVolume_cb);
|
||||||
iface.GetVolume = new GetVolumeNativeDelegate (GetVolume_cb);
|
iface.GetVolume = new GetVolumeNativeDelegate (GetVolume_cb);
|
||||||
|
@ -44,129 +43,127 @@ namespace Gst.Interfaces {
|
||||||
iface.GetMixerFlags = new GetMixerFlagsNativeDelegate (GetMixerFlags_cb);
|
iface.GetMixerFlags = new GetMixerFlagsNativeDelegate (GetMixerFlags_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate IntPtr ListTracksNativeDelegate (IntPtr inst);
|
delegate IntPtr ListTracksNativeDelegate (IntPtr inst);
|
||||||
|
|
||||||
static IntPtr ListTracks_cb (IntPtr inst)
|
static IntPtr ListTracks_cb (IntPtr inst)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
MixerImplementor __obj = GLib.Object.GetObject (inst, false) as MixerImplementor;
|
MixerImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as MixerImplementor;
|
||||||
Gst.Interfaces.MixerTrack[] __result = __obj.ListTracks ();
|
Gst.Interfaces.MixerTrack[] __result = __obj.ListTracks ();
|
||||||
GLib.List ret = new GLib.List(__result, typeof (Gst.Interfaces.MixerTrack), false, false);
|
return new Gst.GLib.List(__result, typeof (Gst.Interfaces.MixerTrack), false, false) == null ? IntPtr.Zero : new Gst.GLib.List(__result, typeof (Gst.Interfaces.MixerTrack), false, false).Handle;
|
||||||
if (ret == null)
|
|
||||||
return IntPtr.Zero;
|
|
||||||
return ret.Handle;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate void SetVolumeNativeDelegate (IntPtr inst, IntPtr track, IntPtr volumes);
|
delegate void SetVolumeNativeDelegate (IntPtr inst, IntPtr track, IntPtr volumes);
|
||||||
|
|
||||||
static void SetVolume_cb (IntPtr inst, IntPtr track, IntPtr volumes)
|
static void SetVolume_cb (IntPtr inst, IntPtr track, IntPtr volumes)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
MixerImplementor __obj = GLib.Object.GetObject (inst, false) as MixerImplementor;
|
MixerImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as MixerImplementor;
|
||||||
MixerTrack managed_track = GLib.Object.GetObject (track) as MixerTrack;
|
MixerTrack managed_track = Gst.GLib.Object.GetObject (track) as MixerTrack;
|
||||||
int[] managed_volumes = new int[managed_track.NumChannels];
|
int[] managed_volumes = new int[managed_track.NumChannels];
|
||||||
Marshal.Copy (volumes, managed_volumes, 0, managed_track.NumChannels);
|
Marshal.Copy (volumes, managed_volumes, 0, managed_track.NumChannels);
|
||||||
__obj.SetVolume (managed_track, managed_volumes);
|
__obj.SetVolume (managed_track, managed_volumes);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate void GetVolumeNativeDelegate (IntPtr inst, IntPtr track, out IntPtr volumes);
|
delegate void GetVolumeNativeDelegate (IntPtr inst, IntPtr track, IntPtr volumes);
|
||||||
|
|
||||||
static void GetVolume_cb (IntPtr inst, IntPtr track, out IntPtr volumes)
|
static void GetVolume_cb (IntPtr inst, IntPtr track, IntPtr volumes)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
MixerImplementor __obj = GLib.Object.GetObject (inst, false) as MixerImplementor;
|
MixerImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as MixerImplementor;
|
||||||
MixerTrack managed_track = GLib.Object.GetObject (track) as MixerTrack;
|
MixerTrack managed_track = Gst.GLib.Object.GetObject (track) as MixerTrack;
|
||||||
|
|
||||||
int[] managed_volumes = __obj.GetVolume (managed_track);
|
int[] managed_volumes = __obj.GetVolume (managed_track);
|
||||||
|
|
||||||
volumes = GLib.Marshaller.Malloc ((ulong) (4 * managed_track.NumChannels));
|
volumes = Gst.GLib.Marshaller.Malloc ((ulong) (4 * managed_track.NumChannels));
|
||||||
Marshal.Copy (managed_volumes, 0, volumes, managed_track.NumChannels);
|
Marshal.Copy (managed_volumes, 0, volumes, managed_track.NumChannels);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate void SetMuteNativeDelegate (IntPtr inst, IntPtr track, bool mute);
|
delegate void SetMuteNativeDelegate (IntPtr inst, IntPtr track, bool mute);
|
||||||
|
|
||||||
static void SetMute_cb (IntPtr inst, IntPtr track, bool mute)
|
static void SetMute_cb (IntPtr inst, IntPtr track, bool mute)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
MixerImplementor __obj = GLib.Object.GetObject (inst, false) as MixerImplementor;
|
MixerImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as MixerImplementor;
|
||||||
__obj.SetMute (GLib.Object.GetObject(track) as Gst.Interfaces.MixerTrack, mute);
|
__obj.SetMute (Gst.GLib.Object.GetObject(track) as Gst.Interfaces.MixerTrack, mute);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate void SetRecordNativeDelegate (IntPtr inst, IntPtr track, bool record);
|
delegate void SetRecordNativeDelegate (IntPtr inst, IntPtr track, bool record);
|
||||||
|
|
||||||
static void SetRecord_cb (IntPtr inst, IntPtr track, bool record)
|
static void SetRecord_cb (IntPtr inst, IntPtr track, bool record)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
MixerImplementor __obj = GLib.Object.GetObject (inst, false) as MixerImplementor;
|
MixerImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as MixerImplementor;
|
||||||
__obj.SetRecord (GLib.Object.GetObject(track) as Gst.Interfaces.MixerTrack, record);
|
__obj.SetRecord (Gst.GLib.Object.GetObject(track) as Gst.Interfaces.MixerTrack, record);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate void SetOptionNativeDelegate (IntPtr inst, IntPtr opts, IntPtr value);
|
delegate void SetOptionNativeDelegate (IntPtr inst, IntPtr opts, IntPtr value);
|
||||||
|
|
||||||
static void SetOption_cb (IntPtr inst, IntPtr opts, IntPtr value)
|
static void SetOption_cb (IntPtr inst, IntPtr opts, IntPtr value)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
MixerImplementor __obj = GLib.Object.GetObject (inst, false) as MixerImplementor;
|
MixerImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as MixerImplementor;
|
||||||
__obj.SetOption (GLib.Object.GetObject(opts) as Gst.Interfaces.MixerOptions, GLib.Marshaller.PtrToStringGFree(value));
|
__obj.SetOption (Gst.GLib.Object.GetObject(opts) as Gst.Interfaces.MixerOptions, Gst.GLib.Marshaller.PtrToStringGFree(value));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate IntPtr GetOptionNativeDelegate (IntPtr inst, IntPtr opts);
|
delegate IntPtr GetOptionNativeDelegate (IntPtr inst, IntPtr opts);
|
||||||
|
|
||||||
static IntPtr GetOption_cb (IntPtr inst, IntPtr opts)
|
static IntPtr GetOption_cb (IntPtr inst, IntPtr opts)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
MixerImplementor __obj = GLib.Object.GetObject (inst, false) as MixerImplementor;
|
MixerImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as MixerImplementor;
|
||||||
string __result = __obj.GetOption (GLib.Object.GetObject(opts) as Gst.Interfaces.MixerOptions);
|
string __result = __obj.GetOption (Gst.GLib.Object.GetObject(opts) as Gst.Interfaces.MixerOptions);
|
||||||
return GLib.Marshaller.StringToPtrGStrdup(__result);
|
return Gst.GLib.Marshaller.StringToPtrGStrdup(__result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate int GetMixerFlagsNativeDelegate (IntPtr inst);
|
delegate int GetMixerFlagsNativeDelegate (IntPtr inst);
|
||||||
|
|
||||||
static int GetMixerFlags_cb (IntPtr inst)
|
static int GetMixerFlags_cb (IntPtr inst)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
MixerImplementor __obj = GLib.Object.GetObject (inst, false) as MixerImplementor;
|
MixerImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as MixerImplementor;
|
||||||
Gst.Interfaces.MixerFlags __result = __obj.MixerFlags;
|
Gst.Interfaces.MixerFlags __result = __obj.MixerFlags;
|
||||||
return (int) __result;
|
return (int) __result;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
@ -188,67 +185,73 @@ namespace Gst.Interfaces {
|
||||||
native_iface.GetMixerFlags = iface.GetMixerFlags;
|
native_iface.GetMixerFlags = iface.GetMixerFlags;
|
||||||
|
|
||||||
GCHandle gch = (GCHandle) data;
|
GCHandle gch = (GCHandle) data;
|
||||||
MixerAdapter adapter = gch.Target as MixerAdapter;
|
|
||||||
MixerImplementor implementor = adapter.Implementor;
|
|
||||||
|
|
||||||
|
MixerAdapter adapter = gch.Target as MixerAdapter;
|
||||||
|
MixerImplementor implementor = adapter.Implementor;
|
||||||
|
|
||||||
if (implementor != null) {
|
if (implementor != null) {
|
||||||
PropertyInfo pi = implementor.GetType().GetProperty ("MixerType", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy);
|
PropertyInfo pi = implementor.GetType().GetProperty ("MixerType", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy);
|
||||||
if (pi != null && pi.PropertyType == typeof (Gst.Interfaces.MixerType))
|
if (pi != null && pi.PropertyType == typeof (Gst.Interfaces.MixerType))
|
||||||
native_iface.MixerType = (Gst.Interfaces.MixerType) pi.GetValue (null, null);
|
native_iface.MixerType = (Gst.Interfaces.MixerType) pi.GetValue (null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
Marshal.StructureToPtr (native_iface, ifaceptr, false);
|
Marshal.StructureToPtr (native_iface, ifaceptr, false);
|
||||||
gch.Free ();
|
gch.Free ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gst.GLib.Object implementor;
|
||||||
|
|
||||||
public MixerAdapter ()
|
public MixerAdapter ()
|
||||||
{
|
{
|
||||||
InitHandler = new GLib.GInterfaceInitHandler (Initialize);
|
InitHandler = new Gst.GLib.GInterfaceInitHandler (Initialize);
|
||||||
}
|
}
|
||||||
|
|
||||||
MixerImplementor implementor;
|
|
||||||
|
|
||||||
public MixerAdapter (MixerImplementor implementor)
|
public MixerAdapter (MixerImplementor implementor)
|
||||||
{
|
{
|
||||||
if (implementor == null)
|
if (implementor == null)
|
||||||
throw new ArgumentNullException ("implementor");
|
throw new ArgumentNullException ("implementor");
|
||||||
this.implementor = implementor;
|
else if (!(implementor is Gst.GLib.Object))
|
||||||
|
throw new ArgumentException ("implementor must be a subclass of Gst.GLib.Object");
|
||||||
|
this.implementor = implementor as Gst.GLib.Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MixerAdapter (IntPtr handle)
|
public MixerAdapter (IntPtr handle)
|
||||||
{
|
{
|
||||||
if (!_gtype.IsInstance (handle))
|
if (!_gtype.IsInstance (handle))
|
||||||
throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle");
|
throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle");
|
||||||
this.handle = handle;
|
implementor = Gst.GLib.Object.GetObject (handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern IntPtr gst_mixer_get_type();
|
static extern IntPtr gst_mixer_get_type();
|
||||||
|
|
||||||
private static GLib.GType _gtype = new GLib.GType (gst_mixer_get_type ());
|
private static Gst.GLib.GType _gtype = new Gst.GLib.GType (gst_mixer_get_type ());
|
||||||
|
|
||||||
public override GLib.GType GType {
|
public override Gst.GLib.GType GType {
|
||||||
get {
|
get {
|
||||||
return _gtype;
|
return _gtype;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IntPtr handle;
|
|
||||||
public override IntPtr Handle {
|
public override IntPtr Handle {
|
||||||
get {
|
get {
|
||||||
if (handle != IntPtr.Zero)
|
return implementor.Handle;
|
||||||
return handle;
|
}
|
||||||
return implementor == null ? IntPtr.Zero : implementor.Handle;
|
}
|
||||||
|
|
||||||
|
public IntPtr OwnedHandle {
|
||||||
|
get {
|
||||||
|
return implementor.OwnedHandle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Mixer GetObject (IntPtr handle, bool owned)
|
public static Mixer GetObject (IntPtr handle, bool owned)
|
||||||
{
|
{
|
||||||
GLib.Object obj = GLib.Object.GetObject (handle, owned);
|
Gst.GLib.Object obj = Gst.GLib.Object.GetObject (handle, owned);
|
||||||
return GetObject (obj);
|
return GetObject (obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Mixer GetObject (GLib.Object obj)
|
public static Mixer GetObject (Gst.GLib.Object obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -262,13 +265,13 @@ namespace Gst.Interfaces {
|
||||||
|
|
||||||
public MixerImplementor Implementor {
|
public MixerImplementor Implementor {
|
||||||
get {
|
get {
|
||||||
return implementor;
|
return implementor as MixerImplementor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_mixer_volume_changed(IntPtr raw, IntPtr track, IntPtr volumes);
|
static extern void gst_mixer_volume_changed(IntPtr raw, IntPtr track, IntPtr volumes);
|
||||||
|
|
||||||
public void VolumeChanged(Gst.Interfaces.MixerTrack track, int[] volumes) {
|
public void VolumeChanged(Gst.Interfaces.MixerTrack track, int[] volumes) {
|
||||||
if (track == null)
|
if (track == null)
|
||||||
return;
|
return;
|
||||||
|
@ -276,29 +279,29 @@ namespace Gst.Interfaces {
|
||||||
if (volumes.Length != track.NumChannels)
|
if (volumes.Length != track.NumChannels)
|
||||||
throw new ArgumentOutOfRangeException ();
|
throw new ArgumentOutOfRangeException ();
|
||||||
|
|
||||||
IntPtr native_volumes = GLib.Marshaller.Malloc ((ulong) (4 * track.NumChannels));
|
IntPtr native_volumes = Gst.GLib.Marshaller.Malloc ((ulong) (4 * track.NumChannels));
|
||||||
Marshal.Copy (volumes, 0, native_volumes, track.NumChannels);
|
Marshal.Copy (volumes, 0, native_volumes, track.NumChannels);
|
||||||
gst_mixer_volume_changed(Handle, track.Handle, native_volumes);
|
gst_mixer_volume_changed(Handle, track.Handle, native_volumes);
|
||||||
GLib.Marshaller.Free (native_volumes);
|
Gst.GLib.Marshaller.Free (native_volumes);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern IntPtr gst_mixer_list_tracks(IntPtr raw);
|
static extern IntPtr gst_mixer_list_tracks(IntPtr raw);
|
||||||
|
|
||||||
public Gst.Interfaces.MixerTrack[] ListTracks() {
|
public Gst.Interfaces.MixerTrack[] ListTracks() {
|
||||||
IntPtr raw_ret = gst_mixer_list_tracks(Handle);
|
IntPtr raw_ret = gst_mixer_list_tracks(Handle);
|
||||||
Gst.Interfaces.MixerTrack[] ret = (Gst.Interfaces.MixerTrack[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof(GLib.List), false, false, typeof(Gst.Interfaces.MixerTrack));
|
Gst.Interfaces.MixerTrack[] ret = (Gst.Interfaces.MixerTrack[]) Gst.GLib.Marshaller.ListPtrToArray (raw_ret, typeof(Gst.GLib.List), false, false, typeof(Gst.Interfaces.MixerTrack));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_mixer_set_option(IntPtr raw, IntPtr opts, IntPtr value);
|
static extern void gst_mixer_set_option(IntPtr raw, IntPtr opts, IntPtr value);
|
||||||
|
|
||||||
public void SetOption(Gst.Interfaces.MixerOptions opts, string value) {
|
public void SetOption(Gst.Interfaces.MixerOptions opts, string value) {
|
||||||
gst_mixer_set_option(Handle, opts == null ? IntPtr.Zero : opts.Handle, GLib.Marshaller.StringToPtrGStrdup(value));
|
gst_mixer_set_option(Handle, opts == null ? IntPtr.Zero : opts.Handle, Gst.GLib.Marshaller.StringToPtrGStrdup(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_mixer_set_volume(IntPtr raw, IntPtr track, IntPtr volumes);
|
static extern void gst_mixer_set_volume(IntPtr raw, IntPtr track, IntPtr volumes);
|
||||||
|
|
||||||
public void SetVolume(Gst.Interfaces.MixerTrack track, int[] volumes) {
|
public void SetVolume(Gst.Interfaces.MixerTrack track, int[] volumes) {
|
||||||
|
@ -307,75 +310,84 @@ namespace Gst.Interfaces {
|
||||||
|
|
||||||
if (volumes.Length != track.NumChannels)
|
if (volumes.Length != track.NumChannels)
|
||||||
throw new ArgumentOutOfRangeException ();
|
throw new ArgumentOutOfRangeException ();
|
||||||
|
IntPtr volumes_native = Gst.GLib.Marshaller.Malloc ((ulong) (4 * track.NumChannels));
|
||||||
IntPtr volumes_native = GLib.Marshaller.Malloc ((ulong) (4 * track.NumChannels));
|
|
||||||
Marshal.Copy (volumes, 0, volumes_native, track.NumChannels);
|
Marshal.Copy (volumes, 0, volumes_native, track.NumChannels);
|
||||||
|
|
||||||
gst_mixer_set_volume(Handle, track.Handle, volumes_native);
|
gst_mixer_set_volume(Handle, track.Handle, volumes_native);
|
||||||
GLib.Marshaller.Free (volumes_native);
|
Gst.GLib.Marshaller.Free (volumes_native);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_mixer_mute_toggled(IntPtr raw, IntPtr track, bool mute);
|
static extern int gst_mixer_get_mixer_type(IntPtr raw);
|
||||||
|
|
||||||
public void MuteToggled(Gst.Interfaces.MixerTrack track, bool mute) {
|
public Gst.Interfaces.MixerType MixerType {
|
||||||
gst_mixer_mute_toggled(Handle, track == null ? IntPtr.Zero : track.Handle, mute);
|
get {
|
||||||
|
int raw_ret = gst_mixer_get_mixer_type(Handle);
|
||||||
|
Gst.Interfaces.MixerType ret = (Gst.Interfaces.MixerType) raw_ret;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_mixer_option_changed(IntPtr raw, IntPtr opts, IntPtr value);
|
static extern void gst_mixer_option_changed(IntPtr raw, IntPtr opts, IntPtr value);
|
||||||
|
|
||||||
public void OptionChanged(Gst.Interfaces.MixerOptions opts, string value) {
|
public void OptionChanged(Gst.Interfaces.MixerOptions opts, string value) {
|
||||||
gst_mixer_option_changed(Handle, opts == null ? IntPtr.Zero : opts.Handle, GLib.Marshaller.StringToPtrGStrdup(value));
|
gst_mixer_option_changed(Handle, opts == null ? IntPtr.Zero : opts.Handle, Gst.GLib.Marshaller.StringToPtrGStrdup(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_mixer_options_list_changed(IntPtr raw, IntPtr opts);
|
|
||||||
|
|
||||||
public void OptionsListChanged(Gst.Interfaces.MixerOptions opts) {
|
|
||||||
gst_mixer_options_list_changed(Handle, opts == null ? IntPtr.Zero : opts.Handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
|
||||||
static extern IntPtr gst_mixer_get_option(IntPtr raw, IntPtr opts);
|
static extern IntPtr gst_mixer_get_option(IntPtr raw, IntPtr opts);
|
||||||
|
|
||||||
public string GetOption(Gst.Interfaces.MixerOptions opts) {
|
public string GetOption(Gst.Interfaces.MixerOptions opts) {
|
||||||
IntPtr raw_ret = gst_mixer_get_option(Handle, opts == null ? IntPtr.Zero : opts.Handle);
|
IntPtr raw_ret = gst_mixer_get_option(Handle, opts == null ? IntPtr.Zero : opts.Handle);
|
||||||
string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
|
string ret = Gst.GLib.Marshaller.Utf8PtrToString (raw_ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_mixer_set_record(IntPtr raw, IntPtr track, bool record);
|
static extern void gst_mixer_set_record(IntPtr raw, IntPtr track, bool record);
|
||||||
|
|
||||||
public void SetRecord(Gst.Interfaces.MixerTrack track, bool record) {
|
public void SetRecord(Gst.Interfaces.MixerTrack track, bool record) {
|
||||||
gst_mixer_set_record(Handle, track == null ? IntPtr.Zero : track.Handle, record);
|
gst_mixer_set_record(Handle, track == null ? IntPtr.Zero : track.Handle, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
static extern void gst_mixer_options_list_changed(IntPtr raw, IntPtr opts);
|
||||||
|
|
||||||
|
public void ListChanged(Gst.Interfaces.MixerOptions opts) {
|
||||||
|
gst_mixer_options_list_changed(Handle, opts == null ? IntPtr.Zero : opts.Handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_mixer_record_toggled(IntPtr raw, IntPtr track, bool record);
|
static extern void gst_mixer_record_toggled(IntPtr raw, IntPtr track, bool record);
|
||||||
|
|
||||||
public void RecordToggled(Gst.Interfaces.MixerTrack track, bool record) {
|
public void RecordToggled(Gst.Interfaces.MixerTrack track, bool record) {
|
||||||
gst_mixer_record_toggled(Handle, track == null ? IntPtr.Zero : track.Handle, record);
|
gst_mixer_record_toggled(Handle, track == null ? IntPtr.Zero : track.Handle, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
static extern void gst_mixer_mute_toggled(IntPtr raw, IntPtr track, bool mute);
|
||||||
|
|
||||||
|
public void MuteToggled(Gst.Interfaces.MixerTrack track, bool mute) {
|
||||||
|
gst_mixer_mute_toggled(Handle, track == null ? IntPtr.Zero : track.Handle, mute);
|
||||||
|
}
|
||||||
|
|
||||||
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_mixer_get_volume(IntPtr raw, IntPtr track, ref IntPtr volumes);
|
static extern void gst_mixer_get_volume(IntPtr raw, IntPtr track, ref IntPtr volumes);
|
||||||
|
|
||||||
public int[] GetVolume(Gst.Interfaces.MixerTrack track) {
|
public int[] GetVolume(Gst.Interfaces.MixerTrack track) {
|
||||||
if (track == null)
|
if (track == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
IntPtr native_volumes = GLib.Marshaller.Malloc ((ulong) (4 * track.NumChannels));
|
IntPtr native_volumes = Gst.GLib.Marshaller.Malloc ((ulong) (4 * track.NumChannels));
|
||||||
gst_mixer_get_volume(Handle, track.Handle, ref native_volumes);
|
gst_mixer_get_volume(Handle, track.Handle, ref native_volumes);
|
||||||
|
|
||||||
int[] volumes = new int[track.NumChannels];
|
int[] volumes = new int[track.NumChannels];
|
||||||
Marshal.Copy (native_volumes, volumes, 0, track.NumChannels);
|
Marshal.Copy (native_volumes, volumes, 0, track.NumChannels);
|
||||||
GLib.Marshaller.Free (native_volumes);
|
Gst.GLib.Marshaller.Free (native_volumes);
|
||||||
return volumes;
|
return volumes;
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern int gst_mixer_get_mixer_flags(IntPtr raw);
|
static extern int gst_mixer_get_mixer_flags(IntPtr raw);
|
||||||
|
|
||||||
public Gst.Interfaces.MixerFlags MixerFlags {
|
public Gst.Interfaces.MixerFlags MixerFlags {
|
||||||
|
@ -386,32 +398,20 @@ namespace Gst.Interfaces {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_mixer_mixer_changed(IntPtr raw);
|
static extern void gst_mixer_mixer_changed(IntPtr raw);
|
||||||
|
|
||||||
public void MixerChanged() {
|
public void MixerChanged() {
|
||||||
gst_mixer_mixer_changed(Handle);
|
gst_mixer_mixer_changed(Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_mixer_set_mute(IntPtr raw, IntPtr track, bool mute);
|
static extern void gst_mixer_set_mute(IntPtr raw, IntPtr track, bool mute);
|
||||||
|
|
||||||
public void SetMute(Gst.Interfaces.MixerTrack track, bool mute) {
|
public void SetMute(Gst.Interfaces.MixerTrack track, bool mute) {
|
||||||
gst_mixer_set_mute(Handle, track == null ? IntPtr.Zero : track.Handle, mute);
|
gst_mixer_set_mute(Handle, track == null ? IntPtr.Zero : track.Handle, mute);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgobject-2.0-0.dll")]
|
|
||||||
static extern IntPtr g_type_interface_peek (IntPtr klass, IntPtr iface_gtype);
|
|
||||||
public Gst.Interfaces.MixerType MixerType {
|
|
||||||
get {
|
|
||||||
IntPtr gclass = Marshal.ReadIntPtr (Handle);
|
|
||||||
IntPtr ifaceptr = g_type_interface_peek (gclass, _gtype.Val);
|
|
||||||
GstMixerClass native_iface = (GstMixerClass) Marshal.PtrToStructure (ifaceptr, typeof (GstMixerClass));
|
|
||||||
|
|
||||||
return native_iface.MixerType;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// This file was generated by the Gtk# code generator.
|
// This file was generated by the Gtk# code generator.
|
||||||
// Changed to copy the structure in SendEvent ().
|
// Any changes made will be lost if regenerated.
|
||||||
|
|
||||||
namespace Gst.Interfaces {
|
namespace Gst.Interfaces {
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ namespace Gst.Interfaces {
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
#region Autogenerated code
|
#region Autogenerated code
|
||||||
public class NavigationAdapter : GLib.GInterfaceAdapter, Gst.Interfaces.Navigation {
|
public partial class NavigationAdapter : Gst.GLib.GInterfaceAdapter, Gst.Interfaces.Navigation {
|
||||||
|
|
||||||
[StructLayout (LayoutKind.Sequential)]
|
[StructLayout (LayoutKind.Sequential)]
|
||||||
struct GstNavigationInterface {
|
struct GstNavigationInterface {
|
||||||
|
@ -20,20 +20,20 @@ namespace Gst.Interfaces {
|
||||||
|
|
||||||
static NavigationAdapter ()
|
static NavigationAdapter ()
|
||||||
{
|
{
|
||||||
GLib.GType.Register (_gtype, typeof(NavigationAdapter));
|
Gst.GLib.GType.Register (_gtype, typeof(NavigationAdapter));
|
||||||
iface.SendEvent = new SendEventNativeDelegate (SendEvent_cb);
|
iface.SendEvent = new SendEventNativeDelegate (SendEvent_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate void SendEventNativeDelegate (IntPtr inst, IntPtr structure);
|
delegate void SendEventNativeDelegate (IntPtr inst, IntPtr structure);
|
||||||
|
|
||||||
static void SendEvent_cb (IntPtr inst, IntPtr structure)
|
static void SendEvent_cb (IntPtr inst, IntPtr structure)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
NavigationImplementor __obj = GLib.Object.GetObject (inst, false) as NavigationImplementor;
|
NavigationImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as NavigationImplementor;
|
||||||
__obj.SendEvent (structure == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (structure, typeof (Gst.Structure), true));
|
__obj.SendEvent (structure == IntPtr.Zero ? null : (Gst.Structure) Gst.GLib.Opaque.GetOpaque (structure, typeof (Gst.Structure), true));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,54 +49,59 @@ namespace Gst.Interfaces {
|
||||||
gch.Free ();
|
gch.Free ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gst.GLib.Object implementor;
|
||||||
|
|
||||||
public NavigationAdapter ()
|
public NavigationAdapter ()
|
||||||
{
|
{
|
||||||
InitHandler = new GLib.GInterfaceInitHandler (Initialize);
|
InitHandler = new Gst.GLib.GInterfaceInitHandler (Initialize);
|
||||||
}
|
}
|
||||||
|
|
||||||
NavigationImplementor implementor;
|
|
||||||
|
|
||||||
public NavigationAdapter (NavigationImplementor implementor)
|
public NavigationAdapter (NavigationImplementor implementor)
|
||||||
{
|
{
|
||||||
if (implementor == null)
|
if (implementor == null)
|
||||||
throw new ArgumentNullException ("implementor");
|
throw new ArgumentNullException ("implementor");
|
||||||
this.implementor = implementor;
|
else if (!(implementor is Gst.GLib.Object))
|
||||||
|
throw new ArgumentException ("implementor must be a subclass of Gst.GLib.Object");
|
||||||
|
this.implementor = implementor as Gst.GLib.Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NavigationAdapter (IntPtr handle)
|
public NavigationAdapter (IntPtr handle)
|
||||||
{
|
{
|
||||||
if (!_gtype.IsInstance (handle))
|
if (!_gtype.IsInstance (handle))
|
||||||
throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle");
|
throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle");
|
||||||
this.handle = handle;
|
implementor = Gst.GLib.Object.GetObject (handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern IntPtr gst_navigation_get_type();
|
static extern IntPtr gst_navigation_get_type();
|
||||||
|
|
||||||
private static GLib.GType _gtype = new GLib.GType (gst_navigation_get_type ());
|
private static Gst.GLib.GType _gtype = new Gst.GLib.GType (gst_navigation_get_type ());
|
||||||
|
|
||||||
public override GLib.GType GType {
|
public override Gst.GLib.GType GType {
|
||||||
get {
|
get {
|
||||||
return _gtype;
|
return _gtype;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IntPtr handle;
|
|
||||||
public override IntPtr Handle {
|
public override IntPtr Handle {
|
||||||
get {
|
get {
|
||||||
if (handle != IntPtr.Zero)
|
return implementor.Handle;
|
||||||
return handle;
|
}
|
||||||
return implementor == null ? IntPtr.Zero : implementor.Handle;
|
}
|
||||||
|
|
||||||
|
public IntPtr OwnedHandle {
|
||||||
|
get {
|
||||||
|
return implementor.OwnedHandle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Navigation GetObject (IntPtr handle, bool owned)
|
public static Navigation GetObject (IntPtr handle, bool owned)
|
||||||
{
|
{
|
||||||
GLib.Object obj = GLib.Object.GetObject (handle, owned);
|
Gst.GLib.Object obj = Gst.GLib.Object.GetObject (handle, owned);
|
||||||
return GetObject (obj);
|
return GetObject (obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Navigation GetObject (GLib.Object obj)
|
public static Navigation GetObject (Gst.GLib.Object obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -110,41 +115,41 @@ namespace Gst.Interfaces {
|
||||||
|
|
||||||
public NavigationImplementor Implementor {
|
public NavigationImplementor Implementor {
|
||||||
get {
|
get {
|
||||||
return implementor;
|
return implementor as NavigationImplementor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_navigation_send_event(IntPtr raw, IntPtr structure);
|
static extern void gst_navigation_send_event(IntPtr raw, IntPtr structure);
|
||||||
|
|
||||||
[DllImport("libgstreamer-0.10.dll")]
|
[DllImport("libgstreamer-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern IntPtr gst_structure_copy (IntPtr raw);
|
static extern IntPtr gst_structure_copy (IntPtr raw);
|
||||||
|
|
||||||
public void SendEvent(Gst.Structure structure) {
|
public void SendEvent(Gst.Structure structure) {
|
||||||
gst_navigation_send_event(Handle, structure == null ? IntPtr.Zero : gst_structure_copy (structure.Handle));
|
gst_navigation_send_event(Handle, structure == null ? IntPtr.Zero : gst_structure_copy (structure.Handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_navigation_send_mouse_event(IntPtr raw, IntPtr evnt, int button, double x, double y);
|
static extern void gst_navigation_send_mouse_event(IntPtr raw, IntPtr evnt, int button, double x, double y);
|
||||||
|
|
||||||
public void SendMouseEvent(string evnt, int button, double x, double y) {
|
public void SendMouseEvent(string evnt, int button, double x, double y) {
|
||||||
IntPtr native_evnt = GLib.Marshaller.StringToPtrGStrdup (evnt);
|
IntPtr native_evnt = Gst.GLib.Marshaller.StringToPtrGStrdup (evnt);
|
||||||
gst_navigation_send_mouse_event(Handle, native_evnt, button, x, y);
|
gst_navigation_send_mouse_event(Handle, native_evnt, button, x, y);
|
||||||
GLib.Marshaller.Free (native_evnt);
|
Gst.GLib.Marshaller.Free (native_evnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_navigation_send_key_event(IntPtr raw, IntPtr evnt, IntPtr key);
|
static extern void gst_navigation_send_key_event(IntPtr raw, IntPtr evnt, IntPtr key);
|
||||||
|
|
||||||
public void SendKeyEvent(string evnt, string key) {
|
public void SendKeyEvent(string evnt, string key) {
|
||||||
IntPtr native_evnt = GLib.Marshaller.StringToPtrGStrdup (evnt);
|
IntPtr native_evnt = Gst.GLib.Marshaller.StringToPtrGStrdup (evnt);
|
||||||
IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
|
IntPtr native_key = Gst.GLib.Marshaller.StringToPtrGStrdup (key);
|
||||||
gst_navigation_send_key_event(Handle, native_evnt, native_key);
|
gst_navigation_send_key_event(Handle, native_evnt, native_key);
|
||||||
GLib.Marshaller.Free (native_evnt);
|
Gst.GLib.Marshaller.Free (native_evnt);
|
||||||
GLib.Marshaller.Free (native_key);
|
Gst.GLib.Marshaller.Free (native_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void gst_navigation_send_command(IntPtr raw, int command);
|
static extern void gst_navigation_send_command(IntPtr raw, int command);
|
||||||
|
|
||||||
public void SendCommand(Gst.Interfaces.NavigationCommand command) {
|
public void SendCommand(Gst.Interfaces.NavigationCommand command) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace Gst.Interfaces {
|
||||||
|
|
||||||
public delegate void ProbeNeededHandler(object o, ProbeNeededArgs args);
|
public delegate void ProbeNeededHandler(object o, ProbeNeededArgs args);
|
||||||
|
|
||||||
public class ProbeNeededArgs : GLib.SignalArgs {
|
public class ProbeNeededArgs : Gst.GLib.SignalArgs {
|
||||||
public string Property {
|
public string Property {
|
||||||
get {
|
get {
|
||||||
IntPtr pspec = (IntPtr) Args[0];
|
IntPtr pspec = (IntPtr) Args[0];
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace Gst.Interfaces {
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
public interface PropertyProbe : GLib.IWrapper {
|
public partial interface PropertyProbe : Gst.GLib.IWrapper {
|
||||||
event Gst.Interfaces.ProbeNeededHandler ProbeNeeded;
|
event Gst.Interfaces.ProbeNeededHandler ProbeNeeded;
|
||||||
|
|
||||||
string[] Properties { get; }
|
string[] Properties { get; }
|
||||||
|
@ -16,8 +16,8 @@ namespace Gst.Interfaces {
|
||||||
object[] ProbeAndGetValues (string property);
|
object[] ProbeAndGetValues (string property);
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.GInterface (typeof (PropertyProbeAdapter))]
|
[Gst.GLib.GInterface (typeof (PropertyProbeAdapter))]
|
||||||
public interface PropertyProbeImplementor : GLib.IWrapper {
|
public partial interface PropertyProbeImplementor : Gst.GLib.IWrapper {
|
||||||
string[] Properties { get; }
|
string[] Properties { get; }
|
||||||
bool NeedsProbe (string property);
|
bool NeedsProbe (string property);
|
||||||
void ProbeProperty (string property);
|
void ProbeProperty (string property);
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace Gst.Interfaces {
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
public class PropertyProbeAdapter : GLib.GInterfaceAdapter, Gst.Interfaces.PropertyProbe {
|
public partial class PropertyProbeAdapter : Gst.GLib.GInterfaceAdapter, Gst.Interfaces.PropertyProbe {
|
||||||
|
|
||||||
[StructLayout (LayoutKind.Sequential)]
|
[StructLayout (LayoutKind.Sequential)]
|
||||||
struct GstPropertyProbeInterface {
|
struct GstPropertyProbeInterface {
|
||||||
|
@ -24,14 +24,14 @@ namespace Gst.Interfaces {
|
||||||
|
|
||||||
static PropertyProbeAdapter ()
|
static PropertyProbeAdapter ()
|
||||||
{
|
{
|
||||||
GLib.GType.Register (_gtype, typeof(PropertyProbeAdapter));
|
Gst.GLib.GType.Register (_gtype, typeof(PropertyProbeAdapter));
|
||||||
iface.GetProperties = new GetPropertiesNativeDelegate (GetProperties_cb);
|
iface.GetProperties = new GetPropertiesNativeDelegate (GetProperties_cb);
|
||||||
iface.NeedsProbe = new NeedsProbeNativeDelegate (NeedsProbe_cb);
|
iface.NeedsProbe = new NeedsProbeNativeDelegate (NeedsProbe_cb);
|
||||||
iface.ProbeProperty = new ProbePropertyNativeDelegate (ProbeProperty_cb);
|
iface.ProbeProperty = new ProbePropertyNativeDelegate (ProbeProperty_cb);
|
||||||
iface.GetValues = new GetValuesNativeDelegate (GetValues_cb);
|
iface.GetValues = new GetValuesNativeDelegate (GetValues_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate IntPtr GetPropertiesNativeDelegate (IntPtr inst);
|
delegate IntPtr GetPropertiesNativeDelegate (IntPtr inst);
|
||||||
|
|
||||||
[DllImport("libglib-2.0-0.dll")]
|
[DllImport("libglib-2.0-0.dll")]
|
||||||
|
@ -40,15 +40,15 @@ namespace Gst.Interfaces {
|
||||||
static IntPtr GetProperties_cb (IntPtr inst)
|
static IntPtr GetProperties_cb (IntPtr inst)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
PropertyProbeImplementor __obj = GLib.Object.GetObject (inst, false) as PropertyProbeImplementor;
|
PropertyProbeImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as PropertyProbeImplementor;
|
||||||
|
|
||||||
string[] properties = __obj.Properties;
|
string[] properties = __obj.Properties;
|
||||||
GLib.List properties_list = new GLib.List (typeof (IntPtr));
|
Gst.GLib.List properties_list = new Gst.GLib.List (typeof (IntPtr));
|
||||||
IntPtr gclass = Marshal.ReadIntPtr (inst);
|
IntPtr gclass = Marshal.ReadIntPtr (inst);
|
||||||
foreach (string prop in properties) {
|
foreach (string prop in properties) {
|
||||||
IntPtr name = GLib.Marshaller.StringToPtrGStrdup (prop);
|
IntPtr name = Gst.GLib.Marshaller.StringToPtrGStrdup (prop);
|
||||||
IntPtr pspec = g_object_class_find_property (gclass, name);
|
IntPtr pspec = g_object_class_find_property (gclass, name);
|
||||||
GLib.Marshaller.Free (name);
|
Gst.GLib.Marshaller.Free (name);
|
||||||
if (pspec != IntPtr.Zero)
|
if (pspec != IntPtr.Zero)
|
||||||
properties_list.Prepend (pspec);
|
properties_list.Prepend (pspec);
|
||||||
}
|
}
|
||||||
|
@ -56,59 +56,59 @@ namespace Gst.Interfaces {
|
||||||
/* FIXME: We leak the list! */
|
/* FIXME: We leak the list! */
|
||||||
return properties_list.Handle;
|
return properties_list.Handle;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate bool NeedsProbeNativeDelegate (IntPtr inst, uint prop_id, IntPtr pspec);
|
delegate bool NeedsProbeNativeDelegate (IntPtr inst, uint prop_id, IntPtr pspec);
|
||||||
|
|
||||||
static bool NeedsProbe_cb (IntPtr inst, uint prop_id, IntPtr pspec)
|
static bool NeedsProbe_cb (IntPtr inst, uint prop_id, IntPtr pspec)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
PropertyProbeImplementor __obj = GLib.Object.GetObject (inst, false) as PropertyProbeImplementor;
|
PropertyProbeImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as PropertyProbeImplementor;
|
||||||
Gst.PropertyInfo pi = new Gst.PropertyInfo (pspec);
|
Gst.PropertyInfo pi = new Gst.PropertyInfo (pspec);
|
||||||
bool __result = __obj.NeedsProbe (pi.Name);
|
bool __result = __obj.NeedsProbe (pi.Name);
|
||||||
return __result;
|
return __result;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate void ProbePropertyNativeDelegate (IntPtr inst, uint prop_id, IntPtr pspec);
|
delegate void ProbePropertyNativeDelegate (IntPtr inst, uint prop_id, IntPtr pspec);
|
||||||
|
|
||||||
static void ProbeProperty_cb (IntPtr inst, uint prop_id, IntPtr pspec)
|
static void ProbeProperty_cb (IntPtr inst, uint prop_id, IntPtr pspec)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
PropertyProbeImplementor __obj = GLib.Object.GetObject (inst, false) as PropertyProbeImplementor;
|
PropertyProbeImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as PropertyProbeImplementor;
|
||||||
Gst.PropertyInfo pi = new Gst.PropertyInfo (pspec);
|
Gst.PropertyInfo pi = new Gst.PropertyInfo (pspec);
|
||||||
__obj.ProbeProperty (pi.Name);
|
__obj.ProbeProperty (pi.Name);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate IntPtr GetValuesNativeDelegate (IntPtr inst, uint prop_id, IntPtr pspec);
|
delegate IntPtr GetValuesNativeDelegate (IntPtr inst, uint prop_id, IntPtr pspec);
|
||||||
|
|
||||||
static IntPtr GetValues_cb (IntPtr inst, uint prop_id, IntPtr pspec)
|
static IntPtr GetValues_cb (IntPtr inst, uint prop_id, IntPtr pspec)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
PropertyProbeImplementor __obj = GLib.Object.GetObject (inst, false) as PropertyProbeImplementor;
|
PropertyProbeImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as PropertyProbeImplementor;
|
||||||
Gst.PropertyInfo pi = new Gst.PropertyInfo (pspec);
|
Gst.PropertyInfo pi = new Gst.PropertyInfo (pspec);
|
||||||
object[] values = __obj.GetValues (pi.Name);
|
object[] values = __obj.GetValues (pi.Name);
|
||||||
GLib.ValueArray va = new GLib.ValueArray ((uint) values.Length);
|
Gst.GLib.ValueArray va = new Gst.GLib.ValueArray ((uint) values.Length);
|
||||||
|
|
||||||
foreach (object v in values)
|
foreach (object v in values)
|
||||||
va.Append (new GLib.Value (v));
|
va.Append (new Gst.GLib.Value (v));
|
||||||
return va.Handle;
|
return va.Handle;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
@ -129,54 +129,59 @@ namespace Gst.Interfaces {
|
||||||
gch.Free ();
|
gch.Free ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gst.GLib.Object implementor;
|
||||||
|
|
||||||
public PropertyProbeAdapter ()
|
public PropertyProbeAdapter ()
|
||||||
{
|
{
|
||||||
InitHandler = new GLib.GInterfaceInitHandler (Initialize);
|
InitHandler = new Gst.GLib.GInterfaceInitHandler (Initialize);
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyProbeImplementor implementor;
|
|
||||||
|
|
||||||
public PropertyProbeAdapter (PropertyProbeImplementor implementor)
|
public PropertyProbeAdapter (PropertyProbeImplementor implementor)
|
||||||
{
|
{
|
||||||
if (implementor == null)
|
if (implementor == null)
|
||||||
throw new ArgumentNullException ("implementor");
|
throw new ArgumentNullException ("implementor");
|
||||||
this.implementor = implementor;
|
else if (!(implementor is Gst.GLib.Object))
|
||||||
|
throw new ArgumentException ("implementor must be a subclass of Gst.GLib.Object");
|
||||||
|
this.implementor = implementor as Gst.GLib.Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PropertyProbeAdapter (IntPtr handle)
|
public PropertyProbeAdapter (IntPtr handle)
|
||||||
{
|
{
|
||||||
if (!_gtype.IsInstance (handle))
|
if (!_gtype.IsInstance (handle))
|
||||||
throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle");
|
throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle");
|
||||||
this.handle = handle;
|
implementor = Gst.GLib.Object.GetObject (handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll")]
|
||||||
static extern IntPtr gst_property_probe_get_type();
|
static extern IntPtr gst_property_probe_get_type();
|
||||||
|
|
||||||
private static GLib.GType _gtype = new GLib.GType (gst_property_probe_get_type ());
|
private static Gst.GLib.GType _gtype = new Gst.GLib.GType (gst_property_probe_get_type ());
|
||||||
|
|
||||||
public override GLib.GType GType {
|
public override Gst.GLib.GType GType {
|
||||||
get {
|
get {
|
||||||
return _gtype;
|
return _gtype;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IntPtr handle;
|
|
||||||
public override IntPtr Handle {
|
public override IntPtr Handle {
|
||||||
get {
|
get {
|
||||||
if (handle != IntPtr.Zero)
|
return implementor.Handle;
|
||||||
return handle;
|
}
|
||||||
return implementor == null ? IntPtr.Zero : implementor.Handle;
|
}
|
||||||
|
|
||||||
|
public IntPtr OwnedHandle {
|
||||||
|
get {
|
||||||
|
return implementor.OwnedHandle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PropertyProbe GetObject (IntPtr handle, bool owned)
|
public static PropertyProbe GetObject (IntPtr handle, bool owned)
|
||||||
{
|
{
|
||||||
GLib.Object obj = GLib.Object.GetObject (handle, owned);
|
Gst.GLib.Object obj = Gst.GLib.Object.GetObject (handle, owned);
|
||||||
return GetObject (obj);
|
return GetObject (obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PropertyProbe GetObject (GLib.Object obj)
|
public static PropertyProbe GetObject (Gst.GLib.Object obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -190,19 +195,19 @@ namespace Gst.Interfaces {
|
||||||
|
|
||||||
public PropertyProbeImplementor Implementor {
|
public PropertyProbeImplementor Implementor {
|
||||||
get {
|
get {
|
||||||
return implementor;
|
return implementor as PropertyProbeImplementor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[GLib.Signal("probe-needed")]
|
[Gst.GLib.Signal("probe-needed")]
|
||||||
public event Gst.Interfaces.ProbeNeededHandler ProbeNeeded {
|
public event Gst.Interfaces.ProbeNeededHandler ProbeNeeded {
|
||||||
add {
|
add {
|
||||||
GLib.Signal sig = GLib.Signal.Lookup (GLib.Object.GetObject (Handle), "probe-needed", typeof (Gst.Interfaces.ProbeNeededArgs));
|
Gst.GLib.Signal sig = Gst.GLib.Signal.Lookup (Gst.GLib.Object.GetObject (Handle), "probe-needed", typeof (Gst.Interfaces.ProbeNeededArgs));
|
||||||
sig.AddDelegate (value);
|
sig.AddDelegate (value);
|
||||||
}
|
}
|
||||||
remove {
|
remove {
|
||||||
GLib.Signal sig = GLib.Signal.Lookup (GLib.Object.GetObject (Handle), "probe-needed", typeof (Gst.Interfaces.ProbeNeededArgs));
|
Gst.GLib.Signal sig = Gst.GLib.Signal.Lookup (Gst.GLib.Object.GetObject (Handle), "probe-needed", typeof (Gst.Interfaces.ProbeNeededArgs));
|
||||||
sig.RemoveDelegate (value);
|
sig.RemoveDelegate (value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,10 +216,10 @@ namespace Gst.Interfaces {
|
||||||
static extern bool gst_property_probe_needs_probe_name(IntPtr raw, IntPtr name);
|
static extern bool gst_property_probe_needs_probe_name(IntPtr raw, IntPtr name);
|
||||||
|
|
||||||
public bool NeedsProbe(string name) {
|
public bool NeedsProbe(string name) {
|
||||||
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
IntPtr native_name = Gst.GLib.Marshaller.StringToPtrGStrdup (name);
|
||||||
bool raw_ret = gst_property_probe_needs_probe_name(Handle, native_name);
|
bool raw_ret = gst_property_probe_needs_probe_name(Handle, native_name);
|
||||||
bool ret = raw_ret;
|
bool ret = raw_ret;
|
||||||
GLib.Marshaller.Free (native_name);
|
Gst.GLib.Marshaller.Free (native_name);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,9 +227,9 @@ namespace Gst.Interfaces {
|
||||||
static extern void gst_property_probe_probe_property_name(IntPtr raw, IntPtr name);
|
static extern void gst_property_probe_probe_property_name(IntPtr raw, IntPtr name);
|
||||||
|
|
||||||
public void Probe(string name) {
|
public void Probe(string name) {
|
||||||
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
IntPtr native_name = Gst.GLib.Marshaller.StringToPtrGStrdup (name);
|
||||||
gst_property_probe_probe_property_name(Handle, native_name);
|
gst_property_probe_probe_property_name(Handle, native_name);
|
||||||
GLib.Marshaller.Free (native_name);
|
Gst.GLib.Marshaller.Free (native_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstinterfaces-0.10.dll")]
|
[DllImport("libgstinterfaces-0.10.dll")]
|
||||||
|
@ -236,7 +241,7 @@ namespace Gst.Interfaces {
|
||||||
if (raw_ret == IntPtr.Zero)
|
if (raw_ret == IntPtr.Zero)
|
||||||
return new string[] {};
|
return new string[] {};
|
||||||
|
|
||||||
GLib.List raw_ret_list = new GLib.List(raw_ret, typeof (IntPtr));
|
Gst.GLib.List raw_ret_list = new Gst.GLib.List(raw_ret, typeof (IntPtr));
|
||||||
ArrayList ret = new ArrayList ();
|
ArrayList ret = new ArrayList ();
|
||||||
|
|
||||||
foreach (IntPtr pspec in raw_ret_list) {
|
foreach (IntPtr pspec in raw_ret_list) {
|
||||||
|
@ -252,15 +257,15 @@ namespace Gst.Interfaces {
|
||||||
static extern IntPtr gst_property_probe_get_values_name (IntPtr raw, IntPtr name);
|
static extern IntPtr gst_property_probe_get_values_name (IntPtr raw, IntPtr name);
|
||||||
|
|
||||||
public object[] GetValues (string name) {
|
public object[] GetValues (string name) {
|
||||||
IntPtr raw_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
IntPtr raw_name = Gst.GLib.Marshaller.StringToPtrGStrdup (name);
|
||||||
IntPtr raw_ret = gst_property_probe_get_values_name (Handle, raw_name);
|
IntPtr raw_ret = gst_property_probe_get_values_name (Handle, raw_name);
|
||||||
GLib.Marshaller.Free (raw_name);
|
Gst.GLib.Marshaller.Free (raw_name);
|
||||||
if (raw_ret == IntPtr.Zero)
|
if (raw_ret == IntPtr.Zero)
|
||||||
return new object[] {};
|
return new object[] {};
|
||||||
|
|
||||||
GLib.ValueArray va = new GLib.ValueArray (raw_ret);
|
Gst.GLib.ValueArray va = new Gst.GLib.ValueArray (raw_ret);
|
||||||
ArrayList ret = new ArrayList ();
|
ArrayList ret = new ArrayList ();
|
||||||
foreach (GLib.Value v in va)
|
foreach (Gst.GLib.Value v in va)
|
||||||
ret.Add ((object) v.Val);
|
ret.Add ((object) v.Val);
|
||||||
|
|
||||||
va.Dispose ();
|
va.Dispose ();
|
||||||
|
@ -272,15 +277,15 @@ namespace Gst.Interfaces {
|
||||||
static extern IntPtr gst_property_probe_probe_and_get_values_name (IntPtr raw, IntPtr name);
|
static extern IntPtr gst_property_probe_probe_and_get_values_name (IntPtr raw, IntPtr name);
|
||||||
|
|
||||||
public object[] ProbeAndGetValues (string name) {
|
public object[] ProbeAndGetValues (string name) {
|
||||||
IntPtr raw_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
IntPtr raw_name = Gst.GLib.Marshaller.StringToPtrGStrdup (name);
|
||||||
IntPtr raw_ret = gst_property_probe_probe_and_get_values_name (Handle, raw_name);
|
IntPtr raw_ret = gst_property_probe_probe_and_get_values_name (Handle, raw_name);
|
||||||
GLib.Marshaller.Free (raw_name);
|
Gst.GLib.Marshaller.Free (raw_name);
|
||||||
if (raw_ret == IntPtr.Zero)
|
if (raw_ret == IntPtr.Zero)
|
||||||
return new object[] {};
|
return new object[] {};
|
||||||
|
|
||||||
GLib.ValueArray va = new GLib.ValueArray (raw_ret);
|
Gst.GLib.ValueArray va = new Gst.GLib.ValueArray (raw_ret);
|
||||||
ArrayList ret = new ArrayList ();
|
ArrayList ret = new ArrayList ();
|
||||||
foreach (GLib.Value v in va)
|
foreach (Gst.GLib.Value v in va)
|
||||||
ret.Add ((object) v.Val);
|
ret.Add ((object) v.Val);
|
||||||
|
|
||||||
va.Dispose ();
|
va.Dispose ();
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
// This file was generated by the Gtk# code generator.
|
// This file was generated by the Gtk# code generator.
|
||||||
// Modified to correctly handle the Get{Type,Protocols}Full vmethods
|
// Any changes made will be lost if regenerated.
|
||||||
|
|
||||||
namespace Gst {
|
namespace Gst {
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Reflection;
|
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
#region Autogenerated code
|
#region Autogenerated code
|
||||||
public class URIHandlerAdapter : GLib.GInterfaceAdapter, Gst.URIHandler {
|
public partial class URIHandlerAdapter : Gst.GLib.GInterfaceAdapter, Gst.URIHandler {
|
||||||
|
|
||||||
[StructLayout (LayoutKind.Sequential)]
|
[StructLayout (LayoutKind.Sequential)]
|
||||||
struct GstURIHandlerInterface {
|
struct GstURIHandlerInterface {
|
||||||
|
@ -28,20 +28,20 @@ namespace Gst {
|
||||||
|
|
||||||
static URIHandlerAdapter ()
|
static URIHandlerAdapter ()
|
||||||
{
|
{
|
||||||
GLib.GType.Register (_gtype, typeof(URIHandlerAdapter));
|
Gst.GLib.GType.Register (_gtype, typeof(URIHandlerAdapter));
|
||||||
iface.GetTypeFull = new GetTypeFullNativeDelegate (GetTypeFull_cb);
|
iface.GetTypeFull = new GetTypeFullNativeDelegate (GetTypeFull_cb);
|
||||||
iface.GetProtocolsFull = new GetProtocolsFullNativeDelegate (GetProtocolsFull_cb);
|
iface.GetProtocolsFull = new GetProtocolsFullNativeDelegate (GetProtocolsFull_cb);
|
||||||
iface.GetUri = new GetUriNativeDelegate (GetUri_cb);
|
iface.GetUri = new GetUriNativeDelegate (GetUri_cb);
|
||||||
iface.SetUri = new SetUriNativeDelegate (SetUri_cb);
|
iface.SetUri = new SetUriNativeDelegate (SetUri_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate int GetTypeFullNativeDelegate (IntPtr gtype);
|
delegate int GetTypeFullNativeDelegate (IntPtr gtype);
|
||||||
|
|
||||||
static int GetTypeFull_cb (IntPtr gtype)
|
static int GetTypeFull_cb (IntPtr gtype)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
GLib.GType gt = new GLib.GType (gtype);
|
Gst.GLib.GType gt = new Gst.GLib.GType (gtype);
|
||||||
System.Type t = (System.Type) gt;
|
System.Type t = (System.Type) gt;
|
||||||
|
|
||||||
System.Reflection.PropertyInfo pi = t.GetProperty ("Type", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy);
|
System.Reflection.PropertyInfo pi = t.GetProperty ("Type", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy);
|
||||||
|
@ -51,13 +51,13 @@ namespace Gst {
|
||||||
|
|
||||||
return (int) __result;
|
return (int) __result;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate IntPtr GetProtocolsFullNativeDelegate (IntPtr gtype);
|
delegate IntPtr GetProtocolsFullNativeDelegate (IntPtr gtype);
|
||||||
|
|
||||||
static Hashtable protocols_cache = new Hashtable ();
|
static Hashtable protocols_cache = new Hashtable ();
|
||||||
|
@ -65,7 +65,7 @@ namespace Gst {
|
||||||
static IntPtr GetProtocolsFull_cb (IntPtr gtype)
|
static IntPtr GetProtocolsFull_cb (IntPtr gtype)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
GLib.GType gt = new GLib.GType (gtype);
|
Gst.GLib.GType gt = new Gst.GLib.GType (gtype);
|
||||||
System.Type t = (System.Type) gt;
|
System.Type t = (System.Type) gt;
|
||||||
|
|
||||||
if (protocols_cache.Contains (gtype)) {
|
if (protocols_cache.Contains (gtype)) {
|
||||||
|
@ -83,39 +83,39 @@ namespace Gst {
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate IntPtr GetUriNativeDelegate (IntPtr inst);
|
delegate IntPtr GetUriNativeDelegate (IntPtr inst);
|
||||||
|
|
||||||
static IntPtr GetUri_cb (IntPtr inst)
|
static IntPtr GetUri_cb (IntPtr inst)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
URIHandlerImplementor __obj = GLib.Object.GetObject (inst, false) as URIHandlerImplementor;
|
URIHandlerImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as URIHandlerImplementor;
|
||||||
string __result = __obj.Uri;
|
string __result = __obj.Uri;
|
||||||
return GLib.Marshaller.StringToPtrGStrdup (__result);
|
return Gst.GLib.Marshaller.StringToPtrGStrdup (__result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.CDeclCallback]
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||||||
delegate bool SetUriNativeDelegate (IntPtr inst, IntPtr uri);
|
delegate bool SetUriNativeDelegate (IntPtr inst, IntPtr uri);
|
||||||
|
|
||||||
static bool SetUri_cb (IntPtr inst, IntPtr uri)
|
static bool SetUri_cb (IntPtr inst, IntPtr uri)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
URIHandlerImplementor __obj = GLib.Object.GetObject (inst, false) as URIHandlerImplementor;
|
URIHandlerImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as URIHandlerImplementor;
|
||||||
bool __result = __obj.SetUri (GLib.Marshaller.Utf8PtrToString (uri));
|
bool __result = __obj.SetUri (Gst.GLib.Marshaller.Utf8PtrToString (uri));
|
||||||
return __result;
|
return __result;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||||||
// NOTREACHED: above call does not return.
|
// NOTREACHED: above call does not return.
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
@ -136,54 +136,59 @@ namespace Gst {
|
||||||
gch.Free ();
|
gch.Free ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gst.GLib.Object implementor;
|
||||||
|
|
||||||
public URIHandlerAdapter ()
|
public URIHandlerAdapter ()
|
||||||
{
|
{
|
||||||
InitHandler = new GLib.GInterfaceInitHandler (Initialize);
|
InitHandler = new Gst.GLib.GInterfaceInitHandler (Initialize);
|
||||||
}
|
}
|
||||||
|
|
||||||
URIHandlerImplementor implementor;
|
|
||||||
|
|
||||||
public URIHandlerAdapter (URIHandlerImplementor implementor)
|
public URIHandlerAdapter (URIHandlerImplementor implementor)
|
||||||
{
|
{
|
||||||
if (implementor == null)
|
if (implementor == null)
|
||||||
throw new ArgumentNullException ("implementor");
|
throw new ArgumentNullException ("implementor");
|
||||||
this.implementor = implementor;
|
else if (!(implementor is Gst.GLib.Object))
|
||||||
|
throw new ArgumentException ("implementor must be a subclass of Gst.GLib.Object");
|
||||||
|
this.implementor = implementor as Gst.GLib.Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public URIHandlerAdapter (IntPtr handle)
|
public URIHandlerAdapter (IntPtr handle)
|
||||||
{
|
{
|
||||||
if (!_gtype.IsInstance (handle))
|
if (!_gtype.IsInstance (handle))
|
||||||
throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle");
|
throw new ArgumentException ("The gobject doesn't implement the GInterface of this adapter", "handle");
|
||||||
this.handle = handle;
|
implementor = Gst.GLib.Object.GetObject (handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstreamer-0.10.dll")]
|
[DllImport("libgstreamer-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern IntPtr gst_uri_handler_get_type();
|
static extern IntPtr gst_uri_handler_get_type();
|
||||||
|
|
||||||
private static GLib.GType _gtype = new GLib.GType (gst_uri_handler_get_type ());
|
private static Gst.GLib.GType _gtype = new Gst.GLib.GType (gst_uri_handler_get_type ());
|
||||||
|
|
||||||
public override GLib.GType GType {
|
public override Gst.GLib.GType GType {
|
||||||
get {
|
get {
|
||||||
return _gtype;
|
return _gtype;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IntPtr handle;
|
|
||||||
public override IntPtr Handle {
|
public override IntPtr Handle {
|
||||||
get {
|
get {
|
||||||
if (handle != IntPtr.Zero)
|
return implementor.Handle;
|
||||||
return handle;
|
}
|
||||||
return implementor == null ? IntPtr.Zero : implementor.Handle;
|
}
|
||||||
|
|
||||||
|
public IntPtr OwnedHandle {
|
||||||
|
get {
|
||||||
|
return implementor.OwnedHandle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URIHandler GetObject (IntPtr handle, bool owned)
|
public static URIHandler GetObject (IntPtr handle, bool owned)
|
||||||
{
|
{
|
||||||
GLib.Object obj = GLib.Object.GetObject (handle, owned);
|
Gst.GLib.Object obj = Gst.GLib.Object.GetObject (handle, owned);
|
||||||
return GetObject (obj);
|
return GetObject (obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URIHandler GetObject (GLib.Object obj)
|
public static URIHandler GetObject (Gst.GLib.Object obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -197,62 +202,62 @@ namespace Gst {
|
||||||
|
|
||||||
public URIHandlerImplementor Implementor {
|
public URIHandlerImplementor Implementor {
|
||||||
get {
|
get {
|
||||||
return implementor;
|
return implementor as URIHandlerImplementor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[GLib.Signal("new-uri")]
|
[Gst.GLib.Signal("new-uri")]
|
||||||
public event Gst.NewUriHandler NewUri {
|
public event Gst.NewUriHandler NewUri {
|
||||||
add {
|
add {
|
||||||
GLib.Signal sig = GLib.Signal.Lookup (GLib.Object.GetObject (Handle), "new-uri", typeof (Gst.NewUriArgs));
|
Gst.GLib.Signal sig = Gst.GLib.Signal.Lookup (Gst.GLib.Object.GetObject (Handle), "new-uri", typeof (Gst.NewUriArgs));
|
||||||
sig.AddDelegate (value);
|
sig.AddDelegate (value);
|
||||||
}
|
}
|
||||||
remove {
|
remove {
|
||||||
GLib.Signal sig = GLib.Signal.Lookup (GLib.Object.GetObject (Handle), "new-uri", typeof (Gst.NewUriArgs));
|
Gst.GLib.Signal sig = Gst.GLib.Signal.Lookup (Gst.GLib.Object.GetObject (Handle), "new-uri", typeof (Gst.NewUriArgs));
|
||||||
sig.RemoveDelegate (value);
|
sig.RemoveDelegate (value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstreamer-0.10.dll")]
|
[DllImport("libgstreamer-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern uint gst_uri_handler_get_uri_type(IntPtr raw);
|
static extern int gst_uri_handler_get_uri_type(IntPtr raw);
|
||||||
|
|
||||||
public Gst.URIType UriType {
|
public Gst.URIType UriType {
|
||||||
get {
|
get {
|
||||||
uint raw_ret = gst_uri_handler_get_uri_type(Handle);
|
int raw_ret = gst_uri_handler_get_uri_type(Handle);
|
||||||
Gst.URIType ret = (Gst.URIType) raw_ret;
|
Gst.URIType ret = (Gst.URIType) raw_ret;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstreamer-0.10.dll")]
|
[DllImport("libgstreamer-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern bool gst_uri_handler_set_uri(IntPtr raw, IntPtr uri);
|
static extern bool gst_uri_handler_set_uri(IntPtr raw, IntPtr uri);
|
||||||
|
|
||||||
public bool SetUri(string uri) {
|
public bool SetUri(string uri) {
|
||||||
IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
|
IntPtr native_uri = Gst.GLib.Marshaller.StringToPtrGStrdup (uri);
|
||||||
bool raw_ret = gst_uri_handler_set_uri(Handle, native_uri);
|
bool raw_ret = gst_uri_handler_set_uri(Handle, native_uri);
|
||||||
bool ret = raw_ret;
|
bool ret = raw_ret;
|
||||||
GLib.Marshaller.Free (native_uri);
|
Gst.GLib.Marshaller.Free (native_uri);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstreamer-0.10.dll")]
|
[DllImport("libgstreamer-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern IntPtr gst_uri_handler_get_protocols(IntPtr raw);
|
static extern IntPtr gst_uri_handler_get_protocols(IntPtr raw);
|
||||||
|
|
||||||
public string[] Protocols {
|
public string[] Protocols {
|
||||||
get {
|
get {
|
||||||
IntPtr raw_ret = gst_uri_handler_get_protocols(Handle);
|
IntPtr raw_ret = gst_uri_handler_get_protocols(Handle);
|
||||||
string[] ret = GLib.Marshaller.NullTermPtrToStringArray(raw_ret, false);
|
string[] ret = Gst.Marshaller.NullTermPtrToStringArray (raw_ret, false);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgstreamer-0.10.dll")]
|
[DllImport("libgstreamer-0.10.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern IntPtr gst_uri_handler_get_uri(IntPtr raw);
|
static extern IntPtr gst_uri_handler_get_uri(IntPtr raw);
|
||||||
|
|
||||||
public string Uri {
|
public string Uri {
|
||||||
get {
|
get {
|
||||||
IntPtr raw_ret = gst_uri_handler_get_uri(Handle);
|
IntPtr raw_ret = gst_uri_handler_get_uri(Handle);
|
||||||
string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
|
string ret = Gst.GLib.Marshaller.Utf8PtrToString (raw_ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue