Logo Search packages:      
Sourcecode: rosegarden version File versions  Download package

ViewElementList::iterator Rosegarden::Staff::findEvent ( Rosegarden::Event e  ) 

Return the location of the given event in this Staff

!! (This is also why this method has to be here and not in

Definition at line 80 of file Staff.C.

Referenced by NotationSelector::drag(), endMarkerTimeChanged(), and eventRemoved().

    // Note that we have to create this using the virtual
    // makeViewElement, because the result of equal_range depends on
    // the value of the view absolute time for the element, which
    // depends on the particular subclass of ViewElement in use.
    //!!! (This is also why this method has to be here and not in
    // ViewElementList -- ViewElementList has no equivalent of
    // makeViewElement.  Possibly things like NotationElementList
    // should be subclasses of ViewElementList that implement
    // makeViewElement instead of having makeViewElement in Staff, but
    // that's for another day.)
    ViewElement *dummy = makeViewElement(e);
        r = m_viewElementList->equal_range(dummy);
    delete dummy;

    for (ViewElementList::iterator i = r.first; i != r.second; ++i) {
        if ((*i)->event() == e) {
            return i;

    return m_viewElementList->end();

Generated by  Doxygen 1.6.0   Back to index