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