mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2026-01-11 23:25:57 +01:00
VU Meters update.
Parameterize values used for allocating the UDP port number for VU meters. Signed-off-by: David Klann <dklann@broadcasttool.com>
This commit is contained in:
12
lib/rd.h
12
lib/rd.h
@@ -625,4 +625,16 @@
|
||||
*/
|
||||
#define RD_GPIO_EVENT_DAYS 30
|
||||
|
||||
/*
|
||||
* Starting UDP port for cae_meter_socket.
|
||||
* Default 'MeterPortBaseNumber=' value in rd.conf(5)
|
||||
*/
|
||||
#define RD_DEFAULT_METER_SOCKET_BASE_UDP_PORT 30000
|
||||
|
||||
/*
|
||||
* Maximum number of UDP ports to consider for cae_meter_socket.
|
||||
* Default 'MeterPortRange' value in rd.conf(5)
|
||||
*/
|
||||
#define RD_METER_SOCKET_PORT_RANGE 100
|
||||
|
||||
#endif // RD_H
|
||||
|
||||
@@ -56,9 +56,14 @@ RDCae::RDCae(RDStation *station,RDConfig *config,QObject *parent)
|
||||
//
|
||||
cae_meter_socket=new Q3SocketDevice(Q3SocketDevice::Datagram);
|
||||
cae_meter_socket->setBlocking(false);
|
||||
for(Q_INT16 i=30000;i<30100;i++) {
|
||||
cae_meter_base_port=cae_config->meterBasePort();
|
||||
cae_meter_port_range=cae_config->meterPortRange();
|
||||
if(cae_meter_port_range>999) {
|
||||
cae_meter_port_range=999;
|
||||
}
|
||||
for(Q_INT16 i=cae_meter_base_port;i<(cae_meter_base_port+cae_meter_port_range);i++) {
|
||||
if(cae_meter_socket->bind(QHostAddress(),i)) {
|
||||
i=31000;
|
||||
i=(cae_meter_base_port+cae_meter_port_range)+1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,6 +113,8 @@ class RDCae : public QObject
|
||||
int cae_handle[RD_MAX_CARDS][RD_MAX_STREAMS];
|
||||
unsigned cae_pos[RD_MAX_CARDS][RD_MAX_STREAMS];
|
||||
Q3SocketDevice *cae_meter_socket;
|
||||
int cae_meter_base_port;
|
||||
int cae_meter_port_range;
|
||||
short cae_input_levels[RD_MAX_CARDS][RD_MAX_PORTS][2];
|
||||
short cae_output_levels[RD_MAX_CARDS][RD_MAX_PORTS][2];
|
||||
short cae_stream_output_levels[RD_MAX_CARDS][RD_MAX_PORTS][2];
|
||||
|
||||
@@ -382,6 +382,18 @@ bool RDConfig::lockRdairplayMemory() const
|
||||
}
|
||||
|
||||
|
||||
int RDConfig::meterBasePort() const
|
||||
{
|
||||
return conf_meter_base_port;
|
||||
}
|
||||
|
||||
|
||||
int RDConfig::meterPortRange() const
|
||||
{
|
||||
return conf_meter_port_range;
|
||||
}
|
||||
|
||||
|
||||
uid_t RDConfig::uid() const
|
||||
{
|
||||
return conf_uid;
|
||||
@@ -590,6 +602,10 @@ bool RDConfig::load()
|
||||
profile->boolValue("Hacks","DisableMaintChecks",false);
|
||||
conf_lock_rdairplay_memory=
|
||||
profile->boolValue("Hacks","LockRdairplayMemory",false);
|
||||
conf_meter_base_port=
|
||||
profile->intValue("Hacks","MeterPortBaseNumber",RD_DEFAULT_METER_SOCKET_BASE_UDP_PORT);
|
||||
conf_meter_port_range=
|
||||
profile->intValue("Hacks","MeterPortRange",RD_METER_SOCKET_PORT_RANGE);
|
||||
if((user=getpwnam(profile->stringValue("Identity","AudioOwner")))!=NULL) {
|
||||
conf_uid=user->pw_uid;
|
||||
}
|
||||
@@ -713,6 +729,8 @@ void RDConfig::clear()
|
||||
conf_jack_ports[1].clear();
|
||||
conf_disable_maint_checks=false;
|
||||
conf_lock_rdairplay_memory=false;
|
||||
conf_meter_base_port=RD_DEFAULT_METER_SOCKET_BASE_UDP_PORT;
|
||||
conf_meter_port_range=RD_METER_SOCKET_PORT_RANGE;
|
||||
conf_uid=65535;
|
||||
conf_gid=65535;
|
||||
conf_pypad_uid=65535;
|
||||
|
||||
@@ -100,6 +100,8 @@ class RDConfig
|
||||
QString jackPort(int num,int endpt) const;
|
||||
bool disableMaintChecks() const;
|
||||
bool lockRdairplayMemory() const;
|
||||
int meterBasePort() const;
|
||||
int meterPortRange() const;
|
||||
bool enableMixerLogging() const;
|
||||
uid_t uid() const;
|
||||
gid_t gid() const;
|
||||
@@ -170,6 +172,8 @@ class RDConfig
|
||||
QString conf_http_user_agent;
|
||||
bool conf_disable_maint_checks;
|
||||
bool conf_lock_rdairplay_memory;
|
||||
int conf_meter_base_port;
|
||||
int conf_meter_port_range;
|
||||
std::vector<QString> conf_jack_ports[2];
|
||||
uid_t conf_uid;
|
||||
gid_t conf_gid;
|
||||
|
||||
Reference in New Issue
Block a user