start moving include files into subdirs

custom
jacqueline 12 months ago
parent 1573a8c4cd
commit 7d7f7755d1
  1. 12
      src/main/main.cpp
  2. 3
      src/tangara/CMakeLists.txt
  3. 8
      src/tangara/app_console/app_console.hpp
  4. 10
      src/tangara/audio/audio_converter.cpp
  5. 8
      src/tangara/audio/audio_converter.hpp
  6. 20
      src/tangara/audio/audio_decoder.cpp
  7. 10
      src/tangara/audio/audio_decoder.hpp
  8. 4
      src/tangara/audio/audio_events.hpp
  9. 28
      src/tangara/audio/audio_fsm.cpp
  10. 28
      src/tangara/audio/audio_fsm.hpp
  11. 8
      src/tangara/audio/audio_source.cpp
  12. 5
      src/tangara/audio/audio_source.hpp
  13. 2
      src/tangara/audio/bt_audio_output.cpp
  14. 2
      src/tangara/audio/bt_audio_output.hpp
  15. 28
      src/tangara/audio/fatfs_audio_input.cpp
  16. 10
      src/tangara/audio/fatfs_audio_input.hpp
  17. 8
      src/tangara/audio/fatfs_source.cpp
  18. 2
      src/tangara/audio/fatfs_source.hpp
  19. 9
      src/tangara/audio/i2s_audio_output.cpp
  20. 2
      src/tangara/audio/i2s_audio_output.hpp
  21. 4
      src/tangara/audio/readahead_source.cpp
  22. 2
      src/tangara/audio/readahead_source.hpp
  23. 2
      src/tangara/audio/resample.cpp
  24. 14
      src/tangara/audio/track_queue.cpp
  25. 6
      src/tangara/audio/track_queue.hpp
  26. 6
      src/tangara/battery/battery.cpp
  27. 22
      src/tangara/database/database.cpp
  28. 10
      src/tangara/database/database.hpp
  29. 4
      src/tangara/database/env_esp.cpp
  30. 2
      src/tangara/database/file_gatherer.cpp
  31. 12
      src/tangara/database/file_gatherer.hpp
  32. 2
      src/tangara/database/future_fetcher.hpp
  33. 11
      src/tangara/database/index.cpp
  34. 7
      src/tangara/database/index.hpp
  35. 6
      src/tangara/database/records.cpp
  36. 4
      src/tangara/database/records.hpp
  37. 2
      src/tangara/database/tag_parser.cpp
  38. 2
      src/tangara/database/tag_parser.hpp
  39. 16
      src/tangara/database/test/test_database.cpp
  40. 2
      src/tangara/database/test/test_records.cpp
  41. 2
      src/tangara/database/track.cpp
  42. 2
      src/tangara/dev_console/console.cpp
  43. 7
      src/tangara/events/event_queue.cpp
  44. 6
      src/tangara/events/event_queue.hpp
  45. 14
      src/tangara/input/device_factory.cpp
  46. 8
      src/tangara/input/device_factory.hpp
  47. 2
      src/tangara/input/feedback_haptics.hpp
  48. 4
      src/tangara/input/input_device.hpp
  49. 2
      src/tangara/input/input_hook.hpp
  50. 2
      src/tangara/input/input_hook_actions.hpp
  51. 6
      src/tangara/input/input_nav_buttons.cpp
  52. 6
      src/tangara/input/input_nav_buttons.hpp
  53. 6
      src/tangara/input/input_touch_dpad.hpp
  54. 10
      src/tangara/input/input_touch_wheel.cpp
  55. 8
      src/tangara/input/input_touch_wheel.hpp
  56. 6
      src/tangara/input/input_volume_buttons.cpp
  57. 4
      src/tangara/input/input_volume_buttons.hpp
  58. 12
      src/tangara/input/lvgl_input_driver.hpp
  59. 28
      src/tangara/lua/bridge.cpp
  60. 9
      src/tangara/lua/bridge.hpp
  61. 4
      src/tangara/lua/lua_controls.cpp
  62. 36
      src/tangara/lua/lua_database.cpp
  63. 2
      src/tangara/lua/lua_database.hpp
  64. 20
      src/tangara/lua/lua_queue.cpp
  65. 6
      src/tangara/lua/lua_registry.hpp
  66. 20
      src/tangara/lua/lua_screen.cpp
  67. 15
      src/tangara/lua/lua_theme.cpp
  68. 16
      src/tangara/lua/lua_thread.cpp
  69. 2
      src/tangara/lua/lua_thread.hpp
  70. 6
      src/tangara/lua/lua_version.cpp
  71. 8
      src/tangara/lua/property.cpp
  72. 4
      src/tangara/lua/property.hpp
  73. 10
      src/tangara/lua/registry.cpp
  74. 18
      src/tangara/system_fsm/booting.cpp
  75. 14
      src/tangara/system_fsm/idle.cpp
  76. 20
      src/tangara/system_fsm/running.cpp
  77. 2
      src/tangara/system_fsm/service_locator.cpp
  78. 8
      src/tangara/system_fsm/service_locator.hpp
  79. 6
      src/tangara/system_fsm/system_events.hpp
  80. 14
      src/tangara/system_fsm/system_fsm.cpp
  81. 25
      src/tangara/system_fsm/system_fsm.hpp
  82. 10
      src/tangara/ui/lvgl_task.cpp
  83. 6
      src/tangara/ui/lvgl_task.hpp
  84. 14
      src/tangara/ui/modal.cpp
  85. 2
      src/tangara/ui/modal.hpp
  86. 2
      src/tangara/ui/screen.cpp
  87. 8
      src/tangara/ui/screen_lua.cpp
  88. 4
      src/tangara/ui/screen_lua.hpp
  89. 2
      src/tangara/ui/screen_splash.cpp
  90. 2
      src/tangara/ui/screen_splash.hpp
  91. 5
      src/tangara/ui/themes.cpp
  92. 3
      src/tangara/ui/themes.hpp
  93. 6
      src/tangara/ui/ui_events.hpp
  94. 50
      src/tangara/ui/ui_fsm.cpp
  95. 40
      src/tangara/ui/ui_fsm.hpp

