Delay committing fullscreen until seeing window size change
[lsnes.git] / include / core / movie.hpp
blobfd09fe74d8323d776c810f2e1684d0734cc0fdab
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 "core/moviefile.hpp"
9 #include "library/rrdata.hpp"
10 #include "library/movie.hpp"
12 /**
13 * Class encapsulating bridge logic between core interface and movie code.
15 class movie_logic
17 public:
18 /**
19 * Create new bridge.
21 movie_logic() throw();
22 /**
23 * Has movie?
25 operator bool() throw() { return mov; }
26 bool operator!() throw() { return !mov; }
27 /**
28 * Get the movie instance associated.
30 * returns: The movie instance.
32 movie& get_movie() throw(std::runtime_error);
34 /**
35 * Set the movie instance associated.
37 void set_movie(movie& _mov, bool free_old = false) throw();
39 /**
40 * Get the current movie file.
42 moviefile& get_mfile() throw(std::runtime_error);
44 /**
45 * Set the current movie file.
47 void set_mfile(moviefile& _mf, bool free_old = false) throw();
48 /**
49 * Get current rrdata.
51 rrdata_set& get_rrdata() throw(std::runtime_error);
53 /**
54 * Set current rrdata.
56 void set_rrdata(rrdata_set& _rrd, bool free_old = false) throw();
58 /**
59 * Notify about new frame starting.
61 void new_frame_starting(bool dont_poll) throw(std::bad_alloc, std::runtime_error);
63 /**
64 * Poll for input.
66 * parameter port: The port number.
67 * parameter dev: The controller index.
68 * parameter id: Control id.
69 * returns: Value for polled input.
70 * throws std::bad_alloc: Not enough memory.
71 * throws std::runtime_error: Error polling for input.
73 short input_poll(unsigned port, unsigned dev, unsigned id) throw(std::bad_alloc, std::runtime_error);
75 /**
76 * Called when movie code needs new controls snapshot.
78 * parameter subframe: True if this is for subframe update, false if for frame update.
80 portctrl::frame update_controls(bool subframe, bool forced = false) throw(std::bad_alloc, std::runtime_error);
82 /**
83 * Notify user poll (exit poll advance).
85 * returns: If true, update_controls is forced.
87 bool notify_user_poll() throw(std::bad_alloc, std::runtime_error);
88 /**
89 * Release memory for mov, mf and rrd.
91 void release_memory();
92 private:
93 movie_logic(const movie_logic&);
94 movie_logic& operator=(const movie_logic&);
95 movie* mov;
96 moviefile* mf;
97 rrdata_set* rrd;
100 #endif