inLimbo
TUI Music Player that keeps you in Limbo.
 
Loading...
Searching...
No Matches
misc.hpp File Reference
#include "../arg-handler.hpp"
#include "../dirsort/taglib_parser.h"
#include "./colors.hpp"
#include "./keymaps.hpp"
#include "components/image_view.hpp"
#include <algorithm>
#include <cctype>
#include <ftxui/component/captured_mouse.hpp>
#include <ftxui/component/component.hpp>
#include <ftxui/component/component_base.hpp>
#include <ftxui/component/event.hpp>
#include <ftxui/component/screen_interactive.hpp>
#include <ftxui/dom/elements.hpp>
#include <string>
#include <vector>

Go to the source code of this file.

Macros

#define MAX_LENGTH_SONG_NAME   50
 
#define MAX_LENGTH_ARTIST_NAME   30
 
#define SONG_TITLE_DELIM   " • "
 
#define LYRICS_AVAIL   "L*"
 
#define ADDN_PROPS_AVAIL   "&*"
 
#define STATUS_BAR_DELIM   " | "
 

Functions

auto handleToggleMute (int *volume, int *lastVolume, bool *muted) -> int
 
auto formatDiscTrackInfo (const int &disc_number, const int &track_number)
 
auto formatLyrics (const std::string &lyrics)
 
auto formatAdditionalInfo (const std::string &genre, const bool &has_comment, const bool &has_lyrics, const bool &show_bitrate, const int &bitrate) -> std::string
 
auto charToStr (char ch) -> std::string
 
auto FormatTime (int seconds)
 
auto getTrueColor (TrueColors::Color color)
 
auto getTrueBGColor (TrueColors::Color color)
 
auto renderAlbumName (const std::string &album_name, const int &year, ftxui::Color sel_color, ftxui::Color sel_color_fg)
 
auto renderSongName (const std::string &disc_track_info, const std::string &song_name, const int &duration)
 
auto RenderArtistNames (const std::vector< std::string > &artist_list)
 
auto CreateMenu (const std::vector< std::string > *vecLines, int *currLine)
 
auto RenderSongMenu (const std::vector< Element > &items)
 
auto RenderArtistMenu (const std::vector< std::string > &artist_list)
 
auto getMimeTypeFromExtension (const std::string &filePath) -> std::string
 
auto RenderThumbnail (const std::string &songFilePath, const std::string &cacheDirPath, const std::string &songTitle, const std::string &artistName, const std::string &albumName, const std::string &genre, unsigned int year, unsigned int trackNumber, unsigned int discNumber, float progress)
 
auto RenderSearchBar (std::string &user_input) -> Element
 
auto RenderDialog (const std::string &dialog_message) -> Element
 
auto RenderHelpScreen (Keybinds &global_keybinds) -> Element
 
void searchModeIndices (const std::vector< std::string > &words, const std::string &prefix, std::vector< int > &search_indices)
 
void UpdateSelectedIndex (int &index, int max_size, bool move_down)
 
auto RenderStatusBar (const std::string &status, const std::string &current_song_info, const std::string &additional_info, const std::string &year_info, InLimboColors &global_colors, const std::string &current_artist) -> Element
 
auto RenderVolumeBar (int volume, ftxui::Color volume_bar_col) -> Element
 

Macro Definition Documentation

◆ ADDN_PROPS_AVAIL

#define ADDN_PROPS_AVAIL   "&*"

◆ LYRICS_AVAIL

#define LYRICS_AVAIL   "L*"

◆ MAX_LENGTH_ARTIST_NAME

#define MAX_LENGTH_ARTIST_NAME   30

◆ MAX_LENGTH_SONG_NAME

#define MAX_LENGTH_SONG_NAME   50

STRING TRUNCATION MACROS

◆ SONG_TITLE_DELIM

#define SONG_TITLE_DELIM   " • "

◆ STATUS_BAR_DELIM

#define STATUS_BAR_DELIM   " | "

Function Documentation

◆ charToStr()

auto charToStr ( char ch) -> std::string

◆ CreateMenu()

auto CreateMenu ( const std::vector< std::string > * vecLines,
int * currLine )

◆ formatAdditionalInfo()

auto formatAdditionalInfo ( const std::string & genre,
const bool & has_comment,
const bool & has_lyrics,
const bool & show_bitrate,
const int & bitrate ) -> std::string

◆ formatDiscTrackInfo()

auto formatDiscTrackInfo ( const int & disc_number,
const int & track_number )

◆ formatLyrics()

auto formatLyrics ( const std::string & lyrics)

◆ FormatTime()

auto FormatTime ( int seconds)

◆ getMimeTypeFromExtension()

auto getMimeTypeFromExtension ( const std::string & filePath) -> std::string

◆ getTrueBGColor()

auto getTrueBGColor ( TrueColors::Color color)

◆ getTrueColor()

auto getTrueColor ( TrueColors::Color color)

◆ handleToggleMute()

auto handleToggleMute ( int * volume,
int * lastVolume,
bool * muted ) -> int

◆ renderAlbumName()

auto renderAlbumName ( const std::string & album_name,
const int & year,
ftxui::Color sel_color,
ftxui::Color sel_color_fg )

◆ RenderArtistMenu()

auto RenderArtistMenu ( const std::vector< std::string > & artist_list)

◆ RenderArtistNames()

auto RenderArtistNames ( const std::vector< std::string > & artist_list)

◆ RenderDialog()

auto RenderDialog ( const std::string & dialog_message) -> Element

◆ RenderHelpScreen()

auto RenderHelpScreen ( Keybinds & global_keybinds) -> Element

◆ RenderSearchBar()

auto RenderSearchBar ( std::string & user_input) -> Element

◆ RenderSongMenu()

auto RenderSongMenu ( const std::vector< Element > & items)

◆ renderSongName()

auto renderSongName ( const std::string & disc_track_info,
const std::string & song_name,
const int & duration )

◆ RenderStatusBar()

auto RenderStatusBar ( const std::string & status,
const std::string & current_song_info,
const std::string & additional_info,
const std::string & year_info,
InLimboColors & global_colors,
const std::string & current_artist ) -> Element

◆ RenderThumbnail()

auto RenderThumbnail ( const std::string & songFilePath,
const std::string & cacheDirPath,
const std::string & songTitle,
const std::string & artistName,
const std::string & albumName,
const std::string & genre,
unsigned int year,
unsigned int trackNumber,
unsigned int discNumber,
float progress )

◆ RenderVolumeBar()

auto RenderVolumeBar ( int volume,
ftxui::Color volume_bar_col ) -> Element

◆ searchModeIndices()

void searchModeIndices ( const std::vector< std::string > & words,
const std::string & prefix,
std::vector< int > & search_indices )

◆ UpdateSelectedIndex()

void UpdateSelectedIndex ( int & index,
int max_size,
bool move_down )