summaryrefslogtreecommitdiff
path: root/src/multicast_configuration.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/multicast_configuration.cc')
-rw-r--r--src/multicast_configuration.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/multicast_configuration.cc b/src/multicast_configuration.cc
index 8982f7a..969faca 100644
--- a/src/multicast_configuration.cc
+++ b/src/multicast_configuration.cc
@@ -32,9 +32,11 @@ MulticastConfiguration::MulticastConfiguration(Info *info, char *file)
{
mcastconf_t conf;
+ // Create the default values.
global_conf.addr = "224.0.0.1";
global_conf.port = 1234;
global_conf.enabled = false;
+ global_conf.with_audio = false;
bool global = true;
@@ -44,10 +46,14 @@ MulticastConfiguration::MulticastConfiguration(Info *info, char *file)
while(cfg) {
if(strcmp(cfg->name->c_str(), "client") == 0) {
if(!global) confs.push_back(conf);
+
+ // Reset the configuration to the defaults
conf.client = *(cfg->stringval);
conf.addr = global_conf.addr;
conf.port = global_conf.port;
conf.enabled = global_conf.enabled;
+ conf.with_audio = global_conf.with_audio;
+
global = false;
}
if(strcmp(cfg->name->c_str(), "address") == 0) {
@@ -62,22 +68,28 @@ MulticastConfiguration::MulticastConfiguration(Info *info, char *file)
if(global) global_conf.enabled = cfg->boolval;
else conf.enabled = cfg->boolval;
}
+ if(strcmp(cfg->name->c_str(), "with_audio") == 0) {
+ if(global) global_conf.with_audio = cfg->boolval;
+ else conf.with_audio = cfg->boolval;
+ }
cfg = cfg->next;
}
if(!global) confs.push_back(conf);
// Show the configuration in the log file .
- info->info("Global - Enabled: %s - Addr: %s - Port: %d",
+ info->info("Global - Enabled: %s - Addr: %s - Port: %d - WithAudio: %s",
global_conf.enabled?"Yes\0":"No\0",
global_conf.addr.c_str(),
- global_conf.port);
+ global_conf.port,
+ global_conf.with_audio?"Yes\0":"No\0");
for(unsigned int cnt = 0; cnt < confs.size(); cnt++) {
- info->info("Client: %s - Enabled: %s - Addr: %s - Port: %d",
+ info->info("Client: %s - Enabled: %s - Addr: %s - Port: %d - WithAudio: %s",
confs[cnt].client.c_str(),
confs[cnt].enabled?"Yes\0":"No\0",
confs[cnt].addr.c_str(),
- confs[cnt].port);
+ confs[cnt].port,
+ confs[cnt].with_audio?"Yes\0":"No\0");
}
info->info("Chosing:");