project64/Source/Settings/Settings.h

66 lines
2.7 KiB
C
Raw Normal View History

2016-01-27 09:11:59 +00:00
#pragma once
#if defined(__cplusplus)
extern "C" {
#endif
// Get plugin settings, take a setting ID
2016-03-03 10:07:16 +00:00
unsigned int GetSetting(short SettingID);
const char * GetSettingSz(short SettingID, char * Buffer, int BufferLen);
// Get system settings, take a setting returned by FindSystemSettingId
2016-03-03 10:07:16 +00:00
unsigned int GetSystemSetting(short SettingID);
const char * GetSystemSettingSz(short SettingID, char * Buffer, int BufferLen);
// Set a settings value
void SetSetting(short SettingID, unsigned int Value);
void SetSettingSz(short SettingID, const char * Value);
2017-09-25 12:00:04 +00:00
void SetSystemSetting(short SettingID, unsigned int Value);
void SetSystemSettingSz(short SettingID, const char * Value);
2016-03-03 10:07:16 +00:00
// Enums
2016-03-03 10:07:16 +00:00
enum SETTING_DATA_TYPE
{
Data_DWORD_General = 0, // An unsigned int setting used anywhere
2016-03-03 10:07:16 +00:00
Data_String_General = 1, // A string setting used anywhere
Data_DWORD_Game = 2, // An unsigned int associated with the current game
2016-03-03 10:07:16 +00:00
Data_String_Game = 3, // A string associated with the current game
Data_DWORD_RDB = 4, // An unsigned int associated with the current game in the ROM database
Data_String_RDB = 5, // A string associated with the current game in the ROM database
Data_DWORD_RDB_Setting = 6, // An unsigned int read from the ROM database, with config file
Data_String_RDB_Setting = 7, // A string read from the ROM database, with config file
2016-03-03 10:07:16 +00:00
};
// Set other information about various settings
2016-03-03 10:07:16 +00:00
int SettingsInitilized(void);
void SetModuleName(const char * Name);
void RegisterSetting(short SettingID, SETTING_DATA_TYPE Type, const char * Name, const char * Category,
unsigned int DefaultDW, const char * DefaultStr);
void RegisterSetting2(short SettingID, SETTING_DATA_TYPE Type, const char * Name, const char * Category, short DefaultSettingID);
short FindSystemSettingId(const char * Name);
void FlushSettings(void);
// This must be implemented to be notified when a setting is used but has not been set up
2016-03-03 10:07:16 +00:00
void UseUnregisteredSetting(int SettingID);
2016-01-27 09:11:59 +00:00
typedef void(*SettingChangedFunc)(void *);
void SettingsRegisterChange(bool SystemSetting, int Type, void * Data, SettingChangedFunc Func);
void SettingsUnregisterChange(bool SystemSetting, int Type, void * Data, SettingChangedFunc Func);
2016-01-27 09:11:59 +00:00
#if defined(__cplusplus)
}
#endif
2017-04-18 11:32:43 +00:00
class CNotification
{
public:
static void DisplayError(const char * Message);
static void FatalError(const char * Message);
static void DisplayMessage(int DisplayTime, const char * Message);
static void DisplayMessage2(const char * Message);
static void BreakPoint(const char * FileName, int LineNumber);
};
extern CNotification * g_Notify;