38 void setMotor(
bool status, EmuTime::param time)
override;
39 int16_t
readSample(EmuTime::param time)
override;
40 void setSignal(
bool output, EmuTime::param time)
override;
43 std::string_view
getName()
const override;
55 template<
typename Archive>
56 void serialize(Archive& ar,
unsigned version);
78 [[nodiscard]] std::string getStateString()
const;
81 void setImageName(
const Filename& newImage);
82 void checkInvariants()
const;
86 void playTape(
const Filename& filename, EmuTime::param time);
87 void insertTape(
const Filename& filename, EmuTime::param time);
91 void removeTape(EmuTime::param time);
96 void recordTape(
const Filename& filename, EmuTime::param time);
102 void rewind(EmuTime::param time);
103 void wind(EmuTime::param time);
107 void setMotorControl(
bool status, EmuTime::param time);
112 bool isRolling()
const;
118 void updateLoadingState(EmuTime::param time);
122 void setTapePos(EmuTime::param time,
double newPos);
124 void sync(EmuTime::param time);
128 void fillBuf(
size_t length,
double x);
136 void executeUntil(EmuTime::param time)
override {
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;
176 LoadingIndicator loadingIndicator;
177 BooleanSetting autoRunSetting;
178 std::unique_ptr<Wav8Writer> recordImage;
179 std::unique_ptr<CassetteImage> playImage;
183 bool lastOutput =
false;
184 bool motor =
false, motorControl =
true;
185 bool syncScheduled =
false;