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);
90 void wind(EmuTime::param time);
94 void setMotorControl(
bool status, EmuTime::param time);
99 bool isRolling()
const;
105 void updateLoadingState(EmuTime::param time);
109 double getTapePos(EmuTime::param time);
113 void setTapePos(EmuTime::param time,
double newPos);
119 double getTapeLength(EmuTime::param time);
121 void sync(EmuTime::param time);
125 void fillBuf(
size_t length,
double x);
130 bool signalEvent(
const Event& event)
override;
135 explicit SyncEndOfTape(Scheduler& s) :
Schedulable(s) {}
136 void executeUntil(EmuTime::param time)
override {
137 auto& cp =
OUTER(CassettePlayer, syncEndOfTape);
138 cp.execEndOfTape(time);
143 explicit SyncAudioEmu(Scheduler& s) :
Schedulable(s) {}
144 void executeUntil(EmuTime::param time)
override {
145 auto& cp =
OUTER(CassettePlayer, syncAudioEmu);
146 cp.execSyncAudioEmu(time);
150 void execEndOfTape(EmuTime::param time);
151 void execSyncAudioEmu(EmuTime::param time);
152 EmuTime::param getCurrentTime()
const {
return syncEndOfTape.getCurrentTime(); }
154 std::array<uint8_t, 1024> buf;
159 double partialInterval;
162 EmuTime tapePos = EmuTime::zero();
166 EmuTime prevSyncTime = EmuTime::zero();
169 unsigned audioPos = 0;
172 MSXMotherBoard& motherBoard;
174 struct TapeCommand final : RecordedCommand {
175 TapeCommand(CommandController& commandController,
176 StateChangeDistributor& stateChangeDistributor,
177 Scheduler& scheduler);
178 void execute(std::span<const TclObject> tokens, TclObject& result,
179 EmuTime::param time)
override;
180 [[nodiscard]] std::string help(std::span<const TclObject> tokens)
const override;
181 void tabCompletion(std::vector<std::string>& tokens)
const override;
182 [[nodiscard]]
bool needRecord(std::span<const TclObject> tokens)
const override;
185 LoadingIndicator loadingIndicator;
186 BooleanSetting autoRunSetting;
187 std::unique_ptr<Wav8Writer> recordImage;
188 std::unique_ptr<CassetteImage> playImage;
192 bool lastOutput =
false;
193 bool motor =
false, motorControl =
true;
194 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