mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-23 16:08:15 +02:00
2018-12-20 Fred Gleason <fredg@paravelsystems.com>
* Added a 'pypad_liqcomp.py' PyPAD script. * Removed the 'rlm_liqcomp' RLM.
This commit is contained in:
parent
ca76777c11
commit
8b16cb1b58
@ -18248,3 +18248,6 @@
|
|||||||
2018-12-20 Fred Gleason <fredg@paravelsystems.com>
|
2018-12-20 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Added a 'pypad_ando.py' PyPAD script.
|
* Added a 'pypad_ando.py' PyPAD script.
|
||||||
* Removed the 'rlm_ando' RLM.
|
* Removed the 'rlm_ando' RLM.
|
||||||
|
2018-12-20 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Added a 'pypad_liqcomp.py' PyPAD script.
|
||||||
|
* Removed the 'rlm_liqcomp' RLM.
|
||||||
|
@ -28,6 +28,8 @@ install-exec-am:
|
|||||||
cp pypad_filewrite.exemplar $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_filewrite.exemplar
|
cp pypad_filewrite.exemplar $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_filewrite.exemplar
|
||||||
../../../helpers/install_python.sh pypad_live365.py $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.py
|
../../../helpers/install_python.sh pypad_live365.py $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.py
|
||||||
cp pypad_live365.exemplar $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.exemplar
|
cp pypad_live365.exemplar $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.exemplar
|
||||||
|
../../../helpers/install_python.sh pypad_liqcomp.py $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_liqcomp.py
|
||||||
|
cp pypad_liqcomp.exemplar $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_liqcomp.exemplar
|
||||||
../../../helpers/install_python.sh pypad_spinitron.py $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_spinitron.py
|
../../../helpers/install_python.sh pypad_spinitron.py $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_spinitron.py
|
||||||
cp pypad_spinitron.exemplar $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_spinitron.exemplar
|
cp pypad_spinitron.exemplar $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_spinitron.exemplar
|
||||||
../../../helpers/install_python.sh pypad_udp.py $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_udp.py
|
../../../helpers/install_python.sh pypad_udp.py $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_udp.py
|
||||||
@ -44,6 +46,8 @@ uninstall-local:
|
|||||||
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_filewrite.py
|
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_filewrite.py
|
||||||
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.exemplar
|
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.exemplar
|
||||||
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.py
|
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_live365.py
|
||||||
|
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_liqcomp.exemplar
|
||||||
|
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_liqcomp.py
|
||||||
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_spinitron.exemplar
|
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_spinitron.exemplar
|
||||||
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_spinitron.py
|
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_spinitron.py
|
||||||
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_udp.exemplar
|
rm -f $(DESTDIR)$(prefix)/@RD_LIB_PATH@/rivendell/PyPAD/pypad_udp.exemplar
|
||||||
@ -57,6 +61,8 @@ EXTRA_DIST = pypad_ando.exemplar\
|
|||||||
pypad_ando.py\
|
pypad_ando.py\
|
||||||
pypad_filewrite.exemplar\
|
pypad_filewrite.exemplar\
|
||||||
pypad_filewrite.py\
|
pypad_filewrite.py\
|
||||||
|
pypad_liqcomp.exemplar\
|
||||||
|
pypad_liqcomp.py\
|
||||||
pypad_live365.exemplar\
|
pypad_live365.exemplar\
|
||||||
pypad_live365.py\
|
pypad_live365.py\
|
||||||
pypad_spinitron.exemplar\
|
pypad_spinitron.exemplar\
|
||||||
|
94
apis/PyPAD/scripts/pypad_liqcomp.exemplar
Normal file
94
apis/PyPAD/scripts/pypad_liqcomp.exemplar
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
; This is the configuration for the 'pypad_liqcomp.py' module for
|
||||||
|
; Rivendell, which can be used to output Now & Next data to one or more
|
||||||
|
; Liquid Compass Internet streaming encoders, using the following format:
|
||||||
|
;
|
||||||
|
; |<title>|<artist>|<cart-num>|<length>|<group>|<album>|<label>|<lf>
|
||||||
|
|
||||||
|
; Section Header
|
||||||
|
;
|
||||||
|
; One section per remote encoder is configured, starting with 'System1' and
|
||||||
|
; working up consecutively
|
||||||
|
[System1]
|
||||||
|
|
||||||
|
; IP Address
|
||||||
|
;
|
||||||
|
; The IP address of the remote encoder, in dotted-quad notation.
|
||||||
|
;IpAddress=192.168.10.22
|
||||||
|
IpAddress=127.0.0.1
|
||||||
|
|
||||||
|
; UDP Port
|
||||||
|
;
|
||||||
|
; The UDP port number of the remote encoder, in the range 0 - 65,535.
|
||||||
|
UdpPort=5273
|
||||||
|
|
||||||
|
; Field Definitions. The string to use to populate the <title>, <artist>,
|
||||||
|
; <album> and <label> fields sent to ANDO each time RDAirPlay changes play
|
||||||
|
; state. These can include wildcards as placeholders for metadata values.
|
||||||
|
; For the list of supported wildcards. see the 'Metadata Wildcards' section
|
||||||
|
; of the Rivendell Operations Guide.
|
||||||
|
Title=%t
|
||||||
|
Artist=%a
|
||||||
|
Album=%l
|
||||||
|
Label=%b
|
||||||
|
|
||||||
|
; Log Selection
|
||||||
|
;
|
||||||
|
; Set the status for each log to 'Yes', 'No' or 'Onair' to indicate whether
|
||||||
|
; state changes on that log should be output on this udp port. If set
|
||||||
|
; to 'Onair', then output will be generated only if the RDAirPlay OnAir flag
|
||||||
|
; is active.
|
||||||
|
MasterLog=Yes
|
||||||
|
Aux1Log=Yes
|
||||||
|
Aux2Log=Yes
|
||||||
|
VLog101=No
|
||||||
|
VLog102=No
|
||||||
|
VLog103=No
|
||||||
|
VLog104=No
|
||||||
|
VLog105=No
|
||||||
|
VLog106=No
|
||||||
|
VLog107=No
|
||||||
|
VLog108=No
|
||||||
|
VLog109=No
|
||||||
|
VLog110=No
|
||||||
|
VLog111=No
|
||||||
|
VLog112=No
|
||||||
|
VLog113=No
|
||||||
|
VLog114=No
|
||||||
|
VLog115=No
|
||||||
|
VLog116=No
|
||||||
|
VLog117=No
|
||||||
|
VLog118=No
|
||||||
|
VLog119=No
|
||||||
|
VLog120=No
|
||||||
|
|
||||||
|
|
||||||
|
; Additional encoders can be configured by adding new sections...
|
||||||
|
;[System2]
|
||||||
|
;IpAddress=192.168.10.22
|
||||||
|
;UdpPort=6789
|
||||||
|
;Title=%u
|
||||||
|
;Artist=%a
|
||||||
|
;Album=%p
|
||||||
|
;MasterLog=Yes
|
||||||
|
;Aux1Log=No
|
||||||
|
;Aux2Log=Onair
|
||||||
|
;VLog101=No
|
||||||
|
;VLog102=No
|
||||||
|
;VLog103=No
|
||||||
|
;VLog104=No
|
||||||
|
;VLog105=No
|
||||||
|
;VLog106=No
|
||||||
|
;VLog107=No
|
||||||
|
;VLog108=No
|
||||||
|
;VLog109=No
|
||||||
|
;VLog110=No
|
||||||
|
;VLog111=No
|
||||||
|
;VLog112=No
|
||||||
|
;VLog113=No
|
||||||
|
;VLog114=No
|
||||||
|
;VLog115=No
|
||||||
|
;VLog116=No
|
||||||
|
;VLog117=No
|
||||||
|
;VLog118=No
|
||||||
|
;VLog119=No
|
||||||
|
;VLog120=No
|
72
apis/PyPAD/scripts/pypad_liqcomp.py
Executable file
72
apis/PyPAD/scripts/pypad_liqcomp.py
Executable file
@ -0,0 +1,72 @@
|
|||||||
|
#!%PYTHON_BANGPATH%
|
||||||
|
|
||||||
|
# pypad_liqcomp.py
|
||||||
|
#
|
||||||
|
# Send PAD updates to a Liquid Compass stream encoder
|
||||||
|
#
|
||||||
|
# (C) Copyright 2018 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
|
# published by the Free Software Foundation.
|
||||||
|
#
|
||||||
|
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
#
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import socket
|
||||||
|
import configparser
|
||||||
|
import PyPAD
|
||||||
|
|
||||||
|
last_updates={}
|
||||||
|
|
||||||
|
def eprint(*args,**kwargs):
|
||||||
|
print(*args,file=sys.stderr,**kwargs)
|
||||||
|
|
||||||
|
def ProcessPad(update):
|
||||||
|
try:
|
||||||
|
last_updates[update.machine()]
|
||||||
|
except KeyError:
|
||||||
|
last_updates[update.machine()]=None
|
||||||
|
|
||||||
|
n=1
|
||||||
|
while(True):
|
||||||
|
section='System'+str(n)
|
||||||
|
try:
|
||||||
|
if update.shouldBeProcessed(section) and update.hasPadType(PyPAD.TYPE_NOW) and (last_updates[update.machine()] != update.startDateTimeString(PyPAD.TYPE_NOW)):
|
||||||
|
last_updates[update.machine()]=update.startDateTimeString(PyPAD.TYPE_NOW)
|
||||||
|
title=update.resolvePadFields(update.config().get(section,'Title'),PyPAD.ESCAPE_NONE)
|
||||||
|
artist=update.resolvePadFields(update.config().get(section,'Artist'),PyPAD.ESCAPE_NONE)
|
||||||
|
album=update.resolvePadFields(update.config().get(section,'Album'),PyPAD.ESCAPE_NONE)
|
||||||
|
label=update.resolvePadFields(update.config().get(section,'Label'),PyPAD.ESCAPE_NONE)
|
||||||
|
secs=update.padField(PyPAD.TYPE_NOW,PyPAD.FIELD_LENGTH)
|
||||||
|
group=update.padField(PyPAD.TYPE_NOW,PyPAD.FIELD_GROUP_NAME)
|
||||||
|
msg='|'+title+'|'+artist+'|'+str(update.padField(PyPAD.TYPE_NOW,PyPAD.FIELD_CART_NUMBER))+'|'+str(secs)+'|'+group+'|'+album+'|'+label+'|\n'
|
||||||
|
send_sock.sendto(msg.encode('utf-8'),
|
||||||
|
(update.config().get(section,'IpAddress'),int(update.config().get(section,'UdpPort'))))
|
||||||
|
n=n+1
|
||||||
|
except configparser.NoSectionError:
|
||||||
|
return
|
||||||
|
|
||||||
|
#
|
||||||
|
# 'Main' function
|
||||||
|
#
|
||||||
|
# Create Send Socket
|
||||||
|
#
|
||||||
|
send_sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
|
||||||
|
|
||||||
|
rcvr=PyPAD.Receiver()
|
||||||
|
try:
|
||||||
|
rcvr.setConfigFile(sys.argv[3])
|
||||||
|
except IndexError:
|
||||||
|
eprint('pypad_liqcomp.py: you must specify a configuration file')
|
||||||
|
sys.exit(1)
|
||||||
|
rcvr.setCallback(ProcessPad)
|
||||||
|
rcvr.start(sys.argv[1],int(sys.argv[2]))
|
@ -23,7 +23,6 @@ AM_CFLAGS = -fPIC -Wall -I../
|
|||||||
|
|
||||||
RLM_MODULES = rlm_icecast2.rlm\
|
RLM_MODULES = rlm_icecast2.rlm\
|
||||||
rlm_inno713.rlm\
|
rlm_inno713.rlm\
|
||||||
rlm_liqcomp.rlm\
|
|
||||||
rlm_serial.rlm\
|
rlm_serial.rlm\
|
||||||
rlm_shoutcast1.rlm\
|
rlm_shoutcast1.rlm\
|
||||||
rlm_spottrap.rlm\
|
rlm_spottrap.rlm\
|
||||||
@ -53,7 +52,6 @@ EXTRA_DIST = Makefile-example\
|
|||||||
rlm.h\
|
rlm.h\
|
||||||
rlm_icecast2.c\
|
rlm_icecast2.c\
|
||||||
rlm_inno713.c\
|
rlm_inno713.c\
|
||||||
rlm_liqcomp.c\
|
|
||||||
rlm_serial.c\
|
rlm_serial.c\
|
||||||
rlm_shoutcast1.c\
|
rlm_shoutcast1.c\
|
||||||
rlm_spottrap.c\
|
rlm_spottrap.c\
|
||||||
|
@ -1,430 +0,0 @@
|
|||||||
/* rlm_liqcomp.c
|
|
||||||
*
|
|
||||||
* (C) Copyright 2009-2018 Fred Gleason <fredg@paravelsystems.com>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2
|
|
||||||
* as published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*
|
|
||||||
* This is a Rivendell Loadable Module. It sends Now&Next PAD data to a
|
|
||||||
* Liquid Compass Internet streaming encoder. Options are specified in the
|
|
||||||
* configuration file pointed to by the plugin argument.
|
|
||||||
*
|
|
||||||
* To compile this module, just do:
|
|
||||||
*
|
|
||||||
* gcc -shared -o rlm_liqcomp.rlm rlm_liqcomp.c
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <strings.h>
|
|
||||||
#include <rlm/rlm.h>
|
|
||||||
|
|
||||||
int rlm_liqcomp_devs;
|
|
||||||
char *rlm_liqcomp_addresses;
|
|
||||||
uint16_t *rlm_liqcomp_ports;
|
|
||||||
char *rlm_liqcomp_titles;
|
|
||||||
char *rlm_liqcomp_artists;
|
|
||||||
char *rlm_liqcomp_albums;
|
|
||||||
char *rlm_liqcomp_labels;
|
|
||||||
int *rlm_liqcomp_masters;
|
|
||||||
int *rlm_liqcomp_aux1s;
|
|
||||||
int *rlm_liqcomp_aux2s;
|
|
||||||
int *rlm_liqcomp_vlog101s;
|
|
||||||
int *rlm_liqcomp_vlog102s;
|
|
||||||
int *rlm_liqcomp_vlog103s;
|
|
||||||
int *rlm_liqcomp_vlog104s;
|
|
||||||
int *rlm_liqcomp_vlog105s;
|
|
||||||
int *rlm_liqcomp_vlog106s;
|
|
||||||
int *rlm_liqcomp_vlog107s;
|
|
||||||
int *rlm_liqcomp_vlog108s;
|
|
||||||
int *rlm_liqcomp_vlog109s;
|
|
||||||
int *rlm_liqcomp_vlog110s;
|
|
||||||
int *rlm_liqcomp_vlog111s;
|
|
||||||
int *rlm_liqcomp_vlog112s;
|
|
||||||
int *rlm_liqcomp_vlog113s;
|
|
||||||
int *rlm_liqcomp_vlog114s;
|
|
||||||
int *rlm_liqcomp_vlog115s;
|
|
||||||
int *rlm_liqcomp_vlog116s;
|
|
||||||
int *rlm_liqcomp_vlog117s;
|
|
||||||
int *rlm_liqcomp_vlog118s;
|
|
||||||
int *rlm_liqcomp_vlog119s;
|
|
||||||
int *rlm_liqcomp_vlog120s;
|
|
||||||
|
|
||||||
int rlm_liqcomp_GetLogStatus(void *ptr,const char *arg,const char *section,
|
|
||||||
const char *logname)
|
|
||||||
{
|
|
||||||
const char *tag=RLMGetStringValue(ptr,arg,section,logname,"");
|
|
||||||
if(strcasecmp(tag,"yes")==0) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if(strcasecmp(tag,"on")==0) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if(strcasecmp(tag,"true")==0) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if(strcasecmp(tag,"no")==0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if(strcasecmp(tag,"off")==0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if(strcasecmp(tag,"false")==0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if(strcasecmp(tag,"onair")==0) {
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void rlm_liqcomp_RLMStart(void *ptr,const char *arg)
|
|
||||||
{
|
|
||||||
char address[17];
|
|
||||||
char section[256];
|
|
||||||
char errtext[256];
|
|
||||||
int i=1;
|
|
||||||
|
|
||||||
rlm_liqcomp_devs=0;
|
|
||||||
rlm_liqcomp_addresses=NULL;
|
|
||||||
rlm_liqcomp_ports=NULL;
|
|
||||||
rlm_liqcomp_masters=NULL;
|
|
||||||
rlm_liqcomp_aux1s=NULL;
|
|
||||||
rlm_liqcomp_aux2s=NULL;
|
|
||||||
rlm_liqcomp_vlog101s=NULL;
|
|
||||||
rlm_liqcomp_vlog102s=NULL;
|
|
||||||
rlm_liqcomp_vlog103s=NULL;
|
|
||||||
rlm_liqcomp_vlog104s=NULL;
|
|
||||||
rlm_liqcomp_vlog105s=NULL;
|
|
||||||
rlm_liqcomp_vlog106s=NULL;
|
|
||||||
rlm_liqcomp_vlog107s=NULL;
|
|
||||||
rlm_liqcomp_vlog108s=NULL;
|
|
||||||
rlm_liqcomp_vlog109s=NULL;
|
|
||||||
rlm_liqcomp_vlog110s=NULL;
|
|
||||||
rlm_liqcomp_vlog111s=NULL;
|
|
||||||
rlm_liqcomp_vlog112s=NULL;
|
|
||||||
rlm_liqcomp_vlog113s=NULL;
|
|
||||||
rlm_liqcomp_vlog114s=NULL;
|
|
||||||
rlm_liqcomp_vlog115s=NULL;
|
|
||||||
rlm_liqcomp_vlog116s=NULL;
|
|
||||||
rlm_liqcomp_vlog117s=NULL;
|
|
||||||
rlm_liqcomp_vlog118s=NULL;
|
|
||||||
rlm_liqcomp_vlog119s=NULL;
|
|
||||||
rlm_liqcomp_vlog120s=NULL;
|
|
||||||
|
|
||||||
sprintf(section,"System%d",i++);
|
|
||||||
strncpy(address,RLMGetStringValue(ptr,arg,section,"IpAddress",""),15);
|
|
||||||
if(strlen(address)==0) {
|
|
||||||
RLMLog(ptr,LOG_WARNING,"rlm_liqcomp: no encoder destinations specified");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
while(strlen(address)>0) {
|
|
||||||
rlm_liqcomp_addresses=
|
|
||||||
realloc(rlm_liqcomp_addresses,(rlm_liqcomp_devs+1)*(rlm_liqcomp_devs+1)*16);
|
|
||||||
strcpy(rlm_liqcomp_addresses+16*rlm_liqcomp_devs,address);
|
|
||||||
rlm_liqcomp_ports=realloc(rlm_liqcomp_ports,(rlm_liqcomp_devs+1)*sizeof(uint16_t));
|
|
||||||
rlm_liqcomp_ports[rlm_liqcomp_devs]=
|
|
||||||
RLMGetIntegerValue(ptr,arg,section,"UdpPort",0);
|
|
||||||
rlm_liqcomp_titles=realloc(rlm_liqcomp_titles,(rlm_liqcomp_devs+1)*256);
|
|
||||||
strncpy(rlm_liqcomp_titles+256*rlm_liqcomp_devs,
|
|
||||||
RLMGetStringValue(ptr,arg,section,"Title",""),256);
|
|
||||||
rlm_liqcomp_artists=realloc(rlm_liqcomp_artists,(rlm_liqcomp_devs+1)*256);
|
|
||||||
strncpy(rlm_liqcomp_artists+256*rlm_liqcomp_devs,
|
|
||||||
RLMGetStringValue(ptr,arg,section,"Artist",""),256);
|
|
||||||
rlm_liqcomp_albums=realloc(rlm_liqcomp_albums,(rlm_liqcomp_devs+1)*256);
|
|
||||||
strncpy(rlm_liqcomp_albums+256*rlm_liqcomp_devs,
|
|
||||||
RLMGetStringValue(ptr,arg,section,"Album",""),256);
|
|
||||||
rlm_liqcomp_labels=realloc(rlm_liqcomp_labels,(rlm_liqcomp_devs+1)*256);
|
|
||||||
strncpy(rlm_liqcomp_labels+256*rlm_liqcomp_devs,
|
|
||||||
RLMGetStringValue(ptr,arg,section,"Label",""),256);
|
|
||||||
rlm_liqcomp_masters=realloc(rlm_liqcomp_masters,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_masters[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"MasterLog");
|
|
||||||
rlm_liqcomp_aux1s=realloc(rlm_liqcomp_aux1s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_aux1s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"Aux1Log");
|
|
||||||
rlm_liqcomp_aux2s=realloc(rlm_liqcomp_aux2s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_aux2s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"Aux2Log");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog101s=realloc(rlm_liqcomp_vlog101s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog101s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog101");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog102s=realloc(rlm_liqcomp_vlog102s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog102s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog102");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog103s=realloc(rlm_liqcomp_vlog103s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog103s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog103");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog104s=realloc(rlm_liqcomp_vlog104s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog104s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog104");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog105s=realloc(rlm_liqcomp_vlog105s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog105s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog105");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog106s=realloc(rlm_liqcomp_vlog106s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog106s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog106");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog107s=realloc(rlm_liqcomp_vlog107s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog107s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog107");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog108s=realloc(rlm_liqcomp_vlog108s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog108s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog108");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog109s=realloc(rlm_liqcomp_vlog109s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog109s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog109");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog110s=realloc(rlm_liqcomp_vlog110s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog110s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog110");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog111s=realloc(rlm_liqcomp_vlog111s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog111s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog111");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog112s=realloc(rlm_liqcomp_vlog112s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog112s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog112");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog113s=realloc(rlm_liqcomp_vlog113s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog113s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog113");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog114s=realloc(rlm_liqcomp_vlog114s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog114s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog114");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog115s=realloc(rlm_liqcomp_vlog115s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog115s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog115");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog116s=realloc(rlm_liqcomp_vlog116s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog116s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog116");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog117s=realloc(rlm_liqcomp_vlog117s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog117s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog117");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog118s=realloc(rlm_liqcomp_vlog118s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog118s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog118");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog119s=realloc(rlm_liqcomp_vlog119s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog119s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog119");
|
|
||||||
|
|
||||||
rlm_liqcomp_vlog120s=realloc(rlm_liqcomp_vlog120s,
|
|
||||||
(rlm_liqcomp_devs+1)*sizeof(int));
|
|
||||||
rlm_liqcomp_vlog120s[rlm_liqcomp_devs]=
|
|
||||||
rlm_liqcomp_GetLogStatus(ptr,arg,section,"VLog120");
|
|
||||||
|
|
||||||
sprintf(errtext,"rlm_liqcomp: configured destination \"%s:%d\"",address,
|
|
||||||
rlm_liqcomp_ports[rlm_liqcomp_devs]);
|
|
||||||
rlm_liqcomp_devs++;
|
|
||||||
RLMLog(ptr,LOG_INFO,errtext);
|
|
||||||
sprintf(section,"System%d",i++);
|
|
||||||
strncpy(address,RLMGetStringValue(ptr,arg,section,"IpAddress",""),15);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void rlm_liqcomp_RLMFree(void *ptr)
|
|
||||||
{
|
|
||||||
free(rlm_liqcomp_addresses);
|
|
||||||
free(rlm_liqcomp_ports);
|
|
||||||
free(rlm_liqcomp_titles);
|
|
||||||
free(rlm_liqcomp_artists);
|
|
||||||
free(rlm_liqcomp_albums);
|
|
||||||
free(rlm_liqcomp_labels);
|
|
||||||
free(rlm_liqcomp_masters);
|
|
||||||
free(rlm_liqcomp_aux1s);
|
|
||||||
free(rlm_liqcomp_aux2s);
|
|
||||||
free(rlm_liqcomp_vlog101s);
|
|
||||||
free(rlm_liqcomp_vlog102s);
|
|
||||||
free(rlm_liqcomp_vlog103s);
|
|
||||||
free(rlm_liqcomp_vlog104s);
|
|
||||||
free(rlm_liqcomp_vlog105s);
|
|
||||||
free(rlm_liqcomp_vlog106s);
|
|
||||||
free(rlm_liqcomp_vlog107s);
|
|
||||||
free(rlm_liqcomp_vlog108s);
|
|
||||||
free(rlm_liqcomp_vlog109s);
|
|
||||||
free(rlm_liqcomp_vlog110s);
|
|
||||||
free(rlm_liqcomp_vlog111s);
|
|
||||||
free(rlm_liqcomp_vlog112s);
|
|
||||||
free(rlm_liqcomp_vlog113s);
|
|
||||||
free(rlm_liqcomp_vlog114s);
|
|
||||||
free(rlm_liqcomp_vlog115s);
|
|
||||||
free(rlm_liqcomp_vlog116s);
|
|
||||||
free(rlm_liqcomp_vlog117s);
|
|
||||||
free(rlm_liqcomp_vlog118s);
|
|
||||||
free(rlm_liqcomp_vlog119s);
|
|
||||||
free(rlm_liqcomp_vlog120s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void rlm_liqcomp_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 fmt[1500];
|
|
||||||
char msg[1500];
|
|
||||||
|
|
||||||
for(i=0;i<rlm_liqcomp_devs;i++) {
|
|
||||||
switch(log->log_mach) {
|
|
||||||
case 0:
|
|
||||||
flag=rlm_liqcomp_masters[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
flag=rlm_liqcomp_aux1s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
flag=rlm_liqcomp_aux2s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 100:
|
|
||||||
flag=rlm_liqcomp_vlog101s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 101:
|
|
||||||
flag=rlm_liqcomp_vlog102s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 102:
|
|
||||||
flag=rlm_liqcomp_vlog103s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 103:
|
|
||||||
flag=rlm_liqcomp_vlog104s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 104:
|
|
||||||
flag=rlm_liqcomp_vlog105s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 105:
|
|
||||||
flag=rlm_liqcomp_vlog106s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 106:
|
|
||||||
flag=rlm_liqcomp_vlog107s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 107:
|
|
||||||
flag=rlm_liqcomp_vlog108s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 108:
|
|
||||||
flag=rlm_liqcomp_vlog109s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 109:
|
|
||||||
flag=rlm_liqcomp_vlog110s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 110:
|
|
||||||
flag=rlm_liqcomp_vlog111s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 111:
|
|
||||||
flag=rlm_liqcomp_vlog112s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 112:
|
|
||||||
flag=rlm_liqcomp_vlog113s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 113:
|
|
||||||
flag=rlm_liqcomp_vlog114s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 114:
|
|
||||||
flag=rlm_liqcomp_vlog115s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 115:
|
|
||||||
flag=rlm_liqcomp_vlog116s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 116:
|
|
||||||
flag=rlm_liqcomp_vlog117s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 117:
|
|
||||||
flag=rlm_liqcomp_vlog118s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 118:
|
|
||||||
flag=rlm_liqcomp_vlog119s[i];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 119:
|
|
||||||
flag=rlm_liqcomp_vlog120s[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if((flag==1)||((flag==2)&&(log->log_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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user