summaryrefslogtreecommitdiff
path: root/src/multicast_configuration.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-05-28 15:05:57 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-05-28 15:05:57 +0200
commit0332e496347f6b563abb86d4ef9650bbd6ebc3e1 (patch)
tree74dadbe6e4f3216c8a3c8570e203aad0187febf3 /src/multicast_configuration.cc
parent8eb0759e2e8a5405b2dd9e6d72d3bd620b51bee4 (diff)
Port server to hugin.
Diffstat (limited to 'src/multicast_configuration.cc')
-rw-r--r--src/multicast_configuration.cc63
1 files changed, 17 insertions, 46 deletions
diff --git a/src/multicast_configuration.cc b/src/multicast_configuration.cc
index 217b959..4e097dd 100644
--- a/src/multicast_configuration.cc
+++ b/src/multicast_configuration.cc
@@ -24,13 +24,14 @@
* along with MIaV; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "config.h"
#include "multicast_configuration.h"
#include <string.h>
-MulticastConfiguration::MulticastConfiguration(Info *info, const char *file)
- : MiavConfig(file, info)
+#include <hugin.hpp>
+
+MulticastConfiguration::MulticastConfiguration(const char *file)
+ : MiavConfig(file)
{
mcastconf_t conf;
@@ -79,22 +80,23 @@ MulticastConfiguration::MulticastConfiguration(Info *info, const char *file)
if(!global) confs.push_back(conf);
// Show the configuration in the log file .
- 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.with_audio?"Yes\0":"No\0");
+ DEBUG(multicast, "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.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 - WithAudio: %s",
- confs[cnt].client.c_str(),
- confs[cnt].enabled?"Yes\0":"No\0",
- confs[cnt].addr.c_str(),
- confs[cnt].port,
- confs[cnt].with_audio?"Yes\0":"No\0");
+ DEBUG(multicast,
+ "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].with_audio?"Yes\0":"No\0");
}
- info->info("Chosing:");
+ DEBUG(multicast, "Chosing:");
}
MulticastConfiguration::~MulticastConfiguration()
@@ -110,34 +112,3 @@ mcastconf_t &MulticastConfiguration::getConf(char *client)
return global_conf;
}
-
-#ifdef __TEST_MULTICAST_CONFIGURATION
-#include "info_simple.h"
-
-int main(int argc, char *argv[]) {
- if(argc < 2) {
- fprintf(stderr, "usage:\n\t%s [filename]\n", argv[0]);
- return 1;
- }
-
- InfoSimple info;
- MulticastConfiguration conf(&info, argv[1]);
-
- mcastconf_t mcconf = conf.getConf("192.168.0.11");
-
- info.warn("Client: %s - Enabled: %s - Addr: %s - Port: %d",
- mcconf.client.c_str(),
- mcconf.enabled?"Yes\0":"No\0",
- mcconf.addr.c_str(),
- mcconf.port);
-
- mcconf = conf.getConf("192.168.0.0");
-
- info.warn("Client: %s - Enabled: %s - Addr: %s - Port: %d",
- mcconf.client.c_str(),
- mcconf.enabled?"Yes\0":"No\0",
- mcconf.addr.c_str(),
- mcconf.port);
-}
-
-#endif/* __TEST_MULTICAST_CONFIGURATION*/