#ifndef WIDG_H #define WIDG_H #include "Menu.h" #include #include #include #include #include namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT enum Command { Playback, Next, Previous, Forward, Back, Pause, Return, Enter }; public: explicit Widget(QWidget* parent = 0); ~Widget(); public slots: void showPlayList(); private slots: void onSerialError(QSerialPort::SerialPortError error); void onTimeout(); void onReadyRead(); private: Ui::Widget* ui; QStringList fileList; QTimer* timer; QSerialPort* serialPort; QMap commandMap; bool isPlayback = false; QString curChannelName; QString curFileName; Menu* menu; private: void initSerialPort(); void initCommandMap(); }; #endif // WIDG_H