|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dguitar.codecs.guitarPro.GPInputStream dguitar.codecs.guitarPro.version1.GP1InputStream
The class GP1InputStream allows to parse an InputStream containing a GTP file which is encoded in the 1, 1.01, 1.02, 1.03, 1.04 format.
Field Summary | |
private static java.util.List |
_files
|
private int |
_numTracks
The number of tracks. |
private static int |
_total
|
private int |
_versionNumber
The version number read from the stream. |
private static java.lang.String[] |
supportedVersions
The versions this parser supports. |
Fields inherited from class dguitar.codecs.guitarPro.GPInputStream |
__fileName, __version |
Constructor Summary | |
GP1InputStream(GPInputStream gpIn)
Creates a new GP4InputStream by cloning an existing GPInputStream. |
|
GP1InputStream(java.io.InputStream in)
Creates a new GP2InputStream from an existing stream. |
Method Summary | |
private void |
checkVersionNumber()
Sets the _versionNumber attribute, according to the version read from the file, and sets attributes that are version-dependant. |
private static void |
decodeGP2InDirectory(java.io.File dir)
Decode recursively all the GP2 files in the directory specified. |
static void |
main(java.lang.String[] args)
The main function. |
private GPBeat |
readBeat(int trackNumberOfStrings)
Returns a beat read from a GP2 file. |
private GPBend |
readBend(GPBendType bendType)
Reads a bend from the stream. |
private GPChordDiagram |
readChordDiagram()
Reads a ChordDiagram from the stream. |
private void |
readEffectsOnBeat(GP1EffectsOnBeat gp1effects,
GPEffectsOnBeat eob)
Reads effects on the current beat from the stream. |
private GPEffectsOnNote |
readEffectsOnNote()
Reads effects on the current note from the stream. |
private void |
readMeasureTrackPairs(java.util.List tracks,
GPMeasure measure,
java.util.List mtpList)
Reads a pair of "measure-track". |
private GPNote |
readNote()
Reads a note (which here means only the fret and the dynamic). |
GPSong |
readPiece()
Reads a piece from the stream. |
private GPMIDIChannel |
readTrack(GPTrack track)
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 |
private static final java.lang.String[] supportedVersions
private int _numTracks
private int _versionNumber
private static final java.util.List _files
private static int _total
Constructor Detail |
public GP1InputStream(java.io.InputStream in)
public GP1InputStream(GPInputStream gpIn)
gpIn
- the original GPInputStream.Method Detail |
public static boolean supportedVersion(java.lang.String version)
version
- the version described by a string.
public static java.lang.String supportedVersions()
public GPSong readPiece() throws java.io.IOException
java.io.IOException
private void checkVersionNumber()
private GPBeat readBeat(int trackNumberOfStrings) throws java.io.IOException
trackNumberOfStrings
- the number of strings of the track we are currently reading.
java.io.IOException
private GPBend readBend(GPBendType bendType) throws java.io.IOException
java.io.IOException
private GPChordDiagram readChordDiagram() throws java.io.IOException
java.io.IOException
GPFormatException
private void readEffectsOnBeat(GP1EffectsOnBeat gp1effects, GPEffectsOnBeat eob) throws java.io.IOException
java.io.IOException
private GPEffectsOnNote readEffectsOnNote() throws java.io.IOException
java.io.IOException
private void readMeasureTrackPairs(java.util.List tracks, GPMeasure measure, java.util.List mtpList) throws java.io.IOException
tracks
- a list containing the information about the tracks.measure
- the GPMeasure that will hold the data read from the file.mtpList
- the list of GPMeasureTrackPair.
java.io.IOException
private GPNote readNote() throws java.io.IOException
java.io.IOException
private GPMIDIChannel readTrack(GPTrack track) throws java.io.IOException
track
- a GPTrack where the data will be written
java.io.IOException
public static void main(java.lang.String[] args)
args
- private static void decodeGP2InDirectory(java.io.File dir) throws java.io.FileNotFoundException
dir
- The directory to decode files from.
java.io.FileNotFoundException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |