#ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #include "config.h" #include "sound.h" #include "soundbutton.h" QT_BEGIN_NAMESPACE namespace Ui { class Soundboard; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(const std::string& binary, QWidget *parent = nullptr); ~MainWindow(); public slots: void reloadConfig(); void stop(); void moveUp(); void moveDown(); void moveLeft(); void moveRight(); void playCurrent(); void reloadButtonConfig(); private slots: void alwaysOnTopSettingChange(int status); void saveConfig(); void openButtonManager(); void openSettings(); signals: void newStatusMessage(const QString&); private: void loadSoundFromConfig(); void loadShortcuts(); void removeAllButtons(); void loadButtonsFromConfig(); void reselectNext(std::function stepf); QLayoutItem* findNextButton(std::function stepf); QxtGlobalShortcut* loadShortcut(const std::string& key); Ui::Soundboard *ui; std::vector soundbuttons; QxtGlobalShortcut* stopGlobal = nullptr; QxtGlobalShortcut* up = nullptr; QxtGlobalShortcut* down = nullptr; QxtGlobalShortcut* left = nullptr; QxtGlobalShortcut* right = nullptr; QxtGlobalShortcut* play = nullptr; // "real" coordinates uint8_t xCoord = 0; uint8_t yCoord = 0; Config config; }; #endif // MAINWINDOW_H