openMSX
AviRecorder.hh
Go to the documentation of this file.
1 #ifndef AVIRECORDER_HH
2 #define AVIRECORDER_HH
3 
4 #include "EmuTime.hh"
5 #include "array_ref.hh"
6 #include "noncopyable.hh"
7 #include <vector>
8 #include <memory>
9 
10 namespace openmsx {
11 
12 class Reactor;
13 class AviWriter;
14 class Wav16Writer;
15 class Filename;
16 class PostProcessor;
17 class FrameSource;
18 class MSXMixer;
19 class RecordCommand;
20 class TclObject;
21 
22 class AviRecorder : private noncopyable
23 {
24 public:
25  explicit AviRecorder(Reactor& reactor);
26  ~AviRecorder();
27 
28  void addWave(unsigned num, short* data);
29  void addImage(FrameSource* frame, EmuTime::param time);
30  void stop();
31  unsigned getFrameHeight() const;
32 
33 private:
34  void start(bool recordAudio, bool recordVideo, bool recordMono,
35  bool recordStereo, const Filename& filename);
36  void status(array_ref<TclObject> tokens, TclObject& result) const;
37 
38  void processStart (array_ref<TclObject> tokens, TclObject& result);
39  void processStop (array_ref<TclObject> tokens);
40  void processToggle(array_ref<TclObject> tokens, TclObject& result);
41 
42  Reactor& reactor;
43  const std::unique_ptr<RecordCommand> recordCommand;
44  std::vector<short> audioBuf;
45  std::unique_ptr<AviWriter> aviWriter;
46  std::unique_ptr<Wav16Writer> wavWriter;
47  std::vector<PostProcessor*> postProcessors;
48  MSXMixer* mixer;
49  EmuDuration duration;
50  EmuTime prevTime;
51  unsigned sampleRate;
52  unsigned frameWidth;
53  unsigned frameHeight;
54  bool warnedFps;
55  bool warnedSampleRate;
56  bool warnedStereo;
57  bool stereo;
58 
59  friend class RecordCommand;
60 };
61 
62 } // namespace openmsx
63 
64 #endif
unsigned getFrameHeight() const
Definition: AviRecorder.cc:200
Contains the main loop of openMSX.
Definition: Reactor.hh:62
void addWave(unsigned num, short *data)
Definition: AviRecorder.cc:131
Interface for getting lines from a video frame.
Definition: FrameSource.hh:15
This class implements a subset of the proposal for std::array_ref (proposed for the next c++ standard...
Definition: array_ref.hh:19
This class represents a filename.
Definition: Filename.hh:17
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:7
void addImage(FrameSource *frame, EmuTime::param time)
Definition: AviRecorder.cc:175
Based on boost::noncopyable, see boost documentation: http://www.boost.org/libs/utility.
Definition: noncopyable.hh:12
AviRecorder(Reactor &reactor)
Definition: AviRecorder.cc:37