#ifndef mice_metadata_h
#define mice_metadata_h

#include <stdint.h>
#include <stdbool.h>

#define METADATA_TITLE_MAX 64
#define METADATA_ARTIST_MAX 64
#define METADATA_ALBUM_MAX 64

struct metadata_t
{
	char title[METADATA_TITLE_MAX];
	char artist[METADATA_ARTIST_MAX];
	char album[METADATA_ALBUM_MAX];
};

/**
 * Extract metadata from an audio file
 * 
 * \param	file		Path to the audio file
 * \param	metadata	Pointer to metadata structure to fill
 * \return				0 on success, -1 on failure
 */
int extractMetadata(const char* file, struct metadata_t* metadata);

/**
 * Clear metadata structure and free any allocated memory
 * 
 * \param	metadata	Pointer to metadata structure to clear
 */
void clearMetadata(struct metadata_t* metadata);

/**
 * Display metadata on the top screen
 * 
 * \param	metadata	Pointer to metadata structure to display
 * \param	filename	Filename to display if no title is available
 */
void displayMetadata(struct metadata_t* metadata, const char* filename);

#endif