forked from MrBesen/soundboard
35 lines
678 B
C++
35 lines
678 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <QtCore/QObject>
|
|
#include <QPushButton>
|
|
#include <cstdint>
|
|
|
|
#include "qxtglobalshortcut.h"
|
|
|
|
class SoundButton : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
SoundButton(const std::string& filename, const std::string& name_ = "", const std::string& keycombo = "");
|
|
~SoundButton();
|
|
|
|
const std::string& getName() const;
|
|
const std::string& getFile() const;
|
|
const std::string& getKeyCombo() const;
|
|
|
|
QPushButton* getButton();
|
|
|
|
public slots:
|
|
void play();
|
|
|
|
private:
|
|
static uint64_t nextid;
|
|
uint64_t id;
|
|
std::string name;
|
|
std::string file;
|
|
std::string keycombo;
|
|
|
|
QxtGlobalShortcut* globalShortcut = nullptr;
|
|
QPushButton* button = nullptr;
|
|
}; |