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.)
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)|