From 5fe914edd9e10c6ef23000df49e51178cd099f5d Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 23 Jun 2023 10:58:33 +0200 Subject: [PATCH] audio/codec: get rid of rang.hpp --- src/audio/codec.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/audio/codec.cpp b/src/audio/codec.cpp index 6d3ba742c..a6e1826a3 100644 --- a/src/audio/codec.cpp +++ b/src/audio/codec.cpp @@ -47,7 +47,6 @@ #include "utils/misc.h" #include "lib_common.h" -#include "rang.hpp" #include #include @@ -55,8 +54,6 @@ static constexpr const char *MOD_NAME = "[acodec] "; -using rang::fg; -using rang::style; using namespace std; static const unordered_map> audio_codec_info = { @@ -106,19 +103,21 @@ std::vector> get_audio_codec_list(void){ void list_audio_codecs(void) { printf("Syntax:\n"); - cout << style::bold << fg::red << "\t--audio-codec " << fg::reset << "[:sample_rate=][:bitrate=]\n" << style::reset; - cout << "\nwhere\n"; - cout << "\t" << style::bold << "codec_name " << style::reset << " - one of the list below\n"; - cout << "\t" << style::bold << "sample_rate" << style::reset << " - sample rate that will the codec used (may differ from captured)\n"; - cout << "\t" << style::bold << "bitrate " << style::reset << " - codec bitrate " << style::bold << "per channel" << style::reset << " (with optional k/M suffix)\n"; - cout << "\n"; + col() << SBOLD( + SRED("\t-A ") + << "[:sample_rate=][:bitrate=]\n"); + col() << "\nwhere\n"; + col() << "\t" << SBOLD("codec_name ") << " - one of the list below\n"; + col() << "\t" << SBOLD("sample_rate") + << " - sample rate that will the codec used (may differ from\n" + << "\t\t captured)\n"; + col() << "\t" << SBOLD("bitrate ") << " - codec bitrate " + << SBOLD("per channel") << " (with optional k/M suffix)\n"; + col() << "\n"; printf("Supported audio codecs:\n"); for (auto const &it : get_audio_codec_list()) { - cout << style::bold << "\t" << it.first << style::reset; - if (!it.second) { - cout << " - " << fg::red <<"unavailable" << fg::reset; - } - printf("\n"); + col() << SBOLD("\t" << it.first) + << (!it.second ? " - " TRED("unavailable") : "") << "\n"; } }