@@ -58,10 +58,10 @@ extern "C" {
58
58
#include " output.hpp"
59
59
#include " easymode.hpp"
60
60
61
- #define PRINT_LIB (lib, version ) print(" " COLOR_YELLOW " {:<14}" COLOR_OFF " {}\n " , lib, version)
61
+ #define PRINT_LIB (lib, version ) rsgain:: print(" " COLOR_YELLOW " {:<14}" COLOR_OFF " {}\n " , lib, version)
62
62
#define PRINT_LIB_FFMPEG (name, fn ) \
63
63
ffver = fn(); \
64
- PRINT_LIB (name, format(" {}.{}.{}" , AV_VERSION_MAJOR(ffver), AV_VERSION_MINOR(ffver), AV_VERSION_MICRO(ffver)))
64
+ PRINT_LIB (name, rsgain:: format(" {}.{}.{}" , AV_VERSION_MAJOR(ffver), AV_VERSION_MINOR(ffver), AV_VERSION_MICRO(ffver)))
65
65
66
66
#ifdef _WIN32
67
67
#include < windows.h>
@@ -386,77 +386,77 @@ int main(int argc, char *argv[]) {
386
386
}
387
387
388
388
static void help_main () {
389
- print (COLOR_RED " Usage: " COLOR_OFF " {}{}{} [OPTIONS] <command> ...\n " , COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF);
389
+ rsgain:: print (COLOR_RED " Usage: " COLOR_OFF " {}{}{} [OPTIONS] <command> ...\n " , COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF);
390
390
391
- print (" {} {} supports writing tags to the following file types:\n " , PROJECT_NAME, PROJECT_VERSION);
392
- print (" FLAC (.flac), Ogg (.ogg, .oga, .spx), Opus (.opus), MP2 (.mp2),\n " );
393
- print (" MP3 (.mp3), MP4 (.m4a), WMA (.wma), WavPack (.wv), APE (.ape),\n " );
394
- print (" WAV (.wav), AIFF (.aiff, .aif, .snd), and TAK (.tak).\n " );
391
+ rsgain:: print (" {} {} supports writing tags to the following file types:\n " , PROJECT_NAME, PROJECT_VERSION);
392
+ rsgain:: print (" FLAC (.flac), Ogg (.ogg, .oga, .spx), Opus (.opus), MP2 (.mp2),\n " );
393
+ rsgain:: print (" MP3 (.mp3), MP4 (.m4a), WMA (.wma), WavPack (.wv), APE (.ape),\n " );
394
+ rsgain:: print (" WAV (.wav), AIFF (.aiff, .aif, .snd), and TAK (.tak).\n " );
395
395
396
- print (" \n " );
397
- print (COLOR_RED " Options:\n " COLOR_OFF);
396
+ rsgain:: print (" \n " );
397
+ rsgain:: print (COLOR_RED " Options:\n " COLOR_OFF);
398
398
399
399
CMD_HELP (" --help" , " -h" , " Show this help" );
400
400
CMD_HELP (" --version" , " -v" , " Show version number" );
401
401
402
- print (" \n " );
403
- print (COLOR_RED " Commands:\n " COLOR_OFF);
402
+ rsgain:: print (" \n " );
403
+ rsgain:: print (COLOR_RED " Commands:\n " COLOR_OFF);
404
404
405
405
CMD_CMD (" easy" , " Easy Mode: Recursively scan a directory with recommended settings" );
406
406
CMD_CMD (" custom" , " Custom Mode: Scan individual files with custom settings" );
407
- print (" \n " );
408
- print (" Run '{} easy --help' or '{} custom --help' for more information." , EXECUTABLE_TITLE, EXECUTABLE_TITLE);
407
+ rsgain:: print (" \n " );
408
+ rsgain:: print (" Run '{} easy --help' or '{} custom --help' for more information." , EXECUTABLE_TITLE, EXECUTABLE_TITLE);
409
409
410
- print (" \n\n " );
411
- print (" Please report any issues to " PROJECT_URL " /issues\n\n " );
410
+ rsgain:: print (" \n\n " );
411
+ rsgain:: print (" Please report any issues to " PROJECT_URL " /issues\n\n " );
412
412
}
413
413
414
414
static inline void help_custom () {
415
- print (COLOR_RED " Usage: " COLOR_OFF " {}{}{} custom [OPTIONS] FILES...\n " , COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF);
415
+ rsgain:: print (COLOR_RED " Usage: " COLOR_OFF " {}{}{} custom [OPTIONS] FILES...\n " , COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF);
416
416
417
- print (" Custom Mode allows the user to specify the options to scan the files with. The\n " );
418
- print (" list of files to scan must be listed explicitly after the options.\n " );
419
- print (" \n " );
417
+ rsgain:: print (" Custom Mode allows the user to specify the options to scan the files with. The\n " );
418
+ rsgain:: print (" list of files to scan must be listed explicitly after the options.\n " );
419
+ rsgain:: print (" \n " );
420
420
421
- print (COLOR_RED " Options:\n " COLOR_OFF);
421
+ rsgain:: print (COLOR_RED " Options:\n " COLOR_OFF);
422
422
CMD_HELP (" --help" , " -h" , " Show this help" );
423
- print (" \n " );
423
+ rsgain:: print (" \n " );
424
424
425
425
CMD_HELP (" --album" , " -a" , " Calculate album gain and peak" );
426
426
CMD_HELP (" --skip-existing" , " -S" , " Don't scan files with existing ReplayGain information" );
427
- print (" \n " );
427
+ rsgain:: print (" \n " );
428
428
429
429
CMD_HELP (" --tagmode=s" , " -s s" , " Scan files but don't write ReplayGain tags (default)" );
430
430
CMD_HELP (" --tagmode=d" , " -s d" , " Delete ReplayGain tags from files" );
431
431
CMD_HELP (" --tagmode=i" , " -s i" , " Scan and write ReplayGain 2.0 tags to files" );
432
- print (" \n " );
432
+ rsgain:: print (" \n " );
433
433
434
434
CMD_HELP (" --loudness=n" , " -l n" , " Use n LUFS as target loudness (" STR (MIN_TARGET_LOUDNESS) " ≤ n ≤ " STR (MAX_TARGET_LOUDNESS) " )" );
435
- print (" \n " );
435
+ rsgain:: print (" \n " );
436
436
437
437
CMD_HELP (" --clip-mode=n" , " -c n" , " No clipping protection (default)" );
438
438
CMD_HELP (" --clip-mode=p" , " -c p" , " Clipping protection enabled for positive gain values only" );
439
439
CMD_HELP (" --clip-mode=a" , " -c a" , " Clipping protection always enabled" );
440
440
CMD_HELP (" --max-peak=n" , " -m n" , " Use max peak level n dB for clipping protection" );
441
441
CMD_HELP (" --true-peak" , " -t" , " Use true peak for peak calculations" );
442
442
443
- print (" \n " );
443
+ rsgain:: print (" \n " );
444
444
445
445
CMD_HELP (" --lowercase" , " -L" , " Write lowercase tags (MP2/MP3/MP4/WMA/WAV/AIFF)" );
446
446
CMD_CONT (" This is non-standard but sometimes needed" );
447
447
CMD_HELP (" --id3v2-version=keep" , " -I keep" , " Keep file's existing ID3v2 version, 3 if none exists (default)" );
448
448
CMD_HELP (" --id3v2-version=3" , " -I 3" , " Write ID3v2.3 tags to MP2/MP3/WAV/AIFF" );
449
449
CMD_HELP (" --id3v2-version=4" , " -I 4" , " Write ID3v2.4 tags to MP2/MP3/WAV/AIFF" );
450
450
451
- print (" \n " );
451
+ rsgain:: print (" \n " );
452
452
453
453
CMD_HELP (" --opus-mode=d" , " -o d" , " Write standard ReplayGain tags, clear header output gain (default)" );
454
454
CMD_HELP (" --opus-mode=r" , " -o r" , " Write R128_*_GAIN tags, clear header output gain" );
455
455
CMD_HELP (" --opus-mode=s" , " -o s" , " Same as 'r', plus override target loudness to -23 LUFS" );
456
456
CMD_HELP (" --opus-mode=t" , " -o t" , " Write track gain to header output gain" );
457
457
CMD_HELP (" --opus-mode=a" , " -o a" , " Write album gain to header output gain" );
458
458
459
- print (" \n " );
459
+ rsgain:: print (" \n " );
460
460
461
461
CMD_HELP (" --output" , " -O" , " Output tab-delimited scan data to stdout" );
462
462
CMD_HELP (" --output=s" , " -O s" , " Output with sep header (needed for Microsoft Excel compatibility)" );
@@ -465,18 +465,18 @@ static inline void help_custom() {
465
465
CMD_HELP (" --preserve-mtimes" , " -p" , " Preserve file mtimes" );
466
466
CMD_HELP (" --quiet" , " -q" , " Don't print scanning status messages" );
467
467
468
- print (" \n " );
468
+ rsgain:: print (" \n " );
469
469
470
- print (" Please report any issues to " PROJECT_URL " /issues\n " );
471
- print (" \n " );
470
+ rsgain:: print (" Please report any issues to " PROJECT_URL " /issues\n " );
471
+ rsgain:: print (" \n " );
472
472
}
473
473
474
474
static void version () {
475
475
unsigned int ffver;
476
476
int ebur128_v_major = 0 ;
477
477
int ebur128_v_minor = 0 ;
478
478
int ebur128_v_patch = 0 ;
479
- print (COLOR_GREEN PROJECT_NAME COLOR_OFF " " PROJECT_VERSION
479
+ rsgain:: print (COLOR_GREEN PROJECT_NAME COLOR_OFF " " PROJECT_VERSION
480
480
#if defined COMMITS_SINCE_TAG && defined COMMIT_HASH
481
481
" -r" COMMITS_SINCE_TAG " -" COMMIT_HASH
482
482
#endif
@@ -485,36 +485,36 @@ static void version() {
485
485
486
486
// Library versions
487
487
ebur128_get_version (&ebur128_v_major, &ebur128_v_minor, &ebur128_v_patch);
488
- PRINT_LIB (" libebur128" , format (" {}.{}.{}" , ebur128_v_major, ebur128_v_minor, ebur128_v_patch));
488
+ PRINT_LIB (" libebur128" , rsgain:: format (" {}.{}.{}" , ebur128_v_major, ebur128_v_minor, ebur128_v_patch));
489
489
PRINT_LIB_FFMPEG (" libavformat" , avformat_version);
490
490
PRINT_LIB_FFMPEG (" libavcodec" , avcodec_version);
491
491
PRINT_LIB_FFMPEG (" libavutil" , avutil_version);
492
492
PRINT_LIB_FFMPEG (" libswresample" , swresample_version);
493
493
#if HAS_TAGLIB2
494
494
TagLib::VersionNumber tver = TagLib::runtimeVersion ();
495
- PRINT_LIB (" TagLib" , format (" {}.{}{}" , tver.majorVersion (), tver.minorVersion (), tver.patchVersion () ? format (" .{}" , tver.patchVersion ()) : " " ));
495
+ PRINT_LIB (" TagLib" , rsgain:: format (" {}.{}{}" , tver.majorVersion (), tver.minorVersion (), tver.patchVersion () ? rsgain:: format (" .{}" , tver.patchVersion ()) : " " ));
496
496
#else
497
- print (" \n " );
498
- print (" Built with:\n " );
499
- PRINT_LIB (" TagLib" , format (" {}.{}{}" , TAGLIB_MAJOR_VERSION, TAGLIB_MINOR_VERSION, TAGLIB_PATCH_VERSION ? format (" .{}" , TAGLIB_PATCH_VERSION) : " " ));
497
+ rsgain:: print (" \n " );
498
+ rsgain:: print (" Built with:\n " );
499
+ PRINT_LIB (" TagLib" , rsgain:: format (" {}.{}{}" , TAGLIB_MAJOR_VERSION, TAGLIB_MINOR_VERSION, TAGLIB_PATCH_VERSION ? rsgain:: format (" .{}" , TAGLIB_PATCH_VERSION) : " " ));
500
500
#endif
501
- print (" \n " );
501
+ rsgain:: print (" \n " );
502
502
503
503
#if defined(__GNUC__) && !defined(__clang__)
504
- print (COLOR_YELLOW " {:<17}" COLOR_OFF " GCC {}.{}\n " , " Compiler:" , __GNUC__, __GNUC_MINOR__);
504
+ rsgain:: print (COLOR_YELLOW " {:<17}" COLOR_OFF " GCC {}.{}\n " , " Compiler:" , __GNUC__, __GNUC_MINOR__);
505
505
#endif
506
506
507
507
#ifdef __clang__
508
- print (COLOR_YELLOW " {:<17}" COLOR_OFF " "
508
+ rsgain:: print (COLOR_YELLOW " {:<17}" COLOR_OFF " "
509
509
#ifdef __apple_build_version__
510
510
" Apple "
511
511
#endif
512
512
" Clang {}.{}.{}\n " , " Compiler:" , __clang_major__, __clang_minor__, __clang_patchlevel__);
513
513
#endif
514
514
515
515
#ifdef _MSC_VER
516
- print (COLOR_YELLOW " {:<17}" COLOR_OFF " Microsoft C/C++ {:.2f}\n " , " Compiler:" , (float ) _MSC_VER / 100 .0f );
516
+ rsgain:: print (COLOR_YELLOW " {:<17}" COLOR_OFF " Microsoft C/C++ {:.2f}\n " , " Compiler:" , (float ) _MSC_VER / 100 .0f );
517
517
#endif
518
518
519
- print (COLOR_YELLOW " {:<17}" COLOR_OFF " " BUILD_DATE " \n " , " Build Date:" );
519
+ rsgain:: print (COLOR_YELLOW " {:<17}" COLOR_OFF " " BUILD_DATE " \n " , " Build Date:" );
520
520
}
0 commit comments