X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=input_mapping_dialog.h;h=3fa11e3fc63c63529d0c3ce73336001c34b52561;hb=26e1ec466d4730b6abc0e20201d704cfdf41a6eb;hp=c7fea24f3675a0278dd45340196579136c469d0b;hpb=c19209ad2d9f862ae634fefb4b7bb2e30bfc3dc1;p=nageru diff --git a/input_mapping_dialog.h b/input_mapping_dialog.h index c7fea24..3fa11e3 100644 --- a/input_mapping_dialog.h +++ b/input_mapping_dialog.h @@ -6,21 +6,54 @@ #include #include +#include "audio_mixer.h" #include "mixer.h" namespace Ui { class InputMappingDialog; } // namespace Ui +class QComboBox; + class InputMappingDialog : public QDialog { Q_OBJECT public: InputMappingDialog(); + ~InputMappingDialog(); private: + void fill_ui_from_mapping(const InputMapping &mapping); + void fill_row_from_bus(unsigned row, const InputMapping::Bus &bus); + void setup_channel_choices_from_bus(unsigned row, const InputMapping::Bus &bus); + void cell_changed(int row, int column); + void card_selected(QComboBox *card_combo, unsigned row, int index); + void channel_selected(unsigned row, unsigned channel, int index); + void ok_clicked(); + void cancel_clicked(); + void add_clicked(); + void remove_clicked(); + void updown_clicked(int direction); + void save_clicked(); + void load_clicked(); + void update_button_state(); + Ui::InputMappingDialog *ui; + InputMapping mapping; // Under edit. Will be committed on OK. + + // The old mapping. Will be re-committed on cancel, so that we + // unhold all the unused devices (otherwise they would be + // held forever). + InputMapping old_mapping; + + // 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 bus_settings; + + std::map devices; // Needs no lock, accessed only on the UI thread. + AudioMixer::state_changed_callback_t saved_callback; }; #endif // !defined(_INPUT_MAPPING_DIALOG_H)