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
This commit is contained in:
Aaron Bockover 2006-05-25 15:57:02 +00:00
parent 37b04a8811
commit 8c72b3b631
4 changed files with 44 additions and 11 deletions

View file

@ -1,3 +1,13 @@
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
2006-05-25 Aaron Bockover <aaron@abock.org>
* gstreamer-sharp-0.10.pc.in: link against proper assembly

View file

@ -1,13 +1,10 @@
/*[DllImport ("gstreamersharpglue-0.10")]
[DllImport ("gstreamersharpglue-0.10")]
private extern static uint gstsharp_gst_bin_get_children_offset();
static uint children_offset = gstsharp_gst_bin_get_children_offset();*/
static uint children_offset = gstsharp_gst_bin_get_children_offset();
/* TODO: This needs to be called 'Children' and the default version
needs to be hidden (see Gstreamer.metadata) */
public Element [] List {
public Element [] Children {
get {
GLib.List list;

View file

@ -3,10 +3,10 @@
<attr path="/api/namespace/object[@name='Bin']" name="disable_gtype_ctor">1</attr>
<attr path="/api/namespace/object[@name='Pipeline']" name="disable_gtype_ctor">1</attr>
<!-- TODO: Why doesn't this work? -->
<attr path="/api/namespace/class[@name='Bin']/property[@name='Children']" name="hidden">1</attr>
<attr path="/api/namespace/object[@name='Bin']/property[@name='ChildrenCount']" name="name">ChildCount</attr>
<attr path="/api/namespace/object[@name='Bin']/field[@name='Children']" name="hidden">1</attr>
<attr path="/api/namespace/object[@name='Element']/signal[@name='NoMorePads']" name="name">HasNoMorePads</attr>
<!-- Hidden as the parameter name conflicts with generated code -->
<attr path="/api/namespace/object[@name='Element']/method[@name='ContinueState']/parameters/*[@name='ret']" name="name">state_change_ret</attr>

View file

@ -35,7 +35,7 @@ public class BinTest
Element e2 = ElementFactory.Make("fakesink", "fakesink");
bin.AddMany(e1, e2);
Assert.AreEqual(bin.List.Length, 2);
Assert.AreEqual(bin.ChildrenCount, 2);
e1.Dispose();
e2.Dispose();
@ -57,5 +57,31 @@ public class BinTest
e1.Dispose();
bin.Dispose();
}
[Test]
public void TestChildren()
{
Bin bin = new Bin("test-bin");
Element [] elements = new Element [] {
ElementFactory.Make("fakesrc", "fakesrc"),
ElementFactory.Make("audioconvert", "audioconvert"),
ElementFactory.Make("wavenc", "wavenc"),
ElementFactory.Make("fakesink", "fakesink")
};
foreach(Element element in elements) {
bin.Add(element);
}
Assert.AreEqual(elements.Length, bin.ChildrenCount);
Element [] children = bin.Children;
for(int i = 0; i < elements.Length; i++) {
Assert.AreEqual(elements[i], children[i]);
}
bin.Dispose();
}
}