+ void reset_peak(unsigned bus_index);
+
+ struct BusLevel {
+ float current_level_dbfs[2]; // Digital peak of last frame, left and right.
+ float peak_level_dbfs[2]; // Digital peak with hold, left and right.
+ float historic_peak_dbfs;
+ float gain_staging_db;
+ float compressor_attenuation_db; // A positive number; 0.0 for no attenuation.
+ };
+
+ typedef std::function<void(float level_lufs, float peak_db,
+ std::vector<BusLevel> bus_levels,
+ float global_level_lufs, float range_low_lufs, float range_high_lufs,
+ float final_makeup_gain_db,
+ float correlation)> audio_level_callback_t;
+ void set_audio_level_callback(audio_level_callback_t callback)
+ {
+ audio_level_callback = callback;
+ }
+
+ typedef std::function<void()> state_changed_callback_t;
+ void set_state_changed_callback(state_changed_callback_t callback)
+ {
+ state_changed_callback = callback;
+ }
+
+ state_changed_callback_t get_state_changed_callback() const
+ {
+ return state_changed_callback;
+ }
+
+ void trigger_state_changed_callback()
+ {
+ if (state_changed_callback != nullptr) {
+ state_changed_callback();
+ }
+ }
+
+ // A combination of all settings for a bus. Useful if you want to get
+ // or store them as a whole without bothering to call all of the get_*
+ // or set_* functions for that bus.
+ struct BusSettings {
+ float fader_volume_db;
+ bool muted;
+ bool locut_enabled;
+ float eq_level_db[NUM_EQ_BANDS];
+ float gain_staging_db;
+ bool level_compressor_enabled;
+ float compressor_threshold_dbfs;
+ bool compressor_enabled;
+ };
+ static BusSettings get_default_bus_settings();
+ BusSettings get_bus_settings(unsigned bus_index) const;
+ void set_bus_settings(unsigned bus_index, const BusSettings &settings);
+