void rlm_spottrap_RLMPadDataSent(void *ptr,const struct rlm_svc *svc, const struct rlm_log *log, const struct rlm_pad *now, const struct rlm_pad *next) { int i; int flag=0; char msg[1500]; for(i=0;i<rlm_spottrap_devs;i++) { switch(log->log_mach) { case 0: flag=rlm_spottrap_masters[i]; break; case 1: flag=rlm_spottrap_aux1s[i]; break; case 2: flag=rlm_spottrap_aux2s[i]; break; } if((flag==1)||((flag==2)&&(log->log_onair!=0))) { if((strcasecmp(now->rlm_group,rlm_spottrap_groups+16*i)==0)&& (now->rlm_len>=rlm_spottrap_minimums[i])&& (now->rlm_len<=rlm_spottrap_maximums[i])) { const char *str= RLMResolveNowNext(ptr,now,next,rlm_spottrap_formats+256*i); RLMSendUdp(ptr,rlm_spottrap_addresses+i*16,rlm_spottrap_ports[i], str,strlen(str)); snprintf(msg,1500,"rlm_spottrap: sending pad update: \"%s\"", (const char *)str); RLMLog(ptr,LOG_INFO,msg); } else { const char *str= RLMResolveNowNext(ptr,now,next,rlm_spottrap_default_formats+256*i); RLMSendUdp(ptr,rlm_spottrap_addresses+i*16,rlm_spottrap_ports[i], str,strlen(str)); snprintf(msg,1500,"rlm_spottrap: sending default pad update: \"%s\"", (const char *)str); RLMLog(ptr,LOG_INFO,msg); } } } }
void rlm_walltime_RLMPadDataSent(void *ptr,const struct rlm_svc *svc, const struct rlm_log *log, const struct rlm_pad *now, const struct rlm_pad *next) { int i; int flag=0; char timer[1500]; FILE *f; for(i=0;i<rlm_walltime_devs;i++) { switch(log->log_mach) { case 0: flag=rlm_walltime_masters[i]; break; case 1: flag=rlm_walltime_aux1s[i]; break; case 2: flag=rlm_walltime_aux2s[i]; break; } if((flag==1)||((flag==2)&&(log->log_onair!=0))) { f=fopen("/var/www/html/walltime/walltime.html","w"); if(now->rlm_len==0) { snprintf(timer,1500, "SP!RS!WU http://%s/walltime/walltime.html!", rlm_walltime_host_addresses+16*i); fprintf(f,"<body bgcolor=\"#000000\"> </body>"); } else { snprintf(timer,1500, "SM D!PS %d!ST!WU http://%s/walltime/walltime.html!", now->rlm_len/1000, rlm_walltime_host_addresses+16*i); fprintf(f,"%s\n", RLMResolveNowNextEncoded(ptr,now,next,rlm_walltime_formats+8192*i, RLM_ENCODE_XML)); } fclose(f); RLMSendUdp(ptr,rlm_walltime_addresses+i*16,rlm_walltime_ports[i], timer,strlen(timer)); RLMLog(ptr,LOG_INFO,"rlm_walltime: sending pad update!"); } } }
void rlm_liqcomp_RLMPadDataSent(void *ptr,const char *svcname,int onair, int lognum,const struct rlm_pad *now, const struct rlm_pad *next) { int i; int flag=0; char fmt[1500]; char msg[1500]; for(i=0;i<rlm_liqcomp_devs;i++) { switch(lognum) { case 0: flag=rlm_liqcomp_masters[i]; break; case 1: flag=rlm_liqcomp_aux1s[i]; break; case 2: flag=rlm_liqcomp_aux2s[i]; break; } if((flag==1)||((flag==2)&&(onair!=0))) { snprintf(fmt,1500,"|%s|%s|%06u|%u|%s|%s|%s|\n", rlm_liqcomp_titles+256*i, rlm_liqcomp_artists+256*i, now->rlm_cartnum, now->rlm_len, now->rlm_group, rlm_liqcomp_albums+256*i, rlm_liqcomp_labels+256*i); const char *str=RLMResolveNowNext(ptr,now,next,fmt); RLMSendUdp(ptr,rlm_liqcomp_addresses+i*16,rlm_liqcomp_ports[i],str, strlen(str)); snprintf(msg,1500,"rlm_liqcomp: sending pad update: \"%s\"", (const char *)str); RLMLog(ptr,LOG_INFO,msg); } } }
void rlm_inno713_SendString(void *ptr,const struct rlm_pad *now, const struct rlm_pad *next,const char *tag, const char *fmt,const char *addr,uint16_t port, int handle) { char pkt[1024]; if(strlen(fmt)>0) { const char *str=RLMResolveNowNext(ptr,now,next,fmt); if(strlen(str)>0) { sprintf(pkt,"%s=%s\r\n",tag,str); rlm_inno713_Upcase(pkt); if(strlen(addr)>0) { RLMSendUdp(ptr,addr,port,pkt,strlen(pkt)); } if(handle>=0) { RLMSendSerial(ptr,handle,pkt,strlen(pkt)); } } } }