1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2005 Dave Chapman
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
27 #include "metadata_common.h"
28 #include "rbunicode.h"
30 bool get_mod_metadata(int fd
, struct mp3entry
* id3
)
32 /* Use the trackname part of the id3 structure as a temporary buffer */
33 unsigned char buf
[1084];
38 if ((lseek(fd
, 0, SEEK_SET
) < 0)
39 || ((read_bytes
= read(fd
, buf
, sizeof(buf
))) < 1084))
44 /* We don't do file format checking here
45 * There can be .mod files without any signatures out there */
49 /* Copy Title as artist */
50 strcpy(p
, &buf
[0x00]);
54 id3
->bitrate
= filesize(fd
)/1024; /* size in kb */
55 id3
->frequency
= 44100;
56 id3
->length
= 120*1000;
58 id3
->filesize
= filesize(fd
);