From 39f7545cd5ef7a30bbd482f3579df7744c6b688d Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 7 Jul 2023 15:29:47 +1000 Subject: wire up the playing screen with some real data Includes implementing song duration calculation for CBR MP3 files --- src/app_console/app_console.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/app_console/app_console.cpp') diff --git a/src/app_console/app_console.cpp b/src/app_console/app_console.cpp index b0a90155..2b5b84f7 100644 --- a/src/app_console/app_console.cpp +++ b/src/app_console/app_console.cpp @@ -30,6 +30,7 @@ namespace console { std::weak_ptr AppConsole::sDatabase; +audio::TrackQueue* AppConsole::sTrackQueue; int CmdListDir(int argc, char** argv) { auto lock = AppConsole::sDatabase.lock(); @@ -108,9 +109,10 @@ int CmdPlayFile(int argc, char** argv) { if (is_id) { database::TrackId id = std::atoi(argv[1]); - events::Dispatch( - audio::PlayTrack{.id = id}); + AppConsole::sTrackQueue->AddLast(id); } else { + // TODO. + /* std::ostringstream path; path << '/' << argv[1]; for (int i = 2; i < argc; i++) { @@ -119,6 +121,7 @@ int CmdPlayFile(int argc, char** argv) { events::Dispatch( audio::PlayFile{.filename = path.str()}); + */ } return 0; -- cgit v1.2.3