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
pgplSrcTMG9Dw.pgp
Description: PGP signature
_______________________________________________ Sugar mailing list [email protected] http://lists.laptop.org/listinfo/sugar

