[sugar] [PATCH] Add speaker device and icon by default
Martin Dengler
martin
Thu Apr 24 15:21:01 EDT 2008
On Thu, Apr 24, 2008 at 12:47:11PM -0400, Eben Eliason wrote:
> On Thu, Apr 24, 2008 at 12:40 PM, Martin Dengler wrote:
> > On Thu, Apr 24, 2008 at 12:01:52PM -0400, Eben Eliason wrote:
> > > On Thu, Apr 24, 2008 at 7:33 AM, Martin Dengler wrote:
> > > > + return self._master.flags & gst.interfaces.MIXER_TRACK_MUTE \
> > > > + == gst.interfaces.MIXER_TRACK_MUTE
> > >
> > > If MIXER_TRACK_MUTE is a bit mask, isn't the equality check redundant?
> >
> > It's not a bitmask, IIUC. So no, it's not redundant AFAICS. But yes,
> > it'd read much more nicely without the equality check if it wasn't.
>
> Hmmm, but you appear to be using it as such anyway. How else could
> the boolean & be interpreted logically otherwise? (I may very well be
> missing something here.)
the GFlags class overrides the __and__ method...nice, eh?
>>> master.flags
<flags GST_MIXER_TRACK_OUTPUT | GST_MIXER_TRACK_MASTER of type GstMixerTrackFlags>
>>> gst.interfaces.MIXER_TRACK_MUTE.__and__
<method-wrapper '__and__' of MixerTrackFlags object at 0x817b52c>
>>> type(gst.interfaces.MIXER_TRACK_MUTE)
<class 'gst.interfaces.MixerTrackFlags'>
>>> type(gst.interfaces.MIXER_TRACK_MUTE & gst.interfaces.MIXER_TRACK_MUTE)
<class 'gst.interfaces.MixerTrackFlags'>
> - Eben
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/sugar/attachments/20080424/bde1ad8a/attachment.pgp
More information about the Sugar-devel
mailing list