40 void setMotor(
bool status, EmuTime::param time)
override;
41 int16_t
readSample(EmuTime::param time)
override;
42 void setSignal(
bool output, EmuTime::param time)
override;
45 std::string_view
getName()
const override;
57 template<
typename Archive>
58 void serialize(Archive& ar,
unsigned version);
63 [[nodiscard]]
State getState()
const {
return state; }
64 [[nodiscard]] std::string getStateString()
const;
65 void setState(
State newState,
const Filename& newImage,
67 void setImageName(
const Filename& newImage);
68 const Filename& getImageName()
const {
return casImage; }
69 void checkInvariants()
const;
73 void playTape(
const Filename& filename, EmuTime::param time);
74 void insertTape(
const Filename& filename, EmuTime::param time);
78 void removeTape(EmuTime::param time);
83 void recordTape(
const Filename& filename, EmuTime::param time);
89 void rewind(EmuTime::param time);
93 void setMotorControl(
bool status, EmuTime::param time);
98 bool isRolling()
const;
104 void updateLoadingState(EmuTime::param time);
108 double getTapePos(EmuTime::param time);
114 double getTapeLength(EmuTime::param time);
116 void sync(EmuTime::param time);
120 void fillBuf(
size_t length,
double x);
125 int signalEvent(
const Event& event)
override;
130 explicit SyncEndOfTape(Scheduler& s) :
Schedulable(s) {}
131 void executeUntil(EmuTime::param time)
override {
132 auto& cp =
OUTER(CassettePlayer, syncEndOfTape);
133 cp.execEndOfTape(time);
138 explicit SyncAudioEmu(Scheduler& s) :
Schedulable(s) {}
139 void executeUntil(EmuTime::param time)
override {
140 auto& cp =
OUTER(CassettePlayer, syncAudioEmu);
141 cp.execSyncAudioEmu(time);
145 void execEndOfTape(EmuTime::param time);
146 void execSyncAudioEmu(EmuTime::param time);
147 EmuTime::param getCurrentTime()
const {
return syncEndOfTape.getCurrentTime(); }
149 std::array<uint8_t, 1024> buf;
154 double partialInterval;
157 EmuTime tapePos = EmuTime::zero();
161 EmuTime prevSyncTime = EmuTime::zero();
164 unsigned audioPos = 0;
167 MSXMotherBoard& motherBoard;
169 struct TapeCommand final : RecordedCommand {
170 TapeCommand(CommandController& commandController,
171 StateChangeDistributor& stateChangeDistributor,
172 Scheduler& scheduler);
173 void execute(std::span<const TclObject> tokens, TclObject& result,
174 EmuTime::param time)
override;
175 [[nodiscard]] std::string help(std::span<const TclObject> tokens)
const override;
176 void tabCompletion(std::vector<std::string>& tokens)
const override;
177 [[nodiscard]]
bool needRecord(std::span<const TclObject> tokens)
const override;
180 LoadingIndicator loadingIndicator;
181 BooleanSetting autoRunSetting;
182 std::unique_ptr<Wav8Writer> recordImage;
183 std::unique_ptr<CassetteImage> playImage;
187 bool lastOutput =
false;
188 bool motor =
false, motorControl =
true;
189 bool syncScheduled =
false;
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