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 <string>
7 #include <vector>
8 #include <memory>
9 
10 namespace openmsx {
11 
12 class Reactor;
13 class VideoSourceSetting;
14 class AviWriter;
15 class Wav16Writer;
16 class Filename;
17 class PostProcessor;
18 class FrameSource;
19 class MSXMixer;
20 class RecordCommand;
21 class TclObject;
22 
23 class AviRecorder : private noncopyable
24 {
25 public:
26  explicit AviRecorder(Reactor& reactor);
27  ~AviRecorder();
28 
29  void addWave(unsigned num, short* data);
30  void addImage(FrameSource* frame, EmuTime::param time);
31  void stop();
32  unsigned getFrameHeight() const;
33 
34 private:
35  void start(bool recordAudio, bool recordVideo, bool recordMono,
36  bool recordStereo, const Filename& filename);
37  void status(const std::vector<TclObject>& tokens, TclObject& result) const;
38 
39  void processStart(const std::vector<TclObject>& tokens, TclObject& result);
40  void processStop(const std::vector<TclObject>& tokens);
41  void processToggle(const std::vector<TclObject>& tokens, TclObject& result);
42 
43  Reactor& reactor;
44  const std::unique_ptr<RecordCommand> recordCommand;
45  std::vector<short> audioBuf;
46  std::unique_ptr<AviWriter> aviWriter;
47  std::unique_ptr<Wav16Writer> wavWriter;
48  std::vector<PostProcessor*> postProcessors;
49  MSXMixer* mixer;
50  EmuDuration duration;
51  EmuTime prevTime;
52  unsigned sampleRate;
53  unsigned frameWidth;
54  unsigned frameHeight;
55  bool warnedFps;
56  bool warnedSampleRate;
57  bool warnedStereo;
58  bool stereo;
59 
60  friend class RecordCommand;
61 };
62 
63 } // namespace openmsx
64 
65 #endif