inLimbo
TUI Music Player that keeps you in Limbo.
 
Loading...
Searching...
No Matches
taglib_parser.h File Reference

A header file for the TagLibParser class and Metadata structure, used to parse metadata from audio files. More...

#include <filesystem>
#include <fstream>
#include <iostream>
#include <string>
#include <sys/stat.h>
#include <taglib/fileref.h>
#include <taglib/tag.h>
#include <taglib/id3v2tag.h>
#include <taglib/mpegfile.h>
#include <taglib/attachedpictureframe.h>
#include <taglib/tpropertymap.h>
#include <png.h>
#include <unordered_map>

Go to the source code of this file.

Classes

struct  Metadata
 A structure to hold metadata information for a song. More...
 
class  TagLibParser
 A class for parsing metadata from audio files. More...
 

Functions

void printMetadata (const Metadata &metadata)
 Prints the metadata of a song to the console.
 
void sendErrMsg (std::string debugLogBoolStr, std::string errMsg)
 Sends an error message based on the debug log setting.
 
bool extractThumbnail (const std::string &audioFilePath, const std::string &outputImagePath)
 Extracts the thumbnail (album art) from an audio file and saves it to an image file.
 

Variables

std::string debugLogBoolStr
 

Detailed Description

A header file for the TagLibParser class and Metadata structure, used to parse metadata from audio files.

This file defines a Metadata structure for storing song information such as title, artist, album, and more. It also defines the TagLibParser class for reading and extracting metadata from audio files using the TagLib library. In addition, the file provides utility functions for printing metadata, handling error messages, and extracting thumbnails from audio files.

Note: In the Emscripten build, dummy functions are used because TagLib must be compiled using Emscripten to function correctly in a web environment.

Function Documentation

◆ extractThumbnail()

bool extractThumbnail ( const std::string & audioFilePath,
const std::string & outputImagePath )

Extracts the thumbnail (album art) from an audio file and saves it to an image file.

Parameters
audioFilePathThe path to the audio file containing embedded album art.
outputImagePathThe path where the extracted album art image will be saved.
Returns
true if the thumbnail was successfully extracted, false otherwise.

◆ printMetadata()

void printMetadata ( const Metadata & metadata)

Prints the metadata of a song to the console.

Parameters
metadataThe metadata of the song to print.

◆ sendErrMsg()

void sendErrMsg ( std::string debugLogBoolStr,
std::string errMsg )

Sends an error message based on the debug log setting.

Parameters
debugLogBoolStrThe debug log setting ("true" or "false").
errMsgThe error message to send.

Variable Documentation

◆ debugLogBoolStr

std::string debugLogBoolStr