# \[patch\] Make \[\] an alias of get\_pad

**URL:** <https://www.ruby-forum.com/t/patch-make-an-alias-of-get-pad/133286>\
**Category:** Ruby-Gnome 2\
**Created:** [March 29, 2008, 7:16pm UTC](https://www.ruby-forum.com/t/patch-make-an-alias-of-get-pad/133286 "2008-03-29T19:16:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 29, 2008, 7:16pm UTC](https://www.ruby-forum.com/t/patch-make-an-alias-of-get-pad/133286/1 "2008-03-29T19:16:28Z")

</div>

Hi,

See attached patch.

Sjoerd

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 29, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/patch-make-an-alias-of-get-pad/133286/2 "2008-03-29T19:47:06Z")

</div>

On Sat, Mar 29, 2008 at 07:15:42PM +0100, Sjoerd S. wrote:

> Hi,
> 
> See attached patch.

Original patch was broken. Fixed version attached

```
Sjoerd
```

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 29, 2008, 9:57pm UTC](https://www.ruby-forum.com/t/patch-make-an-alias-of-get-pad/133286/3 "2008-03-29T21:57:46Z")

</div>

On Sat, Mar 29, 2008 at 07:15:42PM +0100, Sjoerd S. wrote:

> Hi,

Interestingly Ruby/Gstreamer choose the other option and already uses  
[] on  
Gst::Bin to get specific children.

In my experience in programming with gstreamer one rarely needs to get  
a  
specifically named child from a bin, but quite often wants to get a  
specifically named pad. That’s why i decided to use [] to get the pads  
of an  
element.

Obviously some choose needs to be made. Obviously i using [] to get  
pads and  
to not define it on Gst::Bin. Opinions?

```
Sjoerd

```

–  
Torque is cheap.

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 30, 2008, 12:55am UTC](https://www.ruby-forum.com/t/patch-make-an-alias-of-get-pad/133286/4 "2008-03-30T00:55:18Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] [patch] Make [] an alias of get\_pad” on  
Sat, 29 Mar 2008 19:46:45 +0100,  
Sjoerd S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > See attached patch.
> 
> Original patch was broken. Fixed version attached

It was very happy for us if you considered to follow our  
coding-style.

Others are OK for me.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 30, 2008, 12:56am UTC](https://www.ruby-forum.com/t/patch-make-an-alias-of-get-pad/133286/5 "2008-03-30T00:56:29Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] [patch] Make [] an alias of get\_pad” on  
Sat, 29 Mar 2008 21:57:14 +0100,  
Sjoerd S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Obviously some choose needs to be made. Obviously i using [] to get pads and  
> to not define it on Gst::Bin. Opinions?

I can’t understand why you say about Gst::Bin#[]. The change  
is about Gst::Element, isn’t it?

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 30, 2008, 1:33am UTC](https://www.ruby-forum.com/t/patch-make-an-alias-of-get-pad/133286/6 "2008-03-30T01:33:26Z")

</div>

On Sun, Mar 30, 2008 at 08:56:07AM +0900, Kouhei S. wrote:

> > Gst::Bin to get specific children.  
> > is about Gst::Element, isn’t it?  
> > The problem is that with this change both Gst::Element and Gst::Bin will  
> > have a  
> > [] function, which both have very different semantics. And as Gst::Bin  
> > is a  
> > child of Gst::Element this is really not something you want. So we  
> > should  
> > choose one and stick with it.

I know i and some others have various bits of code around that expects  
Gst::Element#[] as defined in this patch. So i’d obviously like to keep  
that  
and to get rid of Gst::Bin#[] to making porting a lot easier. And in  
practise  
it seems more convinient too 🙂

## Sjoerd

Did you hear that there’s a group of South American Indians that worship  
the number zero?

Is nothing sacred?

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 29, 2008, 11:13pm UTC](https://www.ruby-forum.com/t/patch-make-an-alias-of-get-pad/133286/7 "2008-03-29T23:13:40Z")

</div>

On Sat, Mar 29, 2008 at 09:57:14PM +0100, Sjoerd S. wrote:

> pads and to not define it on Gst::Bin. Opinions?  
> Yes! Pads please!

Paul

–  
PhD Student @ Eindhoven | email: removed\_email\_address@domain.invalid  
University of Technology, The Netherlands | JID: removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![sschunselaar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@sschunselaar](https://www.ruby-forum.com/u/sschunselaar)\
**Post date:** [March 30, 2008, 8:58am UTC](https://www.ruby-forum.com/t/patch-make-an-alias-of-get-pad/133286/8 "2008-03-30T08:58:47Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] [patch] Make [] an alias of get\_pad” on  
Sun, 30 Mar 2008 01:32:54 +0100,  
Sjoerd S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Interestingly Ruby/Gstreamer choose the other option and already uses [] on  
> > > I can’t understand why you say about Gst::Bin#[]. The change  
> > > it seems more convinient too 🙂  
> > > OK. You can do.

## Thanks,

kou
