dguitar.codecs.guitarPro
Class GPBeat

java.lang.Object
  extended bydguitar.codecs.guitarPro.GPBeat

public class GPBeat
extends java.lang.Object

This class describes a Beat read from a Guitar Pro file.
A beat can contain several notes, and can hold information about a chord diagram, a mix table change event, a text marker and effects.

Author:
Matthieu Wipliez

Field Summary
private  GPDuration _duration
          This beat's duration.
private  boolean _emptyBeat
          Whether this beat is empty.
private  java.util.List _notes
          Notes possibly associated with this beat.
private  int _nTuplet
          When the beat is a n-tuplet.
private  boolean _restBeat
          Whether this beat is a rest.
private  boolean[] _strings
          The strings played in this beat.
 GPChordDiagram chordDiagram
          Chord diagram possibly associated with this beat.
 boolean dottedNotes
          Whether the notes contained in this beat are dotted notes.
 GPEffectsOnBeat effects
          Effects possibly associated with this beat.
 GPMixTableChange mixTableChange
          Mix table change possibly associated with this beat.
 java.lang.String text
          Text possibly associated with this beat.
 
Constructor Summary
GPBeat()
          Creates a new Beat.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true if the given object is equals to this Beat.
 GPDuration getDuration()
          Returns this beat's duration.
 java.util.List getNotes()
          Returns the notes contained in this beat.
 int getNTuplet()
          Returns the number of the n-tuplet (3, 5, 7...).
 boolean isEmptyBeat()
          Returns true if this beat is empty.
 boolean isNoteBeat()
          Returns true if this beat contains at least one note.
 boolean isRestBeat()
          Returns true if this beat is a rest beat.
 boolean isStringPlayed(int i)
          Returns true if the string i is played.
 void setDuration(GPDuration duration)
          Sets this beat's duration.
 void setEmptyBeat(boolean emptyBeat)
          Sets if this beat is empty or not (according to emptyBeat).
 void setNTuplet(int tuplet)
          Sets the number of the n-tuplet (3, 5, 7...).
 void setRestBeat(boolean restBeat)
          Sets this beat to be a rest or not according to restBeat.
 void setString(int i, boolean string)
          Changes the status of the string i.
 java.lang.String toString()
          Returns a string representation of the Beat.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_emptyBeat

private boolean _emptyBeat
Whether this beat is empty.


_restBeat

private boolean _restBeat
Whether this beat is a rest.


_duration

private GPDuration _duration
This beat's duration.

See Also:
GPDuration

_notes

private java.util.List _notes
Notes possibly associated with this beat.


_nTuplet

private int _nTuplet
When the beat is a n-tuplet.


_strings

private boolean[] _strings
The strings played in this beat.
7 strings maximum can be played.
The higher the index, the higher the string.


chordDiagram

public GPChordDiagram chordDiagram
Chord diagram possibly associated with this beat.

See Also:
GPChordDiagram

dottedNotes

public boolean dottedNotes
Whether the notes contained in this beat are dotted notes.


effects

public GPEffectsOnBeat effects
Effects possibly associated with this beat.

See Also:
GPEffectsOnBeat

mixTableChange

public GPMixTableChange mixTableChange
Mix table change possibly associated with this beat.

See Also:
GPMixTableChange

text

public java.lang.String text
Text possibly associated with this beat.

Constructor Detail

GPBeat

public GPBeat()
Creates a new Beat.

Method Detail

equals

public boolean equals(java.lang.Object o)
Returns true if the given object is equals to this Beat.


getDuration

public GPDuration getDuration()
Returns this beat's duration.

Returns:
this beat's duration.
See Also:
GPDuration

getNotes

public java.util.List getNotes()
Returns the notes contained in this beat.

Returns:
a list of the notes contained in this beat.

getNTuplet

public int getNTuplet()
Returns the number of the n-tuplet (3, 5, 7...).

Returns:
the number of the n-tuplet (3, 5, 7...).

isEmptyBeat

public boolean isEmptyBeat()
Returns true if this beat is empty.

Returns:
whether this beat is empty.

isNoteBeat

public boolean isNoteBeat()
Returns true if this beat contains at least one note.

Returns:
true if this beat contains at least one note. This occurs when the beat is not empty and does not contain only a rest.

isRestBeat

public boolean isRestBeat()
Returns true if this beat is a rest beat.

Returns:
whether this beat is a rest beat.

isStringPlayed

public boolean isStringPlayed(int i)
Returns true if the string i is played.

Returns:
true if the string i is played.

setDuration

public void setDuration(GPDuration duration)
Sets this beat's duration.

Parameters:
duration - the duration to set.
See Also:
GPDuration

setEmptyBeat

public void setEmptyBeat(boolean emptyBeat)
Sets if this beat is empty or not (according to emptyBeat).

Parameters:
emptyBeat - the boolean value.

setNTuplet

public void setNTuplet(int tuplet)
Sets the number of the n-tuplet (3, 5, 7...).

Parameters:
tuplet - the number of the n-tuplet

setRestBeat

public void setRestBeat(boolean restBeat)
Sets this beat to be a rest or not according to restBeat.

Parameters:
restBeat - the boolean value indicating if the beat is a rest beat.

setString

public void setString(int i,
                      boolean string)
Changes the status of the string i.

Parameters:
i - the index of the string.
string - true if this string is played.

toString

public java.lang.String toString()
Returns a string representation of the Beat.