1 #ifndef _movie__hpp__included__
2 #define _movie__hpp__included__
7 #include "core/controllerframe.hpp"
8 #include "core/moviefile.hpp"
9 #include "library/rrdata.hpp"
10 #include "library/movie.hpp"
13 * Class encapsulating bridge logic between core interface and movie code.
21 movie_logic() throw();
25 operator bool() throw() { return mov
; }
26 bool operator!() throw() { return !mov
; }
28 * Get the movie instance associated.
30 * returns: The movie instance.
32 movie
& get_movie() throw(std::runtime_error
);
35 * Set the movie instance associated.
37 void set_movie(movie
& _mov
, bool free_old
= false) throw();
40 * Get the current movie file.
42 moviefile
& get_mfile() throw(std::runtime_error
);
45 * Set the current movie file.
47 void set_mfile(moviefile
& _mf
, bool free_old
= false) throw();
51 rrdata_set
& get_rrdata() throw(std::runtime_error
);
56 void set_rrdata(rrdata_set
& _rrd
, bool free_old
= false) throw();
59 * Notify about new frame starting.
61 void new_frame_starting(bool dont_poll
) throw(std::bad_alloc
, std::runtime_error
);
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
);
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
);
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
);
89 * Release memory for mov, mf and rrd.
91 void release_memory();
93 movie_logic(const movie_logic
&);
94 movie_logic
& operator=(const movie_logic
&);