After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 143283 - [PATCH] Property accessors for the mixer interface
[PATCH] Property accessors for the mixer interface
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other Linux
: Normal minor
: 0.8.2
Assigned To: Ronald Bultje
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-05-27 12:03 UTC by Owen Fraser-Green
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8


Attachments
Adds the property accessors (6.44 KB, patch)
2004-05-27 12:07 UTC, Owen Fraser-Green
none Details | Review
Unified this time (9.65 KB, patch)
2004-05-27 20:54 UTC, Owen Fraser-Green
none Details | Review

Description Owen Fraser-Green 2004-05-27 12:03:48 UTC
The current mixer interface doesn't offer any property accessors for the
GstMixerTrack class. Also, there is no way to get the available options list.
Comment 1 Owen Fraser-Green 2004-05-27 12:07:07 UTC
Created attachment 28083 [details] [review]
Adds the property accessors

The attached patch adds the property accessors to GstMixerTrack and a
gst_mixer_options_get_values method to get the list of possible values for a
GstMixerOptions track.

It also includes a couple of syntax changes, in particular, 

typedef struct _Gst... { } Gst...;

->

typedef struct _Gst... Gst...;

struct _Gst... { };

because GAPI doesn't like this and I don't think it's consistent with the GNOME
programming style.
Comment 2 Ronald Bultje 2004-05-27 20:38:35 UTC
Can you please attach a unified diff patch? Looks good otherwise, but just to be
sure. :).
Comment 3 Owen Fraser-Green 2004-05-27 20:54:42 UTC
Created attachment 28100 [details] [review]
Unified this time

Oops! Sorry about that. I was trying to do it in a hurry before I left work.
Comment 4 Johan (not receiving bugmail) Dahlin 2004-05-28 11:36:30 UTC
It's actually not necessary to have this. But I understand that it will make
things easier from a language binding point of view.

In C, you can just do:

GST_MIXER(element)->label ...

And, don't create a new method call get_property(). It's already used by GObject
and shouldn't be used by any classes/interfaces derived. (same with connect,
that used to be used by GstElement)

I'd rather see accessors for all different field names, like .set_label/.get_label.
Comment 5 Owen Fraser-Green 2004-05-28 12:18:42 UTC
It was the desire to use the mixer interface in the .NET bindings that drove me
to add these accessors. 

What did you mean regarding calling a method get_property()? Surely, it's
effectively just a private method existing in the gst_mixer namespace and,
hence, doesn't interfere? Or am I missing something (disclaimer: the last time I
did any real glib programming in C was pre-2.0).

Regarding using named accessor methods such as set_label and get_label, I feel
that this style of accessor is somewhat evil in that it undermines glib's
already limited introspection capabilities. One of the few useful things you can
easily do with with glib in the way of introspection is ask an object what
properties it has. This breaks that.
Comment 6 Johan (not receiving bugmail) Dahlin 2004-05-28 13:33:46 UTC
Well, remember that an interface is not a class. I'm actually quite sure that
interfaces provides properties already. The FileChooser for gtk+ 2.4 uses this.

For python bindings (and other OO) bindings, the method get_property() is
important to preserve, since it should map to the method of GObject instead of
GstMixer. Otherwise

mixer.get_property('name') will fail, since 'name' is a property of GstElement,
but not found in the mixer (since it's an interface) and only provedes label etc.
Comment 7 Ronald Bultje 2004-05-28 13:51:08 UTC
No, GstMixerTrack & co are all GObjects. GstMixer is an interface. Owen's patch
is correct and doesn't interfere.
Comment 8 Ronald Bultje 2004-05-28 13:51:50 UTC
(Note that Gtk provides both function accessors and properties, so I think
following that model is the right way to go.)
Comment 9 Johan (not receiving bugmail) Dahlin 2004-05-28 14:38:01 UTC
Sorry, ignore me. I can't see the difference between GstMixer and GstMixerTrack
Comment 10 Owen Fraser-Green 2004-06-01 20:08:19 UTC
I've applied the patch.