-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
57 lines (48 loc) · 2 KB
/
main.cpp
File metadata and controls
57 lines (48 loc) · 2 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
// #include "bin/binbend.h"
#include "bin/CalBender.h"
#include "lib/inih/INIReader.h"
int main() {
std::cout.sync_with_stdio(false);
INIReader inioptions ("options.ini");
if(inioptions.ParseError() != 0){
std::cout << "Please create an option file [options.ini]" << std::endl;
exit(EXIT_FAILURE);
}
CalBender *bb = new CalBender();
// Main options
bb->loadFile(inioptions.Get("Main Options", "filename", ""));
int loops = inioptions.GetInteger("Main Options", "loops", 1);
std::vector<std::string> modes = Utility::split(inioptions.Get("Main Options", "modes", ""), ' ');
// All Mode options
std::map<std::string, std::string> options = {
{"iterations", inioptions.Get("CALMode options", "iterations", "")},
{"chunksize", inioptions.Get("CALMode options", "chunksize", "")},
// Repeat options
{"repeats", inioptions.Get("Repeat Options", "repeats", "")},
// Increment options
{"incrementby", inioptions.Get("Increment Options", "incrementby", "")},
// Rainbow options
{"rainsize", inioptions.Get("Rainbow Options", "rainsize", "")},
{"raindelay", inioptions.Get("Rainbow Options", "raindelay", "")},
// Echo options
{"echodecay", inioptions.Get("Echo Options", "echodecay", "")},
{"echolength", inioptions.Get("Echo Options", "echolength", "")},
// Magnifi options
{"magnify", inioptions.Get("Magnifi Options", "magnifyby", "")},
// Timewarp options
{"speedup", inioptions.Get("Timewarp Options", "speedupby", "")},
// Slowdown options
{"slowby", inioptions.Get("Slowdown Options", "slowby", "")},
};
bb->loadDefaultMutations();
bb->setGlobalMutationOptions(options);
for(int i = 0; i < loops; i++){
std::cout << "Loop [" << i << "]" << std::endl;
for(auto mode : modes){
bb->mutateUsing(mode);
bb->saveContents();
bb->resetFile();
}
}
return 0;
}