From 0332e496347f6b563abb86d4ef9650bbd6ebc3e1 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 28 May 2014 15:05:57 +0200 Subject: Port server to hugin. --- src/multicast_configuration.cc | 63 ++++++++++++------------------------------ 1 file changed, 17 insertions(+), 46 deletions(-) (limited to 'src/multicast_configuration.cc') 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 -MulticastConfiguration::MulticastConfiguration(Info *info, const char *file) - : MiavConfig(file, info) +#include + +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*/ -- cgit v1.2.3