Allow adding borders to dumps even without lua
[lsnes.git] / avsnoop.hpp
blobe0ec77c1c3d5429053a07451ea4dc180dc766c01
1 #ifndef _avsnoop__hpp__included__
2 #define _avsnoop__hpp__included__
4 #include "render.hpp"
5 #include <list>
6 #include <string>
7 #include <stdexcept>
8 #include "window.hpp"
10 /**
11 * A/V snooper.
13 class av_snooper
15 public:
16 /**
17 * Create new A/V snooper.
19 * throws std::bad_alloc: Not enough memory.
21 av_snooper() throw(std::bad_alloc);
23 /**
24 * Destroy A/V snooper. This will not call end method.
26 ~av_snooper() throw();
28 /**
29 * Dump a frame.
31 * parameter _frame: The frame to dump.
32 * parameter fps_n: Current fps numerator.
33 * parameter fps_d: Current fps denomerator.
34 * throws std::bad_alloc: Not enough memory.
35 * throws std::runtime_error: Error dumping frame.
37 virtual void frame(struct lcscreen& _frame, uint32_t fps_n, uint32_t fps_d, window* win, bool dummy)
38 throw(std::bad_alloc, std::runtime_error) = 0;
40 /**
41 * Dump a frame.
43 * parameter _frame: The frame to dump.
44 * parameter fps_n: Current fps numerator.
45 * parameter fps_d: Current fps denomerator.
46 * parameter win: Graphics system handle.
48 static void frame(struct lcscreen& _frame, uint32_t fps_n, uint32_t fps_d, window* win) throw();
50 /**
51 * Dump a sample.
53 * parameter l: Left channel sample.
54 * parameter r: Right channel sample.
55 * throws std::bad_alloc: Not enough memory.
56 * throws std::runtime_error: Error dumping sample.
58 virtual void sample(short l, short r) throw(std::bad_alloc, std::runtime_error) = 0;
60 /**
61 * Dump a sample.
63 * parameter l: Left channel sample.
64 * parameter r: Right channel sample.
65 * parameter win: Graphics system handle.
67 static void sample(short l, short r, window* win) throw();
69 /**
70 * End dump.
72 * throws std::bad_alloc: Not enough memory.
73 * throws std::runtime_error: Error dumping sample.
75 virtual void end() throw(std::bad_alloc, std::runtime_error) = 0;
77 /**
78 * End dump.
80 * parameter win: Graphics system handle.
82 static void end(window* win) throw();
84 /**
85 * Notify game information.
87 * parameter gamename: Name of the game.
88 * parameter authors: Authors of the run.
89 * parameter gametime: Game time.
90 * parameter rercords: Rerecord count.
91 * throws std::bad_alloc: Not enough memory.
92 * throws std::runtime_error: Error recording this info.
94 virtual void gameinfo(const std::string& gamename, const std::list<std::pair<std::string, std::string>>&
95 authors, double gametime, const std::string& rerecords) throw(std::bad_alloc, std::runtime_error) = 0;
97 /**
98 * Notify game information.
100 * parameter gamename: Name of the game.
101 * parameter authors: Authors of the run.
102 * parameter gametime: Game time.
103 * parameter rercords: Rerecord count.
104 * parameter win: Graphics system handle.
105 * throws std::bad_alloc Not enough memory.
107 static void gameinfo(const std::string& gamename, const std::list<std::pair<std::string, std::string>>&
108 authors, double gametime, const std::string& rerecords, window* win) throw(std::bad_alloc);
111 * Send game info. This causes gameinfo method to be called on object this method is called on.
113 void send_gameinfo() throw();
116 * Is there dump in progress?
118 * returns: True if dump is in progress, false if not.
120 static bool dump_in_progress() throw();
123 * Notifier for dumps starting/ending.
125 class dump_notification
127 public:
129 * Destructor.
131 virtual ~dump_notification() throw();
133 * New dump starting.
135 virtual void dump_starting() throw();
137 * Dump ending.
139 virtual void dump_ending() throw();
143 * Add a notifier.
145 * parameter notifier: New notifier to add.
147 static void add_dump_notifier(dump_notification& notifier) throw(std::bad_alloc);
150 * Remove a notifier.
152 * parameter notifier: Existing notifier to remove.
154 static void remove_dump_notifier(dump_notification& notifier) throw();
157 #endif