From 2ff8eac022f397bb1aed28aca376fbe422fc8b3c Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 29 May 2024 14:45:49 +1000 Subject: Start on TTS support by logging the data that will become TTS lines Includes some misc cleanup of haptic double-triggering (or non-triggering), since those cases all end up being TTS event double-reporting, which to me crosses the threshold from "annoying" to "usability issue" --- src/tangara/tts/provider.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/tangara/tts/provider.cpp (limited to 'src/tangara/tts/provider.cpp') diff --git a/src/tangara/tts/provider.cpp b/src/tangara/tts/provider.cpp new file mode 100644 index 00000000..7d33bae6 --- /dev/null +++ b/src/tangara/tts/provider.cpp @@ -0,0 +1,38 @@ +/* + * Copyright 2024 jacqueline + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#include "tts/provider.hpp" + +#include +#include +#include + +#include "esp_log.h" + +#include "tts/events.hpp" + +namespace tts { + +[[maybe_unused]] static constexpr char kTag[] = "tts"; + +Provider::Provider() {} + +auto Provider::feed(const Event& e) -> void { + if (std::holds_alternative(e)) { + // ESP_LOGI(kTag, "context changed"); + } else if (std::holds_alternative(e)) { + auto ev = std::get(e); + if (!ev.new_selection) { + // ESP_LOGI(kTag, "no selection"); + } else { + // ESP_LOGI(kTag, "new selection: '%s', interactive? %i", + // ev.new_selection->description.value_or("").c_str(), + // ev.new_selection->is_interactive); + } + } +} + +} // namespace tts -- cgit v1.2.3