Logo Search packages:      
Sourcecode: rosegarden version File versions

LinedStaff Class Reference

#include <linedstaff.h>

Inheritance diagram for LinedStaff:

Rosegarden::Staff NotationStaff

List of all members.

Detailed Description

LinedStaff is a base class for implementations of Staff that display the contents of a Segment on a set of horizontal lines with optional vertical bar lines. Likely subclasses include the notation and piano-roll staffs.

In general, this class handles x coordinates in floating-point, but y-coordinates as integers because of the requirement that staff lines be a precise integral distance apart.

Definition at line 70 of file linedstaff.h.

Public Types

enum  BarStyle {
  PlainBar = 0, DoubleBar, HeavyDoubleBar, RepeatEndBar,
  RepeatStartBar, RepeatBothBar, NoVisibleBar
typedef std::pair< double, int > LinedStaffCoords
enum  PageMode { LinearMode = 0, ContinuousPageMode, MultiPageMode }

Public Member Functions

void addObserver (StaffObserver *obs)
virtual void appearanceChanged (const Segment *)
virtual bool containsCanvasCoords (double canvasX, int canvasY) const
virtual void drawStaffName ()
virtual void endMarkerTimeChanged (const Segment *, bool shorten)
virtual void eventAdded (const Segment *, Event *)
virtual void eventRemoved (const Segment *, Event *)
ViewElementList::iterator findEvent (Rosegarden::Event *)
virtual QRect getBarExtents (double x, int y) const
LinedStaffCoords getCanvasCoordsForLayoutCoords (double x, int y) const
 !! fix NotationView::scrollToTime
virtual int getCanvasYForHeight (int height, double baseX=-1, int baseY=-1) const
getClosestElementToCanvasCoords (double x, int y, Rosegarden::Event *&clef, Rosegarden::Event *&key, bool notesAndRestsOnly=false, int proximityThreshold=10)
getClosestElementToLayoutX (double x, Rosegarden::Event *&clef, Rosegarden::Event *&key, bool notesAndRestsOnly=false, int proximityThreshold=10)
getElementUnderCanvasCoords (double x, int y, Rosegarden::Event *&clef, Rosegarden::Event *&key)
getElementUnderLayoutX (double x, Rosegarden::Event *&clef, Rosegarden::Event *&key)
virtual int getHeightAtCanvasCoords (double x, int y) const
virtual int getHeightOfRow () const
virtual int getId () const
virtual void getInsertCursorPosition (double &x, int &y) const
LinedStaffCoords getLayoutCoordsForCanvasCoords (double x, int y) const
 !! fix NotationView::doDeferredCursorMove
virtual double getLayoutXOfInsertCursor () const
virtual double getLayoutXOfPointer () const
virtual int getLayoutYForHeight (int height) const
int getLineSpacing () const
virtual double getMargin () const
int getPageCount () const
virtual void getPointerPosition (double &x, int &y) const
int getRowSpacing ()
const Segment & getSegment () const
Segment & getSegment ()
virtual int getTitleHeight () const
virtual int getTotalHeight () const
virtual double getTotalWidth () const
ViewElementList * getViewElementList (Segment::iterator from, Segment::iterator to)
ViewElementList * getViewElementList ()
virtual double getX () const
virtual int getY () const
virtual void hideInsertCursor ()
virtual void hidePointer ()
virtual void positionAllElements ()
virtual void positionElements (Rosegarden::timeT from, Rosegarden::timeT to)=0
void removeObserver (StaffObserver *obs)
virtual void renderAllElements ()
virtual void renderElements (Rosegarden::ViewElementList::iterator from, Rosegarden::ViewElementList::iterator to)
virtual void segmentDeleted (const Segment *)
virtual void setCurrent (bool current)
virtual void setInsertCursorPosition (double x, int y)
virtual void setInsertCursorPosition (Rosegarden::HorizontalLayoutEngine &, Rosegarden::timeT)
virtual void setMargin (double m)
virtual void setPointerPosition (double x)
virtual void setPointerPosition (double x, int y)
virtual void setPointerPosition (Rosegarden::HorizontalLayoutEngine &, Rosegarden::timeT)
virtual void setTitleHeight (int h)
virtual void setX (double x)
virtual void setY (int y)
virtual void sizeStaff (Rosegarden::HorizontalLayoutEngine &layout)
virtual ~LinedStaff ()

Protected Types

typedef FastVector< BarLine * > BarLineList
typedef std::vector
< QCanvasItem * > 
typedef std::vector< ItemList > ItemMatrix
typedef std::pair< double,
QCanvasItem * > 
typedef FastVector< LineRec > LineRecList
typedef std::list
< StaffObserver * > 

Protected Member Functions

virtual void clearStaffLineRow (int row)
virtual void deleteBars ()
virtual void deleteRepeatedClefsAndKeys ()
virtual void deleteTimeSignatures ()
virtual bool elementsInSpaces () const
virtual double getBarInset (int, bool) const
int getBarLineHeight () const
virtual BarStyle getBarStyle (int) const
virtual int getBottomLineHeight () const =0
LinedStaffCoords getCanvasOffsetsForLayoutCoords (double x, int y) const
double getCanvasXForLayoutX (double x) const
double getCanvasXForLeftOfRow (int row) const
double getCanvasXForRightOfRow (int row) const
int getCanvasYForTopLine (int row=-1) const
int getCanvasYForTopOfStaff (int row=-1) const
virtual int getHeightPerLine () const =0
virtual int getLegerLineCount () const =0
virtual int getLineCount () const =0
int getRowForCanvasCoords (double x, int y) const
int getRowForLayoutX (double x) const
int getRowsPerPage () const
int getTopLineHeight () const
int getTopLineOffset () const
void initCursors ()
virtual void insertBar (double layoutX, double width, bool isCorrect, const Rosegarden::TimeSignature &, int barNo, bool showBarNo)
virtual void insertRepeatedClefAndKey (double layoutX, int barNo)
virtual void insertTimeSignature (double layoutX, const Rosegarden::TimeSignature &)
 LinedStaff (QCanvas *, Rosegarden::Segment *, Rosegarden::SnapGrid *, int id, int resolution, int lineThickness, PageMode pageMode, double pageWidth, int rowsPerPage, int rowSpacing)
 LinedStaff (QCanvas *, Rosegarden::Segment *, Rosegarden::SnapGrid *, int id, int resolution, int lineThickness, double pageWidth, int rowsPerPage, int rowSpacing)
 LinedStaff (QCanvas *, Rosegarden::Segment *, Rosegarden::SnapGrid *, int id, int resolution, int lineThickness)
virtual ViewElement * makeViewElement (Event *)=0
void notifyAdd (ViewElement *) const
void notifyRemove (ViewElement *) const
void notifySourceDeletion () const
virtual void resizeStaffLineRow (int row, double offset, double length)
virtual void resizeStaffLines ()
virtual void setConnectingLineLength (int length)
 Subclass may wish to expose this. Default is zero.
virtual void setLineThickness (int lineThickness)
 Subclass may wish to expose this.
virtual void setPageMode (PageMode pageMode)
 Subclass may wish to expose this.
virtual void setPageWidth (double pageWidth)
 Subclass may wish to expose this.
virtual void setResolution (int resolution)
 Subclass may wish to expose this.
virtual void setRowSpacing (int rowSpacing)
 Subclass may wish to expose this.
virtual void setRowsPerPage (int rowsPerPage)
 Subclass may wish to expose this.
virtual int showBarNumbersEvery () const
virtual bool showBeatLines () const
virtual bool wrapEvent (Event *)

Static Protected Member Functions

static bool compareBars (const BarLine *, const BarLine *)
 !! should be multiset I reckon
static bool compareBarToLayoutX (const BarLine *, int)

Protected Attributes

LineRecList m_barConnectingLines
BarLineList m_barLines
ItemList m_barNumbers
LineRecList m_beatLines
QCanvas * m_canvas
int m_connectingLineLength
bool m_current
double m_endLayoutX
int m_id
QCanvasLine * m_insertCursor
int m_lineThickness
double m_margin
ObserverSet m_observers
PageMode m_pageMode
double m_pageWidth
QCanvasLine * m_pointer
int m_resolution
int m_rowSpacing
int m_rowsPerPage
Segment & m_segment
ItemList m_staffConnectingLines
ItemMatrix m_staffLines
double m_startLayoutX
int m_titleHeight
ViewElementList * m_viewElementList
double m_x
int m_y

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index