From 2ffa7c11808cce622ed72381d4b7a274b79fc04b Mon Sep 17 00:00:00 2001 From: nots1dd Date: Sat, 1 Feb 2025 20:49:44 +0530 Subject: [PATCH] [CHORE] Readme update + tests fix + new cmd line arg --- README.md | 29 ++++++++++++++++----- assets/completions/inLimbo-completions.bash | 1 + assets/completions/inLimbo-completions.fish | 3 ++- assets/completions/inLimbo-completions.zsh | 1 + src/arg-handler.hpp | 10 ++++++- src/cmd-line-args.hpp | 2 +- src/main.cpp | 5 ++++ tests/toml/TomlParserTestsLinux.cpp | 4 +-- 8 files changed, 43 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a7f25a4..71be4b6 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,15 @@ The inLimbo project aims to be a new upcoming TUI music player for UNIX based systems that gives music lovers a clean and efficient environment to browse, play and interact with your favourite offline music. -## Features +## **Why** + +There are a dozen of great music players out there that do a really good job of making my music experience top notch, but nothing was ever perfect. So I tried making something that in my opinion comes closest to my ideal TUI music player. + +Why would you want to stay in Limbo? + +Sometimes it feels good to be stuck in a weird place in your life, and it feels even better to be stuck in Limbo with music :) + +## **Features** - **Fully configurable**: Keybinds, library, FTP credentials, and more, all in one `config.toml` file located in `$HOME/.config/inLimbo/config.toml` - **Very fast and easy to use**: Optimized for speed and usability. @@ -37,16 +45,17 @@ The inLimbo project aims to be a new upcoming TUI music player for UNIX based sy - **Clean and nice TUI experience**: Interact with your music library seamlessly in a terminal interface. - **Showcases all the metadata**: Displays song metadata, including lyrics, genre, and more, for every file in your library. - **Plays and caters to many audio file formats**: Compatible with a variety of audio formats, depending on the capabilities of [miniaudio](https://github.com/mackron/miniaudio). -- **Customizable**: Add your own color palette to inLimbo ;) +- **Customizable**: Heavily customizable TUI with custom keybinds, colors, UI designs and much more to come... +- **Privacy**: No data is collected by inLimbo other than a backtrace of when the application catches a critical signal like `SIGSEGV`, `SIGABRT` -## LOOKS +## **LOOKS**
inLimbo Demo GIF inLimbo Demo GIF
-## DEPENDENCIES +## **DEPENDENCIES** > [!IMPORTANT] > @@ -274,11 +283,13 @@ The **DEBUG BUILD** will account for the following issues: -> Undefined Behaviour Sanitation (UBSan) -## DIRECTORY SORTING +## **DIRECTORY SORTING** + +inLimbo reads a directory and attempts to parse each inode for its metadata using TagLib, and accordingly creates a song map datastructure that is utilized to efficiently traverse the required artist, album, song etc. To know more about inLimbo Project's logical flow on creating a song map, visit [SONGMAP](https://github.com/nots1dd/inLimbo/blob/main/src/dirsort/SONGMAP.md) -## TESTING +## **TESTING** The inLimbo project is aiming to be more aware of how bad its codebase is, hence I am setting up unit tests for most if not all functions/classes that should: @@ -288,7 +299,7 @@ The inLimbo project is aiming to be more aware of how bad its codebase is, hence The testing is done using GTest, read [TESTS.md](https;//github.com/nots1dd/inLimbo/blob/main/tests/TESTS,md) to understand more on how tests are configured and built -## DOCUMENTATION +## **DOCUMENTATION** There is a primitive Doxygen documention set up for the inLimbo project, that should explain a lot more about the thought process and idea behind every aspect of the codebase. @@ -327,6 +338,10 @@ To parse the [config.toml](https://github.com/nots1dd/inlimbo/blob/main/src/pars Audio playback and capture is thanks to [miniaudio](https://github.com/mackron/miniaudio) +**INSPIRATIONS**: + +This music player's UI flow is heavily inspired by [CMUS](https://github.com/cmus/cmus), it seemed (to me atleast) the fastest and most responsive and logical UI/UX design of a TUI that has a great balance between looking good and feeling smooth + ---- inLimbo is Free and Open Source Software Licensed under [GNU GPL v3](https://github.com/nots1dd/inlimbo/blob/main/LICENSE) diff --git a/assets/completions/inLimbo-completions.bash b/assets/completions/inLimbo-completions.bash index 456377a..6aaabd6 100755 --- a/assets/completions/inLimbo-completions.bash +++ b/assets/completions/inLimbo-completions.bash @@ -14,6 +14,7 @@ _inLimbo_completions() { "--show-log-dir Show the log directory path" "--show-dbus-name Show the DBus service name" "--update-cache-run Update the cache file and run the application" + "--print-song-tree Print the Song Map parsed from directory" ) # Provide completion for options diff --git a/assets/completions/inLimbo-completions.fish b/assets/completions/inLimbo-completions.fish index 0444c4d..03c943e 100644 --- a/assets/completions/inLimbo-completions.fish +++ b/assets/completions/inLimbo-completions.fish @@ -7,7 +7,8 @@ function _inLimbo_completions "--show-config-file" "Show the configuration file path" \ "--show-log-dir" "Show the log directory path" \ "--show-dbus-name" "Show the DBus service name" \ - "--update-cache-run" "Update the cache file and run the application" + "--update-cache-run" "Update the cache file and run the application" \ + "--print-song-tree" "Print the Song Map parsed from directory" for i in (seq 1 2 (count $opts)) set -l opt (string trim -- $opts[$i]) set -l desc $opts[(math $i + 1)] diff --git a/assets/completions/inLimbo-completions.zsh b/assets/completions/inLimbo-completions.zsh index b25064d..d662c94 100755 --- a/assets/completions/inLimbo-completions.zsh +++ b/assets/completions/inLimbo-completions.zsh @@ -8,6 +8,7 @@ _inLimbo_completions() { "--show-log-dir:Show the log directory path" "--show-dbus-name:Show the DBus service name" "--update-cache-run:Update the cache file and run the application" + "--print-song-tree:Print the Song Map parsed from directory" ) _describe -t options "inLimbo options" opts } diff --git a/src/arg-handler.hpp b/src/arg-handler.hpp index 72fb35b..91cdcba 100644 --- a/src/arg-handler.hpp +++ b/src/arg-handler.hpp @@ -22,6 +22,7 @@ constexpr const char* REPOSITORY_URL = "https://github.com/nots1dd/inLimbo"; bool shouldRunApp = false; ///< Indicates if the application should proceed to run after handling arguments. +bool printSongTree = false; /** * @enum ConsoleColor @@ -111,7 +112,8 @@ class ArgumentHandler {"--show-config-file", [&]() { handleShowConfig(paths.configPath); }}, {"--show-log-dir", [&]() { handleShowLogDir(paths.cacheDir); }}, {"--show-dbus-name", [&]() { handleShowDBusName(); }}, - {"--update-cache-run", [&]() { handleUpdateCacheRun(paths.libBinPath); }}}; + {"--update-cache-run", [&]() { handleUpdateCacheRun(paths.libBinPath); }}, + {"--print-song-tree", [&]() { handlePrintSongTree(); }}}; for (const auto& [flag, handler] : argumentHandlers) { @@ -226,4 +228,10 @@ class ArgumentHandler handleClearCache(libBinPath); shouldRunApp = true; } + + static void handlePrintSongTree() + { + printSongTree = true; + shouldRunApp = true; + } }; diff --git a/src/cmd-line-args.hpp b/src/cmd-line-args.hpp index ec309e3..0da6aaf 100644 --- a/src/cmd-line-args.hpp +++ b/src/cmd-line-args.hpp @@ -223,4 +223,4 @@ class CommandLineArgs // Define valid flags globally const std::vector CommandLineArgs::validFlags = { "--help", "--show-dbus-name", "--version", "--clear-cache", "--show-config-file", - "--show-log-dir", "--update-cache-run"}; + "--show-log-dir", "--update-cache-run", "--print-song-tree"}; diff --git a/src/main.cpp b/src/main.cpp index 9862bd8..068c891 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,6 +37,11 @@ auto main(int argc, char* argv[]) -> int song_tree.saveToFile(libBinPath); } + if (printSongTree) { + song_tree.display(); + return 0; + } + auto library_map = song_tree.returnSongMap(); auto end = chrono::high_resolution_clock::now(); Keybinds global_keybinds = parseKeybinds(); diff --git a/tests/toml/TomlParserTestsLinux.cpp b/tests/toml/TomlParserTestsLinux.cpp index 08beaff..4e2242e 100644 --- a/tests/toml/TomlParserTestsLinux.cpp +++ b/tests/toml/TomlParserTestsLinux.cpp @@ -38,7 +38,7 @@ salt = "salt_value" password_hash = "hashed_password" [debug] -parser_log = "true" +taglib_parser_log = "true" )"; // Write the test configuration file @@ -104,7 +104,7 @@ TEST_F(TOMLParserTest, LoadConfig_FileExistsAndParsed) { // Check that a value exists for a given field EXPECT_EQ(string(parseTOMLFieldCustom(config, PARENT_LIB, PARENT_LIB_FIELD_NAME)), "MyLibrary"); EXPECT_EQ(string(parseTOMLFieldCustom(config, PARENT_FTP, PARENT_FTP_FIELD_USER)), "user"); - EXPECT_EQ(string(parseTOMLFieldCustom(config, PARENT_DBG, PARENT_DBG_FIELD_PARSER_LOG)), "true"); + EXPECT_EQ(string(parseTOMLFieldCustom(config, PARENT_DBG, PARENT_DBG_FIELD_TAGLIB_PARSER_LOG)), "true"); } // Test for parseTOMLField for non-existent field