openMSX
EventDelay.hh
Go to the documentation of this file.
1#ifndef EVENTDELAY_HH
2#define EVENTDELAY_HH
3
4#include "EventListener.hh"
5#include "Schedulable.hh"
6#include "EmuTime.hh"
7#include "Event.hh"
8#include "FloatSetting.hh"
9#include "build-info.hh"
10#include <vector>
11#include <deque>
12#include <cstdint>
13
14namespace openmsx {
15
16class Scheduler;
17class CommandController;
18class EventDistributor;
19class MSXEventDistributor;
20class ReverseManager;
21
26class EventDelay final : private EventListener, private Schedulable
27{
28public:
29 EventDelay(Scheduler& scheduler, CommandController& commandController,
30 EventDistributor& eventDistributor,
31 MSXEventDistributor& msxEventDistributor,
32 ReverseManager& reverseManager);
34
35 void sync(EmuTime::param curEmu);
36 void flush();
37
38private:
39 // EventListener
40 bool signalEvent(const Event& event) override;
41
42 // Schedulable
43 void executeUntil(EmuTime::param time) override;
44
45private:
46 EventDistributor& eventDistributor;
47 MSXEventDistributor& msxEventDistributor;
48
49 std::vector<Event> toBeScheduledEvents;
50 std::deque<Event> scheduledEvents;
51
52#if PLATFORM_ANDROID
53 std::vector<std::pair<int, Event>> nonMatchedKeyPresses;
54#endif
55
56 EmuTime prevEmu = EmuTime::zero();
57 uint64_t prevReal;
58 FloatSetting delaySetting;
59};
60
61} // namespace openmsx
62
63#endif
This class is responsible for translating host events into MSX events.
Definition EventDelay.hh:27
void sync(EmuTime::param curEmu)
Definition EventDelay.cc:63
A Setting with a floating point value.
Every class that wants to get scheduled at some point must inherit from this class.
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:445