]> git.sesse.net Git - nageru/blobdiff - input_mapping_dialog.h
Let settings follow buses when editing the mapping.
[nageru] / input_mapping_dialog.h
index d092a34cd5f12f71356a67f59956575de8e5ffca..3fa11e3fc63c63529d0c3ce73336001c34b52561 100644 (file)
@@ -6,6 +6,7 @@
 #include <vector>
 #include <sys/time.h>
 
+#include "audio_mixer.h"
 #include "mixer.h"
 
 namespace Ui {
@@ -20,6 +21,7 @@ class InputMappingDialog : public QDialog
 
 public:
        InputMappingDialog();
+       ~InputMappingDialog();
 
 private:
        void fill_ui_from_mapping(const InputMapping &mapping);
@@ -33,6 +35,8 @@ private:
        void add_clicked();
        void remove_clicked();
        void updown_clicked(int direction);
+       void save_clicked();
+       void load_clicked();
        void update_button_state();
 
        Ui::InputMappingDialog *ui;
@@ -43,7 +47,13 @@ private:
        // held forever).
        InputMapping old_mapping;
 
-       const std::map<DeviceSpec, DeviceInfo> devices;
+       // One for each bus in the mapping. Edited along with the mapping,
+       // so that old volumes etc. are being kept in place for buses that
+       // existed before.
+       std::vector<AudioMixer::BusSettings> bus_settings;
+
+       std::map<DeviceSpec, DeviceInfo> devices;  // Needs no lock, accessed only on the UI thread.
+       AudioMixer::state_changed_callback_t saved_callback;
 };
 
 #endif  // !defined(_INPUT_MAPPING_DIALOG_H)