#ifndef app_settings_H_
#define app_settings_H_

#include <QtCore/QtGlobal>
#include <QtCore/QSettings>
#include <QtCore/QStringList>
#include <vector>

class AppSettings
{
private:
    QSettings* settings_;
public:
    enum DEMO_TYPE {
        DEMO_TYPE_PRIVATE_PROTOCOL,
        DEMO_TYPE_RTSP
    };
    struct DeviceInfo {
        QString  device_ip;
        unsigned device_port;
        unsigned device_rtspport;
        QString  device_username;
        QString  device_password;
        int device_type;
    };

    struct SerialConfig {
        int name_index;
        int bitrate;
        int databits;
        int parity;
        int stopbits;
    };
    AppSettings(void);
    ~AppSettings(void);

    void GetDeviceInfo(DeviceInfo* device_info);

    void SetDeviceInfo(const DeviceInfo& device_info);

    int GetTestInterval();//seconds
};

Q_GLOBAL_STATIC(AppSettings,AppSettingsInstance);

#endif // app_settings_H_
