sustain-pedal-hid-sw/sustain-kbd-config/mainwindow.h

48 lines
1.0 KiB
C
Raw Normal View History

2023-08-10 23:00:40 +02:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "sustainpedalkeyboard.h"
#include <vector>
#include <optional>
#include <functional>
#include <memory>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
Ui::MainWindow *ui;
void rescan_device_list(void);
UsbDevice *get_device_from_sn(const std::string &sn);
std::vector<SustainPedalKeyboard> m_usb_devices;
std::unique_ptr<SustainPedalKeyboard> m_currently_selected_dev;
UsbHidKeyEvent create_key_event_pedal1();
UsbHidKeyEvent create_key_event_pedal2();
private slots:
void rescan_clicked();
void device_changed(QString sn);
void clear_keyboard_config();
void update_gui_from_keyboard();
void on_buttonProgPedal1_clicked();
void on_buttonProgPedal2_clicked();
void enable_pedal_gui_elements(bool enable);
protected:
void closeEvent(QCloseEvent *event);
void showEvent(QShowEvent *event);
};
#endif // MAINWINDOW_H