1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Splits 'CRTMachine' into three parts: ScanProducer, AudioProducer, TimedMachine.

Simultaneously cleans up some of the naming conventions and tries to make things a bit more template-compatible.
This commit is contained in:
Thomas Harte
2020-04-01 23:19:34 -04:00
parent c4b114133a
commit f417fa82a4
58 changed files with 725 additions and 651 deletions
+7 -7
View File
@@ -8,31 +8,31 @@
#include "KeyboardMachine.hpp"
using namespace KeyboardMachine;
using namespace MachineTypes;
MappedMachine::MappedMachine(const std::set<Inputs::Keyboard::Key> &essential_modifiers) : keyboard_(essential_modifiers) {
MachineTypes::MappedKeyboardMachine::MappedKeyboardMachine(const std::set<Inputs::Keyboard::Key> &essential_modifiers) : keyboard_(essential_modifiers) {
keyboard_.set_delegate(this);
}
bool MappedMachine::keyboard_did_change_key(Inputs::Keyboard *keyboard, Inputs::Keyboard::Key key, bool is_pressed) {
bool MappedKeyboardMachine::keyboard_did_change_key(Inputs::Keyboard *keyboard, Inputs::Keyboard::Key key, bool is_pressed) {
uint16_t mapped_key = get_keyboard_mapper()->mapped_key_for_key(key);
if(mapped_key == KeyNotMapped) return false;
set_key_state(mapped_key, is_pressed);
return true;
}
void MappedMachine::reset_all_keys(Inputs::Keyboard *keyboard) {
void MappedKeyboardMachine::reset_all_keys(Inputs::Keyboard *keyboard) {
// TODO: unify naming.
clear_all_keys();
}
Inputs::Keyboard &MappedMachine::get_keyboard() {
Inputs::Keyboard &MappedKeyboardMachine::get_keyboard() {
return keyboard_;
}
void Machine::type_string(const std::string &) {
void KeyboardMachine::type_string(const std::string &) {
}
MappedMachine::KeyboardMapper *MappedMachine::get_keyboard_mapper() {
MappedKeyboardMachine::KeyboardMapper *MappedKeyboardMachine::get_keyboard_mapper() {
return nullptr;
}