70 lines
1.3 KiB
C++
70 lines
1.3 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include <qlayoutitem.h>
|
|
#include <vector>
|
|
#include <functional>
|
|
|
|
#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();
|
|
|
|
private slots:
|
|
void alwaysOnTopSettingChange(int status);
|
|
void addSample();
|
|
void saveConfig();
|
|
void openButtonManager();
|
|
|
|
signals:
|
|
void newStatusMessage(const QString&);
|
|
|
|
private:
|
|
void loadSoundFromConfig();
|
|
void removeAllButtons();
|
|
void loadButtonsFromConfig();
|
|
|
|
void reselectNext(std::function<void(uint8_t&,uint8_t&)> stepf);
|
|
QLayoutItem* findNextButton(std::function<void(uint8_t&,uint8_t&)> stepf);
|
|
|
|
Ui::Soundboard *ui;
|
|
std::vector<SoundButton*> 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
|
|
|