Skip to content

Commit

Permalink
[CHORE] Readme update + tests fix + new cmd line arg
Browse files Browse the repository at this point in the history
  • Loading branch information
nots1dd committed Feb 1, 2025
1 parent 8180b50 commit 2ffa7c1
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 12 deletions.
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,33 @@
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.
- **Very few external dependencies**: Minimal setup required to get started.
- **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**

<div align="center">
<img src="assets/gifs/inLimbo-1.gif" alt="inLimbo Demo GIF" width="600">
<img src="assets/gifs/inLimbo-3.gif" alt="inLimbo Demo GIF" width="600">
</div>

## DEPENDENCIES
## **DEPENDENCIES**

> [!IMPORTANT]
>
Expand Down Expand Up @@ -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:

Expand All @@ -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.

Expand Down Expand Up @@ -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)
1 change: 1 addition & 0 deletions assets/completions/inLimbo-completions.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion assets/completions/inLimbo-completions.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
1 change: 1 addition & 0 deletions assets/completions/inLimbo-completions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
10 changes: 9 additions & 1 deletion src/arg-handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -226,4 +228,10 @@ class ArgumentHandler
handleClearCache(libBinPath);
shouldRunApp = true;
}

static void handlePrintSongTree()
{
printSongTree = true;
shouldRunApp = true;
}
};
2 changes: 1 addition & 1 deletion src/cmd-line-args.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,4 @@ class CommandLineArgs
// Define valid flags globally
const std::vector<std::string> 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"};
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions tests/toml/TomlParserTestsLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ salt = "salt_value"
password_hash = "hashed_password"
[debug]
parser_log = "true"
taglib_parser_log = "true"
)";

// Write the test configuration file
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2ffa7c1

Please sign in to comment.