1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2005 Dave Chapman
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
29 #include "metadata_common.h"
30 #include "metadata_parsers.h"
31 #include "rbunicode.h"
33 bool get_mod_metadata(int fd
, struct mp3entry
* id3
)
35 /* Use the trackname part of the id3 structure as a temporary buffer */
36 unsigned char buf
[1084];
41 if ((lseek(fd
, 0, SEEK_SET
) < 0)
42 || ((read_bytes
= read(fd
, buf
, sizeof(buf
))) < 1084))
47 /* We don't do file format checking here
48 * There can be .mod files without any signatures out there */
52 /* Copy Title as artist */
53 strcpy(p
, &buf
[0x00]);
57 id3
->bitrate
= filesize(fd
)/1024; /* size in kb */
58 id3
->frequency
= 44100;
59 id3
->length
= 120*1000;
61 id3
->filesize
= filesize(fd
);