mod_musicindex  1.4.1
playlist-flac.c File Reference

Flac files management system. More...

#include "playlist.h"
#include "playlist-flac.h"
#include <FLAC/format.h>
#include <FLAC/metadata.h>

Go to the source code of this file.

Functions

static short flac_ext_check (const char *const filename)
 Checks for valid FLAC filename extension.
mu_entmake_flac_entry (request_rec *r, apr_pool_t *pool, FILE *const in, const char *const filename)
 Fills in the information fields about FLAC data.

Detailed Description

Flac files management system.

Author
Regis Boudin
Thibaut Varene
Version
Revision:
1010
Date
2004-2005
2007

This file contains everything needed to produce music entries from Flac files.

Definition in file playlist-flac.c.

Function Documentation

static short flac_ext_check ( const char *const  filename)
inlinestatic

Checks for valid FLAC filename extension.

FLAC is an arse dealing with unknown files, we /really/ want to have this check. Valid extensions are .flac and .fla

Parameters
filenameThe filename to check.
Warning
Will match anything with .fla*. Not a big deal since the flac handler will discard the file if it's not a true FLAC file anyway.
Returns
TRUE when the extension is correct, FALSE otherwise.

Definition at line 52 of file playlist-flac.c.

References FALSE, and TRUE.

Referenced by make_flac_entry().

mu_ent* make_flac_entry ( request_rec *  r,
apr_pool_t pool,
FILE *const  in,
const char *const  filename 
)

Fills in the information fields about FLAC data.

This function reads the ogg tags (using libFLAC) from the flac file in and fills in the struct mu_ent fields accordingly. If the file is not an ogg one, the function returns head.

Parameters
poolPool
inogg file to parse (closed on normal exit)
filenamecurrent filename
rApache request_rec struct to handle log writings (debugging)
Returns
When possible, struct mu_ent correctly set up, file stream closed.

Definition at line 74 of file playlist-flac.c.

References mu_ent::album, apr_pstrndup, mu_ent::artist, mu_ent::bitrate, mu_ent::date, EF_VBR, mu_ent::filetype, flac_ext_check(), mu_ent::flags, mu_ent::freq, FT_FLAC, mu_ent::length, MI_QUICKPL, mu_ent::mtime, musicindex_module, NEW_ENT, mu_config::options, mu_ent::posn, mu_ent::size, mu_ent::title, and mu_ent::track.