gstreamer/gstreamer-sharp/Bin.custom
Aaron Bockover 8c72b3b631 2006-05-25 Aaron Bockover <aaron@abock.org>
* gstreamer-sharp/Gstreamer.metadata: Hide the Children property and
    implement own version in Bin.custom to return an Element [] instead of
    a GLib.List

    * gstreamer-sharp/Bin.custom: Implement Bin.Children

    * tests/BinTest.cs: wrote a test for Bin.Children



git-svn-id: svn://anonsvn.mono-project.com/source/branches/abock/gstreamer-sharp@61115 e3ebcda4-bce8-0310-ba0a-eca2169e7518
2006-05-25 15:57:02 +00:00

39 lines
1,018 B
Text

[DllImport ("gstreamersharpglue-0.10")]
private extern static uint gstsharp_gst_bin_get_children_offset();
static uint children_offset = gstsharp_gst_bin_get_children_offset();
public Element [] Children {
get {
GLib.List list;
unsafe {
IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + children_offset);
list = new GLib.List((*raw_ptr));
}
Element [] result = new Element[list.Count];
for(int i = 0; i < list.Count; i++) {
result[i] = list[i] as Element;
}
return result;
}
}
public bool AddMany(params Element[] elements)
{
if(elements == null) {
return false;
}
foreach(Element element in elements) {
if(element == null || !Add(element)) {
return false;
}
}
return true;
}