X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=input_mapping_dialog.h;h=0ca81d976866fbd3079015d5da9abdb0bc48e19c;hb=1bd39979930888eaa6061d17cc5122f970d3d66e;hp=4eb5e4cd75b62674855f8c1ad298cb8536c9b1b4;hpb=4bbcd111d04f36a42cf3d40f18fcee5a91c6322a;p=nageru diff --git a/input_mapping_dialog.h b/input_mapping_dialog.h index 4eb5e4c..0ca81d9 100644 --- a/input_mapping_dialog.h +++ b/input_mapping_dialog.h @@ -6,24 +6,48 @@ #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, const std::vector &card_names); - void fill_channel_ui_from_mapping(unsigned row, const InputMapping::Input &input); + 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 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; + + std::map devices; + + AudioMixer::state_changed_callback_t saved_callback; }; #endif // !defined(_INPUT_MAPPING_DIALOG_H)