Wxwidgets: More menu twiddling
[lsnes.git] / avi / jmd.hpp
blob77d9351a5477001b2bba77cde26aab47f01c2070
1 #ifndef _jmd__hpp__included__
2 #define _jmd__hpp__included__
4 #include <cstdint>
5 #include <string>
6 #include <fstream>
7 #include <deque>
8 #include <list>
9 #include <vector>
11 class jmd_dumper
13 public:
14 jmd_dumper(const std::string& filename, unsigned level);
15 ~jmd_dumper();
16 void video(uint64_t ts, uint32_t* memory, uint32_t width, uint32_t height);
17 void audio(uint64_t ts, short l, short r);
18 void gameinfo(const std::string& gamename, const std::string& authors, uint64_t gametime, uint64_t rerecords);
19 void end(uint64_t ts);
20 private:
21 struct frame_buffer
23 uint64_t ts;
24 std::vector<char> data;
26 struct sample_buffer
28 uint64_t ts;
29 short l;
30 short r;
33 std::deque<frame_buffer> frames;
34 std::deque<sample_buffer> samples;
36 std::vector<char> compress_frame(uint32_t* memory, uint32_t width, uint32_t height);
37 void flush_buffers(bool force);
38 void flush_frame(frame_buffer& f);
39 void flush_sample(sample_buffer& s);
41 std::ofstream jmd;
42 uint64_t last_written_ts;
43 unsigned clevel;
46 #endif