Refactor movie class to library/
[lsnes.git] / include / core / movie.hpp
blobe2828159d273a9aac5c9de21b680ef2e5f4ac3e6
1 #ifndef _movie__hpp__included__
2 #define _movie__hpp__included__
4 #include <string>
5 #include <cstdint>
6 #include <stdexcept>
7 #include "core/controllerframe.hpp"
8 #include "library/movie.hpp"
10 /**
11 * Class encapsulating bridge logic between bsnes interface and movie code.
13 class movie_logic
15 public:
16 /**
17 * Create new bridge.
19 movie_logic() throw();
21 /**
22 * Get the movie instance associated.
24 * returns: The movie instance.
26 movie& get_movie() throw();
28 /**
29 * Notify about new frame starting.
31 * returns: Reset status for the new frame.
33 long new_frame_starting(bool dont_poll) throw(std::bad_alloc, std::runtime_error);
35 /**
36 * Poll for input.
38 * parameter port: The port number.
39 * parameter dev: The controller index.
40 * parameter id: Control id.
41 * returns: Value for polled input.
42 * throws std::bad_alloc: Not enough memory.
43 * throws std::runtime_error: Error polling for input.
45 short input_poll(unsigned port, unsigned dev, unsigned id) throw(std::bad_alloc, std::runtime_error);
47 /**
48 * Called when movie code needs new controls snapshot.
50 * parameter subframe: True if this is for subframe update, false if for frame update.
52 controller_frame update_controls(bool subframe) throw(std::bad_alloc, std::runtime_error);
53 private:
54 movie mov;
57 #endif