#ifndef __TTXTSUBSCHANNELSETTINGS_H
#define __TTXTSUBSCHANNELSETTINGS_H

#include <map>
#include <vdr/tools.h>

#define PAGE_MODE_DISABLED -1
#define PAGE_MODE_AUTO 0
#define PAGE_MODE_MANUAL 1

struct TtxtSubsChannelSetting 
{
    int PageMode;
    int PageNumber;
};

typedef std::map<int, TtxtSubsChannelSetting> cSettingsContainer;

class cTtxtSubsChannelSettings
{
    private:
        static class cTtxtSubsChannelSettings *mInstance;
        cSettingsContainer mSettings;
        const char *mChannelSettingsFileName;
    private:
        void LoadSettings();
        void SaveSettings();
        cTtxtSubsChannelSettings();
        cTtxtSubsChannelSettings(const char *configDir);
    public:
        static cTtxtSubsChannelSettings &CreateInstance(const char *configDir);
        static cTtxtSubsChannelSettings &GetInstance();
        TtxtSubsChannelSetting GetChannelSetting(int channelId);
        void SetChannelSetting(int channelId, int PageMode, int PageNumber);
};

#endif //__TTXTSUBSCHANNELSETTINGS_H
