Class SoundFileInfo
java.lang.Object
de.mrjulsen.dragnsounds.core.filesystem.SoundFileInfo
- All Implemented Interfaces:
de.mrjulsen.mcdragonlib.data.INBTSerializable
A collection of read-only properties about the file.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deserializeNbt
(net.minecraft.nbt.CompoundTag nbt) static SoundFileInfo
empty()
static SoundFileInfo
fromNbt
(net.minecraft.nbt.CompoundTag nbt) getAlbum()
int
getDate()
long
A shortcut to get the playback duration of the sound file.getGenre()
long
getSize()
A shortcut to get the size of the sound file.long
static SoundFileInfo
net.minecraft.nbt.CompoundTag
-
Field Details
-
META_TITLE
- See Also:
-
META_ARTIST
- See Also:
-
META_YEAR
- See Also:
-
META_ALBUM
- See Also:
-
META_GENRE
- See Also:
-
-
Constructor Details
-
SoundFileInfo
-
-
Method Details
-
getDuration
public long getDuration()A shortcut to get the playback duration of the sound file. Use this method instead of other methods to calculate it, since it has higher performance. The value changes automatically when the file hash changes.- Returns:
- The playback duration in seconds.
-
getSize
public long getSize()A shortcut to get the size of the sound file. Use this method instead of other methods to calculate it, since it has higher performance. The value changes automatically when the file hash changes.- Returns:
- The size of the file in bytes.
-
getOwnerId
- Returns:
- The UUID of the player which has uploaded this file.
-
getUploadTimeMillis
public long getUploadTimeMillis()- Returns:
- The timestamp in millis when the player has uploaded this file.
-
getUploadDate
- Returns:
- A formatted representation of the time when the player has uploaded this file.
-
getUploadTimeFormatted
- Returns:
- A formatted representation of the time when the player has uploaded this file.
-
getOriginalTitle
- Returns:
- The original title of the sound file which has been uploaded.
-
getArtist
- Returns:
- The original artist of the sound file which has been uploaded.
-
getDate
- Returns:
- The original date of the sound file which has been uploaded.
-
getGenre
- Returns:
- The original genre of the sound file which has been uploaded.
-
getAlbum
- Returns:
- The original album of the sound file which has been uploaded.
-
getChannels
public int getChannels()- Returns:
- The amount of audio channels in this file.
-
fromNbt
-
serializeNbt
public net.minecraft.nbt.CompoundTag serializeNbt()- Specified by:
serializeNbt
in interfacede.mrjulsen.mcdragonlib.data.INBTSerializable
-
deserializeNbt
public void deserializeNbt(net.minecraft.nbt.CompoundTag nbt) - Specified by:
deserializeNbt
in interfacede.mrjulsen.mcdragonlib.data.INBTSerializable
-
empty
-
of
public static SoundFileInfo of(File file, UUID owner, long timestamp, int initialChannels, long initialDuration)
-