added some comments for how the metadata interface should be used.
This commit is contained in:
parent
02a65651ea
commit
810db62c18
@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* Metadata for audio. Not thread-safe.
|
||||||
|
* @author yunya
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
package zero1hd.rhythmbullet.audio;
|
package zero1hd.rhythmbullet.audio;
|
||||||
|
|
||||||
import com.badlogic.gdx.files.FileHandle;
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
@ -5,23 +11,57 @@ import com.badlogic.gdx.graphics.Texture;
|
|||||||
import com.badlogic.gdx.utils.Disposable;
|
import com.badlogic.gdx.utils.Disposable;
|
||||||
|
|
||||||
public interface AudioMetadata extends Disposable {
|
public interface AudioMetadata extends Disposable {
|
||||||
|
/**
|
||||||
|
* Load the album art data in to memory.
|
||||||
|
*/
|
||||||
public void loadAlbumCover();
|
public void loadAlbumCover();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unloads album art from memory.
|
||||||
|
*/
|
||||||
public void unloadAlbumCover();
|
public void unloadAlbumCover();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the author for the song in the metadata.
|
||||||
|
*/
|
||||||
public String getAuthor();
|
public String getAuthor();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the length of the song with proper fomatting.
|
||||||
|
*/
|
||||||
public String getLength();
|
public String getLength();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the texture. Needs to be loaded before hand or else will return null.
|
||||||
|
*/
|
||||||
public Texture getAlbumCover();
|
public Texture getAlbumCover();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return returns the genre of the song stored in metadata.
|
||||||
|
*/
|
||||||
public String getGenre();
|
public String getGenre();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the filehandle.
|
||||||
|
*/
|
||||||
public FileHandle getFileHandle();
|
public FileHandle getFileHandle();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the extra metadata for RhythmBullet.
|
||||||
|
*/
|
||||||
public RhythmBulletMetadata getRBMetadata();
|
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();
|
public boolean flushRBMetadata();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -119,7 +119,6 @@ public class MP3Metadata implements AudioMetadata {
|
|||||||
fileHandle = Gdx.files.absolute(path);
|
fileHandle = Gdx.files.absolute(path);
|
||||||
return true;
|
return true;
|
||||||
} catch (UnsupportedTagException | InvalidDataException | IOException | NotSupportedException e) {
|
} catch (UnsupportedTagException | InvalidDataException | IOException | NotSupportedException e) {
|
||||||
e.printStackTrace();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user