dguitar.adaptors.song.impl
Class SongMeasureImpl

java.lang.Object
  extended bydguitar.adaptors.song.impl.SongMeasureImpl
All Implemented Interfaces:
SongMeasure, SongPhrase

public class SongMeasureImpl
extends java.lang.Object
implements SongMeasure

Implementation of SongMeasure

Author:
crnash

Field Summary
(package private)  int index
           
(package private)  int length
           
(package private)  TimeSignature timeSignature
           
(package private)  java.util.Map trackMap
           
 
Constructor Summary
SongMeasureImpl(int index, int length, TimeSignature timeSignature)
           
 
Method Summary
 void addTrack(SongMeasureTrack smt)
           
 int getIndex()
           
 int getLength()
           
 SongMeasure getPerformanceMeasure(int measure)
           
 int getPerformanceMeasureCount()
           
 SongMeasure getScoreMeasure(int i)
           
 int getScoreMeasureCount()
           
 TimeSignature getTimeSignature()
           
 SongMeasureTrack getTrack(SongTrack track)
          Retrieves the SongMeasureTrack (list of SongEvents) for the given track in this measure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

length

int length

index

int index

timeSignature

TimeSignature timeSignature

trackMap

java.util.Map trackMap
Constructor Detail

SongMeasureImpl

public SongMeasureImpl(int index,
                       int length,
                       TimeSignature timeSignature)
Parameters:
index -
length -
Method Detail

getTimeSignature

public TimeSignature getTimeSignature()
Specified by:
getTimeSignature in interface SongMeasure
Returns:
Returns the timeSignature.

addTrack

public void addTrack(SongMeasureTrack smt)
Specified by:
addTrack in interface SongMeasure

getScoreMeasureCount

public int getScoreMeasureCount()
Specified by:
getScoreMeasureCount in interface SongPhrase
Returns:
The count of the number of measures in this phrase on a printed score

getScoreMeasure

public SongMeasure getScoreMeasure(int i)
Specified by:
getScoreMeasure in interface SongPhrase
Parameters:
i - The measure index (0 based)
Returns:
the measure at this index when printed on a score

getPerformanceMeasureCount

public int getPerformanceMeasureCount()
Specified by:
getPerformanceMeasureCount in interface SongPhrase
Returns:
The count of the number of measures in this phrase when it is performed

getPerformanceMeasure

public SongMeasure getPerformanceMeasure(int measure)
Specified by:
getPerformanceMeasure in interface SongPhrase
Parameters:
measure - the measure index (0 based)
Returns:
the measure at this index when performed

getLength

public int getLength()
Specified by:
getLength in interface SongMeasure
Returns:
the length of this phrase, in resolution units

getIndex

public int getIndex()
Specified by:
getIndex in interface SongMeasure
Returns:
Returns the index.

getTrack

public SongMeasureTrack getTrack(SongTrack track)
Description copied from interface: SongMeasure
Retrieves the SongMeasureTrack (list of SongEvents) for the given track in this measure.

Specified by:
getTrack in interface SongMeasure
Returns:
the song measure track of the score of this measure on this track.