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

Public Types | Public Member Functions | Static Public Attributes | Protected Attributes

Rosegarden::SnapGrid Class Reference

#include <SnapGrid.h>

Collaboration diagram for Rosegarden::SnapGrid:
Collaboration graph

List of all members.

Public Types

enum  SnapDirection { SnapEither, SnapLeft, SnapRight }

Public Member Functions

int getBinHeightMultiple (int bin)
const RulerScalegetRulerScale () const
timeT getSnapSetting () const
timeT getSnapTime (double x) const
timeT getSnapTime (timeT t) const
int getYBin (int y) const
int getYBinCoordinate (int bin) const
int getYSnap () const
void setBinHeightMultiple (int bin, int multiple)
void setSnapTime (timeT snap)
void setYSnap (int ysnap)
 SnapGrid (const RulerScale *rulerScale, int ysnap=0)
timeT snapTime (timeT t, SnapDirection d=SnapEither) const
timeT snapX (double x, SnapDirection d=SnapEither) const
int snapY (int y) const

Static Public Attributes

static const timeT NoSnap = -1
static const timeT SnapToBar = -2
static const timeT SnapToBeat = -3
static const timeT SnapToUnit = -4

Protected Attributes

const RulerScalem_rulerScale
timeT m_snapTime
std::map< int, int > m_ymultiple
int m_ysnap

Detailed Description

SnapGrid is a class that maps x-coordinate onto time, using a RulerScale to get the mapping but constraining the results to a discrete set of suitable times.

(It also snaps y-coordinates, but that bit isn't very interesting.)

Definition at line 33 of file SnapGrid.h.

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

Generated by  Doxygen 1.6.0   Back to index