]> git.sesse.net Git - nageru/blob - input_mapping_dialog.h
Prepare InputMappingDialog for arbitrary kinds of input source types, by storing...
[nageru] / input_mapping_dialog.h
1 #ifndef _INPUT_MAPPING_DIALOG_H
2 #define _INPUT_MAPPING_DIALOG_H
3
4 #include <QDialog>
5 #include <string>
6 #include <vector>
7 #include <sys/time.h>
8
9 #include "mixer.h"
10
11 namespace Ui {
12 class InputMappingDialog;
13 }  // namespace Ui
14
15 class QComboBox;
16
17 class InputMappingDialog : public QDialog
18 {
19         Q_OBJECT
20
21 public:
22         InputMappingDialog();
23
24 private:
25         void fill_ui_from_mapping(const InputMapping &mapping);
26         void fill_row_from_bus(unsigned row, const InputMapping::Bus &bus);
27         void setup_channel_choices_from_bus(unsigned row, const InputMapping::Bus &bus);
28         void cell_changed(int row, int column);
29         void card_selected(QComboBox *card_combo, unsigned row, int index);
30         void channel_selected(unsigned row, unsigned channel, int index);
31         void ok_clicked();
32         void cancel_clicked();
33         void add_clicked();
34         void remove_clicked();
35         void updown_clicked(int direction);
36         void update_button_state();
37
38         Ui::InputMappingDialog *ui;
39         InputMapping mapping;  // Under edit. Will be committed on OK.
40
41         // The old mapping. Will be re-committed on cancel, so that we
42         // unhold all the unused devices (otherwise they would be
43         // held forever).
44         InputMapping old_mapping;
45
46         const std::map<DeviceSpec, std::string> card_names;
47 };
48
49 #endif  // !defined(_INPUT_MAPPING_DIALOG_H)