| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #ifndef SETTING_H
- #define SETTING_H
- #include <QObject>
- #include <QCoreApplication>
- #include "ark_api.h"
- #include <iostream>
- using namespace std;
- #define CHECK_SYSTEM(cmd) do { \
- int __result = system(cmd); \
- if (__result != 0) { \
- std::cerr << "Command failed: " << cmd << " (code: " << __result << ")" << std::endl; \
- } \
- } while(0)
- class Setting : public QObject
- {
- Q_OBJECT
- #ifdef g_Setting
- #undef g_Setting
- #endif
- #define g_Setting (Setting::instance())
- public:
- inline static Setting* instance() {
- static Setting *setting(new Setting(qApp));
- return setting;
- }
- enum WidgetType {
- WIDGET_UNDEFINE = -1,
- WIDGET_HOME,
- WIDGET_MULTIMUSIC,
- WIDGET_PHONELINK,
- WIDGET_BTTELEPHONE,
- WIDGET_VIDEOPICTURE,
- WIDGET_SETTING,
- };
- public:
- void setDisplayMode(int mode);
- void setWidgetType(WidgetType type);
- void setUsbMusicFileName(QString fileName);
- WidgetType getWidgetType();
- disp_handle* getUIDispLayer();
- disp_handle* getVideoDispLayer();
- QString getUsbMusicFileName();
- private:
- explicit Setting(QObject *parent = NULL);
- ~Setting();
- WidgetType m_WidgetType;
- QString m_UsbMusicFileName;
- };
- #endif // SETTING_H
|