1 /* the Music Player Daemon (MPD)
2 * Copyright (C) 2003-2007 by Warren Dukes (warren.dukes@gmail.com)
3 * This project's homepage is: http://www.musicpd.org
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "../config.h"
25 #include "mpd_types.h"
29 #include <sys/param.h>
32 #define DECODE_TYPE_FILE 0
33 #define DECODE_TYPE_URL 1
35 #define DECODE_STATE_STOP 0
36 #define DECODE_STATE_START 1
37 #define DECODE_STATE_DECODE 2
39 #define DECODE_ERROR_NOERROR 0
40 #define DECODE_ERROR_UNKTYPE 10
41 #define DECODE_ERROR_FILE 20
43 #define DECODE_SUFFIX_MP3 1
44 #define DECODE_SUFFIX_OGG 2
45 #define DECODE_SUFFIX_FLAC 3
46 #define DECODE_SUFFIX_AAC 4
47 #define DECODE_SUFFIX_MP4 5
48 #define DECODE_SUFFIX_WAVE 6
50 typedef struct _DecoderControl {
51 volatile mpd_sint8 state;
52 volatile mpd_sint8 stop;
53 volatile mpd_sint8 start;
54 volatile mpd_uint16 error;
55 volatile mpd_sint8 seek;
56 volatile mpd_sint8 seekError;
57 volatile mpd_sint8 seekable;
58 volatile mpd_sint8 cycleLogFiles;
59 volatile double seekWhere;
60 AudioFormat audioFormat;
61 char utf8url[MAXPATHLEN + 1];
62 volatile float totalTime;
65 void decodeSigHandler(int sig, siginfo_t * siginfo, void *v);