2007-02-24 17:16:39 -05:00
|
|
|
/*
|
|
|
|
* ezstream - source client for Icecast with external en-/decoder support
|
|
|
|
* Copyright (C) 2003, 2004, 2005, 2006 Ed Zaleski <oddsock@oddsock.org>
|
2007-07-13 21:32:28 -04:00
|
|
|
* Copyright (C) 2007 Moritz Grimm <mdgrimm@gmx.net>
|
2007-02-24 17:16:39 -05:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-02-24 17:16:39 -05:00
|
|
|
#ifndef __CONFIGFILE_H__
|
|
|
|
#define __CONFIGFILE_H__
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-02-24 17:16:39 -05:00
|
|
|
#include <libxml/parser.h>
|
2004-01-30 12:19:45 -05:00
|
|
|
|
2007-02-24 17:16:39 -05:00
|
|
|
#define MP3_FORMAT "MP3"
|
|
|
|
#define VORBIS_FORMAT "VORBIS"
|
|
|
|
#define THEORA_FORMAT "THEORA"
|
2004-07-18 23:12:31 -04:00
|
|
|
|
|
|
|
#define MAX_FORMAT_ENCDEC 15
|
|
|
|
|
2007-02-24 17:16:39 -05:00
|
|
|
#define TRACK_PLACEHOLDER "@T@"
|
|
|
|
#define METADATA_PLACEHOLDER "@M@"
|
2007-03-09 21:27:48 -05:00
|
|
|
#define ARTIST_PLACEHOLDER "@a@"
|
|
|
|
#define TITLE_PLACEHOLDER "@t@"
|
2007-03-10 14:03:07 -05:00
|
|
|
#define STRING_PLACEHOLDER "@s@"
|
2007-02-24 17:16:39 -05:00
|
|
|
|
2004-07-18 23:12:31 -04:00
|
|
|
typedef struct tag_FORMAT_ENCDEC {
|
|
|
|
char *format;
|
|
|
|
char *match;
|
|
|
|
char *encoder;
|
|
|
|
char *decoder;
|
|
|
|
} FORMAT_ENCDEC;
|
2004-01-30 12:19:45 -05:00
|
|
|
|
|
|
|
typedef struct tag_EZCONFIG {
|
2007-02-24 17:16:39 -05:00
|
|
|
char *URL;
|
|
|
|
char *password;
|
|
|
|
char *format;
|
|
|
|
char *fileName;
|
2007-03-08 21:30:29 -05:00
|
|
|
char *metadataProgram;
|
2007-03-10 14:03:07 -05:00
|
|
|
char *metadataFormat;
|
2007-02-24 17:16:39 -05:00
|
|
|
char *serverName;
|
|
|
|
char *serverURL;
|
|
|
|
char *serverGenre;
|
|
|
|
char *serverDescription;
|
|
|
|
char *serverBitrate;
|
|
|
|
char *serverChannels;
|
|
|
|
char *serverSamplerate;
|
|
|
|
char *serverQuality;
|
|
|
|
int serverPublic;
|
|
|
|
int reencode;
|
2004-07-18 23:12:31 -04:00
|
|
|
FORMAT_ENCDEC *encoderDecoders[MAX_FORMAT_ENCDEC];
|
2007-02-24 17:16:39 -05:00
|
|
|
int numEncoderDecoders;
|
|
|
|
int shuffle;
|
2007-02-28 16:26:16 -05:00
|
|
|
int fileNameIsProgram;
|
2007-02-28 16:48:01 -05:00
|
|
|
int streamOnce;
|
2007-03-01 19:57:11 -05:00
|
|
|
unsigned int reconnectAttempts;
|
2004-01-30 12:19:45 -05:00
|
|
|
} EZCONFIG;
|
|
|
|
|
2007-02-24 17:16:39 -05:00
|
|
|
EZCONFIG * getEZConfig(void);
|
Various cleanups and auto-fu tweaks.
* Make Makefile.am files look alike as much as possible.
* Remove debug: target and don't mess with the users DEBUG environment
variable: Autoconf checks for -g and automatically adds it to CFLAGS, which
is overridden by the user's $DEBUG. If the user didn't specify one, "make
install" will strip the resulting binaries and leave the debugging symbols
intact otherwise.
* Remove profile: target, as it is quite pointless in Ezstream. Also, the user
can add profiling flags via the $DEBUG variable as well.
* Remove -ffast-math and -fsigned-char from gcc, and enable two additional
warnings instead.
* Unconfuse Solaris compiler flags (unfortunately, the configure script still
fails in the libshout check with some obscure linker error): Do not force
-x04 and -fast optimizations, let the user decide (it doesn't matter for
Ezstream anyways.) Remove -xgc92, which is deprecated and actually makes
the resulting binary run slower on SPARC. Also remove -fsimple, which does
not help and has the potential of causing trouble, and don't enable verbose
warnings just to disable them afterwards with -w. Leave only -v for verbose
warnings.
* Const'ify getFormat*() functions and blankString, and squelch a few const-
related warnings.
* Squelch a signedness warning and fix two ;; syntax errors.
* Add a snapshot target to Makefile.am that creates a tarball of the form
ezstream-snapshot-YYYYMMDD.tar.gz.
git-svn-id: https://svn.xiph.org/trunk/ezstream@12562 0101bb08-14d6-0310-b084-bc0e0c8e3800
2007-02-25 09:00:15 -05:00
|
|
|
const char * getFormatEncoder(const char *format);
|
|
|
|
const char * getFormatDecoder(const char *match);
|
2007-02-24 17:50:14 -05:00
|
|
|
int parseConfig(const char *fileName);
|
2004-07-18 23:12:31 -04:00
|
|
|
|
2007-02-24 17:16:39 -05:00
|
|
|
#endif /* __CONFIGFILE_H__ */
|