lsnes/include/core/movie.hpp

56 lines
1.2 KiB
C++
Raw Normal View History

#ifndef _movie__hpp__included__
#define _movie__hpp__included__
#include <string>
#include <cstdint>
#include <stdexcept>
2012-10-12 15:21:57 +03:00
#include "core/controllerframe.hpp"
#include "library/movie.hpp"
/**
2011-09-16 21:09:22 +03:00
* Class encapsulating bridge logic between bsnes interface and movie code.
*/
class movie_logic
{
public:
/**
2011-09-16 21:09:22 +03:00
* Create new bridge.
*/
2011-09-16 06:13:33 +03:00
movie_logic() throw();
/**
2011-09-16 21:09:22 +03:00
* Get the movie instance associated.
*
* returns: The movie instance.
*/
movie& get_movie() throw();
/**
2011-09-16 21:09:22 +03:00
* Notify about new frame starting.
*/
void new_frame_starting(bool dont_poll) throw(std::bad_alloc, std::runtime_error);
/**
2011-09-16 21:09:22 +03:00
* Poll for input.
2011-09-15 22:56:33 +03:00
*
2011-09-16 21:09:22 +03:00
* parameter port: The port number.
* parameter dev: The controller index.
* parameter id: Control id.
* returns: Value for polled input.
* throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Error polling for input.
*/
short input_poll(unsigned port, unsigned dev, unsigned id) throw(std::bad_alloc, std::runtime_error);
/**
2011-09-16 21:09:22 +03:00
* Called when movie code needs new controls snapshot.
2011-09-15 22:56:33 +03:00
*
2011-09-16 21:09:22 +03:00
* parameter subframe: True if this is for subframe update, false if for frame update.
*/
controller_frame update_controls(bool subframe) throw(std::bad_alloc, std::runtime_error);
private:
2011-09-16 06:13:33 +03:00
movie mov;
};
#endif