Lua: Fix type confusion between signed and unsigned
[lsnes.git] / include / core / subtitles.hpp
blobcc9f4a6bb87d6cabd94e10c96c9307d6fd747a08
1 #ifndef _subtitles__hpp__included__
2 #define _subtitles__hpp__included__
4 #include <cstdint>
5 #include <set>
6 #include <string>
7 #include "library/command.hpp"
9 namespace lua { class render_context; }
11 class moviefile_subtiming
13 public:
14 moviefile_subtiming(uint64_t frame);
15 moviefile_subtiming(uint64_t first, uint64_t length);
16 bool operator<(const moviefile_subtiming& a) const;
17 bool operator==(const moviefile_subtiming& a) const;
18 bool inrange(uint64_t x) const;
19 uint64_t get_frame() const;
20 uint64_t get_length() const;
21 private:
22 uint64_t frame;
23 uint64_t length;
24 bool position_only;
27 class movie_logic;
28 class emu_framebuffer;
29 class emulator_dispatch;
31 struct subtitle_commentary
33 public:
34 subtitle_commentary(movie_logic& _mlogic, emu_framebuffer& _fbuf, emulator_dispatch& _dispatch,
35 command::group& _cmd);
36 std::set<std::pair<uint64_t, uint64_t>> get_all();
37 std::string get(uint64_t f, uint64_t l);
38 void set(uint64_t f, uint64_t l, const std::string& x);
39 static std::string s_unescape(std::string x);
40 static std::string s_escape(std::string x);
41 void render(lua::render_context& ctx);
42 private:
43 void do_editsub(const std::string& a);
44 void do_listsub();
45 void do_savesub(const std::string& a);
46 movie_logic& mlogic;
47 emu_framebuffer& fbuf;
48 emulator_dispatch& edispatch;
49 command::group& cmd;
50 command::_fnptr<const std::string&> editsub;
51 command::_fnptr<> listsub;
52 command::_fnptr<command::arg_filename> savesub;
55 #endif