2009-05-09 18:04:43 +00:00
|
|
|
namespace Gst.Interfaces {
|
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using System.Reflection;
|
|
|
|
using GLib;
|
|
|
|
using Gst;
|
|
|
|
using Gst.Interfaces;
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
public static class MixerMessage {
|
2009-05-25 10:09:52 +00:00
|
|
|
[DllImport("libgstinterfaces-0.10.dll") ]
|
2009-05-20 15:29:36 +00:00
|
|
|
static extern int gst_mixer_message_get_type (IntPtr message);
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
public static Gst.Interfaces.MixerMessageType MessageGetType (Gst.Message message) {
|
|
|
|
int raw_ret = gst_mixer_message_get_type (message == null ? IntPtr.Zero : message.Handle);
|
|
|
|
Gst.Interfaces.MixerMessageType ret = (Gst.Interfaces.MixerMessageType) raw_ret;
|
|
|
|
return ret;
|
|
|
|
}
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-25 10:09:52 +00:00
|
|
|
[DllImport("libgstinterfaces-0.10.dll") ]
|
2009-05-20 15:29:36 +00:00
|
|
|
static extern void gst_mixer_message_parse_mute_toggled (IntPtr message, out IntPtr track, out bool mute);
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
public static void ParseMuteToggled (Gst.Message message, out Gst.Interfaces.MixerTrack track, out bool mute) {
|
|
|
|
IntPtr native_ptr;
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
gst_mixer_message_parse_mute_toggled (message == null ? IntPtr.Zero : message.Handle, out native_ptr, out mute);
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
track = (MixerTrack) GLib.Object.GetObject (native_ptr, false);
|
|
|
|
}
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-25 10:09:52 +00:00
|
|
|
[DllImport("libgstinterfaces-0.10.dll") ]
|
2009-05-20 15:29:36 +00:00
|
|
|
static extern void gst_mixer_message_parse_option_changed (IntPtr message, out IntPtr options, out IntPtr value);
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
public static void ParseOptionChanged (Gst.Message message, out Gst.Interfaces.MixerOptions options, out string value) {
|
|
|
|
IntPtr native_value;
|
|
|
|
IntPtr native_options;
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
gst_mixer_message_parse_option_changed (message == null ? IntPtr.Zero : message.Handle, out native_options, out native_value);
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
options = (MixerOptions) GLib.Object.GetObject (native_options, false);
|
|
|
|
value = GLib.Marshaller.Utf8PtrToString (native_value);
|
|
|
|
}
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-25 10:09:52 +00:00
|
|
|
[DllImport("libgstinterfaces-0.10.dll") ]
|
2009-05-20 15:29:36 +00:00
|
|
|
static extern void gst_mixer_message_parse_record_toggled (IntPtr message, out IntPtr track, out bool record);
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
public static void ParseRecordToggled (Gst.Message message, out Gst.Interfaces.MixerTrack track, out bool record) {
|
|
|
|
IntPtr native_ptr;
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
gst_mixer_message_parse_record_toggled (message == null ? IntPtr.Zero : message.Handle, out native_ptr, out record);
|
|
|
|
track = (MixerTrack) GLib.Object.GetObject (native_ptr, false);
|
|
|
|
}
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-25 10:09:52 +00:00
|
|
|
[DllImport("libgstinterfaces-0.10.dll") ]
|
2009-05-20 15:29:36 +00:00
|
|
|
static extern void gst_mixer_message_parse_volume_changed (IntPtr message, out IntPtr track, out IntPtr volumes, out int num_channels);
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
public static void ParseVolumeChanged (Gst.Message message, out Gst.Interfaces.MixerTrack track, out int[] volumes) {
|
|
|
|
IntPtr native_track;
|
|
|
|
IntPtr native_volumes;
|
|
|
|
int n_native_volumes;
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
gst_mixer_message_parse_volume_changed (message == null ? IntPtr.Zero : message.Handle, out native_track, out native_volumes, out n_native_volumes);
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
track = (MixerTrack) GLib.Object.GetObject (native_track, false);
|
|
|
|
volumes = new int[n_native_volumes];
|
|
|
|
for (int i = 0; i < n_native_volumes; i++)
|
|
|
|
volumes[i] = Marshal.ReadInt32 (native_volumes, i * 4);
|
|
|
|
GLib.Marshaller.Free (native_volumes);
|
|
|
|
}
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-25 10:09:52 +00:00
|
|
|
[DllImport("libgstinterfaces-0.10.dll") ]
|
2009-05-20 15:29:36 +00:00
|
|
|
static extern void gst_mixer_message_parse_options_list_changed (IntPtr message, out IntPtr options);
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
public static void ParseOptionsListChanged (Gst.Message message, out Gst.Interfaces.MixerOptions options) {
|
|
|
|
IntPtr native_options;
|
2009-05-09 18:04:43 +00:00
|
|
|
|
2009-05-20 15:29:36 +00:00
|
|
|
gst_mixer_message_parse_options_list_changed (message == null ? IntPtr.Zero : message.Handle, out native_options);
|
|
|
|
options = (MixerOptions) GLib.Object.GetObject (native_options, false);
|
|
|
|
}
|
|
|
|
}
|
2009-05-09 18:04:43 +00:00
|
|
|
}
|