From 810db62c18e242e328f06a5e46f757e4a4b3ee41 Mon Sep 17 00:00:00 2001 From: Recrown Date: Thu, 19 Jul 2018 19:05:23 -0500 Subject: [PATCH] added some comments for how the metadata interface should be used. --- .../rhythmbullet/audio/AudioMetadata.java | 44 ++++++++++++++++++- .../rhythmbullet/audio/MP3Metadata.java | 1 - 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/core/src/zero1hd/rhythmbullet/audio/AudioMetadata.java b/core/src/zero1hd/rhythmbullet/audio/AudioMetadata.java index ec60475..dcf9776 100755 --- a/core/src/zero1hd/rhythmbullet/audio/AudioMetadata.java +++ b/core/src/zero1hd/rhythmbullet/audio/AudioMetadata.java @@ -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 diff --git a/core/src/zero1hd/rhythmbullet/audio/MP3Metadata.java b/core/src/zero1hd/rhythmbullet/audio/MP3Metadata.java index 2db857f..1d7616e 100755 --- a/core/src/zero1hd/rhythmbullet/audio/MP3Metadata.java +++ b/core/src/zero1hd/rhythmbullet/audio/MP3Metadata.java @@ -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; } }