Commit 8810eafb authored by Warren Dukes's avatar Warren Dukes

add configuration variables for shout stuff

git-svn-id: https://svn.musicpd.org/mpd/trunk@2099 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent df50ddf5
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#define CONF_COMMENT '#' #define CONF_COMMENT '#'
#define CONF_NUMBER_OF_PARAMS 34 #define CONF_NUMBER_OF_PARAMS 41
#define CONF_NUMBER_OF_PATHS 6 #define CONF_NUMBER_OF_PATHS 6
#define CONF_NUMBER_OF_REQUIRED 5 #define CONF_NUMBER_OF_REQUIRED 5
#define CONF_NUMBER_OF_ALLOW_CATS 1 #define CONF_NUMBER_OF_ALLOW_CATS 1
...@@ -130,7 +130,14 @@ char ** readConf(char * file) { ...@@ -130,7 +130,14 @@ char ** readConf(char * file) {
"http_proxy_port", "http_proxy_port",
"http_proxy_user", "http_proxy_user",
"http_proxy_password", "http_proxy_password",
"replaygain_preamp" "replaygain_preamp",
"shout_host",
"shout_port",
"shout_password",
"shout_mount",
"shout_name",
"shout_user",
"shout_quality"
}; };
int conf_absolutePaths[CONF_NUMBER_OF_PATHS] = { int conf_absolutePaths[CONF_NUMBER_OF_PATHS] = {
......
...@@ -55,6 +55,13 @@ ...@@ -55,6 +55,13 @@
#define CONF_HTTP_PROXY_USER 31 #define CONF_HTTP_PROXY_USER 31
#define CONF_HTTP_PROXY_PASSWORD 32 #define CONF_HTTP_PROXY_PASSWORD 32
#define CONF_REPLAYGAIN_PREAMP 33 #define CONF_REPLAYGAIN_PREAMP 33
#define CONF_SHOUT_HOST 34
#define CONF_SHOUT_PORT 35
#define CONF_SHOUT_PASSWD 36
#define CONF_SHOUT_MOUNT 37
#define CONF_SHOUT_NAME 38
#define CONF_SHOUT_USER 39
#define CONF_SHOUT_QUALITY 40
#define CONF_CAT_CHAR "\n" #define CONF_CAT_CHAR "\n"
......
...@@ -95,16 +95,21 @@ static int mod_mikModInitiated = 0; ...@@ -95,16 +95,21 @@ static int mod_mikModInitiated = 0;
static int mod_mikModInitError = 0; static int mod_mikModInitError = 0;
static int mod_initMikMod() { static int mod_initMikMod() {
if(mod_mikModInitiated) return 0;
if(mod_mikModInitError) return -1; if(mod_mikModInitError) return -1;
mod_mikModInitiated = 1; if(!mod_mikModInitiated) {
mod_mikModInitiated = 1;
MikMod_RegisterDriver(&drv_mpd); md_device = 0;
MikMod_RegisterAllLoaders(); md_reverb = 0;
md_reverb = 0; MikMod_RegisterDriver(&drv_mpd);
md_mode = (DMODE_SOFT_MUSIC | DMODE_SOFT_SNDFX | DMODE_STEREO | MikMod_RegisterAllLoaders();
}
md_pansep = 64;
md_mixfreq = 44100;
md_mode = (DMODE_SOFT_MUSIC | DMODE_INTERP | DMODE_STEREO |
DMODE_16BITS); DMODE_16BITS);
if(MikMod_Init("")) { if(MikMod_Init("")) {
...@@ -130,7 +135,7 @@ static mod_Data * mod_open(char * path) { ...@@ -130,7 +135,7 @@ static mod_Data * mod_open(char * path) {
MODULE * moduleHandle; MODULE * moduleHandle;
mod_Data * data; mod_Data * data;
if(!(moduleHandle = Player_Load(path, 255, 0))) return NULL; if(!(moduleHandle = Player_Load(path, 128, 0))) return NULL;
data = malloc(sizeof(mod_Data)); data = malloc(sizeof(mod_Data));
...@@ -159,6 +164,7 @@ int mod_decode(OutputBuffer * cb, DecoderControl * dc, char * path) { ...@@ -159,6 +164,7 @@ int mod_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
if(!(data = mod_open(path))) { if(!(data = mod_open(path))) {
ERROR("failed to open mod: %s\n", path); ERROR("failed to open mod: %s\n", path);
MikMod_Exit();
return -1; return -1;
} }
...@@ -192,6 +198,8 @@ int mod_decode(OutputBuffer * cb, DecoderControl * dc, char * path) { ...@@ -192,6 +198,8 @@ int mod_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
mod_close(data); mod_close(data);
MikMod_Exit();
if(dc->stop) { if(dc->stop) {
dc->state = DECODE_STATE_STOP; dc->state = DECODE_STATE_STOP;
dc->stop = 0; dc->stop = 0;
...@@ -207,7 +215,7 @@ MpdTag * modTagDup(char * file) { ...@@ -207,7 +215,7 @@ MpdTag * modTagDup(char * file) {
if(mod_initMikMod() < 0) return NULL; if(mod_initMikMod() < 0) return NULL;
if(!(moduleHandle = Player_Load(file, 255, 0))) return NULL; if(!(moduleHandle = Player_Load(file, 128, 0))) goto fail;
Player_Free(moduleHandle); Player_Free(moduleHandle);
...@@ -216,6 +224,9 @@ MpdTag * modTagDup(char * file) { ...@@ -216,6 +224,9 @@ MpdTag * modTagDup(char * file) {
ret->time = 0; ret->time = 0;
ret->title = Player_LoadTitle(file); ret->title = Player_LoadTitle(file);
fail:
MikMod_Exit();
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment