]> git.sesse.net Git - nageru/blob - input_mapping_dialog.h
Make most of the input mapping dialog actually work.
[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 InputMappingDialog : public QDialog
16 {
17         Q_OBJECT
18
19 public:
20         InputMappingDialog();
21
22 private:
23         void fill_ui_from_mapping(const InputMapping &mapping);
24         void fill_row_from_input(unsigned row, const InputMapping::Input &input);
25         void setup_channel_choices_from_input(unsigned row, const InputMapping::Input &input);
26         void cell_changed(int row, int column);
27         void card_selected(unsigned row, int index);
28         void channel_selected(unsigned row, unsigned channel, int index);
29         void ok_clicked();
30         void cancel_clicked();
31         void add_clicked();
32
33         Ui::InputMappingDialog *ui;
34         InputMapping mapping;  // Under edit. Will be committed on OK.
35
36         // The old mapping. Will be re-committed on cancel, so that we
37         // unhold all the unused devices (otherwise they would be
38         // held forever).
39         InputMapping old_mapping;
40
41         const std::vector<std::string> card_names;
42 };
43
44 #endif  // !defined(_INPUT_MAPPING_DIALOG_H)