@ -7,14 +7,14 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "i2c.hpp"
#include "system_events.hpp"
#include "tinyfsm.hpp" #include "tinyfsm.hpp"
#include "audio_fsm.hpp" #include "audio/audio_fsm.hpp"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "system_fsm.hpp" #include "i2c.hpp"
#include "ui_fsm.hpp" #include "system_fsm/system_events.hpp"
#include "system_fsm/system_fsm.hpp"
#include "ui/ui_fsm.hpp"
extern "C" void app_main(void) { extern "C" void app_main(void) {
ESP_ERROR_CHECK(drivers::init_i2c()); ESP_ERROR_CHECK(drivers::init_i2c());

@ -5,8 +5,7 @@
idf_component_register( idf_component_register(
SRC_DIRS "app_console" "audio" "battery" "database" "dev_console" "events" SRC_DIRS "app_console" "audio" "battery" "database" "dev_console" "events"
"input" "lua" "system_fsm" "ui" "input" "lua" "system_fsm" "ui"
INCLUDE_DIRS "." "app_console" "audio" "battery" "database" "dev_console" INCLUDE_DIRS "."
"events" "input" "lua" "system_fsm" "ui"
REQUIRES "codecs" "drivers" "locale" "memory" "tasks" "util" REQUIRES "codecs" "drivers" "locale" "memory" "tasks" "util"
"tinyfsm" "lvgl" "esp_timer" "luavgl" "esp_app_format" "libcppbor" "libtags" "tinyfsm" "lvgl" "esp_timer" "luavgl" "esp_app_format" "libcppbor" "libtags"
"komihash" "result" "esp_psram" "fatfs" "millershuffle" "speexdsp" "console" "komihash" "result" "esp_psram" "fatfs" "millershuffle" "speexdsp" "console"

@ -8,12 +8,12 @@
#include <memory> #include <memory>
#include "audio/track_queue.hpp"
#include "bluetooth.hpp" #include "bluetooth.hpp"
#include "console.hpp" #include "dev_console/console.hpp"
#include "database.hpp" #include "database/database.hpp"
#include "samd.hpp" #include "samd.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
#include "track_queue.hpp"
namespace console { namespace console {

@ -4,23 +4,23 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "audio_converter.hpp" #include "audio/audio_converter.hpp"
#include <stdint.h> #include <stdint.h>
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
#include <cstdint> #include <cstdint>
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "audio_sink.hpp" #include "audio/audio_sink.hpp"
#include "esp_heap_caps.h" #include "esp_heap_caps.h"
#include "esp_log.h" #include "esp_log.h"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "freertos/projdefs.h" #include "freertos/projdefs.h"
#include "i2s_dac.hpp" #include "i2s_dac.hpp"
#include "resample.hpp" #include "audio/resample.hpp"
#include "sample.hpp" #include "sample.hpp"
#include "tasks.hpp" #include "tasks.hpp"

@ -10,11 +10,11 @@
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "audio_sink.hpp" #include "audio/audio_sink.hpp"
#include "audio_source.hpp" #include "audio/audio_source.hpp"
#include "audio/resample.hpp"
#include "codec.hpp" #include "codec.hpp"
#include "resample.hpp"
#include "sample.hpp" #include "sample.hpp"
namespace audio { namespace audio {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "audio_decoder.hpp" #include "audio/audio_decoder.hpp"
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
@ -25,20 +25,20 @@
#include "freertos/queue.h" #include "freertos/queue.h"
#include "freertos/ringbuf.h" #include "freertos/ringbuf.h"
#include "audio_converter.hpp" #include "audio/audio_converter.hpp"
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "audio_fsm.hpp" #include "audio/audio_fsm.hpp"
#include "audio_sink.hpp" #include "audio/audio_sink.hpp"
#include "audio_source.hpp" #include "audio/audio_source.hpp"
#include "audio/fatfs_audio_input.hpp"
#include "codec.hpp" #include "codec.hpp"
#include "event_queue.hpp" #include "database/track.hpp"
#include "fatfs_audio_input.hpp" #include "events/event_queue.hpp"
#include "i2s_dac.hpp" #include "i2s_dac.hpp"
#include "sample.hpp" #include "sample.hpp"
#include "tasks.hpp" #include "tasks.hpp"
#include "track.hpp"
#include "types.hpp" #include "types.hpp"
#include "ui_fsm.hpp" #include "ui/ui_fsm.hpp"
namespace audio { namespace audio {

@ -9,12 +9,12 @@
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>
#include "audio_converter.hpp" #include "audio/audio_converter.hpp"
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "audio_sink.hpp" #include "audio/audio_sink.hpp"
#include "audio_source.hpp" #include "audio/audio_source.hpp"
#include "codec.hpp" #include "codec.hpp"
#include "track.hpp" #include "database/track.hpp"
#include "types.hpp" #include "types.hpp"
namespace audio { namespace audio {

@ -12,10 +12,10 @@
#include <optional> #include <optional>
#include <string> #include <string>
#include "audio_sink.hpp" #include "audio/audio_sink.hpp"
#include "tinyfsm.hpp" #include "tinyfsm.hpp"
#include "track.hpp" #include "database/track.hpp"
#include "types.hpp" #include "types.hpp"
namespace audio { namespace audio {

@ -4,14 +4,14 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "audio_fsm.hpp" #include "audio/audio_fsm.hpp"
#include <stdint.h> #include <stdint.h>
#include <future> #include <future>
#include <memory> #include <memory>
#include <variant> #include <variant>
#include "audio_sink.hpp" #include "audio/audio_sink.hpp"
#include "bluetooth_types.hpp" #include "bluetooth_types.hpp"
#include "cppbor.h" #include "cppbor.h"
#include "cppbor_parse.h" #include "cppbor_parse.h"
@ -21,23 +21,23 @@
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "freertos/projdefs.h" #include "freertos/projdefs.h"
#include "audio_converter.hpp" #include "audio/audio_converter.hpp"
#include "audio_decoder.hpp" #include "audio/audio_decoder.hpp"
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "audio/bt_audio_output.hpp"
#include "audio/fatfs_audio_input.hpp"
#include "audio/i2s_audio_output.hpp"
#include "audio/track_queue.hpp"
#include "bluetooth.hpp" #include "bluetooth.hpp"
#include "bt_audio_output.hpp" #include "database/future_fetcher.hpp"
#include "event_queue.hpp" #include "database/track.hpp"
#include "fatfs_audio_input.hpp" #include "events/event_queue.hpp"
#include "future_fetcher.hpp"
#include "i2s_audio_output.hpp"
#include "i2s_dac.hpp" #include "i2s_dac.hpp"
#include "nvs.hpp" #include "nvs.hpp"
#include "sample.hpp" #include "sample.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
#include "system_events.hpp" #include "system_fsm/system_events.hpp"
#include "tinyfsm.hpp" #include "tinyfsm.hpp"
#include "track.hpp"
#include "track_queue.hpp"
#include "wm8523.hpp" #include "wm8523.hpp"
namespace audio { namespace audio {

@ -11,24 +11,24 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "audio_sink.hpp" #include "audio/audio_sink.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
#include "tinyfsm.hpp" #include "tinyfsm.hpp"
#include "audio_decoder.hpp" #include "audio/audio_decoder.hpp"
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "bt_audio_output.hpp" #include "audio/bt_audio_output.hpp"
#include "database.hpp" #include "audio/fatfs_audio_input.hpp"
#include "audio/i2s_audio_output.hpp"
#include "audio/track_queue.hpp"
#include "database/database.hpp"
#include "database/tag_parser.hpp"
#include "database/track.hpp"
#include "display.hpp" #include "display.hpp"
#include "fatfs_audio_input.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "i2s_audio_output.hpp"
#include "i2s_dac.hpp" #include "i2s_dac.hpp"
#include "storage.hpp" #include "storage.hpp"
#include "system_events.hpp" #include "system_fsm/system_events.hpp"
#include "tag_parser.hpp"
#include "track.hpp"
#include "track_queue.hpp"
namespace audio { namespace audio {
@ -61,7 +61,7 @@ class AudioState : public tinyfsm::Fsm<AudioState> {
void react(const OutputModeChanged&); void react(const OutputModeChanged&);
virtual void react(const system_fsm::BootComplete&) {} virtual void react(const system_fsm::BootComplete&) {}
virtual void react(const system_fsm::KeyLockChanged&){}; virtual void react(const system_fsm::KeyLockChanged&) {};
virtual void react(const system_fsm::StorageMounted&) {} virtual void react(const system_fsm::StorageMounted&) {}
virtual void react(const system_fsm::BluetoothEvent&); virtual void react(const system_fsm::BluetoothEvent&);
@ -103,7 +103,7 @@ namespace states {
class Uninitialised : public AudioState { class Uninitialised : public AudioState {
public: public:
void react(const system_fsm::BootComplete&) override; void react(const system_fsm::BootComplete&) override;
void react(const system_fsm::BluetoothEvent&) override{}; void react(const system_fsm::BluetoothEvent&) override {};
using AudioState::react; using AudioState::react;
}; };

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "audio_source.hpp" #include "audio/audio_source.hpp"
#include "codec.hpp" #include "codec.hpp"
#include "types.hpp" #include "types.hpp"
@ -14,7 +14,11 @@ TaggedStream::TaggedStream(std::shared_ptr<database::TrackTags> t,
std::unique_ptr<codecs::IStream> w, std::unique_ptr<codecs::IStream> w,
std::string filepath, std::string filepath,
uint32_t offset) uint32_t offset)
: codecs::IStream(w->type()), tags_(t), wrapped_(std::move(w)), filepath_(filepath), offset_(offset) {} : codecs::IStream(w->type()),
tags_(t),
wrapped_(std::move(w)),
filepath_(filepath),
offset_(offset) {}
auto TaggedStream::tags() -> std::shared_ptr<database::TrackTags> { auto TaggedStream::tags() -> std::shared_ptr<database::TrackTags> {
return tags_; return tags_;

@ -8,7 +8,7 @@
#include <memory> #include <memory>
#include "codec.hpp" #include "codec.hpp"
#include "track.hpp" #include "database/track.hpp"
#include "types.hpp" #include "types.hpp"
namespace audio { namespace audio {
@ -18,8 +18,7 @@ class TaggedStream : public codecs::IStream {
TaggedStream(std::shared_ptr<database::TrackTags>, TaggedStream(std::shared_ptr<database::TrackTags>,
std::unique_ptr<codecs::IStream> wrapped, std::unique_ptr<codecs::IStream> wrapped,
std::string path, std::string path,
uint32_t offset = 0 uint32_t offset = 0);
);
auto tags() -> std::shared_ptr<database::TrackTags>; auto tags() -> std::shared_ptr<database::TrackTags>;

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "bt_audio_output.hpp" #include "audio/bt_audio_output.hpp"
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>

@ -13,7 +13,7 @@
#include "result.hpp" #include "result.hpp"
#include "audio_sink.hpp" #include "audio/audio_sink.hpp"
#include "bluetooth.hpp" #include "bluetooth.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "i2s_dac.hpp" #include "i2s_dac.hpp"

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "fatfs_audio_input.hpp" #include "audio/fatfs_audio_input.hpp"
#include <algorithm> #include <algorithm>
#include <climits> #include <climits>
@ -18,24 +18,24 @@
#include <string> #include <string>
#include <variant> #include <variant>
#include "audio/readahead_source.hpp"
#include "esp_heap_caps.h" #include "esp_heap_caps.h"
#include "esp_log.h" #include "esp_log.h"
#include "ff.h" #include "ff.h"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "freertos/projdefs.h" #include "freertos/projdefs.h"
#include "readahead_source.hpp"
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "audio_fsm.hpp" #include "audio/audio_fsm.hpp"
#include "audio_source.hpp" #include "audio/audio_source.hpp"
#include "audio/fatfs_source.hpp"
#include "codec.hpp" #include "codec.hpp"
#include "event_queue.hpp" #include "database/future_fetcher.hpp"
#include "fatfs_source.hpp" #include "database/tag_parser.hpp"
#include "future_fetcher.hpp" #include "database/track.hpp"
#include "events/event_queue.hpp"
#include "spi.hpp" #include "spi.hpp"
#include "tag_parser.hpp"
#include "tasks.hpp" #include "tasks.hpp"
#include "track.hpp"
#include "types.hpp" #include "types.hpp"
[[maybe_unused]] static const char* kTag = "SRC"; [[maybe_unused]] static const char* kTag = "SRC";
@ -61,8 +61,8 @@ auto FatfsAudioInput::SetPath(std::optional<std::string> path) -> void {
} }
} }
auto FatfsAudioInput::SetPath(const std::string& path, uint32_t offset) auto FatfsAudioInput::SetPath(const std::string& path,
-> void { uint32_t offset) -> void {
std::lock_guard<std::mutex> guard{new_stream_mutex_}; std::lock_guard<std::mutex> guard{new_stream_mutex_};
if (OpenFile(path, offset)) { if (OpenFile(path, offset)) {
has_new_stream_ = true; has_new_stream_ = true;
@ -103,8 +103,8 @@ auto FatfsAudioInput::NextStream() -> std::shared_ptr<TaggedStream> {
} }
} }
auto FatfsAudioInput::OpenFile(const std::string& path, uint32_t offset) auto FatfsAudioInput::OpenFile(const std::string& path,
-> bool { uint32_t offset) -> bool {
ESP_LOGI(kTag, "opening file %s", path.c_str()); ESP_LOGI(kTag, "opening file %s", path.c_str());
auto tags = tag_parser_.ReadAndParseTags(path); auto tags = tag_parser_.ReadAndParseTags(path);

@ -15,10 +15,10 @@
#include "ff.h" #include "ff.h"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "audio_source.hpp" #include "audio/audio_source.hpp"
#include "codec.hpp" #include "codec.hpp"
#include "future_fetcher.hpp" #include "database/future_fetcher.hpp"
#include "tag_parser.hpp" #include "database/tag_parser.hpp"
#include "tasks.hpp" #include "tasks.hpp"
#include "types.hpp" #include "types.hpp"
@ -39,7 +39,7 @@ class FatfsAudioInput : public IAudioSource {
* given file path. * given file path.
*/ */
auto SetPath(std::optional<std::string>) -> void; auto SetPath(std::optional<std::string>) -> void;
auto SetPath(const std::string&,uint32_t offset = 0) -> void; auto SetPath(const std::string&, uint32_t offset = 0) -> void;
auto SetPath() -> void; auto SetPath() -> void;
auto HasNewStream() -> bool override; auto HasNewStream() -> bool override;
@ -49,7 +49,7 @@ class FatfsAudioInput : public IAudioSource {
FatfsAudioInput& operator=(const FatfsAudioInput&) = delete; FatfsAudioInput& operator=(const FatfsAudioInput&) = delete;
private: private:
auto OpenFile(const std::string& path,uint32_t offset) -> bool; auto OpenFile(const std::string& path, uint32_t offset) -> bool;
auto ContainerToStreamType(database::Container) auto ContainerToStreamType(database::Container)
-> std::optional<codecs::StreamType>; -> std::optional<codecs::StreamType>;

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "fatfs_source.hpp" #include "audio/fatfs_source.hpp"
#include <sys/_stdint.h> #include <sys/_stdint.h>
#include <cstddef> #include <cstddef>
@ -12,13 +12,13 @@
#include <memory> #include <memory>
#include "esp_log.h" #include "esp_log.h"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "ff.h" #include "ff.h"
#include "audio_source.hpp" #include "audio/audio_source.hpp"
#include "codec.hpp" #include "codec.hpp"
#include "spi.hpp" #include "spi.hpp"
#include "system_events.hpp" #include "system_fsm/system_events.hpp"
#include "types.hpp" #include "types.hpp"
namespace audio { namespace audio {

@ -13,7 +13,7 @@
#include "codec.hpp" #include "codec.hpp"
#include "ff.h" #include "ff.h"
#include "audio_source.hpp" #include "audio/audio_source.hpp"
namespace audio { namespace audio {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "i2s_audio_output.hpp" #include "audio/i2s_audio_output.hpp"
#include <stdint.h> #include <stdint.h>
#include <algorithm> #include <algorithm>
@ -18,7 +18,7 @@
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "freertos/projdefs.h" #include "freertos/projdefs.h"
#include "audio_sink.hpp" #include "audio/audio_sink.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "i2c.hpp" #include "i2c.hpp"
#include "i2s_dac.hpp" #include "i2s_dac.hpp"
@ -120,7 +120,7 @@ auto I2SAudioOutput::SetVolumePct(uint_fast8_t val) -> bool {
if (val > 100) { if (val > 100) {
return false; return false;
} }
uint16_t vol = (val * (max_volume_ - kMinVolume))/100 + kMinVolume; uint16_t vol = (val * (max_volume_ - kMinVolume)) / 100 + kMinVolume;
SetVolume(vol); SetVolume(vol);
return true; return true;
} }
@ -133,7 +133,8 @@ auto I2SAudioOutput::GetVolumeDb() -> int_fast16_t {
} }
auto I2SAudioOutput::SetVolumeDb(int_fast16_t val) -> bool { auto I2SAudioOutput::SetVolumeDb(int_fast16_t val) -> bool {
SetVolume(val * 4 + static_cast<int>(drivers::wm8523::kLineLevelReferenceVolume) - 2); SetVolume(val * 4 +
static_cast<int>(drivers::wm8523::kLineLevelReferenceVolume) - 2);
return true; return true;
} }

@ -11,7 +11,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "audio_sink.hpp" #include "audio/audio_sink.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "i2s_dac.hpp" #include "i2s_dac.hpp"
#include "result.hpp" #include "result.hpp"

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "readahead_source.hpp" #include "audio/readahead_source.hpp"
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
@ -14,7 +14,7 @@
#include "esp_log.h" #include "esp_log.h"
#include "ff.h" #include "ff.h"
#include "audio_source.hpp" #include "audio/audio_source.hpp"
#include "codec.hpp" #include "codec.hpp"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "spi.hpp" #include "spi.hpp"

@ -15,7 +15,7 @@
#include "ff.h" #include "ff.h"
#include "freertos/stream_buffer.h" #include "freertos/stream_buffer.h"
#include "audio_source.hpp" #include "audio/audio_source.hpp"
#include "codec.hpp" #include "codec.hpp"
#include "tasks.hpp" #include "tasks.hpp"

@ -3,7 +3,7 @@
* *
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "resample.hpp" #include "audio/resample.hpp"
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "track_queue.hpp" #include "audio/track_queue.hpp"
#include <stdint.h> #include <stdint.h>
#include <algorithm> #include <algorithm>
@ -18,16 +18,16 @@
#include "MillerShuffle.h" #include "MillerShuffle.h"
#include "esp_random.h" #include "esp_random.h"
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "audio_fsm.hpp" #include "audio/audio_fsm.hpp"
#include "cppbor.h" #include "cppbor.h"
#include "cppbor_parse.h" #include "cppbor_parse.h"
#include "database.hpp" #include "database/database.hpp"
#include "event_queue.hpp" #include "database/track.hpp"
#include "events/event_queue.hpp"
#include "memory_resource.hpp" #include "memory_resource.hpp"
#include "tasks.hpp" #include "tasks.hpp"
#include "track.hpp" #include "ui/ui_fsm.hpp"
#include "ui_fsm.hpp"
namespace audio { namespace audio {

@ -12,11 +12,11 @@
#include <shared_mutex> #include <shared_mutex>
#include <vector> #include <vector>
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "cppbor_parse.h" #include "cppbor_parse.h"
#include "database.hpp" #include "database/database.hpp"
#include "database/track.hpp"
#include "tasks.hpp" #include "tasks.hpp"
#include "track.hpp"
namespace audio { namespace audio {

@ -4,15 +4,15 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "battery.hpp" #include "battery/battery.hpp"
#include <cstdint> #include <cstdint>
#include "adc.hpp" #include "adc.hpp"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "samd.hpp" #include "samd.hpp"
#include "system_events.hpp" #include "system_fsm/system_events.hpp"
namespace battery { namespace battery {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "database.hpp" #include "database/database.hpp"
#include <stdint.h> #include <stdint.h>
#include <sys/_stdint.h> #include <sys/_stdint.h>
@ -23,10 +23,10 @@
#include "collation.hpp" #include "collation.hpp"
#include "cppbor.h" #include "cppbor.h"
#include "cppbor_parse.h" #include "cppbor_parse.h"
#include "database/index.hpp"
#include "esp_log.h" #include "esp_log.h"
#include "ff.h" #include "ff.h"
#include "freertos/projdefs.h" #include "freertos/projdefs.h"
#include "index.hpp"
#include "komihash.h" #include "komihash.h"
#include "leveldb/cache.h" #include "leveldb/cache.h"
#include "leveldb/db.h" #include "leveldb/db.h"
@ -36,17 +36,17 @@
#include "leveldb/status.h" #include "leveldb/status.h"
#include "leveldb/write_batch.h" #include "leveldb/write_batch.h"
#include "db_events.hpp" #include "database/db_events.hpp"
#include "env_esp.hpp" #include "database/env_esp.hpp"
#include "event_queue.hpp" #include "database/file_gatherer.hpp"
#include "file_gatherer.hpp" #include "database/records.hpp"
#include "database/tag_parser.hpp"
#include "database/track.hpp"
#include "events/event_queue.hpp"
#include "memory_resource.hpp" #include "memory_resource.hpp"
#include "records.hpp"
#include "result.hpp" #include "result.hpp"
#include "spi.hpp" #include "spi.hpp"
#include "tag_parser.hpp"
#include "tasks.hpp" #include "tasks.hpp"
#include "track.hpp"
namespace database { namespace database {
@ -63,8 +63,8 @@ static const char kKeyTrackId[] = "next_track_id";
static std::atomic<bool> sIsDbOpen(false); static std::atomic<bool> sIsDbOpen(false);
static auto CreateNewDatabase(leveldb::Options& options, locale::ICollator& col) static auto CreateNewDatabase(leveldb::Options& options,
-> leveldb::DB* { locale::ICollator& col) -> leveldb::DB* {
Database::Destroy(); Database::Destroy();
leveldb::DB* db; leveldb::DB* db;
options.create_if_missing = true; options.create_if_missing = true;

@ -19,19 +19,19 @@
#include "collation.hpp" #include "collation.hpp"
#include "cppbor.h" #include "cppbor.h"
#include "file_gatherer.hpp" #include "database/file_gatherer.hpp"
#include "index.hpp" #include "database/index.hpp"
#include "database/records.hpp"
#include "database/tag_parser.hpp"
#include "database/track.hpp"
#include "leveldb/cache.h" #include "leveldb/cache.h"
#include "leveldb/db.h" #include "leveldb/db.h"
#include "leveldb/iterator.h" #include "leveldb/iterator.h"
#include "leveldb/options.h" #include "leveldb/options.h"
#include "leveldb/slice.h" #include "leveldb/slice.h"
#include "memory_resource.hpp" #include "memory_resource.hpp"
#include "records.hpp"
#include "result.hpp" #include "result.hpp"
#include "tag_parser.hpp"
#include "tasks.hpp" #include "tasks.hpp"
#include "track.hpp"
namespace database { namespace database {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "env_esp.hpp" #include "database/env_esp.hpp"
#include <atomic> #include <atomic>
#include <cerrno> #include <cerrno>
@ -41,7 +41,7 @@
namespace leveldb { namespace leveldb {
tasks::WorkerPool *sBackgroundThread = nullptr; tasks::WorkerPool* sBackgroundThread = nullptr;
std::string ErrToStr(FRESULT err) { std::string ErrToStr(FRESULT err) {
switch (err) { switch (err) {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "file_gatherer.hpp" #include "database/file_gatherer.hpp"
#include <deque> #include <deque>
#include <functional> #include <functional>

@ -17,20 +17,18 @@ namespace database {
class IFileGatherer { class IFileGatherer {
public: public:
virtual ~IFileGatherer(){}; virtual ~IFileGatherer() {};
virtual auto FindFiles( virtual auto FindFiles(
const std::string& root, const std::string& root,
std::function<void(std::string_view, const FILINFO&)> cb) std::function<void(std::string_view, const FILINFO&)> cb) -> void = 0;
-> void = 0;
}; };
class FileGathererImpl : public IFileGatherer { class FileGathererImpl : public IFileGatherer {
public: public:
virtual auto FindFiles( virtual auto FindFiles(const std::string& root,
const std::string& root, std::function<void(std::string_view, const FILINFO&)>
std::function<void(std::string_view, const FILINFO&)> cb) cb) -> void override;
-> void override;
}; };
} // namespace database } // namespace database

@ -9,7 +9,7 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "database.hpp" #include "database/database.hpp"
namespace database { namespace database {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "index.hpp" #include "database/index.hpp"
#include <sys/_stdint.h> #include <sys/_stdint.h>
#include <cstdint> #include <cstdint>
@ -21,8 +21,8 @@
#include "komihash.h" #include "komihash.h"
#include "leveldb/write_batch.h" #include "leveldb/write_batch.h"
#include "records.hpp" #include "database/records.hpp"
#include "track.hpp" #include "database/track.hpp"
namespace database { namespace database {
@ -183,8 +183,9 @@ auto Indexer::handleItem(const IndexKey::Header& header,
} }
} }
auto Index(locale::ICollator& c, const IndexInfo& i, const Track& t) auto Index(locale::ICollator& c,
-> std::vector<std::pair<IndexKey, std::string>> { const IndexInfo& i,
const Track& t) -> std::vector<std::pair<IndexKey, std::string>> {
Indexer indexer{c, t, i}; Indexer indexer{c, t, i};
return indexer.index(); return indexer.index();
} }

@ -17,9 +17,9 @@
#include "leveldb/db.h" #include "leveldb/db.h"
#include "leveldb/slice.h" #include "leveldb/slice.h"
#include "database/track.hpp"
#include "leveldb/write_batch.h" #include "leveldb/write_batch.h"
#include "memory_resource.hpp" #include "memory_resource.hpp"
#include "track.hpp"
namespace database { namespace database {
@ -61,8 +61,9 @@ struct IndexKey {
std::optional<TrackId> track; std::optional<TrackId> track;
}; };
auto Index(locale::ICollator&, const IndexInfo&, const Track&) auto Index(locale::ICollator&,
-> std::vector<std::pair<IndexKey, std::string>>; const IndexInfo&,
const Track&) -> std::vector<std::pair<IndexKey, std::string>>;
auto ExpandHeader(const IndexKey::Header&, auto ExpandHeader(const IndexKey::Header&,
const std::optional<std::pmr::string>&) -> IndexKey::Header; const std::optional<std::pmr::string>&) -> IndexKey::Header;

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "records.hpp" #include "database/records.hpp"
#include <stdint.h> #include <stdint.h>
#include <sys/_stdint.h> #include <sys/_stdint.h>
@ -21,10 +21,10 @@
#include "cppbor_parse.h" #include "cppbor_parse.h"
#include "esp_log.h" #include "esp_log.h"
#include "index.hpp" #include "database/index.hpp"
#include "database/track.hpp"
#include "komihash.h" #include "komihash.h"
#include "memory_resource.hpp" #include "memory_resource.hpp"
#include "track.hpp"
// As LevelDB is a key-value store, each record in the database consists of a // As LevelDB is a key-value store, each record in the database consists of a
// key and an optional value. // key and an optional value.

@ -15,9 +15,9 @@
#include "leveldb/db.h" #include "leveldb/db.h"
#include "leveldb/slice.h" #include "leveldb/slice.h"
#include "index.hpp" #include "database/index.hpp"
#include "database/track.hpp"
#include "memory_resource.hpp" #include "memory_resource.hpp"
#include "track.hpp"
namespace database { namespace database {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "tag_parser.hpp" #include "database/tag_parser.hpp"
#include <cstdint> #include <cstdint>
#include <cstdlib> #include <cstdlib>

@ -8,8 +8,8 @@
#include <string> #include <string>
#include "database/track.hpp"
#include "lru_cache.hpp" #include "lru_cache.hpp"
#include "track.hpp"
namespace database { namespace database {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "database.hpp" #include "database/database.hpp"
#include <stdint.h> #include <stdint.h>
#include <iomanip> #include <iomanip>
@ -13,14 +13,14 @@
#include <string> #include <string>
#include "catch2/catch.hpp" #include "catch2/catch.hpp"
#include "database/file_gatherer.hpp"
#include "database/tag_parser.hpp"
#include "database/track.hpp"
#include "driver_cache.hpp" #include "driver_cache.hpp"
#include "esp_log.h" #include "esp_log.h"
#include "file_gatherer.hpp"
#include "i2c_fixture.hpp" #include "i2c_fixture.hpp"
#include "leveldb/db.h" #include "leveldb/db.h"
#include "spi_fixture.hpp" #include "spi_fixture.hpp"
#include "tag_parser.hpp"
#include "track.hpp"
namespace database { namespace database {
@ -28,8 +28,8 @@ class TestBackends : public IFileGatherer, public ITagParser {
public: public:
std::map<std::pmr::string, TrackTags> tracks; std::map<std::pmr::string, TrackTags> tracks;
auto MakeTrack(const std::pmr::string& path, const std::pmr::string& title) auto MakeTrack(const std::pmr::string& path,
-> void { const std::pmr::string& title) -> void {
TrackTags tags; TrackTags tags;
tags.encoding = Encoding::kMp3; tags.encoding = Encoding::kMp3;
tags.title = title; tags.title = title;
@ -44,8 +44,8 @@ class TestBackends : public IFileGatherer, public ITagParser {
} }
} }
auto ReadAndParseTags(const std::pmr::string& path, TrackTags* out) auto ReadAndParseTags(const std::pmr::string& path,
-> bool override { TrackTags* out) -> bool override {
if (tracks.contains(path)) { if (tracks.contains(path)) {
*out = tracks.at(path); *out = tracks.at(path);
return true; return true;

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "records.hpp" #include "database/records.hpp"
#include <stdint.h> #include <stdint.h>
#include <iomanip> #include <iomanip>

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "track.hpp" #include "database/track.hpp"
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "console.hpp" #include "dev_console/console.hpp"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

@ -6,12 +6,13 @@
#include "events/event_queue.hpp" #include "events/event_queue.hpp"
#include "audio_fsm.hpp"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "freertos/queue.h" #include "freertos/queue.h"
#include "system_fsm.hpp"
#include "ui_fsm.hpp" #include "audio/audio_fsm.hpp"
#include "system_fsm/system_fsm.hpp"
#include "ui/ui_fsm.hpp"
namespace events { namespace events {

@ -11,14 +11,14 @@
#include <queue> #include <queue>
#include <type_traits> #include <type_traits>
#include "audio_fsm.hpp" #include "audio/audio_fsm.hpp"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "freertos/queue.h" #include "freertos/queue.h"
#include "system_fsm.hpp" #include "system_fsm/system_fsm.hpp"
#include "tinyfsm.hpp" #include "tinyfsm.hpp"
#include "ui_fsm.hpp" #include "ui/ui_fsm.hpp"
namespace events { namespace events {

@ -4,16 +4,16 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "device_factory.hpp" #include "input/device_factory.hpp"
#include <memory> #include <memory>
#include "feedback_haptics.hpp" #include "input/feedback_haptics.hpp"
#include "input_device.hpp" #include "input/input_device.hpp"
#include "input_nav_buttons.hpp" #include "input/input_nav_buttons.hpp"
#include "input_touch_dpad.hpp" #include "input/input_touch_dpad.hpp"
#include "input_touch_wheel.hpp" #include "input/input_touch_wheel.hpp"
#include "input_volume_buttons.hpp" #include "input/input_volume_buttons.hpp"
namespace input { namespace input {

@ -9,11 +9,11 @@
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>
#include "feedback_device.hpp" #include "input/feedback_device.hpp"
#include "input_device.hpp" #include "input/input_device.hpp"
#include "input_touch_wheel.hpp" #include "input/input_touch_wheel.hpp"
#include "nvs.hpp" #include "nvs.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
namespace input { namespace input {

@ -8,8 +8,8 @@
#include <cstdint> #include <cstdint>
#include "feedback_device.hpp"
#include "haptics.hpp" #include "haptics.hpp"
#include "input/feedback_device.hpp"
namespace input { namespace input {

@ -11,8 +11,8 @@
#include <vector> #include <vector>
#include "hal/lv_hal_indev.h" #include "hal/lv_hal_indev.h"
#include "input_hook.hpp" #include "input/input_hook.hpp"
#include "property.hpp" #include "lua/property.hpp"
namespace input { namespace input {

@ -13,7 +13,7 @@
#include "hal/lv_hal_indev.h" #include "hal/lv_hal_indev.h"
#include "lua.hpp" #include "lua.hpp"
#include "input_trigger.hpp" #include "input/input_trigger.hpp"
namespace input { namespace input {

@ -7,7 +7,7 @@
#pragma once #pragma once
#include "hal/lv_hal_indev.h" #include "hal/lv_hal_indev.h"
#include "input_hook.hpp" #include "input/input_hook.hpp"
namespace input { namespace input {
namespace actions { namespace actions {

@ -4,12 +4,12 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "input_nav_buttons.hpp" #include "input/input_nav_buttons.hpp"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "hal/lv_hal_indev.h" #include "hal/lv_hal_indev.h"
#include "input_hook_actions.hpp" #include "input/input_hook_actions.hpp"
namespace input { namespace input {

@ -12,9 +12,9 @@
#include "hal/lv_hal_indev.h" #include "hal/lv_hal_indev.h"
#include "haptics.hpp" #include "haptics.hpp"
#include "input_device.hpp" #include "input/input_device.hpp"
#include "input_hook.hpp" #include "input/input_hook.hpp"
#include "input_trigger.hpp" #include "input/input_trigger.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
namespace input { namespace input {

@ -11,9 +11,9 @@
#include "hal/lv_hal_indev.h" #include "hal/lv_hal_indev.h"
#include "haptics.hpp" #include "haptics.hpp"
#include "input_device.hpp" #include "input/input_device.hpp"
#include "input_hook.hpp" #include "input/input_hook.hpp"
#include "input_trigger.hpp" #include "input/input_trigger.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
namespace input { namespace input {

@ -13,13 +13,13 @@
#include "events/event_queue.hpp" #include "events/event_queue.hpp"
#include "haptics.hpp" #include "haptics.hpp"
#include "input_device.hpp" #include "input/input_device.hpp"
#include "input_hook_actions.hpp" #include "input/input_hook_actions.hpp"
#include "input_trigger.hpp" #include "input/input_trigger.hpp"
#include "lua/property.hpp"
#include "nvs.hpp" #include "nvs.hpp"
#include "property.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
#include "ui_events.hpp" #include "ui/ui_events.hpp"
namespace input { namespace input {

@ -12,11 +12,11 @@
#include "hal/lv_hal_indev.h" #include "hal/lv_hal_indev.h"
#include "haptics.hpp" #include "haptics.hpp"
#include "input_device.hpp" #include "input/input_device.hpp"
#include "input_hook.hpp" #include "input/input_hook.hpp"
#include "input_trigger.hpp" #include "input/input_trigger.hpp"
#include "lua/property.hpp"
#include "nvs.hpp" #include "nvs.hpp"
#include "property.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
namespace input { namespace input {

@ -4,10 +4,10 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "input_volume_buttons.hpp" #include "input/input_volume_buttons.hpp"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "input_hook_actions.hpp" #include "input/input_hook_actions.hpp"
namespace input { namespace input {

@ -12,8 +12,8 @@
#include "hal/lv_hal_indev.h" #include "hal/lv_hal_indev.h"
#include "haptics.hpp" #include "haptics.hpp"
#include "input_device.hpp" #include "input/input_device.hpp"
#include "input_hook.hpp" #include "input/input_hook.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
namespace input { namespace input {

@ -12,16 +12,16 @@
#include <set> #include <set>
#include "core/lv_group.h" #include "core/lv_group.h"
#include "device_factory.hpp"
#include "feedback_device.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "hal/lv_hal_indev.h" #include "hal/lv_hal_indev.h"
#include "input/device_factory.hpp"
#include "input/feedback_device.hpp"
#include "input_device.hpp" #include "input/input_device.hpp"
#include "input_hook.hpp" #include "input/input_hook.hpp"
#include "lua_thread.hpp" #include "lua/lua_thread.hpp"
#include "lua/property.hpp"
#include "nvs.hpp" #include "nvs.hpp"
#include "property.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
namespace input { namespace input {

@ -4,33 +4,33 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "bridge.hpp" #include "lua/bridge.hpp"
#include <sys/_stdint.h>
#include <cstdint>
#include <memory> #include <memory>
#include <string> #include <string>
#include "database.hpp" #include "database/database.hpp"
#include "database/index.hpp"
#include "esp_log.h" #include "esp_log.h"
#include "index.hpp"
#include "lauxlib.h" #include "lauxlib.h"
#include "lua.h" #include "lua.h"
#include "lua.hpp" #include "lua.hpp"
#include "lua_controls.hpp" #include "lua/lua_controls.hpp"
#include "lua_database.hpp" #include "lua/lua_database.hpp"
#include "lua_queue.hpp" #include "lua/lua_queue.hpp"
#include "lua_screen.hpp" #include "lua/lua_screen.hpp"
#include "lua_version.hpp" #include "lua/lua_theme.hpp"
#include "lua_theme.hpp" #include "lua/lua_version.hpp"
#include "lvgl.h" #include "lvgl.h"
#include "font/lv_font_loader.h" #include "font/lv_font_loader.h"
#include "luavgl.h" #include "luavgl.h"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "property.hpp" #include "lua/property.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
#include "ui_events.hpp" #include "ui/ui_events.hpp"
extern "C" { extern "C" {
int luaopen_linenoise(lua_State* L); int luaopen_linenoise(lua_State* L);

@ -10,9 +10,9 @@
#include <string> #include <string>
#include "lua.hpp" #include "lua.hpp"
#include "lua/property.hpp"
#include "lvgl.h" #include "lvgl.h"
#include "property.hpp" #include "system_fsm/service_locator.hpp"
#include "service_locator.hpp"
namespace lua { namespace lua {
@ -39,9 +39,8 @@ class Bridge {
auto installPropertyModule( auto installPropertyModule(
lua_State* L, lua_State* L,
const std::string&, const std::string&,
std::vector< std::vector<std::pair<std::string,
std::pair<std::string, std::variant<LuaFunction, Property*>>>&) std::variant<LuaFunction, Property*>>>&) -> void;
-> void;
Bridge(const Bridge&) = delete; Bridge(const Bridge&) = delete;
Bridge& operator=(const Bridge&) = delete; Bridge& operator=(const Bridge&) = delete;

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "lua_controls.hpp" #include "lua/lua_controls.hpp"
#include <memory> #include <memory>
#include <string> #include <string>
@ -17,7 +17,7 @@
#include "lvgl.h" #include "lvgl.h"
#include "nvs.hpp" #include "nvs.hpp"
#include "ui_events.hpp" #include "ui/ui_events.hpp"
namespace lua { namespace lua {

@ -4,30 +4,30 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "lua_database.hpp" #include "lua/lua_database.hpp"
#include <memory> #include <memory>
#include <string> #include <string>
#include <type_traits> #include <type_traits>
#include <variant> #include <variant>
#include "bridge.hpp"
#include "lua.hpp" #include "lua.hpp"
#include "lua/bridge.hpp"
#include "esp_log.h" #include "esp_log.h"
#include "lauxlib.h" #include "lauxlib.h"
#include "lua.h" #include "lua.h"
#include "lua_thread.hpp" #include "lua/lua_thread.hpp"
#include "lvgl.h" #include "lvgl.h"
#include "database.hpp" #include "database/database.hpp"
#include "event_queue.hpp" #include "database/index.hpp"
#include "index.hpp" #include "database/records.hpp"
#include "property.hpp" #include "database/track.hpp"
#include "records.hpp" #include "events/event_queue.hpp"
#include "service_locator.hpp" #include "lua/property.hpp"
#include "track.hpp" #include "system_fsm/service_locator.hpp"
#include "ui_events.hpp" #include "ui/ui_events.hpp"
namespace lua { namespace lua {
@ -152,8 +152,8 @@ auto db_check_iterator(lua_State* L, int stack_pos) -> database::Iterator* {
return it; return it;
} }
static auto push_iterator(lua_State* state, const database::Iterator& it) static auto push_iterator(lua_State* state,
-> void { const database::Iterator& it) -> void {
database::Iterator** data = reinterpret_cast<database::Iterator**>( database::Iterator** data = reinterpret_cast<database::Iterator**>(
lua_newuserdata(state, sizeof(uintptr_t))); lua_newuserdata(state, sizeof(uintptr_t)));
*data = new database::Iterator(it); *data = new database::Iterator(it);
@ -198,12 +198,10 @@ static auto db_iterator_gc(lua_State* state) -> int {
return 0; return 0;
} }
static const struct luaL_Reg kDbIteratorFuncs[] = {{"next", db_iterate}, static const struct luaL_Reg kDbIteratorFuncs[] = {
{"prev", db_iterate_prev}, {"next", db_iterate}, {"prev", db_iterate_prev},
{"clone", db_iterator_clone}, {"clone", db_iterator_clone}, {"__call", db_iterate},
{"__call", db_iterate}, {"__gc", db_iterator_gc}, {NULL, NULL}};
{"__gc", db_iterator_gc},
{NULL, NULL}};
static auto record_text(lua_State* state) -> int { static auto record_text(lua_State* state) -> int {
LuaRecord* data = reinterpret_cast<LuaRecord*>( LuaRecord* data = reinterpret_cast<LuaRecord*>(

@ -8,7 +8,7 @@
#include "lua.hpp" #include "lua.hpp"
#include "database.hpp" #include "database/database.hpp"
namespace lua { namespace lua {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "lua_database.hpp" #include "lua/lua_database.hpp"
#include <memory> #include <memory>
#include <string> #include <string>
@ -16,15 +16,15 @@
#include "lua.h" #include "lua.h"
#include "lvgl.h" #include "lvgl.h"
#include "bridge.hpp" #include "audio/track_queue.hpp"
#include "database.hpp" #include "database/database.hpp"
#include "event_queue.hpp" #include "database/index.hpp"
#include "index.hpp" #include "database/track.hpp"
#include "property.hpp" #include "events/event_queue.hpp"
#include "service_locator.hpp" #include "lua/bridge.hpp"
#include "track.hpp" #include "lua/property.hpp"
#include "track_queue.hpp" #include "system_fsm/service_locator.hpp"
#include "ui_events.hpp" #include "ui/ui_events.hpp"
namespace lua { namespace lua {

@ -11,9 +11,9 @@
#include "lua.hpp" #include "lua.hpp"
#include "bridge.hpp" #include "lua/bridge.hpp"
#include "lua_thread.hpp" #include "lua/lua_thread.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
namespace lua { namespace lua {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "lua_screen.hpp" #include "lua/lua_screen.hpp"
#include <memory> #include <memory>
#include <string> #include <string>
@ -16,15 +16,15 @@
#include "lua.h" #include "lua.h"
#include "lvgl.h" #include "lvgl.h"
#include "bridge.hpp" #include "audio/track_queue.hpp"
#include "database.hpp" #include "database/database.hpp"
#include "event_queue.hpp" #include "database/index.hpp"
#include "index.hpp" #include "database/track.hpp"
#include "property.hpp" #include "events/event_queue.hpp"
#include "service_locator.hpp" #include "lua/bridge.hpp"
#include "track.hpp" #include "lua/property.hpp"
#include "track_queue.hpp" #include "system_fsm/service_locator.hpp"
#include "ui_events.hpp" #include "ui/ui_events.hpp"
namespace lua { namespace lua {

@ -5,20 +5,20 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "lua_version.hpp" #include "lua/lua_version.hpp"
#include <string> #include <string>
#include "bridge.hpp"
#include "lua.hpp" #include "lua.hpp"
#include "lua/bridge.hpp"
#include "esp_app_desc.h" #include "esp_app_desc.h"
#include "esp_log.h" #include "esp_log.h"
#include "lauxlib.h" #include "lauxlib.h"
#include "lua.h" #include "lua.h"
#include "lua_thread.hpp" #include "lua/lua_thread.hpp"
#include "luavgl.h" #include "luavgl.h"
#include "themes.hpp" #include "ui/themes.hpp"
namespace lua { namespace lua {
@ -60,7 +60,8 @@ static auto set_theme(lua_State* L) -> int {
ESP_LOGI("lua_theme", "Style was null or malformed"); ESP_LOGI("lua_theme", "Style was null or malformed");
return 0; return 0;
} else { } else {
ui::themes::Theme::instance()->AddStyle(class_name, selector, style); ui::themes::Theme::instance()->AddStyle(class_name, selector,
style);
} }
} }
lua_pop(L, 1); lua_pop(L, 1);
@ -74,7 +75,9 @@ static auto set_theme(lua_State* L) -> int {
return 0; return 0;
} }
static const struct luaL_Reg kThemeFuncs[] = {{"set", set_theme}, {"set_style", set_style}, {NULL, NULL}}; static const struct luaL_Reg kThemeFuncs[] = {{"set", set_theme},
{"set_style", set_style},
{NULL, NULL}};
static auto lua_theme(lua_State* L) -> int { static auto lua_theme(lua_State* L) -> int {
luaL_newlib(L, kThemeFuncs); luaL_newlib(L, kThemeFuncs);

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "lua_thread.hpp" #include "lua/lua_thread.hpp"
#include <iostream> #include <iostream>
#include <memory> #include <memory>
@ -13,11 +13,11 @@
#include "esp_log.h" #include "esp_log.h"
#include "lua.hpp" #include "lua.hpp"
#include "bridge.hpp" #include "events/event_queue.hpp"
#include "event_queue.hpp" #include "lua/bridge.hpp"
#include "memory_resource.hpp" #include "memory_resource.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
#include "ui_events.hpp" #include "ui/ui_events.hpp"
namespace lua { namespace lua {
@ -42,8 +42,10 @@ class Allocator {
size_t total_allocated_; size_t total_allocated_;
}; };
static auto lua_alloc(void* ud, void* ptr, size_t osize, size_t nsize) static auto lua_alloc(void* ud,
-> void* { void* ptr,
size_t osize,
size_t nsize) -> void* {
Allocator* instance = reinterpret_cast<Allocator*>(ud); Allocator* instance = reinterpret_cast<Allocator*>(ud);
return instance->alloc(ptr, osize, nsize); return instance->alloc(ptr, osize, nsize);
} }

@ -11,7 +11,7 @@
#include "lua.hpp" #include "lua.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
namespace lua { namespace lua {

@ -5,18 +5,18 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "lua_version.hpp" #include "lua/lua_version.hpp"
#include <string> #include <string>
#include "bridge.hpp"
#include "lua.hpp" #include "lua.hpp"
#include "lua/bridge.hpp"
#include "esp_app_desc.h" #include "esp_app_desc.h"
#include "esp_log.h" #include "esp_log.h"
#include "lauxlib.h" #include "lauxlib.h"
#include "lua.h" #include "lua.h"
#include "lua_thread.hpp" #include "lua/lua_thread.hpp"
namespace lua { namespace lua {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "property.hpp" #include "lua/property.hpp"
#include <sys/_stdint.h> #include <sys/_stdint.h>
#include <cmath> #include <cmath>
@ -15,14 +15,14 @@
#include <variant> #include <variant>
#include "bluetooth_types.hpp" #include "bluetooth_types.hpp"
#include "database/track.hpp"
#include "lauxlib.h" #include "lauxlib.h"
#include "lua.h" #include "lua.h"
#include "lua.hpp" #include "lua.hpp"
#include "lua_thread.hpp" #include "lua/lua_thread.hpp"
#include "lvgl.h" #include "lvgl.h"
#include "memory_resource.hpp" #include "memory_resource.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
#include "track.hpp"
#include "types.hpp" #include "types.hpp"
namespace lua { namespace lua {

@ -10,11 +10,11 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "bluetooth_types.hpp" #include "bluetooth_types.hpp"
#include "lua.hpp" #include "lua.hpp"
#include "lvgl.h" #include "lvgl.h"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
namespace lua { namespace lua {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "lua_registry.hpp" #include "lua/lua_registry.hpp"
#include <iostream> #include <iostream>
#include <memory> #include <memory>
@ -13,11 +13,11 @@
#include "esp_log.h" #include "esp_log.h"
#include "lua.hpp" #include "lua.hpp"
#include "bridge.hpp" #include "events/event_queue.hpp"
#include "event_queue.hpp" #include "lua/bridge.hpp"
#include "memory_resource.hpp" #include "memory_resource.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
#include "ui_events.hpp" #include "ui/ui_events.hpp"
namespace lua { namespace lua {

@ -7,7 +7,7 @@
#include "collation.hpp" #include "collation.hpp"
#include "haptics.hpp" #include "haptics.hpp"
#include "spiffs.hpp" #include "spiffs.hpp"
#include "system_fsm.hpp" #include "system_fsm/system_fsm.hpp"
#include <stdint.h> #include <stdint.h>
#include <memory> #include <memory>
@ -21,24 +21,24 @@
#include "freertos/timers.h" #include "freertos/timers.h"
#include "adc.hpp" #include "adc.hpp"
#include "audio_fsm.hpp" #include "audio/audio_fsm.hpp"
#include "battery.hpp" #include "audio/track_queue.hpp"
#include "battery/battery.hpp"
#include "bluetooth.hpp" #include "bluetooth.hpp"
#include "bluetooth_types.hpp" #include "bluetooth_types.hpp"
#include "database/tag_parser.hpp"
#include "display_init.hpp" #include "display_init.hpp"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "i2c.hpp" #include "i2c.hpp"
#include "nvs.hpp" #include "nvs.hpp"
#include "samd.hpp" #include "samd.hpp"
#include "service_locator.hpp"
#include "spi.hpp" #include "spi.hpp"
#include "system_events.hpp" #include "system_fsm/service_locator.hpp"
#include "tag_parser.hpp" #include "system_fsm/system_events.hpp"
#include "tasks.hpp" #include "tasks.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
#include "track_queue.hpp" #include "ui/ui_fsm.hpp"
#include "ui_fsm.hpp"
namespace system_fsm { namespace system_fsm {
namespace states { namespace states {

@ -4,20 +4,20 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "app_console.hpp" #include "app_console/app_console.hpp"
#include "file_gatherer.hpp" #include "database/file_gatherer.hpp"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "freertos/projdefs.h" #include "freertos/projdefs.h"
#include "gpios.hpp" #include "gpios.hpp"
#include "result.hpp" #include "result.hpp"
#include "audio_fsm.hpp" #include "audio/audio_fsm.hpp"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "samd.hpp" #include "samd.hpp"
#include "storage.hpp" #include "storage.hpp"
#include "system_events.hpp" #include "system_fsm/system_events.hpp"
#include "system_fsm.hpp" #include "system_fsm/system_fsm.hpp"
#include "ui_fsm.hpp" #include "ui/ui_fsm.hpp"
namespace system_fsm { namespace system_fsm {
namespace states { namespace states {

@ -4,23 +4,23 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "app_console.hpp" #include "app_console/app_console.hpp"
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "database.hpp" #include "database/database.hpp"
#include "db_events.hpp" #include "database/db_events.hpp"
#include "database/file_gatherer.hpp"
#include "ff.h" #include "ff.h"
#include "file_gatherer.hpp"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "freertos/projdefs.h" #include "freertos/projdefs.h"
#include "gpios.hpp" #include "gpios.hpp"
#include "result.hpp" #include "result.hpp"
#include "audio_fsm.hpp" #include "audio/audio_fsm.hpp"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "storage.hpp" #include "storage.hpp"
#include "system_events.hpp" #include "system_fsm/system_events.hpp"
#include "system_fsm.hpp" #include "system_fsm/system_fsm.hpp"
#include "ui_fsm.hpp" #include "ui/ui_fsm.hpp"
namespace system_fsm { namespace system_fsm {
namespace states { namespace states {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
#include <memory> #include <memory>

@ -8,19 +8,19 @@
#include <memory> #include <memory>
#include "battery.hpp" #include "audio/track_queue.hpp"
#include "battery/battery.hpp"
#include "bluetooth.hpp" #include "bluetooth.hpp"
#include "collation.hpp" #include "collation.hpp"
#include "database.hpp" #include "database/database.hpp"
#include "database/tag_parser.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "haptics.hpp" #include "haptics.hpp"
#include "nvs.hpp" #include "nvs.hpp"
#include "samd.hpp" #include "samd.hpp"
#include "storage.hpp" #include "storage.hpp"
#include "tag_parser.hpp"
#include "tasks.hpp" #include "tasks.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
#include "track_queue.hpp"
namespace system_fsm { namespace system_fsm {

@ -8,13 +8,13 @@
#include <memory> #include <memory>
#include "battery.hpp" #include "battery/battery.hpp"
#include "bluetooth_types.hpp" #include "bluetooth_types.hpp"
#include "database.hpp" #include "database/database.hpp"
#include "ff.h" #include "ff.h"
#include "haptics.hpp" #include "haptics.hpp"
#include "samd.hpp" #include "samd.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
#include "tinyfsm.hpp" #include "tinyfsm.hpp"
namespace system_fsm { namespace system_fsm {

@ -4,15 +4,15 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "system_fsm.hpp" #include "system_fsm/system_fsm.hpp"
#include "audio_fsm.hpp" #include "audio/audio_fsm.hpp"
#include "audio/track_queue.hpp"
#include "database/tag_parser.hpp"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "service_locator.hpp" #include "system_fsm/service_locator.hpp"
#include "system_events.hpp" #include "system_fsm/system_events.hpp"
#include "tag_parser.hpp"
#include "track_queue.hpp"
[[maybe_unused]] static const char kTag[] = "system"; [[maybe_unused]] static const char kTag[] = "system";

@ -8,28 +8,27 @@
#include <memory> #include <memory>
#include "app_console.hpp" #include "freertos/FreeRTOS.h"
#include "audio_events.hpp" #include "freertos/timers.h"
#include "battery.hpp"
#include "app_console/app_console.hpp"
#include "audio/audio_events.hpp"
#include "audio/track_queue.hpp"
#include "battery/battery.hpp"
#include "bluetooth.hpp" #include "bluetooth.hpp"
#include "database.hpp" #include "database/database.hpp"
#include "db_events.hpp" #include "database/db_events.hpp"
#include "database/tag_parser.hpp"
#include "display.hpp" #include "display.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "nvs.hpp" #include "nvs.hpp"
#include "samd.hpp" #include "samd.hpp"
#include "service_locator.hpp"
#include "storage.hpp" #include "storage.hpp"
#include "tag_parser.hpp" #include "system_fsm/service_locator.hpp"
#include "system_fsm/system_events.hpp"
#include "tinyfsm.hpp" #include "tinyfsm.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
#include "freertos/FreeRTOS.h"
#include "freertos/timers.h"
#include "system_events.hpp"
#include "track_queue.hpp"
namespace system_fsm { namespace system_fsm {
void check_interrupts_cb(TimerHandle_t timer); void check_interrupts_cb(TimerHandle_t timer);

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "lvgl_task.hpp" #include "ui/lvgl_task.hpp"
#include <dirent.h> #include <dirent.h>
#include <stdint.h> #include <stdint.h>
@ -21,7 +21,7 @@
#include "core/lv_obj_pos.h" #include "core/lv_obj_pos.h"
#include "core/lv_obj_tree.h" #include "core/lv_obj_tree.h"
#include "esp_log.h" #include "esp_log.h"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "extra/themes/basic/lv_theme_basic.h" #include "extra/themes/basic/lv_theme_basic.h"
#include "font/lv_font.h" #include "font/lv_font.h"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
@ -30,17 +30,17 @@
#include "hal/gpio_types.h" #include "hal/gpio_types.h"
#include "hal/lv_hal_indev.h" #include "hal/lv_hal_indev.h"
#include "hal/spi_types.h" #include "hal/spi_types.h"
#include "input/lvgl_input_driver.hpp"
#include "lua.h" #include "lua.h"
#include "lv_api_map.h" #include "lv_api_map.h"
#include "lvgl/lvgl.h" #include "lvgl/lvgl.h"
#include "lvgl_input_driver.hpp"
#include "misc/lv_color.h" #include "misc/lv_color.h"
#include "misc/lv_style.h" #include "misc/lv_style.h"
#include "misc/lv_timer.h" #include "misc/lv_timer.h"
#include "modal.hpp"
#include "tasks.hpp" #include "tasks.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
#include "ui_fsm.hpp" #include "ui/modal.hpp"
#include "ui/ui_fsm.hpp"
#include "widgets/lv_label.h" #include "widgets/lv_label.h"
#include "display.hpp" #include "display.hpp"

@ -15,10 +15,10 @@
#include "freertos/timers.h" #include "freertos/timers.h"
#include "display.hpp" #include "display.hpp"
#include "lvgl_input_driver.hpp" #include "input/lvgl_input_driver.hpp"
#include "screen.hpp"
#include "themes.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
#include "ui/screen.hpp"
#include "ui/themes.hpp"
namespace ui { namespace ui {

@ -5,7 +5,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "modal.hpp" #include "ui/modal.hpp"
#include "misc/lv_color.h" #include "misc/lv_color.h"
@ -14,17 +14,17 @@
#include "core/lv_group.h" #include "core/lv_group.h"
#include "core/lv_obj_pos.h" #include "core/lv_obj_pos.h"
#include "event_queue.hpp" #include "database/index.hpp"
#include "events/event_queue.hpp"
#include "extra/widgets/list/lv_list.h" #include "extra/widgets/list/lv_list.h"
#include "extra/widgets/menu/lv_menu.h" #include "extra/widgets/menu/lv_menu.h"
#include "extra/widgets/spinner/lv_spinner.h" #include "extra/widgets/spinner/lv_spinner.h"
#include "hal/lv_hal_disp.h" #include "hal/lv_hal_disp.h"
#include "index.hpp"
#include "misc/lv_area.h" #include "misc/lv_area.h"
#include "screen.hpp" #include "ui/screen.hpp"
#include "themes.hpp" #include "ui/themes.hpp"
#include "ui_events.hpp" #include "ui/ui_events.hpp"
#include "ui_fsm.hpp" #include "ui/ui_fsm.hpp"
#include "widgets/lv_label.h" #include "widgets/lv_label.h"
namespace ui { namespace ui {

@ -13,7 +13,7 @@
#include "core/lv_obj_tree.h" #include "core/lv_obj_tree.h"
#include "lvgl.h" #include "lvgl.h"
#include "screen.hpp" #include "ui/screen.hpp"
namespace ui { namespace ui {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "screen.hpp" #include "ui/screen.hpp"
#include <memory> #include <memory>

@ -4,15 +4,15 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "screen_lua.hpp" #include "ui/screen_lua.hpp"
#include "core/lv_obj_tree.h" #include "core/lv_obj_tree.h"
#include "lua.h" #include "lua.h"
#include "lua.hpp" #include "lua.hpp"
#include "property.hpp" #include "lua/property.hpp"
#include "themes.hpp" #include "ui/themes.hpp"
#include "lua_thread.hpp" #include "lua/lua_thread.hpp"
#include "luavgl.h" #include "luavgl.h"
namespace ui { namespace ui {

@ -8,8 +8,8 @@
#include "lua.hpp" #include "lua.hpp"
#include "property.hpp" #include "lua/property.hpp"
#include "screen.hpp" #include "ui/screen.hpp"
namespace ui { namespace ui {
namespace screens { namespace screens {

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "screen_splash.hpp" #include "ui/screen_splash.hpp"
#include "core/lv_obj.h" #include "core/lv_obj.h"
#include "core/lv_obj_style.h" #include "core/lv_obj_style.h"

@ -10,7 +10,7 @@
#include "lvgl.h" #include "lvgl.h"
#include "screen.hpp" #include "ui/screen.hpp"
namespace ui { namespace ui {
namespace screens { namespace screens {

@ -1,4 +1,4 @@
#include "themes.hpp" #include "ui/themes.hpp"
#include "core/lv_obj.h" #include "core/lv_obj.h"
#include "core/lv_obj_style.h" #include "core/lv_obj_style.h"
#include "core/lv_obj_tree.h" #include "core/lv_obj_tree.h"
@ -64,7 +64,6 @@ void Theme::Callback(lv_obj_t* obj) {
lv_obj_add_style(obj, pair.second, pair.first); lv_obj_add_style(obj, pair.second, pair.first);
} }
} }
} }
void Theme::ApplyStyle(lv_obj_t* obj, std::string style_key) { void Theme::ApplyStyle(lv_obj_t* obj, std::string style_key) {
@ -85,7 +84,7 @@ void Theme::AddStyle(std::string key, int selector, lv_style_t* style) {
style_map.try_emplace(key, std::vector<std::pair<int, lv_style_t*>>{}); style_map.try_emplace(key, std::vector<std::pair<int, lv_style_t*>>{});
if (auto search = style_map.find(key); search != style_map.end()) { if (auto search = style_map.find(key); search != style_map.end()) {
// Key exists // Key exists
auto &vec = search->second; auto& vec = search->second;
// Add it to the list // Add it to the list
vec.push_back(std::make_pair(selector, style)); vec.push_back(std::make_pair(selector, style));
} }

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <string>
#include <map> #include <map>
#include <string>
#include <vector> #include <vector>
#include "lvgl.h" #include "lvgl.h"
@ -32,7 +32,6 @@ class Theme {
Theme(); Theme();
std::map<std::string, std::vector<std::pair<int, lv_style_t*>>> style_map; std::map<std::string, std::vector<std::pair<int, lv_style_t*>>> style_map;
lv_theme_t theme_; lv_theme_t theme_;
}; };
} // namespace themes } // namespace themes
} // namespace ui } // namespace ui

@ -7,12 +7,12 @@
#pragma once #pragma once
#include <memory> #include <memory>
#include "database.hpp" #include "database/database.hpp"
#include "database/index.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "index.hpp"
#include "nvs.hpp" #include "nvs.hpp"
#include "screen.hpp"
#include "tinyfsm.hpp" #include "tinyfsm.hpp"
#include "ui/screen.hpp"
namespace ui { namespace ui {

@ -4,61 +4,61 @@
* SPDX-License-Identifier: GPL-3.0-only * SPDX-License-Identifier: GPL-3.0-only
*/ */
#include "ui_fsm.hpp" #include "ui/ui_fsm.hpp"
#include <memory> #include <memory>
#include <memory_resource> #include <memory_resource>
#include <variant> #include <variant>
#include "bluetooth_types.hpp" #include "bluetooth_types.hpp"
#include "db_events.hpp" #include "database/db_events.hpp"
#include "device_factory.hpp"
#include "display_init.hpp" #include "display_init.hpp"
#include "esp_spp_api.h" #include "esp_spp_api.h"
#include "feedback_haptics.hpp"
#include "freertos/portmacro.h" #include "freertos/portmacro.h"
#include "freertos/projdefs.h" #include "freertos/projdefs.h"
#include "input_device.hpp" #include "input/device_factory.hpp"
#include "input_touch_wheel.hpp" #include "input/feedback_haptics.hpp"
#include "input_volume_buttons.hpp" #include "input/input_device.hpp"
#include "input/input_touch_wheel.hpp"
#include "input/input_volume_buttons.hpp"
#include "lua.h" #include "lua.h"
#include "lua.hpp" #include "lua.hpp"
#include "audio_fsm.hpp" #include "audio/audio_fsm.hpp"
#include "battery.hpp" #include "battery/battery.hpp"
#include "core/lv_group.h" #include "core/lv_group.h"
#include "core/lv_obj.h" #include "core/lv_obj.h"
#include "core/lv_obj_tree.h" #include "core/lv_obj_tree.h"
#include "database.hpp" #include "database/database.hpp"
#include "esp_heap_caps.h" #include "esp_heap_caps.h"
#include "esp_timer.h" #include "esp_timer.h"
#include "haptics.hpp" #include "haptics.hpp"
#include "input/lvgl_input_driver.hpp"
#include "lauxlib.h" #include "lauxlib.h"
#include "lua_thread.hpp" #include "lua/lua_thread.hpp"
#include "luavgl.h" #include "luavgl.h"
#include "lvgl_input_driver.hpp"
#include "memory_resource.hpp" #include "memory_resource.hpp"
#include "misc/lv_gc.h" #include "misc/lv_gc.h"
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "audio/track_queue.hpp"
#include "display.hpp" #include "display.hpp"
#include "event_queue.hpp" #include "events/event_queue.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "lua_registry.hpp" #include "lua/lua_registry.hpp"
#include "lvgl_task.hpp" #include "lua/property.hpp"
#include "nvs.hpp" #include "nvs.hpp"
#include "property.hpp"
#include "samd.hpp" #include "samd.hpp"
#include "screen.hpp"
#include "screen_lua.hpp"
#include "screen_splash.hpp"
#include "spiffs.hpp" #include "spiffs.hpp"
#include "storage.hpp" #include "storage.hpp"
#include "system_events.hpp" #include "system_fsm/system_events.hpp"
#include "tinyfsm.hpp" #include "tinyfsm.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
#include "track_queue.hpp" #include "ui/lvgl_task.hpp"
#include "ui_events.hpp" #include "ui/screen.hpp"
#include "ui/screen_lua.hpp"
#include "ui/screen_splash.hpp"
#include "ui/ui_events.hpp"
#include "widgets/lv_label.h" #include "widgets/lv_label.h"
namespace ui { namespace ui {
@ -266,8 +266,8 @@ lua::Property UiState::sUsbMassStorageEnabled{
lua::Property UiState::sUsbMassStorageBusy{false}; lua::Property UiState::sUsbMassStorageBusy{false};
auto UiState::InitBootSplash(drivers::IGpios& gpios, drivers::NvsStorage& nvs) auto UiState::InitBootSplash(drivers::IGpios& gpios,
-> bool { drivers::NvsStorage& nvs) -> bool {
events::Ui().Dispatch(internal::InitDisplay{ events::Ui().Dispatch(internal::InitDisplay{
.gpios = gpios, .gpios = gpios,
.nvs = nvs, .nvs = nvs,

@ -10,30 +10,30 @@
#include <memory> #include <memory>
#include <stack> #include <stack>
#include "audio_events.hpp" #include "audio/audio_events.hpp"
#include "battery.hpp" #include "audio/track_queue.hpp"
#include "db_events.hpp" #include "battery/battery.hpp"
#include "device_factory.hpp" #include "database/db_events.hpp"
#include "database/track.hpp"
#include "display.hpp" #include "display.hpp"
#include "feedback_haptics.hpp"
#include "gpios.hpp" #include "gpios.hpp"
#include "input_touch_wheel.hpp" #include "input/device_factory.hpp"
#include "input_volume_buttons.hpp" #include "input/feedback_haptics.hpp"
#include "lua_thread.hpp" #include "input/input_touch_wheel.hpp"
#include "lvgl_input_driver.hpp" #include "input/input_volume_buttons.hpp"
#include "lvgl_task.hpp" #include "input/lvgl_input_driver.hpp"
#include "modal.hpp" #include "lua/lua_thread.hpp"
#include "lua/property.hpp"
#include "nvs.hpp" #include "nvs.hpp"
#include "property.hpp"
#include "screen.hpp"
#include "service_locator.hpp"
#include "storage.hpp" #include "storage.hpp"
#include "system_events.hpp" #include "system_fsm/service_locator.hpp"
#include "system_fsm/system_events.hpp"
#include "tinyfsm.hpp" #include "tinyfsm.hpp"
#include "touchwheel.hpp" #include "touchwheel.hpp"
#include "track.hpp" #include "ui/lvgl_task.hpp"
#include "track_queue.hpp" #include "ui/modal.hpp"
#include "ui_events.hpp" #include "ui/screen.hpp"
#include "ui/ui_events.hpp"
namespace ui { namespace ui {
@ -74,7 +74,7 @@ class UiState : public tinyfsm::Fsm<UiState> {
void react(const internal::DismissAlerts&); void react(const internal::DismissAlerts&);
void react(const database::event::UpdateStarted&); void react(const database::event::UpdateStarted&);
void react(const database::event::UpdateProgress&){}; void react(const database::event::UpdateProgress&) {};
void react(const database::event::UpdateFinished&); void react(const database::event::UpdateFinished&);
void react(const system_fsm::BluetoothEvent&); void react(const system_fsm::BluetoothEvent&);
@ -86,7 +86,7 @@ class UiState : public tinyfsm::Fsm<UiState> {
sCurrentModal.reset(); sCurrentModal.reset();
} }
void react(const internal::ReindexDatabase&){}; void react(const internal::ReindexDatabase&) {};
protected: protected:
void PushScreen(std::shared_ptr<Screen>); void PushScreen(std::shared_ptr<Screen>);

Loading…
Cancel
Save