#ifndef __SETTINGS_H
#define __SETTINGS_H

#ifdef __cplusplus
extern "C" {
#endif

#include "common.h"
#include "sound.h"
#include "theme.h"

#define X_LEFT 10
#define Y_TOP 50

typedef enum
{
	MODE_ONESHOT,
	MODE_SEQUENTIAL,
	MODE_SHUFFLE
} PlaybackMode;

class Settings : public Theme
{
	public:
		Settings();
		
		int loadSettings();
		int saveSettings();
		
		void setOffset(int x, int y);
		int getOffsetX();
		int getOffsetY();
		
		char *getTheme();
		void setTheme(const char *theme);
	public:
		void writeTabs(File &f, int indent);
		void writeSetting(File &f, const char *setting, const Rect value, int entries, int indent);
		void writeSetting(File &f, const char *setting, const int value, int indent);
		void writeSetting(File &f, const char *setting, const char *value, int indent);
		void closeSetting(File &f, const char *setting, int &indent);
		void openSetting(File &f, const char *setting, int &indent);

		Sound sound;
		static PlaybackMode playMode;
		
		static int masterX;
		static int masterY;
		static char themeName[128];
};

#ifdef __cplusplus
}
#endif

#endif
