brown.core.staff_object

classes

permalink view source

StaffObject

An object which must always be the descendant of a Staff

This is a Mixin class, meant to be paired with GraphicObject classes.

Usage within a GraphicObject will look something like:

>>> class SomeMusicGlyph(MusicText, StaffObject):  
...     def __init__(self, ...):
...         MusicText.__init__(self, ...)
...         StaffObject.__init__(self, ...)

__init__ (parent) permalink view source

arguments:

parent (Staff or StaffObject):

properties

staff: Staff The staff associated with this object permalink view source

read-only.

pos_in_staff: Point The position of this object relative to the staff. permalink view source

This position is in non-flowed space.

# TODO: Definitely cache me when property caching is implemented

read-only.

static methods

find_staff (graphic_object) permalink view source

Find the first staff which is graphic_object or an ancestor of it.

arguments:

graphic_object (GraphicObject):

returns:

Staff or None