Skip to content

Latest commit

 

History

History
95 lines (70 loc) · 2.75 KB

README.md

File metadata and controls

95 lines (70 loc) · 2.75 KB

gbstag-lib : Java library for GBS-files (Game Boy Sound)

Game Boy

A Java library for reading gbs files and reading / manipulating the tags.

GBS-files are sound files containing ripped chiptune music from Game Boy and Game Boy Colour games. GBS stands for Game Boy Sound System.

Features

  • ✔️ 100% Java (Java 8) ☕
  • ✔️ Supports UTF-8 encoding in the tags!
  • Implements Comparable for sorting out of the box!

How to use it

Opening a gbs file

Gbs gbsfile = new GbsFile("/tmp/supermarioland.gbs");
Tag tag = gbsfile.getTag();

System.out.println("Version number: " + tag.getVersionNumber());
System.out.println("This gbs file contains: " + tag.getNumberOfSongs() + " songs");
System.out.println("The first one is no. " + tag.getFirstSong());

System.out.println("Author:\t" + tag.getAuthor());
System.out.println("Title:\t" + tag.getTitle());
System.out.println("Copyright:\t" + tag.getCopyright());

Saving a gbs file

gbsfile.save();

Setting tag values

Gbs gbsfile = new GbsFile("/tmp/supermarioland.gbs");
SimpleGbsTag tag = gbsfile.getTag();

tag.setAuthor("Koji Kondo");
tag.setCopyright("2000 Nintendo");
tag.setTitle("Wario Land 5");

Sorting tags

List<ReadOnlySimpleGbsTag> myTags = new ArrayList<>();
myTags.add(superMarioLand);
myTags.add(warioLand3);
myTags.add(donkeyKongLand);
myTags.sort(null); // That's it! :)

Build

This is a Maven project.

To build simply run

mvn install

To run the tests run

mvn test

Development

For command-line or GUI programs see gbstag and jbstag

Interface-segregation principle

There are a number of interfaces included for the GbsTag class.

  1. Tag - read/write all tags. Reads low-level tags
  2. LowLevel - read only, low-level tags
  3. ReadOnlyGbsTag - read only, all tags
  4. ReadOnlySimpleGbsTag - read only author, title and copyright
  5. SimpleGbsTag - read/write author, title and copyright

Documentation

Please refer to the Javadocs provided for further details.

Licence

LGPL v2.1 only

See COPYING

Further reading:

Libraries and copyright