class Position

The class Position is a very important class. More...

Definition#include <position.h>
InheritsAtoma [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

The class Position is a very important class. It contains all convenience methods to convert the simple linear time (the ticks, stored as an long int) into the three dimensional position presentation (bars, beats and ticks within the beat) an vice versa.

 Position ()

Position

Default Constructor

 Position (long p)

Position

Constructs a position with the initial value p

 Position (int bar, int beat, int tick)

Position

Constructs a position with the initial value bar.beat.tick

 Position (char * str, int)

Position

Constructs a position with the format "bar.beat.tick" given as a char*

 Position (const Position&)

Position

Copy Constructor

long  ticks ()

ticks

[const]

Returns the linear time, measured in ticks

long  negative ()

negative

depricated

int  bar ()

bar

[const]

Returns the bar value of the position

int  beat ()

beat

[const]

Returns the beat value of the position

int  tick ()

tick

[const]

Returns the tick value of the position

bool  sameBar (Position & other)

sameBar

[const]

Returns true if this position and other are located within the same bar

bool  sameBeat (Position & other)

sameBeat

[const]

Returns true if this position and other are located within the same bar and the same beat

bool  sameBarOrGreater (Position & other)

sameBarOrGreater

[const]

Returns true if this position is located within the same bar or greater than the other

void  gBBT (int & bar, int & beat, int & tick, Part * master, int & meter0, int & meter1, bool returnMeter=false)

gBBT

[const]

This method presents the position in the bar.beat.tick format. It sets the first three parameters bar, beat and tick according to the parameters master (specifying the mastertrack's part), meter0 and meter1 (specifying the denominator and the numerator of the global meter). Usually this method is not needed, since the position obtains the master and meter information from the global song instance. Alternatively try the gBBT method with three parameters.

void  gBBT (int & bar, int & beat, int & tick)

gBBT

[const]

This method presents the position in the bar.beat.tick format. It sets the first three parameters bar, beat and tick according to the songs mastertrack and global meter values

void  nextBar ()

nextBar

This method moves the position to the beginning of the next bar

void  nextBeat ()

nextBeat

This method moves the position to the beginning of the next beat

void  prevBar ()

prevBar

This method moves the position to the beginning of the previous bar

void  snap (int res, Tuplet * tuplet = 0)

snap

Rounds off the position to the grid specified by the res parameter (resoloution). For Tuplets it is required to provide the Tuplet instance in order to obtain sensible values.

Position &  operator= (const Position&)

operator=

Assignment Operator

Position &  operator= (long)

operator=

Assignment Operator

Position &  set (int bar, int beat, int tick, Part * master, int m0=0, int m1=0, int snap=0)

set

Sets the position by the format bar.beat.tick, while specifying the mastertrack's part and optionally the global meter. The snap parameter rounds off the position to the specified value.

Position &  operator+= (Position)

operator+=

Increases the position by the specified value

Position &  operator-= (Position)

operator-=

Decreases the position by the specified value

double  operator* (double)

operator*

Multiplies the position by the specified value

friend Position  operator+ (Position,Position)

operator+

Adds two positions

friend Position  operator- (Position,Position)

operator-

Subtracts a positions from another position

friend long  operator+ (Position,long)

operator+

Adds two positions

friend long  operator- (Position,long)

operator-

Subtracts a positions from another position

friend bool  operator== (Position,Position)

operator==

Returns true if two positions are equal

friend bool  operator== (Position,long)

operator==

Returns true if two positions are equal

friend bool  operator!= (Position,Position)

operator!=

Returns true if two positions are not equal

friend bool  operator!= (Position,long)

operator!=

Returns true if two positions are not equal

friend bool  operator< (Position,Position)

operator<

Compares two positions

friend bool  operator<= (Position,Position)

operator<=

Compares two positions

friend bool  operator> (Position,Position)

operator>

Compares two positions

friend bool  operator>= (Position,Position)

operator>=

Compares two positions

friend Position &  operator++ (Position&,int)

operator++

Increases the position by one tick

friend ostream &  operator<< (ostream & s, const Position & p)

operator<<

Sends the position p (in the bar.beat.tick format) to the stream s

ostream &  print (int,ostream&)

print

[const virtual]

Implementation of the print method

Reimplemented from Atoma.

void  flush (const char*)

flush

[const virtual]

Implementation of the flush method

Reimplemented from Atoma.

Element *  copy ()

copy

[const virtual]

Implementation of the copy method

Reimplemented from Atoma.

bool  isEvent ()

isEvent

[const virtual]

Always returns false, since positions never are events

Reimplemented from Element.


Generated by: wuerthne on al on Sun Jan 6 22:32:42 2002, using kdoc 2.0a53.