mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Adds tape motor LED.
This commit is contained in:
parent
54e2eb0948
commit
d368dae94a
@ -1167,6 +1167,7 @@ template <bool has_fdc> class ConcreteMachine:
|
||||
// MARK: - Activity Source
|
||||
void set_activity_observer([[maybe_unused]] Activity::Observer *observer) final {
|
||||
if constexpr (has_fdc) fdc_.set_activity_observer(observer);
|
||||
tape_player_.set_activity_observer(observer);
|
||||
}
|
||||
|
||||
// MARK: - Configuration options.
|
||||
|
@ -135,6 +135,18 @@ void BinaryTapePlayer::set_motor_control(bool enabled) {
|
||||
if(motor_is_running_ != enabled) {
|
||||
motor_is_running_ = enabled;
|
||||
update_clocking_observer();
|
||||
|
||||
if(observer_) {
|
||||
observer_->set_led_status("Tape motor", enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BinaryTapePlayer::set_activity_observer(Activity::Observer *observer) {
|
||||
observer_ = observer;
|
||||
if(observer) {
|
||||
observer->register_led("Tape motor");
|
||||
observer_->set_led_status("Tape motor", motor_is_running_);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
#include "../TimedEventLoop.hpp"
|
||||
|
||||
#include "../../Activity/Source.hpp"
|
||||
|
||||
namespace Storage {
|
||||
namespace Tape {
|
||||
|
||||
@ -151,11 +153,15 @@ class BinaryTapePlayer : public TapePlayer {
|
||||
|
||||
ClockingHint::Preference preferred_clocking() const final;
|
||||
|
||||
void set_activity_observer(Activity::Observer *observer);
|
||||
|
||||
protected:
|
||||
Delegate *delegate_ = nullptr;
|
||||
void process_input_pulse(const Storage::Tape::Tape::Pulse &pulse) final;
|
||||
bool input_level_ = false;
|
||||
bool motor_is_running_ = false;
|
||||
|
||||
Activity::Observer *observer_ = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user