From 01be69eca1fa89c047fc29f5cb0ea8ba0898dad1 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 7 Dec 2022 15:36:47 +1100 Subject: better handling of chunk buffer --- src/main/app_console.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/main/app_console.cpp') diff --git a/src/main/app_console.cpp b/src/main/app_console.cpp index fbb8df87..281454dc 100644 --- a/src/main/app_console.cpp +++ b/src/main/app_console.cpp @@ -8,11 +8,14 @@ #include #include +#include "audio_playback.hpp" #include "esp_console.h" namespace console { -std::string toSdPath(std::string filepath) { +static AppConsole* sInstance = nullptr; + +std::string toSdPath(const std::string& filepath) { return std::string(drivers::kStoragePath) + "/" + filepath; } @@ -57,12 +60,7 @@ int CmdPlayFile(int argc, char** argv) { return 1; } - /* sInstance->playback_->Play(toSdPath(argv[1])); - if (argc == 3) { - sInstance->playback_->SetNextFile(toSdPath(argv[2])); - } - */ return 0; } @@ -125,14 +123,12 @@ void RegisterVolume() { esp_console_cmd_register(&cmd); } -/* -AppConsole::AppConsole() { +AppConsole::AppConsole(audio::AudioPlayback* playback) : playback_(playback) { sInstance = this; } AppConsole::~AppConsole() { sInstance = nullptr; } -*/ auto AppConsole::RegisterExtraComponents() -> void { RegisterListDir(); -- cgit v1.2.3