1 #include "core/advdumper.hpp"
2 #include "core/dispatch.hpp"
3 #include "core/instance.hpp"
4 #include "core/moviedata.hpp"
5 #include "core/moviefile.hpp"
6 #include "core/messages.hpp"
7 #include "core/rom.hpp"
8 #include "library/serialization.hpp"
9 #include "library/minmax.hpp"
22 void deleter_fn(void* f
)
24 delete reinterpret_cast<std::ofstream
*>(f
);
27 class null_dump_obj
: public dumper_base
30 null_dump_obj(master_dumper
& _mdumper
, dumper_factory_base
& _fbase
, const std::string
& mode
,
31 const std::string
& prefix
)
32 : dumper_base(_mdumper
, _fbase
), mdumper(_mdumper
)
35 mdumper
.add_dumper(*this);
36 } catch(std::bad_alloc
& e
) {
38 } catch(std::exception
& e
) {
40 x
<< "Error starting NULL dump: " << e
.what();
41 throw std::runtime_error(x
.str());
44 ~null_dump_obj() throw()
46 mdumper
.drop_dumper(*this);
48 void on_frame(struct framebuffer::raw
& _frame
, uint32_t fps_n
, uint32_t fps_d
)
52 void on_sample(short l
, short r
)
56 void on_rate_change(uint32_t n
, uint32_t d
)
60 void on_gameinfo_change(const master_dumper::gameinfo
& gi
)
69 master_dumper
& mdumper
;
72 class adv_null_dumper
: public dumper_factory_base
75 adv_null_dumper() : dumper_factory_base("INTERNAL-NULL")
79 ~adv_null_dumper() throw();
80 std::set
<std::string
> list_submodes() throw(std::bad_alloc
)
82 std::set
<std::string
> x
;
85 unsigned mode_details(const std::string
& mode
) throw()
87 return target_type_special
;
89 std::string
mode_extension(const std::string
& mode
) throw()
91 return ""; //Nothing interesting.
93 std::string
name() throw(std::bad_alloc
)
97 std::string
modename(const std::string
& mode
) throw(std::bad_alloc
)
101 null_dump_obj
* start(master_dumper
& _mdumper
, const std::string
& mode
, const std::string
& prefix
)
102 throw(std::bad_alloc
, std::runtime_error
)
104 return new null_dump_obj(_mdumper
, *this, mode
, prefix
);
106 bool hidden() const { return true; }
109 adv_null_dumper::~adv_null_dumper() throw()