Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ullenius/gbs-lib

A Java library for reading GBS-files and reading / manipulating the tags
https://github.com/ullenius/gbs-lib

gameboy gameboy-color gbs java lgplv2 maven tagger

Last synced: 24 days ago
JSON representation

A Java library for reading GBS-files and reading / manipulating the tags

Awesome Lists containing this project

README

        

# 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
* :heavy_check_mark: 100% Java (Java 8) :coffee:
* :heavy_check_mark: Supports UTF-8 encoding in the tags!
* Implements Comparable for sorting out of the box!

## How to use it

### Opening a gbs file
```java

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
```java
gbsfile.save();
```

### Setting tag values
```java
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
```java
List 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
```sh
mvn install
```

To run the tests run
```sh
mvn test
```

## Development
For command-line or GUI programs see [gbstag](https://www.github.com/ullenius/gbstag) and [jbstag](https://www.github.com/ullenius/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
1. LowLevel - read only, low-level tags
1. ReadOnlyGbsTag - read only, all tags
1. ReadOnlySimpleGbsTag - read only author, title and copyright
1. SimpleGbsTag - read/write author, title and copyright

### Documentation
Please refer to the [Javadocs provided](https://ullenius.github.io/gbs-lib/) for further details.

## Licence
LGPL v2.1 only

See [COPYING](COPYING)

Further reading:
* [The perils of LGPLv3](https://nikmav.blogspot.com/2013/03/the-perils-of-lgplv3.html)
* FSF [LGPL compatibility matrix](http://gplv3.fsf.org/dd3-faq#gpl-compat-matrix)

### Libraries and copyright
* Image by [Flappiefh](https://fr.wikipedia.org/wiki/Utilisateur:Flappiefh) (2013) from Wikimedia Commons. [Creative Commons Attribution-Share-Alike 3.0 Unported licence](https://creativecommons.org/licenses/by-sa/3.0/deed.en).