]> git.sesse.net Git - nageru/commitdiff
Add an option --flat-audio to start with almost all the audio processing turned off.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 4 Apr 2016 19:32:12 +0000 (21:32 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 4 Apr 2016 19:32:12 +0000 (21:32 +0200)
flags.cpp
flags.h
mixer.cpp

index f8fea018ea89add3c754a604cfea5973eff1cc63..7b20995f12c9c2b94d00432f231698d4e6057759 100644 (file)
--- a/flags.cpp
+++ b/flags.cpp
@@ -13,6 +13,7 @@ void parse_flags(int argc, char * const argv[])
                { "theme", required_argument, 0, 't' },
                { "va-display", required_argument, 0, 1000 },
                { "http-uncompressed-video", no_argument, 0, 1001 },
+               { "flat-audio", no_argument, 0, 1002 },
                { 0, 0, 0, 0 }
        };
        for ( ;; ) {
@@ -35,6 +36,9 @@ void parse_flags(int argc, char * const argv[])
                case 1001:
                        global_flags.uncompressed_video_to_http = true;
                        break;
+               case 1002:
+                       global_flags.flat_audio = true;
+                       break;
                default:
                        fprintf(stderr, "Unknown option '%s'\n", argv[option_index]);
                        exit(1);
diff --git a/flags.h b/flags.h
index f1755918c14209622abaf3cfe4bcbd50630bcdc2..24e5b32f18b4ae52f1000cd8ff8ff5f5a912a8ba 100644 (file)
--- a/flags.h
+++ b/flags.h
@@ -8,6 +8,7 @@ struct Flags {
        std::string va_display;
        bool uncompressed_video_to_http = false;
        std::string theme_filename = "theme.lua";
+       bool flat_audio = false;
 };
 extern Flags global_flags;
 
index 9565894d420722e802d59aa4692373ff819a02b3..1f1035bf84065ef9c7ccca19afb8a5a51a1075e0 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -261,6 +261,14 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards)
 
        locut.init(FILTER_HPF, 2);
 
+       // If --flat-audio is given, turn off everything that messes with the sound,
+       // except the final makeup gain.
+       if (global_flags.flat_audio) {
+               set_locut_enabled(false);
+               set_limiter_enabled(false);
+               set_compressor_enabled(false);
+       }
+
        // hlen=16 is pretty low quality, but we use quite a bit of CPU otherwise,
        // and there's a limit to how important the peak meter is.
        peak_resampler.setup(OUTPUT_FREQUENCY, OUTPUT_FREQUENCY * 4, /*num_channels=*/2, /*hlen=*/16, /*frel=*/1.0);