-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathglight-player.cpp
More file actions
35 lines (29 loc) · 960 Bytes
/
glight-player.cpp
File metadata and controls
35 lines (29 loc) · 960 Bytes
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
#include <iostream>
#include <string>
#include "system/reader.h"
#include "system/settings.h"
#include "theatre/management.h"
namespace glight {
void RunPlayer(const std::string filename) {
const glight::system::Settings settings = glight::system::LoadSettings();
glight::theatre::Management management(settings);
glight::system::Read(filename, management);
management.GetUniverses().Open();
management.Run();
std::cout << "Press enter to exit.\n";
std::cin.get();
management.BlackOut(false, 0.0f);
std::cout << "Stopping...\n";
// There is some time required for the black out to take effect.
usleep(400000);
}
} // namespace glight
int main(int argc, char* argv[]) {
if (argc <= 1) {
std::cout << "Syntax: glight-player <show-file>\n\n"
"glight-player can play a previously created gshow file "
"without requiring a graphical desktop.\n";
return 0;
}
glight::RunPlayer(argv[1]);
}