On Wed, 2005-02-23 at 18:55 +0000, Orton, Yves wrote: > > I tried to explain that in my original mail. The GStreame bindings, > > just like Gtk2 or Gnome2, are different. You don't just use one > > constructor once. Typical applications will have to create many > > Gst::Element's, a few Gst::Structure's, some Gst::Index's, > > Gst::Caps's, a Gst::Clock, etc., etc. Try imagining how long this > > paragraph would be if I used Multimedia::GStreamer as the namespace. > > Export a constant Gst() that equals Multimedia::Gstreamer. > > Ie the moral equivelent of > > use constant Gst=>'Multimedia::Gstreamer'; > > Gst->new(....);
I just realized that this won't work. I don't just need Gst to be an alias for Media::GStreamer, I need Gst::* to be an alias for Media::GStreamer::*. That also seems to rule out the aliased.pm approach. > Or make a factory sub: > > sub GstNew { > my $class="Multimeadia::Gstreamer::".shift(@_); > return $class->new(@_); > } > > And also possibly a clone method: > > my $elem=GstNew("Clock"); > my $other_elem=$elem->clone(); That would work, but seems way too hacky to me. It would also deviate quite a bit from the C API, which I want to avoid. Thanks for the suggestion nonetheless, though. -- Bye, -Torsten