openMSX
FinishFrameEvent.hh
Go to the documentation of this file.
1 #ifndef FINISHFRAMEEVENT_HH
2 #define FINISHFRAMEEVENT_HH
3 
4 #include "Event.hh"
5 #include "TclObject.hh"
6 #include "checked_cast.hh"
7 #include <tuple>
8 
9 namespace openmsx {
10 
22 class FinishFrameEvent final : public Event
23 {
24 public:
25  FinishFrameEvent(int thisSource_, int selectedSource_,
26  bool skipped_)
28  , thisSource(thisSource_), selectedSource(selectedSource_)
29  , skipped(skipped_)
30  {
31  }
32 
33  [[nodiscard]] int getSource() const { return thisSource; }
34  [[nodiscard]] int getSelectedSource() const { return selectedSource; }
35  [[nodiscard]] bool isSkipped() const { return skipped; }
36  [[nodiscard]] bool needRender() const { return !skipped && (thisSource == selectedSource); }
37 
38  [[nodiscard]] TclObject toTclList() const override
39  {
40  return makeTclList("finishframe",
41  int(thisSource),
42  int(selectedSource),
43  skipped);
44  }
45  [[nodiscard]] bool equalImpl(const Event& other) const override
46  {
47  const auto& e = checked_cast<const FinishFrameEvent&>(other);
48  return std::tuple( getSource(), getSelectedSource(), isSkipped()) ==
49  std::tuple(e.getSource(), e.getSelectedSource(), e.isSkipped());
50  }
51 
52 private:
53  const int thisSource;
54  const int selectedSource;
55  const bool skipped;
56 };
57 
58 } // namespace openmsx
59 
60 #endif
This event is send when a device (v99x8, v9990, video9000, laserdisc) reaches the end of a frame.
FinishFrameEvent(int thisSource_, int selectedSource_, bool skipped_)
TclObject toTclList() const override
Similar to toString(), but retains the structure of the event.
bool equalImpl(const Event &other) const override
This file implemented 3 utility functions:
Definition: Autofire.cc:9
@ OPENMSX_FINISH_FRAME_EVENT
Sent when VDP (V99x8 or V9990) reaches the end of a frame.
Definition: Event.hh:39
TclObject makeTclList(Args &&... args)
Definition: TclObject.hh:291