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

Rosegarden::RulerScale Class Reference

#include <RulerScale.h>

Inheritance diagram for Rosegarden::RulerScale:

Rosegarden::SimpleRulerScale Rosegarden::ZoomableMatrixHLayoutRulerScale Rosegarden::NotationHLayout

List of all members.

Detailed Description

RulerScale is a base for classes that may be queried in order to discover the correct x-coordinates for bar lines and bar subdivisions.

RulerScale does not contain any methods that relate bar numbers to times, time signature or duration -- those are in Composition.

The methods in RulerScale should return extrapolated (but valid) results even when passed a bar number outside the theoretically visible or existant bar range.

Apart from getBarPosition, every method in this class has a default implementation, which should work correctly provided the subclass maintains spacing proportional to time within a bar, but which may not be an efficient implementation for any given subclass.

(Potential to-do: At the moment all our RulerScales are used in contexts where spacing proportional to time within a bar is the only interpretation that makes sense, so this is okay. In theory though we should probably subclass out these "default" implementations into an intermediate abstract class.)

Definition at line 49 of file RulerScale.h.

Public Member Functions

virtual int getBarForX (double x) const
virtual double getBarPosition (int n) const =0
virtual double getBarWidth (int n) const
virtual double getBeatWidth (int n) const
Composition * getComposition () const
virtual timeT getDurationForWidth (double x, double width) const
virtual int getFirstVisibleBar () const
virtual int getLastVisibleBar () const
virtual timeT getTimeForX (double x) const
virtual double getTotalWidth () const
virtual double getWidthForDuration (timeT startTime, timeT duration) const
virtual double getXForTime (timeT time) const

Protected Member Functions

 RulerScale (Composition *c)

Protected Attributes

Composition * m_composition

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

Generated by  Doxygen 1.6.0   Back to index