dguitar.codecs.guitarPro.version3
Class GP3InputStream

java.lang.Object
  extended bydguitar.codecs.guitarPro.GPInputStream
      extended bydguitar.codecs.guitarPro.version3.GP3InputStream
All Implemented Interfaces:
Codec, CodecInputStream

public class GP3InputStream
extends GPInputStream

The class GP3InputStream allows to parse an InputStream containing a file encoded with the Guitar Pro 3 format.

Author:
Matthieu Wipliez, Mauricio Gracia Gutierrez

Field Summary
private static java.lang.String[] supportedVersions
          The versions this parser supports.
 
Fields inherited from class dguitar.codecs.guitarPro.GPInputStream
__fileName, __version
 
Constructor Summary
GP3InputStream(GPInputStream gpIn)
          Creates a new GP4InputStream by cloning an existing GPInputStream.
GP3InputStream(java.io.InputStream in)
          Creates a new GP3InputStream from an existing stream.
 
Method Summary
private  GPBeat readBeat()
          Returns a beat read from a GP3 file.
private  GPBend readBend()
          Reads a bend from the stream.
private  GPBendPoint readBendPoint()
          Reads a bend point from the stream.
private  GPChordDiagram readChordDiagram()
          Reads a chord diagram from the stream.
private  GPColor readColor()
          Reads a color from the stream.
private  GPEffectsOnBeat readEffectsOnBeat(GP3EffectsOnBeat gp3effects)
          Reads effects on the current beat from the stream.
private  GPEffectsOnNote readEffectsOnNote()
          Reads effects on the current note from the stream.
private  GPGraceNote readGraceNote()
          The grace notes are stored in the file with 4 variables, written in the followingorder.
private  GPMarker readMarker()
          Reads a marker from the stream.
private  GPMeasure readMeasure(GPMeasure previous)
          Reads a measure from the stream.
private  GPMeasureTrackPair readMeasureTrackPair()
          Reads a pair of "measure-track".
private  GPMIDIChannel readMIDIChannel()
          Reads a MIDI Channel from the stream.
private  GPMixTableChange readMixTableChange()
          Reads a mix table change event from the stream.
private  GPNote readNote()
          Reads a note (with possibly some effects on it) from the stream.
 GPSong readPiece()
          Reads a GPSong from the stream.
private  GPTrack readTrack()
          Reads a track from the stream.
static boolean supportedVersion(java.lang.String version)
          This method checks if the String version if supported.
static java.lang.String supportedVersions()
          This methods returns a String with the supported versions separated by '\n'.
 
Methods inherited from class dguitar.codecs.guitarPro.GPInputStream
assertBytesEqualTo, close, dumpBytes, dumpInts, read, read, readBoolean, readByte, readDouble, readFloat, readInt, readLong, readObject, readStringByte, readStringByteMaxLengthPlusOne, readStringInteger, readStringIntegerPlusOne, readUnsignedByte, skip, supportedExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

supportedVersions

private static final java.lang.String[] supportedVersions
The versions this parser supports.

Constructor Detail

GP3InputStream

public GP3InputStream(java.io.InputStream in)
Creates a new GP3InputStream from an existing stream.

Parameters:
in - the original stream

GP3InputStream

public GP3InputStream(GPInputStream gpIn)
Creates a new GP4InputStream by cloning an existing GPInputStream.

Parameters:
gpIn - the original GPInputStream.
Method Detail

supportedVersion

public static boolean supportedVersion(java.lang.String version)
This method checks if the String version if supported.

Parameters:
version - the version described by a string.
Returns:
true if the version is supported.

supportedVersions

public static java.lang.String supportedVersions()
This methods returns a String with the supported versions separated by '\n'.

Returns:
"FICHIER GUITAR PRO v3.00"

readPiece

public GPSong readPiece()
                 throws java.io.IOException
Reads a GPSong from the stream.

Returns:
the GPSong read.
Throws:
java.io.IOException

readBeat

private GPBeat readBeat()
                 throws java.io.IOException
Returns a beat read from a GP3 file.

Returns:
a GPBeat read from a GP3 file.
Throws:
java.io.IOException

readBend

private GPBend readBend()
                 throws java.io.IOException
Reads a bend from the stream.

Returns:
the GPBend read.
Throws:
java.io.IOException

readBendPoint

private GPBendPoint readBendPoint()
                           throws java.io.IOException
Reads a bend point from the stream.

Returns:
the GPBendPoint read.
Throws:
java.io.IOException

readChordDiagram

private GPChordDiagram readChordDiagram()
                                 throws java.io.IOException
Reads a chord diagram from the stream.

Returns:
the GPChordDiagram read.
Throws:
java.io.IOException

readColor

private GPColor readColor()
                   throws java.io.IOException
Reads a color from the stream.

Returns:
the GPColor read.
Throws:
java.io.IOException

readEffectsOnBeat

private GPEffectsOnBeat readEffectsOnBeat(GP3EffectsOnBeat gp3effects)
                                   throws java.io.IOException
Reads effects on the current beat from the stream.

Returns:
the GPEffectsOnBeat read.
Throws:
java.io.IOException

readEffectsOnNote

private GPEffectsOnNote readEffectsOnNote()
                                   throws java.io.IOException
Reads effects on the current note from the stream.

Returns:
the GPEffectsOnNote read.
Throws:
java.io.IOException

readGraceNote

private GPGraceNote readGraceNote()
                           throws java.io.IOException
The grace notes are stored in the file with 4 variables, written in the followingorder. Fret: byte The fret number the grace note is made from. GPDynamic: byte The grace note dynamic is coded like this: - 1: ppp - 2: pp - 3: p - 4: mp - 5: mf - 6: f - 7: ff - 8: fff The default value is 6. Transition: byte this variable determines the transition type used to make the grace note: - 0: None - 1: GPSlide - 2: GPBend - 3: Hammer GPDuration: byte Determines the grace note duration, coded this way: - 1: Sixteenth note. - 2: Twenty-fourth note. - 3: Thirty-second note.

Returns:
the GPGraceNote read.
Throws:
java.io.IOException

readMarker

private GPMarker readMarker()
                     throws java.io.IOException
Reads a marker from the stream.

Returns:
the GPMarker read.
Throws:
java.io.IOException

readMeasure

private GPMeasure readMeasure(GPMeasure previous)
                       throws java.io.IOException
Reads a measure from the stream. If previous is not null, this measure will inherit the previous one's settings.

Parameters:
previous - the previous measure.
Returns:
the GPMeasure read.
Throws:
java.io.IOException

readMeasureTrackPair

private GPMeasureTrackPair readMeasureTrackPair()
                                         throws java.io.IOException
Reads a pair of "measure-track".

Returns:
the GPMeasureTrackPair read.
Throws:
java.io.IOException

readMIDIChannel

private GPMIDIChannel readMIDIChannel()
                               throws java.io.IOException
Reads a MIDI Channel from the stream.

Returns:
the GPMIDIChannel read.
Throws:
java.io.IOException

readMixTableChange

private GPMixTableChange readMixTableChange()
                                     throws java.io.IOException
Reads a mix table change event from the stream.

Returns:
the GPMixTableChange read.
Throws:
java.io.IOException

readNote

private GPNote readNote()
                 throws java.io.IOException
Reads a note (with possibly some effects on it) from the stream.

Returns:
the GPNote read.
Throws:
java.io.IOException

readTrack

private GPTrack readTrack()
                   throws java.io.IOException
Reads a track from the stream.

Returns:
the GPTrack read.
Throws:
java.io.IOException