added MCUF sender modules to main, config dir now specified on command line
Stefan Schuermans

Stefan Schuermans commited on 2011-11-13 20:54:52
Showing 1 changed files, with 21 additions and 2 deletions.

... ...
@@ -1,15 +1,19 @@
1
+#include <iostream>
2
+#include <string>
3
+
1 4
 #include "CallMgr.h"
2 5
 #include "Directory.h"
3 6
 #include "ModuleMgr.h"
4 7
 #include "Player.h"
5 8
 #include "Printer.h"
6 9
 #include "StreamMgr.h"
10
+#include "Udp4Sender.h"
7 11
 
8 12
 using namespace Blinker;
9 13
 
10
-int main()
14
+void run(const std::string &dirConfig)
11 15
 {
12
-  Directory dirCfg("../example.cfg");
16
+  Directory dirCfg(dirConfig);
13 17
 
14 18
   CallMgr callMgr;
15 19
   StreamMgr streamMgr;
... ...
@@ -18,8 +22,23 @@ int main()
18 22
                               dirCfg.getSubdir("players"));
19 23
   ModuleMgr<Printer> printerMgr(callMgr, streamMgr,
20 24
                                 dirCfg.getSubdir("printers"));
25
+  ModuleMgr<Udp4Sender> udp4Mgr(callMgr, streamMgr,
26
+                                dirCfg.getSubdir("udp4senders"));
21 27
 
22 28
   callMgr.run();
29
+}
30
+
31
+int main(int argc, const char *argv[])
32
+{
33
+  const char * dirConfig;
34
+
35
+  if (argc < 2) {
36
+    std::cerr << "usage: " << argv[0] << " config-directory" << std::endl;
37
+    return 2;
38
+  }
39
+  dirConfig = argv[1];
40
+
41
+  run(dirConfig);
23 42
 
24 43
   return 0;
25 44
 }
26 45