#ifndef BEEP_H #define BEEP_H #include #include #include #include #include #include class beep : public QObject { Q_OBJECT public: explicit beep(QObject *parent = nullptr); bool stop(); void start(); // 用户程序调用这个函数开启蜂鸣器 void set_beep(int delay_on_ms,int delay_off_ms,int ticks); private: bool get_state(); bool set_state(bool state); private: bool is_run; bool state; int delay_on_ms; int delay_off_ms; int ticks; QMutex lock; QFile file; private slots: void run_cb(); }; beep *Beep(); #endif // BEEP_H