-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
64 lines (57 loc) · 1.41 KB
/
main.cpp
File metadata and controls
64 lines (57 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "SysHandler.h"
#include "Params.h"
#include "Common.h"
#include "Daemon.h"
#include "Server.h"
#include "Msg.h"
#include <iostream>
int main(int argc, char *argv[])
{
SysHandler::init();
Daemon daemon;
if(daemon.active()) {
std::ios::sync_with_stdio(true);
Msg::setTimestamps(true);
}
std::setlocale(LC_ALL, "");
Msg() << "WDVC - Windows Desktop Video Capturer";
Msg() << "Release 0.23, October 2017, AtWT";
Params::init(argc, argv);
if(daemon.active()) {
Server server;
server.run();
return EXIT_SUCCESS;
}
switch(Params()->option) {
case Option::start:
{
daemon.start(argc, argv);
daemon.install(argc, argv);
break;
}
case Option::remove:
{
daemon.kill();
daemon.uninstall();
break;
}
case Option::logfile:
{
Msg(FILELINE) << "Log file: \"" << getLogFullName() << "\"";
break;
}
case Option::console:
{
Msg(FILELINE) << "Starting server, press Ctrl-C to terminate";
Server server;
server.run();
break;
}
case Option::help:
{
Params()->showUsage();
break;
}
}
return EXIT_SUCCESS;
}