start moving include files into subdirs

This commit is contained in:
jacqueline
2024-05-02 21:41:56 +10:00
parent 1573a8c4cd
commit 7d7f7755d1
95 changed files with 465 additions and 462 deletions
+6 -6
View File
@@ -7,14 +7,14 @@
#include "freertos/FreeRTOS.h"
#include "freertos/portmacro.h"
#include "i2c.hpp"
#include "system_events.hpp"
#include "tinyfsm.hpp"
#include "audio_fsm.hpp"
#include "event_queue.hpp"
#include "system_fsm.hpp"
#include "ui_fsm.hpp"
#include "audio/audio_fsm.hpp"
#include "events/event_queue.hpp"
#include "i2c.hpp"
#include "system_fsm/system_events.hpp"
#include "system_fsm/system_fsm.hpp"
#include "ui/ui_fsm.hpp"
extern "C" void app_main(void) {
ESP_ERROR_CHECK(drivers::init_i2c());
+1 -2
View File
@@ -5,8 +5,7 @@
idf_component_register(
SRC_DIRS "app_console" "audio" "battery" "database" "dev_console" "events"
"input" "lua" "system_fsm" "ui"
INCLUDE_DIRS "." "app_console" "audio" "battery" "database" "dev_console"
"events" "input" "lua" "system_fsm" "ui"
INCLUDE_DIRS "."
REQUIRES "codecs" "drivers" "locale" "memory" "tasks" "util"
"tinyfsm" "lvgl" "esp_timer" "luavgl" "esp_app_format" "libcppbor" "libtags"
"komihash" "result" "esp_psram" "fatfs" "millershuffle" "speexdsp" "console"
+4 -4
View File
@@ -8,12 +8,12 @@
#include <memory>
#include "audio/track_queue.hpp"
#include "bluetooth.hpp"
#include "console.hpp"
#include "database.hpp"
#include "dev_console/console.hpp"
#include "database/database.hpp"
#include "samd.hpp"
#include "service_locator.hpp"
#include "track_queue.hpp"
#include "system_fsm/service_locator.hpp"
namespace console {
+5 -5
View File
@@ -4,23 +4,23 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "audio_converter.hpp"
#include "audio/audio_converter.hpp"
#include <stdint.h>
#include <algorithm>
#include <cmath>
#include <cstdint>
#include "audio_events.hpp"
#include "audio_sink.hpp"
#include "audio/audio_events.hpp"
#include "audio/audio_sink.hpp"
#include "esp_heap_caps.h"
#include "esp_log.h"
#include "event_queue.hpp"
#include "events/event_queue.hpp"
#include "freertos/portmacro.h"
#include "freertos/projdefs.h"
#include "i2s_dac.hpp"
#include "resample.hpp"
#include "audio/resample.hpp"
#include "sample.hpp"
#include "tasks.hpp"
+4 -4
View File
@@ -10,11 +10,11 @@
#include <cstdint>
#include <memory>
#include "audio_events.hpp"
#include "audio_sink.hpp"
#include "audio_source.hpp"
#include "audio/audio_events.hpp"
#include "audio/audio_sink.hpp"
#include "audio/audio_source.hpp"
#include "audio/resample.hpp"
#include "codec.hpp"
#include "resample.hpp"
#include "sample.hpp"
namespace audio {
+10 -10
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "audio_decoder.hpp"
#include "audio/audio_decoder.hpp"
#include <algorithm>
#include <cmath>
@@ -25,20 +25,20 @@
#include "freertos/queue.h"
#include "freertos/ringbuf.h"
#include "audio_converter.hpp"
#include "audio_events.hpp"
#include "audio_fsm.hpp"
#include "audio_sink.hpp"
#include "audio_source.hpp"
#include "audio/audio_converter.hpp"
#include "audio/audio_events.hpp"
#include "audio/audio_fsm.hpp"
#include "audio/audio_sink.hpp"
#include "audio/audio_source.hpp"
#include "audio/fatfs_audio_input.hpp"
#include "codec.hpp"
#include "event_queue.hpp"
#include "fatfs_audio_input.hpp"
#include "database/track.hpp"
#include "events/event_queue.hpp"
#include "i2s_dac.hpp"
#include "sample.hpp"
#include "tasks.hpp"
#include "track.hpp"
#include "types.hpp"
#include "ui_fsm.hpp"
#include "ui/ui_fsm.hpp"
namespace audio {
+5 -5
View File
@@ -9,12 +9,12 @@
#include <cstdint>
#include <memory>
#include "audio_converter.hpp"
#include "audio_events.hpp"
#include "audio_sink.hpp"
#include "audio_source.hpp"
#include "audio/audio_converter.hpp"
#include "audio/audio_events.hpp"
#include "audio/audio_sink.hpp"
#include "audio/audio_source.hpp"
#include "codec.hpp"
#include "track.hpp"
#include "database/track.hpp"
#include "types.hpp"
namespace audio {
+2 -2
View File
@@ -12,10 +12,10 @@
#include <optional>
#include <string>
#include "audio_sink.hpp"
#include "audio/audio_sink.hpp"
#include "tinyfsm.hpp"
#include "track.hpp"
#include "database/track.hpp"
#include "types.hpp"
namespace audio {
+14 -14
View File
@@ -4,14 +4,14 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "audio_fsm.hpp"
#include "audio/audio_fsm.hpp"
#include <stdint.h>
#include <future>
#include <memory>
#include <variant>
#include "audio_sink.hpp"
#include "audio/audio_sink.hpp"
#include "bluetooth_types.hpp"
#include "cppbor.h"
#include "cppbor_parse.h"
@@ -21,23 +21,23 @@
#include "freertos/portmacro.h"
#include "freertos/projdefs.h"
#include "audio_converter.hpp"
#include "audio_decoder.hpp"
#include "audio_events.hpp"
#include "audio/audio_converter.hpp"
#include "audio/audio_decoder.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 "bt_audio_output.hpp"
#include "event_queue.hpp"
#include "fatfs_audio_input.hpp"
#include "future_fetcher.hpp"
#include "i2s_audio_output.hpp"
#include "database/future_fetcher.hpp"
#include "database/track.hpp"
#include "events/event_queue.hpp"
#include "i2s_dac.hpp"
#include "nvs.hpp"
#include "sample.hpp"
#include "service_locator.hpp"
#include "system_events.hpp"
#include "system_fsm/service_locator.hpp"
#include "system_fsm/system_events.hpp"
#include "tinyfsm.hpp"
#include "track.hpp"
#include "track_queue.hpp"
#include "wm8523.hpp"
namespace audio {
+14 -14
View File
@@ -11,24 +11,24 @@
#include <memory>
#include <vector>
#include "audio_sink.hpp"
#include "service_locator.hpp"
#include "audio/audio_sink.hpp"
#include "system_fsm/service_locator.hpp"
#include "tinyfsm.hpp"
#include "audio_decoder.hpp"
#include "audio_events.hpp"
#include "bt_audio_output.hpp"
#include "database.hpp"
#include "audio/audio_decoder.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 "database/database.hpp"
#include "database/tag_parser.hpp"
#include "database/track.hpp"
#include "display.hpp"
#include "fatfs_audio_input.hpp"
#include "gpios.hpp"
#include "i2s_audio_output.hpp"
#include "i2s_dac.hpp"
#include "storage.hpp"
#include "system_events.hpp"
#include "tag_parser.hpp"
#include "track.hpp"
#include "track_queue.hpp"
#include "system_fsm/system_events.hpp"
namespace audio {
@@ -61,7 +61,7 @@ class AudioState : public tinyfsm::Fsm<AudioState> {
void react(const OutputModeChanged&);
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::BluetoothEvent&);
@@ -103,7 +103,7 @@ namespace states {
class Uninitialised : public AudioState {
public:
void react(const system_fsm::BootComplete&) override;
void react(const system_fsm::BluetoothEvent&) override{};
void react(const system_fsm::BluetoothEvent&) override {};
using AudioState::react;
};
+6 -2
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "audio_source.hpp"
#include "audio/audio_source.hpp"
#include "codec.hpp"
#include "types.hpp"
@@ -14,7 +14,11 @@ TaggedStream::TaggedStream(std::shared_ptr<database::TrackTags> t,
std::unique_ptr<codecs::IStream> w,
std::string filepath,
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> {
return tags_;
+2 -3
View File
@@ -8,7 +8,7 @@
#include <memory>
#include "codec.hpp"
#include "track.hpp"
#include "database/track.hpp"
#include "types.hpp"
namespace audio {
@@ -18,8 +18,7 @@ class TaggedStream : public codecs::IStream {
TaggedStream(std::shared_ptr<database::TrackTags>,
std::unique_ptr<codecs::IStream> wrapped,
std::string path,
uint32_t offset = 0
);
uint32_t offset = 0);
auto tags() -> std::shared_ptr<database::TrackTags>;
+1 -1
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "bt_audio_output.hpp"
#include "audio/bt_audio_output.hpp"
#include <algorithm>
#include <cmath>
+1 -1
View File
@@ -13,7 +13,7 @@
#include "result.hpp"
#include "audio_sink.hpp"
#include "audio/audio_sink.hpp"
#include "bluetooth.hpp"
#include "gpios.hpp"
#include "i2s_dac.hpp"
+14 -14
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "fatfs_audio_input.hpp"
#include "audio/fatfs_audio_input.hpp"
#include <algorithm>
#include <climits>
@@ -18,24 +18,24 @@
#include <string>
#include <variant>
#include "audio/readahead_source.hpp"
#include "esp_heap_caps.h"
#include "esp_log.h"
#include "ff.h"
#include "freertos/portmacro.h"
#include "freertos/projdefs.h"
#include "readahead_source.hpp"
#include "audio_events.hpp"
#include "audio_fsm.hpp"
#include "audio_source.hpp"
#include "audio/audio_events.hpp"
#include "audio/audio_fsm.hpp"
#include "audio/audio_source.hpp"
#include "audio/fatfs_source.hpp"
#include "codec.hpp"
#include "event_queue.hpp"
#include "fatfs_source.hpp"
#include "future_fetcher.hpp"
#include "database/future_fetcher.hpp"
#include "database/tag_parser.hpp"
#include "database/track.hpp"
#include "events/event_queue.hpp"
#include "spi.hpp"
#include "tag_parser.hpp"
#include "tasks.hpp"
#include "track.hpp"
#include "types.hpp"
[[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)
-> void {
auto FatfsAudioInput::SetPath(const std::string& path,
uint32_t offset) -> void {
std::lock_guard<std::mutex> guard{new_stream_mutex_};
if (OpenFile(path, offset)) {
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)
-> bool {
auto FatfsAudioInput::OpenFile(const std::string& path,
uint32_t offset) -> bool {
ESP_LOGI(kTag, "opening file %s", path.c_str());
auto tags = tag_parser_.ReadAndParseTags(path);
+5 -5
View File
@@ -15,10 +15,10 @@
#include "ff.h"
#include "freertos/portmacro.h"
#include "audio_source.hpp"
#include "audio/audio_source.hpp"
#include "codec.hpp"
#include "future_fetcher.hpp"
#include "tag_parser.hpp"
#include "database/future_fetcher.hpp"
#include "database/tag_parser.hpp"
#include "tasks.hpp"
#include "types.hpp"
@@ -39,7 +39,7 @@ class FatfsAudioInput : public IAudioSource {
* given file path.
*/
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 HasNewStream() -> bool override;
@@ -49,7 +49,7 @@ class FatfsAudioInput : public IAudioSource {
FatfsAudioInput& operator=(const FatfsAudioInput&) = delete;
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)
-> std::optional<codecs::StreamType>;
+4 -4
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "fatfs_source.hpp"
#include "audio/fatfs_source.hpp"
#include <sys/_stdint.h>
#include <cstddef>
@@ -12,13 +12,13 @@
#include <memory>
#include "esp_log.h"
#include "event_queue.hpp"
#include "events/event_queue.hpp"
#include "ff.h"
#include "audio_source.hpp"
#include "audio/audio_source.hpp"
#include "codec.hpp"
#include "spi.hpp"
#include "system_events.hpp"
#include "system_fsm/system_events.hpp"
#include "types.hpp"
namespace audio {
+1 -1
View File
@@ -13,7 +13,7 @@
#include "codec.hpp"
#include "ff.h"
#include "audio_source.hpp"
#include "audio/audio_source.hpp"
namespace audio {
+5 -4
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "i2s_audio_output.hpp"
#include "audio/i2s_audio_output.hpp"
#include <stdint.h>
#include <algorithm>
@@ -18,7 +18,7 @@
#include "freertos/portmacro.h"
#include "freertos/projdefs.h"
#include "audio_sink.hpp"
#include "audio/audio_sink.hpp"
#include "gpios.hpp"
#include "i2c.hpp"
#include "i2s_dac.hpp"
@@ -120,7 +120,7 @@ auto I2SAudioOutput::SetVolumePct(uint_fast8_t val) -> bool {
if (val > 100) {
return false;
}
uint16_t vol = (val * (max_volume_ - kMinVolume))/100 + kMinVolume;
uint16_t vol = (val * (max_volume_ - kMinVolume)) / 100 + kMinVolume;
SetVolume(vol);
return true;
}
@@ -133,7 +133,8 @@ auto I2SAudioOutput::GetVolumeDb() -> int_fast16_t {
}
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;
}
+1 -1
View File
@@ -11,7 +11,7 @@
#include <memory>
#include <vector>
#include "audio_sink.hpp"
#include "audio/audio_sink.hpp"
#include "gpios.hpp"
#include "i2s_dac.hpp"
#include "result.hpp"
+2 -2
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "readahead_source.hpp"
#include "audio/readahead_source.hpp"
#include <cstddef>
#include <cstdint>
@@ -14,7 +14,7 @@
#include "esp_log.h"
#include "ff.h"
#include "audio_source.hpp"
#include "audio/audio_source.hpp"
#include "codec.hpp"
#include "freertos/portmacro.h"
#include "spi.hpp"
+1 -1
View File
@@ -15,7 +15,7 @@
#include "ff.h"
#include "freertos/stream_buffer.h"
#include "audio_source.hpp"
#include "audio/audio_source.hpp"
#include "codec.hpp"
#include "tasks.hpp"
+1 -1
View File
@@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "resample.hpp"
#include "audio/resample.hpp"
#include <algorithm>
#include <cmath>
+7 -7
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "track_queue.hpp"
#include "audio/track_queue.hpp"
#include <stdint.h>
#include <algorithm>
@@ -18,16 +18,16 @@
#include "MillerShuffle.h"
#include "esp_random.h"
#include "audio_events.hpp"
#include "audio_fsm.hpp"
#include "audio/audio_events.hpp"
#include "audio/audio_fsm.hpp"
#include "cppbor.h"
#include "cppbor_parse.h"
#include "database.hpp"
#include "event_queue.hpp"
#include "database/database.hpp"
#include "database/track.hpp"
#include "events/event_queue.hpp"
#include "memory_resource.hpp"
#include "tasks.hpp"
#include "track.hpp"
#include "ui_fsm.hpp"
#include "ui/ui_fsm.hpp"
namespace audio {
+3 -3
View File
@@ -12,11 +12,11 @@
#include <shared_mutex>
#include <vector>
#include "audio_events.hpp"
#include "audio/audio_events.hpp"
#include "cppbor_parse.h"
#include "database.hpp"
#include "database/database.hpp"
#include "database/track.hpp"
#include "tasks.hpp"
#include "track.hpp"
namespace audio {
+3 -3
View File
@@ -4,15 +4,15 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "battery.hpp"
#include "battery/battery.hpp"
#include <cstdint>
#include "adc.hpp"
#include "event_queue.hpp"
#include "events/event_queue.hpp"
#include "freertos/portmacro.h"
#include "samd.hpp"
#include "system_events.hpp"
#include "system_fsm/system_events.hpp"
namespace battery {
+11 -11
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "database.hpp"
#include "database/database.hpp"
#include <stdint.h>
#include <sys/_stdint.h>
@@ -23,10 +23,10 @@
#include "collation.hpp"
#include "cppbor.h"
#include "cppbor_parse.h"
#include "database/index.hpp"
#include "esp_log.h"
#include "ff.h"
#include "freertos/projdefs.h"
#include "index.hpp"
#include "komihash.h"
#include "leveldb/cache.h"
#include "leveldb/db.h"
@@ -36,17 +36,17 @@
#include "leveldb/status.h"
#include "leveldb/write_batch.h"
#include "db_events.hpp"
#include "env_esp.hpp"
#include "event_queue.hpp"
#include "file_gatherer.hpp"
#include "database/db_events.hpp"
#include "database/env_esp.hpp"
#include "database/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 "records.hpp"
#include "result.hpp"
#include "spi.hpp"
#include "tag_parser.hpp"
#include "tasks.hpp"
#include "track.hpp"
namespace database {
@@ -63,8 +63,8 @@ static const char kKeyTrackId[] = "next_track_id";
static std::atomic<bool> sIsDbOpen(false);
static auto CreateNewDatabase(leveldb::Options& options, locale::ICollator& col)
-> leveldb::DB* {
static auto CreateNewDatabase(leveldb::Options& options,
locale::ICollator& col) -> leveldb::DB* {
Database::Destroy();
leveldb::DB* db;
options.create_if_missing = true;
+5 -5
View File
@@ -19,19 +19,19 @@
#include "collation.hpp"
#include "cppbor.h"
#include "file_gatherer.hpp"
#include "index.hpp"
#include "database/file_gatherer.hpp"
#include "database/index.hpp"
#include "database/records.hpp"
#include "database/tag_parser.hpp"
#include "database/track.hpp"
#include "leveldb/cache.h"
#include "leveldb/db.h"
#include "leveldb/iterator.h"
#include "leveldb/options.h"
#include "leveldb/slice.h"
#include "memory_resource.hpp"
#include "records.hpp"
#include "result.hpp"
#include "tag_parser.hpp"
#include "tasks.hpp"
#include "track.hpp"
namespace database {
+2 -2
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "env_esp.hpp"
#include "database/env_esp.hpp"
#include <atomic>
#include <cerrno>
@@ -41,7 +41,7 @@
namespace leveldb {
tasks::WorkerPool *sBackgroundThread = nullptr;
tasks::WorkerPool* sBackgroundThread = nullptr;
std::string ErrToStr(FRESULT err) {
switch (err) {
+1 -1
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "file_gatherer.hpp"
#include "database/file_gatherer.hpp"
#include <deque>
#include <functional>
+5 -7
View File
@@ -17,20 +17,18 @@ namespace database {
class IFileGatherer {
public:
virtual ~IFileGatherer(){};
virtual ~IFileGatherer() {};
virtual auto FindFiles(
const std::string& root,
std::function<void(std::string_view, const FILINFO&)> cb)
-> void = 0;
std::function<void(std::string_view, const FILINFO&)> cb) -> void = 0;
};
class FileGathererImpl : public IFileGatherer {
public:
virtual auto FindFiles(
const std::string& root,
std::function<void(std::string_view, const FILINFO&)> cb)
-> void override;
virtual auto FindFiles(const std::string& root,
std::function<void(std::string_view, const FILINFO&)>
cb) -> void override;
};
} // namespace database
+1 -1
View File
@@ -9,7 +9,7 @@
#include <memory>
#include <utility>
#include "database.hpp"
#include "database/database.hpp"
namespace database {
+6 -5
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "index.hpp"
#include "database/index.hpp"
#include <sys/_stdint.h>
#include <cstdint>
@@ -21,8 +21,8 @@
#include "komihash.h"
#include "leveldb/write_batch.h"
#include "records.hpp"
#include "track.hpp"
#include "database/records.hpp"
#include "database/track.hpp"
namespace database {
@@ -183,8 +183,9 @@ auto Indexer::handleItem(const IndexKey::Header& header,
}
}
auto Index(locale::ICollator& c, const IndexInfo& i, const Track& t)
-> std::vector<std::pair<IndexKey, std::string>> {
auto Index(locale::ICollator& c,
const IndexInfo& i,
const Track& t) -> std::vector<std::pair<IndexKey, std::string>> {
Indexer indexer{c, t, i};
return indexer.index();
}
+4 -3
View File
@@ -17,9 +17,9 @@
#include "leveldb/db.h"
#include "leveldb/slice.h"
#include "database/track.hpp"
#include "leveldb/write_batch.h"
#include "memory_resource.hpp"
#include "track.hpp"
namespace database {
@@ -61,8 +61,9 @@ struct IndexKey {
std::optional<TrackId> track;
};
auto Index(locale::ICollator&, const IndexInfo&, const Track&)
-> std::vector<std::pair<IndexKey, std::string>>;
auto Index(locale::ICollator&,
const IndexInfo&,
const Track&) -> std::vector<std::pair<IndexKey, std::string>>;
auto ExpandHeader(const IndexKey::Header&,
const std::optional<std::pmr::string>&) -> IndexKey::Header;
+3 -3
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "records.hpp"
#include "database/records.hpp"
#include <stdint.h>
#include <sys/_stdint.h>
@@ -21,10 +21,10 @@
#include "cppbor_parse.h"
#include "esp_log.h"
#include "index.hpp"
#include "database/index.hpp"
#include "database/track.hpp"
#include "komihash.h"
#include "memory_resource.hpp"
#include "track.hpp"
// As LevelDB is a key-value store, each record in the database consists of a
// key and an optional value.
+2 -2
View File
@@ -15,9 +15,9 @@
#include "leveldb/db.h"
#include "leveldb/slice.h"
#include "index.hpp"
#include "database/index.hpp"
#include "database/track.hpp"
#include "memory_resource.hpp"
#include "track.hpp"
namespace database {
+1 -1
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "tag_parser.hpp"
#include "database/tag_parser.hpp"
#include <cstdint>
#include <cstdlib>
+1 -1
View File
@@ -8,8 +8,8 @@
#include <string>
#include "database/track.hpp"
#include "lru_cache.hpp"
#include "track.hpp"
namespace database {
+8 -8
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "database.hpp"
#include "database/database.hpp"
#include <stdint.h>
#include <iomanip>
@@ -13,14 +13,14 @@
#include <string>
#include "catch2/catch.hpp"
#include "database/file_gatherer.hpp"
#include "database/tag_parser.hpp"
#include "database/track.hpp"
#include "driver_cache.hpp"
#include "esp_log.h"
#include "file_gatherer.hpp"
#include "i2c_fixture.hpp"
#include "leveldb/db.h"
#include "spi_fixture.hpp"
#include "tag_parser.hpp"
#include "track.hpp"
namespace database {
@@ -28,8 +28,8 @@ class TestBackends : public IFileGatherer, public ITagParser {
public:
std::map<std::pmr::string, TrackTags> tracks;
auto MakeTrack(const std::pmr::string& path, const std::pmr::string& title)
-> void {
auto MakeTrack(const std::pmr::string& path,
const std::pmr::string& title) -> void {
TrackTags tags;
tags.encoding = Encoding::kMp3;
tags.title = title;
@@ -44,8 +44,8 @@ class TestBackends : public IFileGatherer, public ITagParser {
}
}
auto ReadAndParseTags(const std::pmr::string& path, TrackTags* out)
-> bool override {
auto ReadAndParseTags(const std::pmr::string& path,
TrackTags* out) -> bool override {
if (tracks.contains(path)) {
*out = tracks.at(path);
return true;
+1 -1
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "records.hpp"
#include "database/records.hpp"
#include <stdint.h>
#include <iomanip>
+1 -1
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "track.hpp"
#include "database/track.hpp"
#include <iomanip>
#include <iostream>
+1 -1
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "console.hpp"
#include "dev_console/console.hpp"
#include <stdio.h>
#include <string.h>
+4 -3
View File
@@ -6,12 +6,13 @@
#include "events/event_queue.hpp"
#include "audio_fsm.hpp"
#include "freertos/FreeRTOS.h"
#include "freertos/portmacro.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 {
+3 -3
View File
@@ -11,14 +11,14 @@
#include <queue>
#include <type_traits>
#include "audio_fsm.hpp"
#include "audio/audio_fsm.hpp"
#include "freertos/FreeRTOS.h"
#include "freertos/portmacro.h"
#include "freertos/queue.h"
#include "system_fsm.hpp"
#include "system_fsm/system_fsm.hpp"
#include "tinyfsm.hpp"
#include "ui_fsm.hpp"
#include "ui/ui_fsm.hpp"
namespace events {
+7 -7
View File
@@ -4,16 +4,16 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "device_factory.hpp"
#include "input/device_factory.hpp"
#include <memory>
#include "feedback_haptics.hpp"
#include "input_device.hpp"
#include "input_nav_buttons.hpp"
#include "input_touch_dpad.hpp"
#include "input_touch_wheel.hpp"
#include "input_volume_buttons.hpp"
#include "input/feedback_haptics.hpp"
#include "input/input_device.hpp"
#include "input/input_nav_buttons.hpp"
#include "input/input_touch_dpad.hpp"
#include "input/input_touch_wheel.hpp"
#include "input/input_volume_buttons.hpp"
namespace input {
+4 -4
View File
@@ -9,11 +9,11 @@
#include <cstdint>
#include <memory>
#include "feedback_device.hpp"
#include "input_device.hpp"
#include "input_touch_wheel.hpp"
#include "input/feedback_device.hpp"
#include "input/input_device.hpp"
#include "input/input_touch_wheel.hpp"
#include "nvs.hpp"
#include "service_locator.hpp"
#include "system_fsm/service_locator.hpp"
namespace input {
+1 -1
View File
@@ -8,8 +8,8 @@
#include <cstdint>
#include "feedback_device.hpp"
#include "haptics.hpp"
#include "input/feedback_device.hpp"
namespace input {
+2 -2
View File
@@ -11,8 +11,8 @@
#include <vector>
#include "hal/lv_hal_indev.h"
#include "input_hook.hpp"
#include "property.hpp"
#include "input/input_hook.hpp"
#include "lua/property.hpp"
namespace input {
+1 -1
View File
@@ -13,7 +13,7 @@
#include "hal/lv_hal_indev.h"
#include "lua.hpp"
#include "input_trigger.hpp"
#include "input/input_trigger.hpp"
namespace input {
+1 -1
View File
@@ -7,7 +7,7 @@
#pragma once
#include "hal/lv_hal_indev.h"
#include "input_hook.hpp"
#include "input/input_hook.hpp"
namespace input {
namespace actions {
+3 -3
View File
@@ -4,12 +4,12 @@
* 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 "hal/lv_hal_indev.h"
#include "input_hook_actions.hpp"
#include "input/input_hook_actions.hpp"
namespace input {
+3 -3
View File
@@ -12,9 +12,9 @@
#include "hal/lv_hal_indev.h"
#include "haptics.hpp"
#include "input_device.hpp"
#include "input_hook.hpp"
#include "input_trigger.hpp"
#include "input/input_device.hpp"
#include "input/input_hook.hpp"
#include "input/input_trigger.hpp"
#include "touchwheel.hpp"
namespace input {
+3 -3
View File
@@ -11,9 +11,9 @@
#include "hal/lv_hal_indev.h"
#include "haptics.hpp"
#include "input_device.hpp"
#include "input_hook.hpp"
#include "input_trigger.hpp"
#include "input/input_device.hpp"
#include "input/input_hook.hpp"
#include "input/input_trigger.hpp"
#include "touchwheel.hpp"
namespace input {
+5 -5
View File
@@ -13,13 +13,13 @@
#include "events/event_queue.hpp"
#include "haptics.hpp"
#include "input_device.hpp"
#include "input_hook_actions.hpp"
#include "input_trigger.hpp"
#include "input/input_device.hpp"
#include "input/input_hook_actions.hpp"
#include "input/input_trigger.hpp"
#include "lua/property.hpp"
#include "nvs.hpp"
#include "property.hpp"
#include "touchwheel.hpp"
#include "ui_events.hpp"
#include "ui/ui_events.hpp"
namespace input {
+4 -4
View File
@@ -12,11 +12,11 @@
#include "hal/lv_hal_indev.h"
#include "haptics.hpp"
#include "input_device.hpp"
#include "input_hook.hpp"
#include "input_trigger.hpp"
#include "input/input_device.hpp"
#include "input/input_hook.hpp"
#include "input/input_trigger.hpp"
#include "lua/property.hpp"
#include "nvs.hpp"
#include "property.hpp"
#include "touchwheel.hpp"
namespace input {
+3 -3
View File
@@ -4,10 +4,10 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "input_volume_buttons.hpp"
#include "event_queue.hpp"
#include "input/input_volume_buttons.hpp"
#include "events/event_queue.hpp"
#include "gpios.hpp"
#include "input_hook_actions.hpp"
#include "input/input_hook_actions.hpp"
namespace input {
+2 -2
View File
@@ -12,8 +12,8 @@
#include "hal/lv_hal_indev.h"
#include "haptics.hpp"
#include "input_device.hpp"
#include "input_hook.hpp"
#include "input/input_device.hpp"
#include "input/input_hook.hpp"
#include "touchwheel.hpp"
namespace input {
+6 -6
View File
@@ -12,16 +12,16 @@
#include <set>
#include "core/lv_group.h"
#include "device_factory.hpp"
#include "feedback_device.hpp"
#include "gpios.hpp"
#include "hal/lv_hal_indev.h"
#include "input/device_factory.hpp"
#include "input/feedback_device.hpp"
#include "input_device.hpp"
#include "input_hook.hpp"
#include "lua_thread.hpp"
#include "input/input_device.hpp"
#include "input/input_hook.hpp"
#include "lua/lua_thread.hpp"
#include "lua/property.hpp"
#include "nvs.hpp"
#include "property.hpp"
#include "touchwheel.hpp"
namespace input {
+14 -14
View File
@@ -4,33 +4,33 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "bridge.hpp"
#include <sys/_stdint.h>
#include "lua/bridge.hpp"
#include <cstdint>
#include <memory>
#include <string>
#include "database.hpp"
#include "database/database.hpp"
#include "database/index.hpp"
#include "esp_log.h"
#include "index.hpp"
#include "lauxlib.h"
#include "lua.h"
#include "lua.hpp"
#include "lua_controls.hpp"
#include "lua_database.hpp"
#include "lua_queue.hpp"
#include "lua_screen.hpp"
#include "lua_version.hpp"
#include "lua_theme.hpp"
#include "lua/lua_controls.hpp"
#include "lua/lua_database.hpp"
#include "lua/lua_queue.hpp"
#include "lua/lua_screen.hpp"
#include "lua/lua_theme.hpp"
#include "lua/lua_version.hpp"
#include "lvgl.h"
#include "font/lv_font_loader.h"
#include "luavgl.h"
#include "event_queue.hpp"
#include "property.hpp"
#include "service_locator.hpp"
#include "ui_events.hpp"
#include "events/event_queue.hpp"
#include "lua/property.hpp"
#include "system_fsm/service_locator.hpp"
#include "ui/ui_events.hpp"
extern "C" {
int luaopen_linenoise(lua_State* L);
+4 -5
View File
@@ -10,9 +10,9 @@
#include <string>
#include "lua.hpp"
#include "lua/property.hpp"
#include "lvgl.h"
#include "property.hpp"
#include "service_locator.hpp"
#include "system_fsm/service_locator.hpp"
namespace lua {
@@ -39,9 +39,8 @@ class Bridge {
auto installPropertyModule(
lua_State* L,
const std::string&,
std::vector<
std::pair<std::string, std::variant<LuaFunction, Property*>>>&)
-> void;
std::vector<std::pair<std::string,
std::variant<LuaFunction, Property*>>>&) -> void;
Bridge(const Bridge&) = delete;
Bridge& operator=(const Bridge&) = delete;
+2 -2
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "lua_controls.hpp"
#include "lua/lua_controls.hpp"
#include <memory>
#include <string>
@@ -17,7 +17,7 @@
#include "lvgl.h"
#include "nvs.hpp"
#include "ui_events.hpp"
#include "ui/ui_events.hpp"
namespace lua {
+17 -19
View File
@@ -4,30 +4,30 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "lua_database.hpp"
#include "lua/lua_database.hpp"
#include <memory>
#include <string>
#include <type_traits>
#include <variant>
#include "bridge.hpp"
#include "lua.hpp"
#include "lua/bridge.hpp"
#include "esp_log.h"
#include "lauxlib.h"
#include "lua.h"
#include "lua_thread.hpp"
#include "lua/lua_thread.hpp"
#include "lvgl.h"
#include "database.hpp"
#include "event_queue.hpp"
#include "index.hpp"
#include "property.hpp"
#include "records.hpp"
#include "service_locator.hpp"
#include "track.hpp"
#include "ui_events.hpp"
#include "database/database.hpp"
#include "database/index.hpp"
#include "database/records.hpp"
#include "database/track.hpp"
#include "events/event_queue.hpp"
#include "lua/property.hpp"
#include "system_fsm/service_locator.hpp"
#include "ui/ui_events.hpp"
namespace lua {
@@ -152,8 +152,8 @@ auto db_check_iterator(lua_State* L, int stack_pos) -> database::Iterator* {
return it;
}
static auto push_iterator(lua_State* state, const database::Iterator& it)
-> void {
static auto push_iterator(lua_State* state,
const database::Iterator& it) -> void {
database::Iterator** data = reinterpret_cast<database::Iterator**>(
lua_newuserdata(state, sizeof(uintptr_t)));
*data = new database::Iterator(it);
@@ -198,12 +198,10 @@ static auto db_iterator_gc(lua_State* state) -> int {
return 0;
}
static const struct luaL_Reg kDbIteratorFuncs[] = {{"next", db_iterate},
{"prev", db_iterate_prev},
{"clone", db_iterator_clone},
{"__call", db_iterate},
{"__gc", db_iterator_gc},
{NULL, NULL}};
static const struct luaL_Reg kDbIteratorFuncs[] = {
{"next", db_iterate}, {"prev", db_iterate_prev},
{"clone", db_iterator_clone}, {"__call", db_iterate},
{"__gc", db_iterator_gc}, {NULL, NULL}};
static auto record_text(lua_State* state) -> int {
LuaRecord* data = reinterpret_cast<LuaRecord*>(
+1 -1
View File
@@ -8,7 +8,7 @@
#include "lua.hpp"
#include "database.hpp"
#include "database/database.hpp"
namespace lua {
+10 -10
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "lua_database.hpp"
#include "lua/lua_database.hpp"
#include <memory>
#include <string>
@@ -16,15 +16,15 @@
#include "lua.h"
#include "lvgl.h"
#include "bridge.hpp"
#include "database.hpp"
#include "event_queue.hpp"
#include "index.hpp"
#include "property.hpp"
#include "service_locator.hpp"
#include "track.hpp"
#include "track_queue.hpp"
#include "ui_events.hpp"
#include "audio/track_queue.hpp"
#include "database/database.hpp"
#include "database/index.hpp"
#include "database/track.hpp"
#include "events/event_queue.hpp"
#include "lua/bridge.hpp"
#include "lua/property.hpp"
#include "system_fsm/service_locator.hpp"
#include "ui/ui_events.hpp"
namespace lua {
+3 -3
View File
@@ -11,9 +11,9 @@
#include "lua.hpp"
#include "bridge.hpp"
#include "lua_thread.hpp"
#include "service_locator.hpp"
#include "lua/bridge.hpp"
#include "lua/lua_thread.hpp"
#include "system_fsm/service_locator.hpp"
namespace lua {
+10 -10
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "lua_screen.hpp"
#include "lua/lua_screen.hpp"
#include <memory>
#include <string>
@@ -16,15 +16,15 @@
#include "lua.h"
#include "lvgl.h"
#include "bridge.hpp"
#include "database.hpp"
#include "event_queue.hpp"
#include "index.hpp"
#include "property.hpp"
#include "service_locator.hpp"
#include "track.hpp"
#include "track_queue.hpp"
#include "ui_events.hpp"
#include "audio/track_queue.hpp"
#include "database/database.hpp"
#include "database/index.hpp"
#include "database/track.hpp"
#include "events/event_queue.hpp"
#include "lua/bridge.hpp"
#include "lua/property.hpp"
#include "system_fsm/service_locator.hpp"
#include "ui/ui_events.hpp"
namespace lua {
+14 -11
View File
@@ -5,20 +5,20 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "lua_version.hpp"
#include "lua/lua_version.hpp"
#include <string>
#include "bridge.hpp"
#include "lua.hpp"
#include "lua/bridge.hpp"
#include "esp_app_desc.h"
#include "esp_log.h"
#include "lauxlib.h"
#include "lua.h"
#include "lua_thread.hpp"
#include "lua/lua_thread.hpp"
#include "luavgl.h"
#include "themes.hpp"
#include "ui/themes.hpp"
namespace lua {
@@ -35,7 +35,7 @@ static auto set_style(lua_State* L) -> int {
static auto set_theme(lua_State* L) -> int {
std::string class_name;
luaL_checktype(L, -1, LUA_TTABLE);
lua_pushnil(L); /* first key */
lua_pushnil(L); /* first key */
while (lua_next(L, -2) != 0) {
/* uses 'key' (at index -2) and 'value' (at index -1) */
if (lua_type(L, -2) == LUA_TSTRING) {
@@ -43,11 +43,11 @@ static auto set_theme(lua_State* L) -> int {
}
if (lua_type(L, -1) == LUA_TTABLE) {
// Nesting
lua_pushnil(L); // First key
lua_pushnil(L); // First key
while (lua_next(L, -2) != 0) {
// Nesting the second
int selector = -1;
lua_pushnil(L); // First key
lua_pushnil(L); // First key
while (lua_next(L, -2) != 0) {
int idx = lua_tointeger(L, -2);
if (idx == 1) {
@@ -60,12 +60,13 @@ static auto set_theme(lua_State* L) -> int {
ESP_LOGI("lua_theme", "Style was null or malformed");
return 0;
} 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);
}
lua_pop(L, 1);
lua_pop(L, 1);
}
}
/* removes 'value'; keeps 'key' for next iteration */
@@ -74,7 +75,9 @@ static auto set_theme(lua_State* L) -> int {
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 {
luaL_newlib(L, kThemeFuncs);
+9 -7
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "lua_thread.hpp"
#include "lua/lua_thread.hpp"
#include <iostream>
#include <memory>
@@ -13,11 +13,11 @@
#include "esp_log.h"
#include "lua.hpp"
#include "bridge.hpp"
#include "event_queue.hpp"
#include "events/event_queue.hpp"
#include "lua/bridge.hpp"
#include "memory_resource.hpp"
#include "service_locator.hpp"
#include "ui_events.hpp"
#include "system_fsm/service_locator.hpp"
#include "ui/ui_events.hpp"
namespace lua {
@@ -42,8 +42,10 @@ class Allocator {
size_t total_allocated_;
};
static auto lua_alloc(void* ud, void* ptr, size_t osize, size_t nsize)
-> void* {
static auto lua_alloc(void* ud,
void* ptr,
size_t osize,
size_t nsize) -> void* {
Allocator* instance = reinterpret_cast<Allocator*>(ud);
return instance->alloc(ptr, osize, nsize);
}
+1 -1
View File
@@ -11,7 +11,7 @@
#include "lua.hpp"
#include "service_locator.hpp"
#include "system_fsm/service_locator.hpp"
namespace lua {
+3 -3
View File
@@ -5,18 +5,18 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "lua_version.hpp"
#include "lua/lua_version.hpp"
#include <string>
#include "bridge.hpp"
#include "lua.hpp"
#include "lua/bridge.hpp"
#include "esp_app_desc.h"
#include "esp_log.h"
#include "lauxlib.h"
#include "lua.h"
#include "lua_thread.hpp"
#include "lua/lua_thread.hpp"
namespace lua {
+4 -4
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "property.hpp"
#include "lua/property.hpp"
#include <sys/_stdint.h>
#include <cmath>
@@ -15,14 +15,14 @@
#include <variant>
#include "bluetooth_types.hpp"
#include "database/track.hpp"
#include "lauxlib.h"
#include "lua.h"
#include "lua.hpp"
#include "lua_thread.hpp"
#include "lua/lua_thread.hpp"
#include "lvgl.h"
#include "memory_resource.hpp"
#include "service_locator.hpp"
#include "track.hpp"
#include "system_fsm/service_locator.hpp"
#include "types.hpp"
namespace lua {
+2 -2
View File
@@ -10,11 +10,11 @@
#include <memory>
#include <string>
#include "audio_events.hpp"
#include "audio/audio_events.hpp"
#include "bluetooth_types.hpp"
#include "lua.hpp"
#include "lvgl.h"
#include "service_locator.hpp"
#include "system_fsm/service_locator.hpp"
namespace lua {
+5 -5
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "lua_registry.hpp"
#include "lua/lua_registry.hpp"
#include <iostream>
#include <memory>
@@ -13,11 +13,11 @@
#include "esp_log.h"
#include "lua.hpp"
#include "bridge.hpp"
#include "event_queue.hpp"
#include "events/event_queue.hpp"
#include "lua/bridge.hpp"
#include "memory_resource.hpp"
#include "service_locator.hpp"
#include "ui_events.hpp"
#include "system_fsm/service_locator.hpp"
#include "ui/ui_events.hpp"
namespace lua {
+9 -9
View File
@@ -7,7 +7,7 @@
#include "collation.hpp"
#include "haptics.hpp"
#include "spiffs.hpp"
#include "system_fsm.hpp"
#include "system_fsm/system_fsm.hpp"
#include <stdint.h>
#include <memory>
@@ -21,24 +21,24 @@
#include "freertos/timers.h"
#include "adc.hpp"
#include "audio_fsm.hpp"
#include "battery.hpp"
#include "audio/audio_fsm.hpp"
#include "audio/track_queue.hpp"
#include "battery/battery.hpp"
#include "bluetooth.hpp"
#include "bluetooth_types.hpp"
#include "database/tag_parser.hpp"
#include "display_init.hpp"
#include "event_queue.hpp"
#include "events/event_queue.hpp"
#include "gpios.hpp"
#include "i2c.hpp"
#include "nvs.hpp"
#include "samd.hpp"
#include "service_locator.hpp"
#include "spi.hpp"
#include "system_events.hpp"
#include "tag_parser.hpp"
#include "system_fsm/service_locator.hpp"
#include "system_fsm/system_events.hpp"
#include "tasks.hpp"
#include "touchwheel.hpp"
#include "track_queue.hpp"
#include "ui_fsm.hpp"
#include "ui/ui_fsm.hpp"
namespace system_fsm {
namespace states {
+7 -7
View File
@@ -4,20 +4,20 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "app_console.hpp"
#include "file_gatherer.hpp"
#include "app_console/app_console.hpp"
#include "database/file_gatherer.hpp"
#include "freertos/portmacro.h"
#include "freertos/projdefs.h"
#include "gpios.hpp"
#include "result.hpp"
#include "audio_fsm.hpp"
#include "event_queue.hpp"
#include "audio/audio_fsm.hpp"
#include "events/event_queue.hpp"
#include "samd.hpp"
#include "storage.hpp"
#include "system_events.hpp"
#include "system_fsm.hpp"
#include "ui_fsm.hpp"
#include "system_fsm/system_events.hpp"
#include "system_fsm/system_fsm.hpp"
#include "ui/ui_fsm.hpp"
namespace system_fsm {
namespace states {
+10 -10
View File
@@ -4,23 +4,23 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "app_console.hpp"
#include "audio_events.hpp"
#include "database.hpp"
#include "db_events.hpp"
#include "app_console/app_console.hpp"
#include "audio/audio_events.hpp"
#include "database/database.hpp"
#include "database/db_events.hpp"
#include "database/file_gatherer.hpp"
#include "ff.h"
#include "file_gatherer.hpp"
#include "freertos/portmacro.h"
#include "freertos/projdefs.h"
#include "gpios.hpp"
#include "result.hpp"
#include "audio_fsm.hpp"
#include "event_queue.hpp"
#include "audio/audio_fsm.hpp"
#include "events/event_queue.hpp"
#include "storage.hpp"
#include "system_events.hpp"
#include "system_fsm.hpp"
#include "ui_fsm.hpp"
#include "system_fsm/system_events.hpp"
#include "system_fsm/system_fsm.hpp"
#include "ui/ui_fsm.hpp"
namespace system_fsm {
namespace states {
+1 -1
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "service_locator.hpp"
#include "system_fsm/service_locator.hpp"
#include <memory>
+4 -4
View File
@@ -8,19 +8,19 @@
#include <memory>
#include "battery.hpp"
#include "audio/track_queue.hpp"
#include "battery/battery.hpp"
#include "bluetooth.hpp"
#include "collation.hpp"
#include "database.hpp"
#include "database/database.hpp"
#include "database/tag_parser.hpp"
#include "gpios.hpp"
#include "haptics.hpp"
#include "nvs.hpp"
#include "samd.hpp"
#include "storage.hpp"
#include "tag_parser.hpp"
#include "tasks.hpp"
#include "touchwheel.hpp"
#include "track_queue.hpp"
namespace system_fsm {
+3 -3
View File
@@ -8,13 +8,13 @@
#include <memory>
#include "battery.hpp"
#include "battery/battery.hpp"
#include "bluetooth_types.hpp"
#include "database.hpp"
#include "database/database.hpp"
#include "ff.h"
#include "haptics.hpp"
#include "samd.hpp"
#include "service_locator.hpp"
#include "system_fsm/service_locator.hpp"
#include "tinyfsm.hpp"
namespace system_fsm {
+7 -7
View File
@@ -4,15 +4,15 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "system_fsm.hpp"
#include "audio_fsm.hpp"
#include "system_fsm/system_fsm.hpp"
#include "audio/audio_fsm.hpp"
#include "audio/track_queue.hpp"
#include "database/tag_parser.hpp"
#include "driver/gpio.h"
#include "event_queue.hpp"
#include "events/event_queue.hpp"
#include "gpios.hpp"
#include "service_locator.hpp"
#include "system_events.hpp"
#include "tag_parser.hpp"
#include "track_queue.hpp"
#include "system_fsm/service_locator.hpp"
#include "system_fsm/system_events.hpp"
[[maybe_unused]] static const char kTag[] = "system";
+12 -13
View File
@@ -8,28 +8,27 @@
#include <memory>
#include "app_console.hpp"
#include "audio_events.hpp"
#include "battery.hpp"
#include "freertos/FreeRTOS.h"
#include "freertos/timers.h"
#include "app_console/app_console.hpp"
#include "audio/audio_events.hpp"
#include "audio/track_queue.hpp"
#include "battery/battery.hpp"
#include "bluetooth.hpp"
#include "database.hpp"
#include "db_events.hpp"
#include "database/database.hpp"
#include "database/db_events.hpp"
#include "database/tag_parser.hpp"
#include "display.hpp"
#include "gpios.hpp"
#include "nvs.hpp"
#include "samd.hpp"
#include "service_locator.hpp"
#include "storage.hpp"
#include "tag_parser.hpp"
#include "system_fsm/service_locator.hpp"
#include "system_fsm/system_events.hpp"
#include "tinyfsm.hpp"
#include "touchwheel.hpp"
#include "freertos/FreeRTOS.h"
#include "freertos/timers.h"
#include "system_events.hpp"
#include "track_queue.hpp"
namespace system_fsm {
void check_interrupts_cb(TimerHandle_t timer);
+5 -5
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "lvgl_task.hpp"
#include "ui/lvgl_task.hpp"
#include <dirent.h>
#include <stdint.h>
@@ -21,7 +21,7 @@
#include "core/lv_obj_pos.h"
#include "core/lv_obj_tree.h"
#include "esp_log.h"
#include "event_queue.hpp"
#include "events/event_queue.hpp"
#include "extra/themes/basic/lv_theme_basic.h"
#include "font/lv_font.h"
#include "freertos/portmacro.h"
@@ -30,17 +30,17 @@
#include "hal/gpio_types.h"
#include "hal/lv_hal_indev.h"
#include "hal/spi_types.h"
#include "input/lvgl_input_driver.hpp"
#include "lua.h"
#include "lv_api_map.h"
#include "lvgl/lvgl.h"
#include "lvgl_input_driver.hpp"
#include "misc/lv_color.h"
#include "misc/lv_style.h"
#include "misc/lv_timer.h"
#include "modal.hpp"
#include "tasks.hpp"
#include "touchwheel.hpp"
#include "ui_fsm.hpp"
#include "ui/modal.hpp"
#include "ui/ui_fsm.hpp"
#include "widgets/lv_label.h"
#include "display.hpp"
+3 -3
View File
@@ -15,10 +15,10 @@
#include "freertos/timers.h"
#include "display.hpp"
#include "lvgl_input_driver.hpp"
#include "screen.hpp"
#include "themes.hpp"
#include "input/lvgl_input_driver.hpp"
#include "touchwheel.hpp"
#include "ui/screen.hpp"
#include "ui/themes.hpp"
namespace ui {
+7 -7
View File
@@ -5,7 +5,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "modal.hpp"
#include "ui/modal.hpp"
#include "misc/lv_color.h"
@@ -14,17 +14,17 @@
#include "core/lv_group.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/menu/lv_menu.h"
#include "extra/widgets/spinner/lv_spinner.h"
#include "hal/lv_hal_disp.h"
#include "index.hpp"
#include "misc/lv_area.h"
#include "screen.hpp"
#include "themes.hpp"
#include "ui_events.hpp"
#include "ui_fsm.hpp"
#include "ui/screen.hpp"
#include "ui/themes.hpp"
#include "ui/ui_events.hpp"
#include "ui/ui_fsm.hpp"
#include "widgets/lv_label.h"
namespace ui {
+1 -1
View File
@@ -13,7 +13,7 @@
#include "core/lv_obj_tree.h"
#include "lvgl.h"
#include "screen.hpp"
#include "ui/screen.hpp"
namespace ui {
+1 -1
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "screen.hpp"
#include "ui/screen.hpp"
#include <memory>
+4 -4
View File
@@ -4,15 +4,15 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "screen_lua.hpp"
#include "ui/screen_lua.hpp"
#include "core/lv_obj_tree.h"
#include "lua.h"
#include "lua.hpp"
#include "property.hpp"
#include "themes.hpp"
#include "lua/property.hpp"
#include "ui/themes.hpp"
#include "lua_thread.hpp"
#include "lua/lua_thread.hpp"
#include "luavgl.h"
namespace ui {
+2 -2
View File
@@ -8,8 +8,8 @@
#include "lua.hpp"
#include "property.hpp"
#include "screen.hpp"
#include "lua/property.hpp"
#include "ui/screen.hpp"
namespace ui {
namespace screens {
+1 -1
View File
@@ -4,7 +4,7 @@
* 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_style.h"
+1 -1
View File
@@ -10,7 +10,7 @@
#include "lvgl.h"
#include "screen.hpp"
#include "ui/screen.hpp"
namespace ui {
namespace screens {
+12 -13
View File
@@ -1,4 +1,4 @@
#include "themes.hpp"
#include "ui/themes.hpp"
#include "core/lv_obj.h"
#include "core/lv_obj_style.h"
#include "core/lv_obj_tree.h"
@@ -35,9 +35,9 @@ void Theme::Apply(void) {
void Theme::Callback(lv_obj_t* obj) {
// Find and apply base styles
if (auto search = style_map.find("base"); search != style_map.end()) {
for (const auto& pair : search->second) {
lv_obj_add_style(obj, pair.second, pair.first);
}
for (const auto& pair : search->second) {
lv_obj_add_style(obj, pair.second, pair.first);
}
}
// Determine class name
@@ -60,19 +60,18 @@ void Theme::Callback(lv_obj_t* obj) {
// Apply all styles from class
if (auto search = style_map.find(class_name); search != style_map.end()) {
for (const auto& pair : search->second) {
lv_obj_add_style(obj, pair.second, pair.first);
}
for (const auto& pair : search->second) {
lv_obj_add_style(obj, pair.second, pair.first);
}
}
}
void Theme::ApplyStyle(lv_obj_t* obj, std::string style_key) {
if (auto search = style_map.find(style_key); search != style_map.end()) {
for (const auto& pair : search->second) {
lv_obj_remove_style(obj, pair.second, pair.first);
lv_obj_add_style(obj, pair.second, pair.first);
}
for (const auto& pair : search->second) {
lv_obj_remove_style(obj, pair.second, pair.first);
lv_obj_add_style(obj, pair.second, pair.first);
}
}
}
@@ -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*>>{});
if (auto search = style_map.find(key); search != style_map.end()) {
// Key exists
auto &vec = search->second;
auto& vec = search->second;
// Add it to the list
vec.push_back(std::make_pair(selector, style));
}
+1 -2
View File
@@ -1,7 +1,7 @@
#pragma once
#include <string>
#include <map>
#include <string>
#include <vector>
#include "lvgl.h"
@@ -32,7 +32,6 @@ class Theme {
Theme();
std::map<std::string, std::vector<std::pair<int, lv_style_t*>>> style_map;
lv_theme_t theme_;
};
} // namespace themes
} // namespace ui
+3 -3
View File
@@ -7,12 +7,12 @@
#pragma once
#include <memory>
#include "database.hpp"
#include "database/database.hpp"
#include "database/index.hpp"
#include "gpios.hpp"
#include "index.hpp"
#include "nvs.hpp"
#include "screen.hpp"
#include "tinyfsm.hpp"
#include "ui/screen.hpp"
namespace ui {
+25 -25
View File
@@ -4,61 +4,61 @@
* SPDX-License-Identifier: GPL-3.0-only
*/
#include "ui_fsm.hpp"
#include "ui/ui_fsm.hpp"
#include <memory>
#include <memory_resource>
#include <variant>
#include "bluetooth_types.hpp"
#include "db_events.hpp"
#include "device_factory.hpp"
#include "database/db_events.hpp"
#include "display_init.hpp"
#include "esp_spp_api.h"
#include "feedback_haptics.hpp"
#include "freertos/portmacro.h"
#include "freertos/projdefs.h"
#include "input_device.hpp"
#include "input_touch_wheel.hpp"
#include "input_volume_buttons.hpp"
#include "input/device_factory.hpp"
#include "input/feedback_haptics.hpp"
#include "input/input_device.hpp"
#include "input/input_touch_wheel.hpp"
#include "input/input_volume_buttons.hpp"
#include "lua.h"
#include "lua.hpp"
#include "audio_fsm.hpp"
#include "battery.hpp"
#include "audio/audio_fsm.hpp"
#include "battery/battery.hpp"
#include "core/lv_group.h"
#include "core/lv_obj.h"
#include "core/lv_obj_tree.h"
#include "database.hpp"
#include "database/database.hpp"
#include "esp_heap_caps.h"
#include "esp_timer.h"
#include "haptics.hpp"
#include "input/lvgl_input_driver.hpp"
#include "lauxlib.h"
#include "lua_thread.hpp"
#include "lua/lua_thread.hpp"
#include "luavgl.h"
#include "lvgl_input_driver.hpp"
#include "memory_resource.hpp"
#include "misc/lv_gc.h"
#include "audio_events.hpp"
#include "audio/audio_events.hpp"
#include "audio/track_queue.hpp"
#include "display.hpp"
#include "event_queue.hpp"
#include "events/event_queue.hpp"
#include "gpios.hpp"
#include "lua_registry.hpp"
#include "lvgl_task.hpp"
#include "lua/lua_registry.hpp"
#include "lua/property.hpp"
#include "nvs.hpp"
#include "property.hpp"
#include "samd.hpp"
#include "screen.hpp"
#include "screen_lua.hpp"
#include "screen_splash.hpp"
#include "spiffs.hpp"
#include "storage.hpp"
#include "system_events.hpp"
#include "system_fsm/system_events.hpp"
#include "tinyfsm.hpp"
#include "touchwheel.hpp"
#include "track_queue.hpp"
#include "ui_events.hpp"
#include "ui/lvgl_task.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"
namespace ui {
@@ -266,8 +266,8 @@ lua::Property UiState::sUsbMassStorageEnabled{
lua::Property UiState::sUsbMassStorageBusy{false};
auto UiState::InitBootSplash(drivers::IGpios& gpios, drivers::NvsStorage& nvs)
-> bool {
auto UiState::InitBootSplash(drivers::IGpios& gpios,
drivers::NvsStorage& nvs) -> bool {
events::Ui().Dispatch(internal::InitDisplay{
.gpios = gpios,
.nvs = nvs,
+20 -20
View File
@@ -10,30 +10,30 @@
#include <memory>
#include <stack>
#include "audio_events.hpp"
#include "battery.hpp"
#include "db_events.hpp"
#include "device_factory.hpp"
#include "audio/audio_events.hpp"
#include "audio/track_queue.hpp"
#include "battery/battery.hpp"
#include "database/db_events.hpp"
#include "database/track.hpp"
#include "display.hpp"
#include "feedback_haptics.hpp"
#include "gpios.hpp"
#include "input_touch_wheel.hpp"
#include "input_volume_buttons.hpp"
#include "lua_thread.hpp"
#include "lvgl_input_driver.hpp"
#include "lvgl_task.hpp"
#include "modal.hpp"
#include "input/device_factory.hpp"
#include "input/feedback_haptics.hpp"
#include "input/input_touch_wheel.hpp"
#include "input/input_volume_buttons.hpp"
#include "input/lvgl_input_driver.hpp"
#include "lua/lua_thread.hpp"
#include "lua/property.hpp"
#include "nvs.hpp"
#include "property.hpp"
#include "screen.hpp"
#include "service_locator.hpp"
#include "storage.hpp"
#include "system_events.hpp"
#include "system_fsm/service_locator.hpp"
#include "system_fsm/system_events.hpp"
#include "tinyfsm.hpp"
#include "touchwheel.hpp"
#include "track.hpp"
#include "track_queue.hpp"
#include "ui_events.hpp"
#include "ui/lvgl_task.hpp"
#include "ui/modal.hpp"
#include "ui/screen.hpp"
#include "ui/ui_events.hpp"
namespace ui {
@@ -74,7 +74,7 @@ class UiState : public tinyfsm::Fsm<UiState> {
void react(const internal::DismissAlerts&);
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 system_fsm::BluetoothEvent&);
@@ -86,7 +86,7 @@ class UiState : public tinyfsm::Fsm<UiState> {
sCurrentModal.reset();
}
void react(const internal::ReindexDatabase&){};
void react(const internal::ReindexDatabase&) {};
protected:
void PushScreen(std::shared_ptr<Screen>);