44 lines
867 B
C++
44 lines
867 B
C++
#ifndef Recorder_h_
|
|
#define Recorder_h_
|
|
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <thread>
|
|
#include <functional>
|
|
#include <cstdlib>
|
|
|
|
#include "SDL.h"
|
|
|
|
#define GLM_ENABLE_EXPERIMENTAL
|
|
#include "glm/ext.hpp"
|
|
|
|
#include "json/json.hpp"
|
|
|
|
#include "filesystem.hpp"
|
|
#include "Animation.hpp"
|
|
#include "Delegate.hpp"
|
|
#include "Display.hpp"
|
|
#include "extension.hpp"
|
|
|
|
struct Recorder : Node
|
|
{
|
|
|
|
std::vector<SDL_Surface*> frames;
|
|
std::vector<unsigned char*> pixel_buffers;
|
|
Animation animation = Animation(&Recorder::add_frame_to_video, this);
|
|
|
|
Recorder(Node*);
|
|
float get_frame_length();
|
|
void respond(SDL_Event&);
|
|
void capture_screen();
|
|
void start_recording();
|
|
void add_frame_to_video();
|
|
void end_recording();
|
|
void write_video_frames(fs::path);
|
|
void update();
|
|
std::string get_class_name() { return "Recorder"; }
|
|
|
|
};
|
|
|
|
#endif
|