2019-10-19 23:03:17 +02:00
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
#include "hooklib/config.h"
|
2021-06-16 12:08:08 +02:00
|
|
|
#include "hooklib/dvd.h"
|
2019-10-19 23:03:17 +02:00
|
|
|
|
2021-10-25 11:16:14 +02:00
|
|
|
void dvd_config_load(struct dvd_config *cfg, const wchar_t *filename)
|
2019-10-19 23:03:17 +02:00
|
|
|
{
|
|
|
|
assert(cfg != NULL);
|
|
|
|
assert(filename != NULL);
|
|
|
|
|
2021-10-25 11:16:14 +02:00
|
|
|
cfg->enable = GetPrivateProfileIntW(L"dvd", L"enable", 1, filename);
|
2019-10-19 23:03:17 +02:00
|
|
|
}
|
2023-07-14 00:59:10 +02:00
|
|
|
|
|
|
|
void touch_screen_config_load(struct touch_screen_config *cfg, const wchar_t *filename)
|
|
|
|
{
|
|
|
|
assert(cfg != NULL);
|
|
|
|
assert(filename != NULL);
|
|
|
|
|
|
|
|
cfg->enable = GetPrivateProfileIntW(L"touch", L"enable", 1, filename);
|
2023-11-11 22:47:47 +01:00
|
|
|
cfg->remap = GetPrivateProfileIntW(L"touch", L"remap", 1, filename);
|
|
|
|
cfg->cursor = GetPrivateProfileIntW(L"touch", L"cursor", 1, filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
void printer_config_load(struct printer_config *cfg, const wchar_t *filename)
|
|
|
|
{
|
|
|
|
assert(cfg != NULL);
|
|
|
|
assert(filename != NULL);
|
|
|
|
|
|
|
|
wchar_t tmpstr[16];
|
|
|
|
|
|
|
|
cfg->enable = GetPrivateProfileIntW(L"printer", L"enable", 0, filename);
|
|
|
|
cfg->rotate_180 = GetPrivateProfileIntW(L"printer", L"rotate180", 0, filename);
|
|
|
|
|
|
|
|
GetPrivateProfileStringW(
|
|
|
|
L"printer",
|
|
|
|
L"serial_no",
|
|
|
|
L"5A-A123",
|
|
|
|
tmpstr,
|
|
|
|
_countof(tmpstr),
|
|
|
|
filename);
|
|
|
|
|
|
|
|
size_t n = wcstombs(cfg->serial_no, tmpstr, sizeof(cfg->serial_no));
|
|
|
|
for (int i = n; i < sizeof(cfg->serial_no); i++)
|
|
|
|
{
|
|
|
|
cfg->serial_no[i] = '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
GetPrivateProfileStringW(
|
|
|
|
L"printer",
|
|
|
|
L"mainFwPath",
|
|
|
|
L"DEVICE\\printer_main_fw.bin",
|
|
|
|
cfg->main_fw_path,
|
|
|
|
_countof(cfg->main_fw_path),
|
|
|
|
filename);
|
|
|
|
|
|
|
|
GetPrivateProfileStringW(
|
|
|
|
L"printer",
|
|
|
|
L"dspFwPath",
|
|
|
|
L"DEVICE\\printer_dsp_fw.bin",
|
|
|
|
cfg->dsp_fw_path,
|
|
|
|
_countof(cfg->dsp_fw_path),
|
|
|
|
filename);
|
|
|
|
|
|
|
|
GetPrivateProfileStringW(
|
|
|
|
L"printer",
|
|
|
|
L"paramFwPath",
|
|
|
|
L"DEVICE\\printer_param_fw.bin",
|
|
|
|
cfg->param_fw_path,
|
|
|
|
_countof(cfg->param_fw_path),
|
|
|
|
filename);
|
|
|
|
|
|
|
|
GetPrivateProfileStringW(
|
|
|
|
L"printer",
|
|
|
|
L"printerOutPath",
|
|
|
|
L"DEVICE\\print",
|
|
|
|
cfg->printer_out_path,
|
|
|
|
_countof(cfg->printer_out_path),
|
|
|
|
filename);
|
2023-07-14 00:59:10 +02:00
|
|
|
}
|