]> git.sesse.net Git - nageru/blobdiff - mixer.h
Add the beginnings of a very simple VU meter, based on libebur128.
[nageru] / mixer.h
diff --git a/mixer.h b/mixer.h
index a177854b46cde0229ebfcb669998afea709813b7..5b82b4e962fe0191d1b0c8b443e71aea4b01c8b0 100644 (file)
--- a/mixer.h
+++ b/mixer.h
@@ -7,6 +7,7 @@
 #undef Success
 #include <movit/effect_chain.h>
 #include <movit/flat_input.h>
+#include <ebur128.h>
 #include <functional>
 
 #include "bmusb/bmusb.h"
@@ -80,6 +81,12 @@ public:
                output_channel[output].set_frame_ready_callback(callback);
        }
 
+       typedef std::function<void(float)> audio_level_callback_t;
+       void set_audio_level_callback(audio_level_callback_t callback)
+       {
+               audio_level_callback = callback;
+       }
+
        std::vector<std::string> get_transition_names()
        {
                return theme->get_transition_names(pts());
@@ -155,6 +162,9 @@ private:
 
        std::thread mixer_thread;
        bool should_quit = false;
+
+       audio_level_callback_t audio_level_callback = nullptr;
+       ebur128_state *r128_state = nullptr;
 };
 
 extern Mixer *global_mixer;