added some comments for how the metadata interface should be used.

This commit is contained in:
Harrison Deng 2018-07-19 19:05:23 -05:00
parent 02a65651ea
commit 810db62c18
2 changed files with 42 additions and 3 deletions

View File

@ -1,3 +1,9 @@
/**
* Metadata for audio. Not thread-safe.
* @author yunya
*
*/
package zero1hd.rhythmbullet.audio;
import com.badlogic.gdx.files.FileHandle;
@ -5,23 +11,57 @@ import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.utils.Disposable;
public interface AudioMetadata extends Disposable {
/**
* Load the album art data in to memory.
*/
public void loadAlbumCover();
/**
* Unloads album art from memory.
*/
public void unloadAlbumCover();
/**
*
* @return the author for the song in the metadata.
*/
public String getAuthor();
/**
*
* @return the length of the song with proper fomatting.
*/
public String getLength();
/**
*
* @return the texture. Needs to be loaded before hand or else will return null.
*/
public Texture getAlbumCover();
/**
*
* @return returns the genre of the song stored in metadata.
*/
public String getGenre();
/**
*
* @return the filehandle.
*/
public FileHandle getFileHandle();
/**
*
* @return the extra metadata for RhythmBullet.
*/
public RhythmBulletMetadata getRBMetadata();
/**
* This method effectively overwrites the mp3 file by creating a copy of it with the new metadata, and the deleting the old one, and renaming the new on to the old ones name.
* This is the suggested way of doing things by the library author in this thread: https://github.com/mpatric/mp3agic/issues/69
* @return true if succeeded in overwrite, and false if failed.
*/
public boolean flushRBMetadata();
@Override

View File

@ -119,7 +119,6 @@ public class MP3Metadata implements AudioMetadata {
fileHandle = Gdx.files.absolute(path);
return true;
} catch (UnsupportedTagException | InvalidDataException | IOException | NotSupportedException e) {
e.printStackTrace();
return false;
}
}