openMSX
VideoLayer.hh
Go to the documentation of this file.
1#ifndef VIDEOLAYER_HH
2#define VIDEOLAYER_HH
3
5#include "Layer.hh"
6#include "Observer.hh"
7#include "MSXEventListener.hh"
8#include <string>
9
10namespace openmsx {
11
12class MSXMotherBoard;
13class Display;
14class Setting;
15class BooleanSetting;
16
17class VideoLayer : public Layer, protected Observer<Setting>
18 , private MSXEventListener
19{
20public:
21 VideoLayer(const VideoLayer&) = delete;
22 VideoLayer& operator=(const VideoLayer&) = delete;
23
28 [[nodiscard]] int getVideoSource() const;
29 [[nodiscard]] int getVideoSourceSetting() const;
30
34 virtual void takeRawScreenShot(
35 unsigned height, const std::string& filename) = 0;
36
37 // We used to test whether a Layer is active by looking at the
38 // Z-coordinate (Z_MSX_ACTIVE vs Z_MSX_PASSIVE). Though in case of
39 // Video9000 it's possible the Video9000 layer is selected, but we
40 // still need to render this layer (the v99x8 or v9990 layer).
42 void setVideo9000Active(int video9000Source_, Video9000Active active) {
43 video9000Source = video9000Source_;
44 activeVideo9000 = active;
45 }
46 [[nodiscard]] bool needRender() const;
47 [[nodiscard]] bool needRecord() const;
48
49protected:
50 VideoLayer(MSXMotherBoard& motherBoard,
51 const std::string& videoSource);
52 ~VideoLayer() override;
53
54 // Observer<Setting> interface:
55 void update(const Setting& setting) noexcept override;
56
57private:
59 void calcZ();
61 void calcCoverage();
62
63 // MSXEventListener
64 void signalMSXEvent(const Event& event,
65 EmuTime::param time) noexcept override;
66
67private:
69 MSXMotherBoard& motherBoard;
71 Display& display;
73 VideoSourceSetting& videoSourceSetting;
75 VideoSourceActivator videoSourceActivator;
77 BooleanSetting& powerSetting;
78
80 int video9000Source = 0;
82 Video9000Active activeVideo9000 = INACTIVE;
83};
84
85} // namespace openmsx
86
87#endif
BaseSetting * setting
Represents the output window/screen of openMSX.
Definition Display.hh:32
Interface for display layers.
Definition Layer.hh:12
Generic Gang-of-Four Observer class, templatized edition.
Definition Observer.hh:10
int getVideoSource() const
Returns the ID for this VideoLayer.
Definition VideoLayer.cc:39
bool needRecord() const
Definition VideoLayer.cc:91
virtual void takeRawScreenShot(unsigned height, const std::string &filename)=0
Create a raw (=non-post-processed) screenshot.
void setVideo9000Active(int video9000Source_, Video9000Active active)
Definition VideoLayer.hh:42
bool needRender() const
Definition VideoLayer.cc:81
VideoLayer & operator=(const VideoLayer &)=delete
int getVideoSourceSetting() const
Definition VideoLayer.cc:43
void update(const Setting &setting) noexcept override
Definition VideoLayer.cc:48
~VideoLayer() override
Definition VideoLayer.cc:30
VideoLayer(const VideoLayer &)=delete
This file implemented 3 utility functions:
Definition Autofire.cc:11
std::variant< KeyUpEvent, KeyDownEvent, MouseMotionEvent, MouseButtonUpEvent, MouseButtonDownEvent, MouseWheelEvent, JoystickAxisMotionEvent, JoystickHatEvent, JoystickButtonUpEvent, JoystickButtonDownEvent, OsdControlReleaseEvent, OsdControlPressEvent, WindowEvent, TextEvent, FileDropEvent, QuitEvent, FinishFrameEvent, CliCommandEvent, GroupEvent, BootEvent, FrameDrawnEvent, BreakEvent, SwitchRendererEvent, TakeReverseSnapshotEvent, AfterTimedEvent, MachineLoadedEvent, MachineActivatedEvent, MachineDeactivatedEvent, MidiInReaderEvent, MidiInWindowsEvent, MidiInCoreMidiEvent, MidiInCoreMidiVirtualEvent, MidiInALSAEvent, Rs232TesterEvent, Rs232NetEvent, ImGuiDelayedActionEvent, ImGuiActiveEvent > Event
Definition Event.hh:444