void stream_encoder::set_config(const dsp_preset&p_data){
	edcastGlobals*cfg=(edcastGlobals*)p_data.get_data();
		
	config->currentBitrate=cfg->currentBitrate;
	config->currentSamplerate=cfg->currentSamplerate;
	config->currentChannels=cfg->currentChannels;
	config->currentSamplerate=cfg->currentSamplerate;
	config->gOggBitQualFlag=cfg->gOggBitQualFlag;
	config->gReconnectSec=cfg->gReconnectSec;
	config->gShoutcastFlag=cfg->gShoutcastFlag;
	config->gIcecast2Flag=cfg->gIcecast2Flag;
	config->gPubServ=cfg->gPubServ;
	strcpy(config->gEncodeType,cfg->gEncodeType);
	strcpy(config->gOggQuality,cfg->gOggQuality);
	strcpy(config->gMountpoint,cfg->gMountpoint);
	strcpy(config->gPassword,cfg->gPassword);
	strcpy(config->gServer, cfg->gServer);
	strcpy(config->gPort, cfg->gPort);
	strcpy(config->gServerType,cfg->gServerType);
	strcpy(config->gServDesc,cfg->gServDesc);
	strcpy(config->gServName,cfg->gServName);
	strcpy(config->gServGenre,cfg->gServGenre);
	strcpy(config->gServURL,cfg->gServURL);
	strcpy(config->gServAIM,cfg->gServAIM);
	strcpy(config->gServICQ,cfg->gServICQ);
	strcpy(config->gServIRC,cfg->gServIRC);
//	disconnect();
//	connect();
}
bool stream_encoder::can_attach(const dsp_preset&p_data){
	edcastGlobals*cfg=(edcastGlobals*)p_data.get_data();
	bool hax=true;
	hax&=!strcmp(config->gMountpoint,cfg->gMountpoint);
	hax&=!strcmp(config->gPassword,cfg->gPassword);
	hax&=!strcmp(config->gServer,cfg->gServer);
	hax&=!strcmp(config->gPort,cfg->gPort);
	return hax;	
}