summary refs log tree commit diff stats
path: root/director.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-01-18 16:49:54 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-01-18 16:49:54 -0500
commitda3bc860f66d34f233028e819beee32dd1c43dd8 (patch)
tree8cc7f5ad0a8dad69ea5c3ae0405f803d3ba80051 /director.h
parent46db0368fbee4cfba97178837e62f4469c4fa884 (diff)
downloadsap-da3bc860f66d34f233028e819beee32dd1c43dd8.tar.gz
sap-da3bc860f66d34f233028e819beee32dd1c43dd8.tar.bz2
sap-da3bc860f66d34f233028e819beee32dd1c43dd8.zip
Modernized project
This rewrite brings the codebase of this project more in line with the format of the other bots, including things like C++ randomization, better abstraction, use of exceptions, etc. Notably, any FFMPEG objects that get allocated are wrapped in simple objects so that they get properly destroyed if an exception is thrown. Some more error detection and cleanliness stuff can probably be done but my wrists really hurt.

Also updated librawr, and thus also removed the yaml-cpp submodule.
Diffstat (limited to 'director.h')
-rw-r--r--director.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/director.h b/director.h new file mode 100644 index 0000000..f00f2ee --- /dev/null +++ b/director.h
@@ -0,0 +1,31 @@
1#ifndef DIRECTOR_H_9DFD929C
2#define DIRECTOR_H_9DFD929C
3
4#include <stdexcept>
5#include <string>
6#include <vector>
7#include <Magick++.h>
8#include <random>
9
10class ffmpeg_error : public std::runtime_error {
11public:
12
13 ffmpeg_error(std::string msg) : std::runtime_error(msg)
14 {
15 }
16};
17
18class director {
19public:
20
21 director(std::string videosPath);
22
23 Magick::Image generate(std::mt19937& rng) const;
24
25private:
26
27 std::string videosPath_;
28 std::vector<std::string> videos_;
29};
30
31#endif /* end of include guard: DIRECTOR_H_9DFD929C */