Apply clang-format code style to all source files

This commit is contained in:
icex2
2019-10-20 00:50:40 +02:00
parent c600e1a423
commit c3bc8782f4
401 changed files with 13844 additions and 11361 deletions
+32 -27
View File
@@ -1,5 +1,5 @@
#include <windows.h>
#include <commctrl.h>
#include <windows.h>
#include <stdbool.h>
#include <stdlib.h>
@@ -18,7 +18,7 @@
#include "util/mem.h"
#include "util/str.h"
#define SENSITIVITY_SCALE 4
#define SENSITIVITY_SCALE 4
struct analogs_ui {
struct array children;
@@ -32,16 +32,16 @@ struct analog_ui {
uint8_t pos;
};
static INT_PTR CALLBACK analogs_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam);
static INT_PTR CALLBACK
analogs_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static INT_PTR analogs_ui_handle_init(HWND hwnd, const PROPSHEETPAGE *psp);
static INT_PTR analogs_ui_handle_activate(HWND hwnd);
static INT_PTR analogs_ui_handle_passivate(HWND hwnd);
static INT_PTR analogs_ui_handle_tick(HWND hwnd);
static INT_PTR analogs_ui_handle_fini(HWND hwnd);
static INT_PTR CALLBACK analog_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam);
static INT_PTR CALLBACK
analog_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static INT_PTR analog_ui_handle_init(HWND hwnd, struct analog_def *def);
static void analog_ui_handle_init_label(HWND hwnd);
static void analog_ui_handle_init_dev(HWND hwnd);
@@ -54,8 +54,8 @@ static INT_PTR analog_ui_handle_sensitivity_change(HWND hwnd);
static INT_PTR analog_ui_handle_tick(HWND hwnd);
static INT_PTR analog_ui_handle_fini(HWND hwnd);
HPROPSHEETPAGE analogs_ui_tab_create(HINSTANCE inst,
const struct schema *schema)
HPROPSHEETPAGE
analogs_ui_tab_create(HINSTANCE inst, const struct schema *schema)
{
PROPSHEETPAGE psp;
@@ -70,8 +70,8 @@ HPROPSHEETPAGE analogs_ui_tab_create(HINSTANCE inst,
return CreatePropertySheetPage(&psp);
}
static INT_PTR CALLBACK analogs_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam)
static INT_PTR CALLBACK
analogs_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
const NMHDR *n;
@@ -122,13 +122,17 @@ static INT_PTR analogs_ui_handle_init(HWND hwnd, const PROPSHEETPAGE *psp)
ypos = 0;
for (i = 0 ; i < schema->nanalogs ; i++) {
child = CreateDialogParam(inst, MAKEINTRESOURCE(IDD_ANALOG), hwnd,
analog_ui_dlg_proc, (LPARAM) &schema->analogs[i]);
for (i = 0; i < schema->nanalogs; i++) {
child = CreateDialogParam(
inst,
MAKEINTRESOURCE(IDD_ANALOG),
hwnd,
analog_ui_dlg_proc,
(LPARAM) &schema->analogs[i]);
GetWindowRect(child, &r);
SetWindowPos(child, HWND_BOTTOM, 0, ypos, 0, 0,
SWP_NOSIZE | SWP_SHOWWINDOW);
SetWindowPos(
child, HWND_BOTTOM, 0, ypos, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
ypos += r.bottom - r.top;
@@ -162,7 +166,7 @@ static INT_PTR analogs_ui_handle_tick(HWND hwnd)
ui = (struct analogs_ui *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
for (i = 0 ; i < ui->children.nitems ; i++) {
for (i = 0; i < ui->children.nitems; i++) {
child = *array_item(HWND, &ui->children, i);
SendMessage(child, WM_USER, 0, 0);
}
@@ -182,8 +186,8 @@ static INT_PTR analogs_ui_handle_fini(HWND hwnd)
return TRUE;
}
static INT_PTR CALLBACK analog_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam)
static INT_PTR CALLBACK
analog_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg) {
case WM_INITDIALOG:
@@ -280,9 +284,8 @@ static void analog_ui_handle_init_dev(HWND hwnd)
ma.hid = NULL;
mapper_get_analog_map(ui->def->tag, &ma);
for (hid = hid_mgr_get_first_stub()
; hid != NULL
; hid = hid_mgr_get_next_stub(hid)) {
for (hid = hid_mgr_get_first_stub(); hid != NULL;
hid = hid_mgr_get_next_stub(hid)) {
if (!analog_ui_match_device(hid)) {
continue;
}
@@ -327,8 +330,11 @@ static void analog_ui_handle_init_sensitivity(HWND hwnd)
pos = 256 * SENSITIVITY_SCALE + mapper_get_analog_sensitivity(ui->def->tag);
SendMessage(slider, TBM_SETTICFREQ, 256, 0);
SendMessage(slider, TBM_SETRANGE, FALSE,
MAKELPARAM(0, SENSITIVITY_SCALE * 256 * 2));
SendMessage(
slider,
TBM_SETRANGE,
FALSE,
MAKELPARAM(0, SENSITIVITY_SCALE * 256 * 2));
SendMessage(slider, TBM_SETPOS, TRUE, (LPARAM) pos);
EnableWindow(slider, !mapper_is_analog_absolute(ui->def->tag));
@@ -350,7 +356,7 @@ static bool analog_ui_match_device(struct hid_stub *hid)
goto content_fail;
}
for (i = 0 ; i < ncontrols ; i++) {
for (i = 0; i < ncontrols; i++) {
if (controls[i].value_max - controls[i].value_min > 1) {
break;
}
@@ -386,7 +392,7 @@ static void analog_ui_populate_controls(HWND hwnd)
InvalidateRect(controls_ctl, NULL, TRUE);
for (index = nitems ; index >= 0 ; index--) {
for (index = nitems; index >= 0; index--) {
SendMessage(controls_ctl, CB_DELETESTRING, index, 0);
}
@@ -411,7 +417,7 @@ static void analog_ui_populate_controls(HWND hwnd)
mapper_get_analog_map(ui->def->tag, &ma);
for (i = 0 ; i < ncontrols ; i++) {
for (i = 0; i < ncontrols; i++) {
if (controls[i].value_max - controls[i].value_min <= 1) {
continue;
}
@@ -537,4 +543,3 @@ static INT_PTR analog_ui_handle_fini(HWND hwnd)
return TRUE;
}
+20 -20
View File
@@ -26,8 +26,8 @@ struct bind_adv_state {
bool was_valid;
};
static INT_PTR CALLBACK bind_adv_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam);
static INT_PTR CALLBACK
bind_adv_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static INT_PTR bind_adv_handle_init(HWND hwnd, struct bind_adv_state *state);
static void bind_adv_handle_init_devs(HWND hwnd);
static void bind_adv_handle_init_insert_dev(HWND hwnd, struct hid_stub *hid);
@@ -47,8 +47,8 @@ static void bind_adv_select_dev(HWND hwnd, size_t dev_no);
static void bind_adv_select_ctl(HWND hwnd, size_t ctl_no);
static void bind_adv_set_range(HWND hwnd, int32_t range_min, int32_t range_max);
bool bind_adv(HINSTANCE inst, HWND hwnd, struct mapped_action *ma,
bool was_valid)
bool bind_adv(
HINSTANCE inst, HWND hwnd, struct mapped_action *ma, bool was_valid)
{
struct bind_adv_state state;
INT_PTR ok;
@@ -58,8 +58,12 @@ bool bind_adv(HINSTANCE inst, HWND hwnd, struct mapped_action *ma,
state.ma = *ma;
state.was_valid = was_valid;
ok = DialogBoxParam(inst, MAKEINTRESOURCE(IDD_BIND_ADV), hwnd,
bind_adv_dlg_proc, (LPARAM) &state) != 0;
ok = DialogBoxParam(
inst,
MAKEINTRESOURCE(IDD_BIND_ADV),
hwnd,
bind_adv_dlg_proc,
(LPARAM) &state) != 0;
if (ok) {
*ma = state.ma;
@@ -68,8 +72,8 @@ bool bind_adv(HINSTANCE inst, HWND hwnd, struct mapped_action *ma,
return ok != 0;
}
static INT_PTR CALLBACK bind_adv_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam)
static INT_PTR CALLBACK
bind_adv_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg) {
case WM_INITDIALOG:
@@ -148,14 +152,13 @@ static INT_PTR bind_adv_handle_init(HWND hwnd, struct bind_adv_state *state)
return TRUE;
}
for (i = 0 ; i < state->devs.nitems ; i++) {
for (i = 0; i < state->devs.nitems; i++) {
hid = *array_item(struct hid_stub *, &state->devs, i);
if (hid == state->ma.hid) {
bind_adv_select_dev(hwnd, (int) i);
bind_adv_select_ctl(hwnd, state->ma.control_no);
bind_adv_set_range(hwnd, state->ma.value_min,
state->ma.value_max);
bind_adv_set_range(hwnd, state->ma.value_min, state->ma.value_max);
}
}
@@ -168,9 +171,8 @@ static void bind_adv_handle_init_devs(HWND hwnd)
hid_mgr_lock();
for (hid = hid_mgr_get_first_stub()
; hid != NULL
; hid = hid_mgr_get_next_stub(hid)) {
for (hid = hid_mgr_get_first_stub(); hid != NULL;
hid = hid_mgr_get_next_stub(hid)) {
bind_adv_handle_init_insert_dev(hwnd, hid);
}
@@ -204,8 +206,7 @@ static void bind_adv_handle_init_insert_dev(HWND hwnd, struct hid_stub *hid)
name_fail:
free(name);
size_fail:
;
size_fail:;
}
static INT_PTR bind_adv_handle_change_ctl(HWND hwnd)
@@ -366,8 +367,8 @@ static bool bind_adv_get_range(HWND hwnd, int32_t *out_min, int32_t *out_max)
wnd_min = GetDlgItem(hwnd, IDC_BINDING_MIN);
wnd_max = GetDlgItem(hwnd, IDC_BINDING_MAX);
return bind_adv_get_int(wnd_min, out_min)
&& bind_adv_get_int(wnd_max, out_max);
return bind_adv_get_int(wnd_min, out_min) &&
bind_adv_get_int(wnd_max, out_max);
}
static bool bind_adv_get_int(HWND control, int32_t *out)
@@ -452,7 +453,7 @@ static void bind_adv_select_dev(HWND hwnd, size_t dev_no)
goto data_fail;
}
for (i = 0 ; i < state->nctls ; i++) {
for (i = 0; i < state->nctls; i++) {
wchars[0] = L'\0';
usages_get(chars, lengthof(chars), state->ctls[i].usage);
@@ -527,4 +528,3 @@ static void bind_adv_set_range(HWND hwnd, int32_t range_min, int32_t range_max)
bind_adv_validate(hwnd);
}
+2 -2
View File
@@ -9,7 +9,7 @@
#include "geninput/input-config.h"
bool bind_adv(HINSTANCE inst, HWND hwnd, struct mapped_action *ma,
bool was_valid);
bool bind_adv(
HINSTANCE inst, HWND hwnd, struct mapped_action *ma, bool was_valid);
#endif
+27 -20
View File
@@ -22,14 +22,19 @@ struct bind_light_state {
bool *bound;
};
static INT_PTR CALLBACK bind_light_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam);
static INT_PTR bind_light_handle_init(HWND hwnd,
struct bind_light_state *state);
static INT_PTR CALLBACK
bind_light_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static INT_PTR
bind_light_handle_init(HWND hwnd, struct bind_light_state *state);
static INT_PTR bind_light_handle_ok(HWND hwnd);
bool bind_light(HINSTANCE inst, HWND hwnd, const struct schema *schema,
const struct mapped_light *ml, uint8_t *game_light, bool *bound)
bool bind_light(
HINSTANCE inst,
HWND hwnd,
const struct schema *schema,
const struct mapped_light *ml,
uint8_t *game_light,
bool *bound)
{
struct bind_light_state state;
@@ -38,17 +43,21 @@ bool bind_light(HINSTANCE inst, HWND hwnd, const struct schema *schema,
state.game_light = game_light;
state.bound = bound;
return DialogBoxParam(inst, MAKEINTRESOURCE(IDD_BIND_LIGHT), hwnd,
bind_light_dlg_proc, (LPARAM) &state) != 0;
return DialogBoxParam(
inst,
MAKEINTRESOURCE(IDD_BIND_LIGHT),
hwnd,
bind_light_dlg_proc,
(LPARAM) &state) != 0;
}
static INT_PTR CALLBACK bind_light_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam)
static INT_PTR CALLBACK
bind_light_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg) {
case WM_INITDIALOG:
return bind_light_handle_init(hwnd,
(struct bind_light_state *) lparam);
return bind_light_handle_init(
hwnd, (struct bind_light_state *) lparam);
case WM_COMMAND:
switch (LOWORD(wparam)) {
@@ -75,8 +84,7 @@ static INT_PTR CALLBACK bind_light_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
return FALSE;
}
static INT_PTR bind_light_handle_init(HWND hwnd,
struct bind_light_state *state)
static INT_PTR bind_light_handle_init(HWND hwnd, struct bind_light_state *state)
{
char chars[256];
wchar_t wchars[256];
@@ -94,13 +102,13 @@ static INT_PTR bind_light_handle_init(HWND hwnd,
ComboBox_AddString(game_light_ctl, L"");
for (i = 0 ; i < state->schema->nlights ; i++) {
LoadString(inst, state->schema->lights[i].name_rsrc,
wchars, lengthof(wchars));
for (i = 0; i < state->schema->nlights; i++) {
LoadString(
inst, state->schema->lights[i].name_rsrc, wchars, lengthof(wchars));
ComboBox_AddString(game_light_ctl, wchars);
if (state->bound
&& state->schema->lights[i].bit == *state->game_light) {
if (state->bound &&
state->schema->lights[i].bit == *state->game_light) {
ComboBox_SetCurSel(game_light_ctl, i + 1);
}
}
@@ -159,4 +167,3 @@ static INT_PTR bind_light_handle_ok(HWND hwnd)
return TRUE;
}
+7 -2
View File
@@ -10,7 +10,12 @@
#include "geninput/mapper.h"
bool bind_light(HINSTANCE inst, HWND hwnd, const struct schema *schema,
const struct mapped_light *ml, uint8_t *game_light, bool *bound);
bool bind_light(
HINSTANCE inst,
HWND hwnd,
const struct schema *schema,
const struct mapped_light *ml,
uint8_t *game_light,
bool *bound);
#endif
+20 -12
View File
@@ -1,5 +1,5 @@
#include <windows.h>
#include <wchar.h>
#include <windows.h>
#include "config/bind.h"
#include "config/resource.h"
@@ -16,15 +16,18 @@ struct bind_state {
uintptr_t timer_id;
};
static INT_PTR CALLBACK bind_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam);
static INT_PTR CALLBACK
bind_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static INT_PTR bind_handle_init(HWND hwnd, struct bind_state *self);
static INT_PTR bind_handle_tick(HWND hwnd);
static INT_PTR bind_handle_cancel(HWND hwnd);
static INT_PTR bind_handle_destroy(HWND hwnd);
bool bind_control(HINSTANCE inst, HWND hwnd, const struct action_def *action,
struct mapped_action *ma)
bool bind_control(
HINSTANCE inst,
HWND hwnd,
const struct action_def *action,
struct mapped_action *ma)
{
struct bind_state self;
bool result;
@@ -36,8 +39,12 @@ bool bind_control(HINSTANCE inst, HWND hwnd, const struct action_def *action,
snap_init(&self.snaps[1]);
snap_init(&self.snaps[0]);
result = DialogBoxParam(inst, MAKEINTRESOURCE(IDD_BIND), hwnd,
bind_dlg_proc, (LPARAM) &self) != 0;
result = DialogBoxParam(
inst,
MAKEINTRESOURCE(IDD_BIND),
hwnd,
bind_dlg_proc,
(LPARAM) &self) != 0;
snap_fini(&self.snaps[0]);
snap_fini(&self.snaps[1]);
@@ -45,8 +52,8 @@ bool bind_control(HINSTANCE inst, HWND hwnd, const struct action_def *action,
return result;
}
static INT_PTR CALLBACK bind_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam)
static INT_PTR CALLBACK
bind_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg) {
case WM_INITDIALOG:
@@ -99,8 +106,10 @@ static INT_PTR bind_handle_tick(HWND hwnd)
snap_fini(&self->snaps[self->cur_snap]);
snap_init(&self->snaps[self->cur_snap]);
if (snap_find_edge(&self->snaps[self->cur_snap],
&self->snaps[!self->cur_snap], self->ma)) {
if (snap_find_edge(
&self->snaps[self->cur_snap],
&self->snaps[!self->cur_snap],
self->ma)) {
EndDialog(hwnd, 1);
}
@@ -124,4 +133,3 @@ static INT_PTR bind_handle_destroy(HWND hwnd)
return TRUE;
}
+5 -2
View File
@@ -9,7 +9,10 @@
#include "geninput/mapper.h"
bool bind_control(HINSTANCE inst, HWND hwnd, const struct action_def *action,
struct mapped_action *ma);
bool bind_control(
HINSTANCE inst,
HWND hwnd,
const struct action_def *action,
struct mapped_action *ma);
#endif
+37 -34
View File
@@ -1,13 +1,13 @@
#include <windows.h>
#include <commctrl.h>
#include <wchar.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config/bind.h"
#include "config/bind-adv.h"
#include "config/bind.h"
#include "config/resource.h"
#include "config/schema.h"
#include "config/usages.h"
@@ -20,10 +20,10 @@
#include "util/mem.h"
#include "util/winres.h"
static INT_PTR CALLBACK buttons_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam);
static bool buttons_get_control_name(const struct mapped_action *ma,
wchar_t *str, size_t nchars);
static INT_PTR CALLBACK
buttons_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static bool buttons_get_control_name(
const struct mapped_action *ma, wchar_t *str, size_t nchars);
static INT_PTR buttons_handle_init(HWND hwnd, const PROPSHEETPAGE *psp);
static INT_PTR buttons_handle_binding_adv(HWND hwnd);
static INT_PTR buttons_handle_binding_clear(HWND hwnd);
@@ -40,7 +40,8 @@ struct buttons_tab {
uint8_t npages;
};
HPROPSHEETPAGE buttons_tab_create(HINSTANCE inst, const struct schema *schema)
HPROPSHEETPAGE
buttons_tab_create(HINSTANCE inst, const struct schema *schema)
{
PROPSHEETPAGE psp;
@@ -55,8 +56,8 @@ HPROPSHEETPAGE buttons_tab_create(HINSTANCE inst, const struct schema *schema)
return CreatePropertySheetPage(&psp);
}
static INT_PTR CALLBACK buttons_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam)
static INT_PTR CALLBACK
buttons_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
NMHDR *n;
@@ -71,8 +72,8 @@ static INT_PTR CALLBACK buttons_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
case IDC_PAGE:
switch (n->code) {
case UDN_DELTAPOS:
return buttons_handle_switch_page(hwnd,
(NMUPDOWN *) n);
return buttons_handle_switch_page(
hwnd, (NMUPDOWN *) n);
default:
return FALSE;
@@ -101,7 +102,7 @@ static INT_PTR CALLBACK buttons_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
case IDC_BINDING_EDIT:
return buttons_handle_binding_edit(hwnd, FALSE);
case IDC_BINDING_EDIT_MANY:
return buttons_handle_binding_edit(hwnd, TRUE);
@@ -136,8 +137,8 @@ static INT_PTR buttons_handle_init(HWND hwnd, const PROPSHEETPAGE *psp)
inst = (HINSTANCE) GetWindowLongPtr(hwnd, GWLP_HINSTANCE);
bindings_ctl = GetDlgItem(hwnd, IDC_BINDINGS);
ListView_SetExtendedListViewStyle(bindings_ctl,
LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
ListView_SetExtendedListViewStyle(
bindings_ctl, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
LoadString(inst, IDS_COL_ACTION, str, lengthof(str));
@@ -157,11 +158,11 @@ static INT_PTR buttons_handle_init(HWND hwnd, const PROPSHEETPAGE *psp)
ListView_InsertColumn(bindings_ctl, 1, &col);
for (i = 0 ; i < self->schema->nactions ; i++) {
for (i = 0; i < self->schema->nactions; i++) {
memset(&item, 0, sizeof(item));
LoadString(inst, self->schema->actions[i].name_rsrc, str,
lengthof(str));
LoadString(
inst, self->schema->actions[i].name_rsrc, str, lengthof(str));
item.mask = LVIF_TEXT;
item.iItem = (int) i;
@@ -197,8 +198,8 @@ static void buttons_update_pager(HWND hwnd)
self->npages = mapper_get_npages() + 1;
rswprintf(str, lengthof(str), inst, IDS_PAGE, self->page_no + 1,
self->npages);
rswprintf(
str, lengthof(str), inst, IDS_PAGE, self->page_no + 1, self->npages);
SetWindowText(GetDlgItem(hwnd, IDC_PAGE_TEXT), str);
}
@@ -219,7 +220,7 @@ static void buttons_update_bindings(HWND hwnd)
/* Clear binding cell text */
for (i = 0 ; i < self->schema->nactions ; i++) {
for (i = 0; i < self->schema->nactions; i++) {
memset(&item, 0, sizeof(item));
item.mask = LVIF_TEXT;
@@ -234,9 +235,8 @@ static void buttons_update_bindings(HWND hwnd)
hid_mgr_lock();
for (pos = mapper_iterate_actions()
; action_iter_is_valid(pos)
; action_iter_next(pos)) {
for (pos = mapper_iterate_actions(); action_iter_is_valid(pos);
action_iter_next(pos)) {
if (action_iter_get_page(pos) != self->page_no) {
continue;
}
@@ -262,8 +262,8 @@ static void buttons_update_bindings(HWND hwnd)
hid_mgr_unlock();
}
static bool buttons_get_control_name(const struct mapped_action *ma,
wchar_t *str, size_t nchars)
static bool buttons_get_control_name(
const struct mapped_action *ma, wchar_t *str, size_t nchars)
{
char chars[128];
struct hid_control *controls;
@@ -367,11 +367,11 @@ static INT_PTR buttons_handle_binding_edit(HWND hwnd, BOOL bind_many)
return TRUE;
}
for(action_no = action_start;
action_no < self->schema->nactions;
action_no++) {
for (action_no = action_start; action_no < self->schema->nactions;
action_no++) {
// Make sure the next listview item is visible
ListView_SetItemState (listview, action_no, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
ListView_SetItemState(
listview, action_no, LVIS_FOCUSED | LVIS_SELECTED, 0x000F);
ListView_EnsureVisible(listview, action_no, FALSE);
bit = self->schema->actions[action_no].bit;
@@ -380,14 +380,18 @@ static INT_PTR buttons_handle_binding_edit(HWND hwnd, BOOL bind_many)
mapper_set_action_map((uint8_t) action_no, self->page_no, bit, &ma);
buttons_update(hwnd);
log_misc("Bind act %d -> dev %p ctl %u range [%d, %d]",
self->schema->actions[action_no].bit, ma.hid,
(unsigned int) ma.control_no, ma.value_min, ma.value_max);
log_misc(
"Bind act %d -> dev %p ctl %u range [%d, %d]",
self->schema->actions[action_no].bit,
ma.hid,
(unsigned int) ma.control_no,
ma.value_min,
ma.value_max);
} else {
break;
}
if(!bind_many) {
if (!bind_many) {
break;
}
}
@@ -423,4 +427,3 @@ static INT_PTR buttons_handle_fini(HWND hwnd)
return TRUE;
}
+34 -29
View File
@@ -1,6 +1,6 @@
#include <windows.h>
#include <commctrl.h>
#include <commdlg.h>
#include <windows.h>
#include <stdbool.h>
#include <stdlib.h>
@@ -47,8 +47,8 @@ struct eam_unit_ui {
struct array devs;
};
static INT_PTR CALLBACK eam_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam);
static INT_PTR CALLBACK
eam_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static INT_PTR eam_ui_handle_init(HWND hwnd, const PROPSHEETPAGE *psp);
static INT_PTR eam_ui_handle_activate(HWND hwnd);
static INT_PTR eam_ui_handle_passivate(HWND hwnd);
@@ -57,10 +57,10 @@ static INT_PTR eam_ui_handle_change_alt_10k(HWND hwnd);
static INT_PTR eam_ui_handle_change_autogen(HWND hwnd);
static INT_PTR eam_ui_handle_fini(HWND hwnd);
static INT_PTR CALLBACK eam_unit_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam);
static INT_PTR eam_unit_ui_handle_init(HWND hwnd,
const struct eam_unit_def *def);
static INT_PTR CALLBACK
eam_unit_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static INT_PTR
eam_unit_ui_handle_init(HWND hwnd, const struct eam_unit_def *def);
static void eam_unit_ui_handle_init_devs(HWND hwnd);
static void eam_unit_ui_handle_init_path(HWND hwnd);
static INT_PTR eam_unit_ui_handle_browse(HWND hwnd);
@@ -70,8 +70,11 @@ static INT_PTR eam_unit_ui_handle_fini(HWND hwnd);
static const struct eam_io_config_api *eam_io_config_api;
HPROPSHEETPAGE eam_ui_tab_create(HINSTANCE inst, const struct schema *schema,
const struct eam_io_config_api *api)
HPROPSHEETPAGE
eam_ui_tab_create(
HINSTANCE inst,
const struct schema *schema,
const struct eam_io_config_api *api)
{
PROPSHEETPAGE psp;
@@ -88,8 +91,8 @@ HPROPSHEETPAGE eam_ui_tab_create(HINSTANCE inst, const struct schema *schema,
return CreatePropertySheetPage(&psp);
}
static INT_PTR CALLBACK eam_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam)
static INT_PTR CALLBACK
eam_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
const NMHDR *n;
@@ -159,13 +162,17 @@ static INT_PTR eam_ui_handle_init(HWND hwnd, const PROPSHEETPAGE *psp)
ypos = 0;
for (i = 0 ; i < schema->nunits ; i++) {
child = CreateDialogParam(inst, MAKEINTRESOURCE(IDD_READER), hwnd,
eam_unit_ui_dlg_proc, (LPARAM) &schema->units[i]);
for (i = 0; i < schema->nunits; i++) {
child = CreateDialogParam(
inst,
MAKEINTRESOURCE(IDD_READER),
hwnd,
eam_unit_ui_dlg_proc,
(LPARAM) &schema->units[i]);
GetWindowRect(child, &r);
SetWindowPos(child, HWND_BOTTOM, 0, ypos, 0, 0,
SWP_NOSIZE | SWP_SHOWWINDOW);
SetWindowPos(
child, HWND_BOTTOM, 0, ypos, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
ypos += r.bottom - r.top;
@@ -207,7 +214,7 @@ static INT_PTR eam_ui_handle_tick(HWND hwnd)
mapper_update();
for (i = 0 ; i < ui->children.nitems ; i++) {
for (i = 0; i < ui->children.nitems; i++) {
child = *array_item(HWND, &ui->children, i);
SendMessage(child, WM_USER, 0, 0);
}
@@ -253,13 +260,13 @@ static INT_PTR eam_ui_handle_fini(HWND hwnd)
return TRUE;
}
static INT_PTR CALLBACK eam_unit_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam)
static INT_PTR CALLBACK
eam_unit_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg) {
case WM_INITDIALOG:
return eam_unit_ui_handle_init(hwnd,
(struct eam_unit_def *) lparam);
return eam_unit_ui_handle_init(
hwnd, (struct eam_unit_def *) lparam);
case WM_USER:
return eam_unit_ui_handle_tick(hwnd);
@@ -296,8 +303,8 @@ static INT_PTR CALLBACK eam_unit_ui_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
}
}
static INT_PTR eam_unit_ui_handle_init(HWND hwnd,
const struct eam_unit_def *def)
static INT_PTR
eam_unit_ui_handle_init(HWND hwnd, const struct eam_unit_def *def)
{
struct eam_unit_ui *ui;
wchar_t str[128];
@@ -338,15 +345,14 @@ static void eam_unit_ui_handle_init_devs(HWND hwnd)
hid_mgr_lock();
for (hid = hid_mgr_get_first_stub()
; hid != NULL
; hid = hid_mgr_get_next_stub(hid)) {
for (hid = hid_mgr_get_first_stub(); hid != NULL;
hid = hid_mgr_get_next_stub(hid)) {
if (!hid_stub_get_device_usage(hid, &dev_usage)) {
continue;
}
if (dev_usage != KBD_DEVICE_USAGE_KEYBOARD
&& dev_usage != KBD_DEVICE_USAGE_KEYPAD) {
if (dev_usage != KBD_DEVICE_USAGE_KEYBOARD &&
dev_usage != KBD_DEVICE_USAGE_KEYPAD) {
continue;
}
@@ -486,4 +492,3 @@ static INT_PTR eam_unit_ui_handle_fini(HWND hwnd)
return TRUE;
}
+8 -9
View File
@@ -9,8 +9,8 @@
#include "util/defs.h"
#include "util/log.h"
static INT_PTR CALLBACK game_type_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam);
static INT_PTR CALLBACK
game_type_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static INT_PTR game_type_handle_init(HWND hwnd);
static INT_PTR game_type_handle_ok(HWND hwnd);
static INT_PTR game_type_handle_cancel(HWND hwnd);
@@ -19,7 +19,7 @@ const struct schema *game_type_from_str(const char *name)
{
size_t i;
for (i = 0 ; i < nschemas ; i++) {
for (i = 0; i < nschemas; i++) {
if (_stricmp(schemas[i].name, name) == 0) {
return &schemas[i];
}
@@ -30,12 +30,12 @@ const struct schema *game_type_from_str(const char *name)
const struct schema *game_type_from_dialog(HINSTANCE inst)
{
return (struct schema *) DialogBoxParam(inst,
MAKEINTRESOURCE(IDD_GAME_TYPE), NULL, game_type_dlg_proc, 0);
return (struct schema *) DialogBoxParam(
inst, MAKEINTRESOURCE(IDD_GAME_TYPE), NULL, game_type_dlg_proc, 0);
}
static INT_PTR CALLBACK game_type_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam)
static INT_PTR CALLBACK
game_type_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg) {
case WM_INITDIALOG:
@@ -68,7 +68,7 @@ static INT_PTR game_type_handle_init(HWND hwnd)
inst = (HINSTANCE) GetWindowLongPtr(hwnd, GWLP_HINSTANCE);
ctl = GetDlgItem(hwnd, IDC_GAME_TYPE);
for (i = 0 ; i < nschemas ; i++) {
for (i = 0; i < nschemas; i++) {
LoadString(inst, schemas[i].label, text, lengthof(text));
SendMessage(ctl, CB_ADDSTRING, 0, (LPARAM) text);
}
@@ -99,4 +99,3 @@ static INT_PTR game_type_handle_cancel(HWND hwnd)
return TRUE;
}
+29 -28
View File
@@ -1,7 +1,7 @@
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <wchar.h>
#include <windows.h>
#include <windowsx.h>
#include <stdint.h>
#include <stdlib.h>
@@ -32,8 +32,8 @@ struct lights_ui {
float pulse_coeff;
};
static INT_PTR CALLBACK lights_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam);
static INT_PTR CALLBACK
lights_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static INT_PTR lights_handle_init(HWND hwnd, const PROPSHEETPAGE *psp);
static void lights_handle_init_devices(HWND hwnd);
static void lights_handle_init_device(HWND hwnd, struct hid_stub *hid);
@@ -47,7 +47,8 @@ static void lights_pulse_start(HWND hwnd, size_t light_no);
static void lights_pulse_stop(HWND hwnd);
static INT_PTR lights_handle_fini(HWND hwnd);
HPROPSHEETPAGE lights_tab_create(HINSTANCE inst, const struct schema *schema)
HPROPSHEETPAGE
lights_tab_create(HINSTANCE inst, const struct schema *schema)
{
PROPSHEETPAGE psp;
@@ -62,8 +63,8 @@ HPROPSHEETPAGE lights_tab_create(HINSTANCE inst, const struct schema *schema)
return CreatePropertySheetPage(&psp);
}
static INT_PTR CALLBACK lights_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam)
static INT_PTR CALLBACK
lights_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
NMHDR *n;
@@ -91,8 +92,8 @@ static INT_PTR CALLBACK lights_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
case IDC_LIGHT:
switch (n->code) {
case LVN_ITEMCHANGED:
return lights_handle_highlight_light(hwnd,
(NMLISTVIEW *) n);
return lights_handle_highlight_light(
hwnd, (NMLISTVIEW *) n);
case NM_DBLCLK:
return lights_handle_bind_light(hwnd);
@@ -137,9 +138,8 @@ static void lights_handle_init_devices(HWND hwnd)
hid_mgr_lock();
for (hid = hid_mgr_get_first_stub()
; hid != NULL
; hid = hid_mgr_get_next_stub(hid)) {
for (hid = hid_mgr_get_first_stub(); hid != NULL;
hid = hid_mgr_get_next_stub(hid)) {
lights_handle_init_device(hwnd, hid);
}
@@ -194,8 +194,8 @@ static void lights_handle_init_lights(HWND hwnd)
inst = (HINSTANCE) GetWindowLongPtr(hwnd, GWLP_HINSTANCE);
lights = GetDlgItem(hwnd, IDC_LIGHT);
ListView_SetExtendedListViewStyle(lights,
LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
ListView_SetExtendedListViewStyle(
lights, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
LoadString(inst, IDS_COL_LIGHT_HID, str, lengthof(str));
@@ -258,15 +258,15 @@ static INT_PTR lights_handle_change_dev(HWND hwnd)
goto locked_fail;
}
for (i = 0 ; i < ui->nlights ; i++) {
if(ui->lights[i].name[0] != L'\0') {
for (i = 0; i < ui->nlights; i++) {
if (ui->lights[i].name[0] != L'\0') {
item.pszText = ui->lights[i].name;
} else {
wchars[0] = L'\0';
usages_get(chars, lengthof(chars), ui->lights[i].usage);
MultiByteToWideChar(CP_UTF8, 0, chars, lengthof(chars), wchars,
lengthof(wchars));
MultiByteToWideChar(
CP_UTF8, 0, chars, lengthof(chars), wchars, lengthof(wchars));
item.pszText = wchars;
}
@@ -379,8 +379,8 @@ static INT_PTR lights_handle_pulse_tick(HWND hwnd)
}
bias = (float) (ui->lights[light_no].value_min);
scale = (float) (ui->lights[light_no].value_max
- ui->lights[light_no].value_min);
scale =
(float) (ui->lights[light_no].value_max - ui->lights[light_no].value_min);
/* Intensity perception is non-linear. Pulse quadratically. */
@@ -408,13 +408,12 @@ static void lights_update_bindings(HWND hwnd)
inst = (HINSTANCE) GetWindowLongPtr(hwnd, GWLP_HINSTANCE);
lights_ctl = GetDlgItem(hwnd, IDC_LIGHT);
for (i = 0 ; i < ui->nlights ; i++) {
for (i = 0; i < ui->nlights; i++) {
ListView_SetItemText(lights_ctl, i, 1, NULL);
}
for (pos = mapper_iterate_lights()
; light_iter_is_valid(pos)
; light_iter_next(pos)) {
for (pos = mapper_iterate_lights(); light_iter_is_valid(pos);
light_iter_next(pos)) {
light_iter_get_mapping(pos, &ml);
if (ml.hid != ui->hid) {
@@ -430,10 +429,13 @@ static void lights_update_bindings(HWND hwnd)
game_light = light_iter_get_game_light(pos);
for (i = 0 ; i < ui->schema->nlights ; i++) {
for (i = 0; i < ui->schema->nlights; i++) {
if (ui->schema->lights[i].bit == game_light) {
LoadString(inst, ui->schema->lights[i].name_rsrc, wchars,
lengthof(wchars));
LoadString(
inst,
ui->schema->lights[i].name_rsrc,
wchars,
lengthof(wchars));
ListView_SetItemText(lights_ctl, ml.light_no, 1, wchars);
}
}
@@ -510,4 +512,3 @@ static INT_PTR lights_handle_fini(HWND hwnd)
return TRUE;
}
+14 -12
View File
@@ -1,5 +1,5 @@
#include <windows.h>
#include <commctrl.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
@@ -21,12 +21,15 @@
#include "util/thread.h"
#include "util/winres.h"
HPROPSHEETPAGE analogs_ui_tab_create(HINSTANCE inst,
const struct schema *schema);
HPROPSHEETPAGE
analogs_ui_tab_create(HINSTANCE inst, const struct schema *schema);
HPROPSHEETPAGE buttons_tab_create(HINSTANCE inst, const struct schema *schema);
HPROPSHEETPAGE lights_tab_create(HINSTANCE inst, const struct schema *schema);
HPROPSHEETPAGE eam_ui_tab_create(HINSTANCE inst, const struct schema *schema,
const struct eam_io_config_api *eam_io_config_api);
HPROPSHEETPAGE
eam_ui_tab_create(
HINSTANCE inst,
const struct schema *schema,
const struct eam_io_config_api *eam_io_config_api);
static void my_fatal(const char *module, const char *fmt, ...)
{
@@ -90,12 +93,12 @@ int main(int argc, char **argv)
}
}
input_set_loggers(log_impl_misc, log_impl_info, log_impl_warning,
log_impl_fatal);
input_set_loggers(
log_impl_misc, log_impl_info, log_impl_warning, log_impl_fatal);
input_init(crt_thread_create, crt_thread_join, crt_thread_destroy);
eam_io_set_loggers(log_impl_misc, log_impl_info, log_impl_warning,
log_impl_fatal);
eam_io_set_loggers(
log_impl_misc, log_impl_info, log_impl_warning, log_impl_fatal);
eam_io_init(crt_thread_create, crt_thread_join, crt_thread_destroy);
eam_io_config_api = eam_io_get_config_api();
@@ -104,13 +107,13 @@ int main(int argc, char **argv)
max_light = -1;
for (i = 0 ; i < schema->nlights ; i++) {
for (i = 0; i < schema->nlights; i++) {
if (max_light < schema->lights[i].bit) {
max_light = schema->lights[i].bit;
}
}
mapper_set_nlights((uint8_t) (max_light + 1));
mapper_set_nlights((uint8_t)(max_light + 1));
mapper_set_nanalogs((uint8_t) schema->nanalogs);
}
@@ -155,4 +158,3 @@ int main(int argc, char **argv)
return EXIT_SUCCESS;
}
+241 -241
View File
@@ -2,244 +2,244 @@
#define IDC_STATIC (-1)
#endif
#define IDR_USAGES 101
#define IDD_TAB_BUTTONS 102
#define IDD_TAB_NETWORK 103
#define IDD_BIND 104
#define IDD_READER 105
#define IDD_GAME_TYPE 107
#define IDD_ANALOG 109
#define IDD_TAB_ANALOGS 111
#define IDD_BIND_ADV 113
#define IDD_TAB_LIGHTS 115
#define IDD_BIND_LIGHT 117
#define IDC_GAME_LIGHT 1000
#define IDC_KBD_DEVICE 1000
#define IDC_AUTOGEN 1001
#define IDC_CARD_PATH 1001
#define IDC_LIGHT 1001
#define IDC_SENSITIVITY 1001
#define IDC_ACTION_NAME 1002
#define IDC_ALT_10K 1002
#define IDC_KEYPAD_STATE 1002
#define IDC_GAME_TYPE 1003
#define IDC_GROUP 1003
#define IDC_LIMIT_MIN 1003
#define IDC_BROWSE 1004
#define IDC_BINDINGS 1005
#define IDC_DEVICE 1005
#define IDC_BINDING_EDIT 1006
#define IDC_CONTROL 1006
#define IDC_BINDING_CLEAR 1007
#define IDC_BINDING_MIN 1008
#define IDC_PAGE_TEXT 1008
#define IDC_POSITION 1008
#define IDC_PAGE 1009
#define IDC_BINDING_MAX 1010
#define IDC_LIMIT_MAX 1011
#define IDC_CURRENT 1013
#define IDC_BINDING_EDIT_MANY 40000
#define IDS_APPNAME 40000
#define IDS_BAD_GAME_TYPE 40001
#define IDS_PAGE 40002
#define IDS_COL_BUTTON 40003
#define IDS_COL_ACTION 40004
#define IDS_NOT_PRESENT 40005
#define IDS_READER_P1 40006
#define IDS_READER_P2 40007
#define IDS_MUXED_TITLE 40008
#define IDS_MUXED_MSG 40009
#define IDS_COL_LIGHT_HID 40010
#define IDS_COL_LIGHT_GAME 40011
#define IDS_GENERIC_TEST 40012
#define IDS_GENERIC_SERVICE 40013
#define IDS_IIDX_SCHEMA 40014
#define IDS_IIDX_P1_1 40015
#define IDS_IIDX_P1_2 40016
#define IDS_IIDX_P1_3 40017
#define IDS_IIDX_P1_4 40018
#define IDS_IIDX_P1_5 40019
#define IDS_IIDX_P1_6 40020
#define IDS_IIDX_P1_7 40021
#define IDS_IIDX_P2_1 40022
#define IDS_IIDX_P2_2 40023
#define IDS_IIDX_P2_3 40024
#define IDS_IIDX_P2_4 40025
#define IDS_IIDX_P2_5 40026
#define IDS_IIDX_P2_6 40027
#define IDS_IIDX_P2_7 40028
#define IDS_IIDX_P1_START 40029
#define IDS_IIDX_P2_START 40030
#define IDS_IIDX_VEFX 40031
#define IDS_IIDX_EFFECT 40032
#define IDS_IIDX_P1_TT_UP 40033
#define IDS_IIDX_P1_TT_DOWN 40034
#define IDS_IIDX_P1_TT_STAB 40035
#define IDS_IIDX_P2_TT_UP 40036
#define IDS_IIDX_P2_TT_DOWN 40037
#define IDS_IIDX_P2_TT_STAB 40038
#define IDS_IIDX_P1_TT 40039
#define IDS_IIDX_P2_TT 40040
#define IDS_IIDX_SPOT_1_LIGHT 40041
#define IDS_IIDX_SPOT_2_LIGHT 40042
#define IDS_IIDX_SPOT_3_LIGHT 40043
#define IDS_IIDX_SPOT_4_LIGHT 40044
#define IDS_IIDX_SPOT_5_LIGHT 40045
#define IDS_IIDX_SPOT_6_LIGHT 40046
#define IDS_IIDX_SPOT_7_LIGHT 40047
#define IDS_IIDX_SPOT_8_LIGHT 40048
#define IDS_IIDX_NEON_LIGHT 40049
#define IDS_DDR_SCHEMA 40050
#define IDS_DDR_P1_START 40051
#define IDS_DDR_P1_MENU_UP 40052
#define IDS_DDR_P1_MENU_DOWN 40053
#define IDS_DDR_P1_MENU_LEFT 40054
#define IDS_DDR_P1_MENU_RIGHT 40055
#define IDS_DDR_P1_UP 40056
#define IDS_DDR_P1_DOWN 40057
#define IDS_DDR_P1_LEFT 40058
#define IDS_DDR_P1_RIGHT 40059
#define IDS_DDR_P2_START 40060
#define IDS_DDR_P2_MENU_UP 40061
#define IDS_DDR_P2_MENU_DOWN 40062
#define IDS_DDR_P2_MENU_LEFT 40063
#define IDS_DDR_P2_MENU_RIGHT 40064
#define IDS_DDR_P2_UP 40065
#define IDS_DDR_P2_DOWN 40066
#define IDS_DDR_P2_LEFT 40067
#define IDS_DDR_P2_RIGHT 40068
#define IDS_DDR_P1_MENU_LIGHT 40069
#define IDS_DDR_P1_TOP_LIGHT 40070
#define IDS_DDR_P1_BOTTOM_LIGHT 40071
#define IDS_DDR_P2_MENU_LIGHT 40072
#define IDS_DDR_P2_TOP_LIGHT 40073
#define IDS_DDR_P2_BOTTOM_LIGHT 40074
#define IDS_DDR_BASS_LIGHT 40075
#define IDS_PNM_SCHEMA 40076
#define IDS_PNM_BTN1 40077
#define IDS_PNM_BTN2 40078
#define IDS_PNM_BTN3 40079
#define IDS_PNM_BTN4 40080
#define IDS_PNM_BTN5 40081
#define IDS_PNM_BTN6 40082
#define IDS_PNM_BTN7 40083
#define IDS_PNM_BTN8 40084
#define IDS_PNM_BTN9 40085
#define IDS_JB_SCHEMA 40086
#define IDS_JB_PANEL1 40087
#define IDS_JB_PANEL2 40088
#define IDS_JB_PANEL3 40089
#define IDS_JB_PANEL4 40090
#define IDS_JB_PANEL5 40091
#define IDS_JB_PANEL6 40092
#define IDS_JB_PANEL7 40093
#define IDS_JB_PANEL8 40094
#define IDC_BINDING_ADV 40095
#define IDS_JB_PANEL9 40095
#define IDS_JB_PANEL10 40096
#define IDS_JB_PANEL11 40097
#define IDS_JB_PANEL12 40098
#define IDS_JB_PANEL13 40099
#define IDS_JB_PANEL14 40100
#define IDS_JB_PANEL15 40101
#define IDS_JB_PANEL16 40102
#define IDS_SDVX_SCHEMA 40103
#define IDS_SDVX_START 40104
#define IDS_SDVX_BTN_A 40105
#define IDS_SDVX_BTN_B 40106
#define IDS_SDVX_BTN_C 40107
#define IDS_SDVX_BTN_D 40108
#define IDS_SDVX_FX_L 40109
#define IDS_SDVX_FX_R 40110
#define IDS_SDVX_VOL_L 40111
#define IDS_SDVX_VOL_R 40112
#define IDS_DM_SCHEMA 40113
#define IDS_DM_START 40114
#define IDS_DM_MENU_LEFT 40115
#define IDS_DM_MENU_RIGHT 40116
#define IDS_DM_HI_HAT 40117
#define IDS_DM_SNARE 40118
#define IDS_DM_HIGH_TOM 40119
#define IDS_DM_LOW_TOM 40120
#define IDS_DM_CYMBAL 40121
#define IDS_DM_BASS 40122
#define IDS_DM_SPEAKER_LIGHT 40123
#define IDS_DM_SPOT_LIGHT 40124
#define IDS_DM_START_LIGHT 40125
#define IDS_DM_MENU_LIGHT 40126
#define IDS_GF_SCHEMA 40127
#define IDS_GF_P1_START 40128
#define IDS_GF_P1_PICK 40129
#define IDS_GF_P1_PICK_A 40130
#define IDS_GF_P1_PICK_B 40131
#define IDS_GF_P1_WAIL 40132
#define IDS_GF_P1_EFFECT 40133
#define IDS_GF_P1_RED 40134
#define IDS_GF_P1_GREEN 40135
#define IDS_GF_P1_BLUE 40136
#define IDS_GF_P2_START 40137
#define IDS_GF_P2_PICK 40138
#define IDS_GF_P2_PICK_A 40139
#define IDS_GF_P2_PICK_B 40140
#define IDS_GF_P2_WAIL 40141
#define IDS_GF_P2_EFFECT 40142
#define IDS_GF_P2_RED 40143
#define IDS_GF_P2_GREEN 40144
#define IDS_GF_P2_BLUE 40145
#define IDS_GF_P1_SPOT_LIGHT 40146
#define IDS_GF_P2_SPOT_LIGHT 40147
#define IDS_RB_SCHEMA 40148
#define IDS_SDVX_RGB1_R 40149
#define IDS_SDVX_RGB1_G 40150
#define IDS_SDVX_RGB1_B 40151
#define IDS_SDVX_RGB2_R 40152
#define IDS_SDVX_RGB2_G 40153
#define IDS_SDVX_RGB2_B 40154
#define IDS_SDVX_RGB3_R 40155
#define IDS_SDVX_RGB3_G 40156
#define IDS_SDVX_RGB3_B 40157
#define IDS_SDVX_RGB4_R 40158
#define IDS_SDVX_RGB4_G 40159
#define IDS_SDVX_RGB4_B 40160
#define IDS_SDVX_RGB5_R 40161
#define IDS_SDVX_RGB5_G 40162
#define IDS_SDVX_RGB5_B 40163
#define IDS_SDVX_RGB6_R 40164
#define IDS_SDVX_RGB6_G 40165
#define IDS_SDVX_RGB6_B 40166
#define IDS_JU5_SCHEMA 40167
#define IDS_JB_RGB_FRONT_R 40168
#define IDS_JB_RGB_FRONT_G 40169
#define IDS_JB_RGB_FRONT_B 40170
#define IDS_JB_RGB_TOP_R 40171
#define IDS_JB_RGB_TOP_G 40172
#define IDS_JB_RGB_TOP_B 40173
#define IDS_JB_RGB_LEFT_R 40174
#define IDS_JB_RGB_LEFT_G 40175
#define IDS_JB_RGB_LEFT_B 40176
#define IDS_JB_RGB_RIGHT_R 40177
#define IDS_JB_RGB_RIGHT_G 40178
#define IDS_JB_RGB_RIGHT_B 40179
#define IDS_JB_RGB_TITLE_R 40180
#define IDS_JB_RGB_TITLE_G 40181
#define IDS_JB_RGB_TITLE_B 40182
#define IDS_JB_RGB_WOOFER_R 40183
#define IDS_JB_RGB_WOOFER_G 40184
#define IDS_JB_RGB_WOOFER_B 40185
#define IDS_BST_SCHEMA 40186
#define IDS_IIDX_PANEL_SCHEMA 40187
#define IDS_IIDX_PANEL_S1_UP 40188
#define IDS_IIDX_PANEL_S1_DOWN 40189
#define IDS_IIDX_PANEL_S2_UP 40190
#define IDS_IIDX_PANEL_S2_DOWN 40191
#define IDS_IIDX_PANEL_S3_UP 40192
#define IDS_IIDX_PANEL_S3_DOWN 40193
#define IDS_IIDX_PANEL_S4_UP 40194
#define IDS_IIDX_PANEL_S4_DOWN 40195
#define IDS_IIDX_PANEL_S5_UP 40196
#define IDS_IIDX_PANEL_S5_DOWN 40197
#define IDS_IIDX_PANEL_S1 40198
#define IDS_IIDX_PANEL_S2 40199
#define IDS_IIDX_PANEL_S3 40200
#define IDS_IIDX_PANEL_S4 40201
#define IDS_IIDX_PANEL_S5 40202
#define IDR_USAGES 101
#define IDD_TAB_BUTTONS 102
#define IDD_TAB_NETWORK 103
#define IDD_BIND 104
#define IDD_READER 105
#define IDD_GAME_TYPE 107
#define IDD_ANALOG 109
#define IDD_TAB_ANALOGS 111
#define IDD_BIND_ADV 113
#define IDD_TAB_LIGHTS 115
#define IDD_BIND_LIGHT 117
#define IDC_GAME_LIGHT 1000
#define IDC_KBD_DEVICE 1000
#define IDC_AUTOGEN 1001
#define IDC_CARD_PATH 1001
#define IDC_LIGHT 1001
#define IDC_SENSITIVITY 1001
#define IDC_ACTION_NAME 1002
#define IDC_ALT_10K 1002
#define IDC_KEYPAD_STATE 1002
#define IDC_GAME_TYPE 1003
#define IDC_GROUP 1003
#define IDC_LIMIT_MIN 1003
#define IDC_BROWSE 1004
#define IDC_BINDINGS 1005
#define IDC_DEVICE 1005
#define IDC_BINDING_EDIT 1006
#define IDC_CONTROL 1006
#define IDC_BINDING_CLEAR 1007
#define IDC_BINDING_MIN 1008
#define IDC_PAGE_TEXT 1008
#define IDC_POSITION 1008
#define IDC_PAGE 1009
#define IDC_BINDING_MAX 1010
#define IDC_LIMIT_MAX 1011
#define IDC_CURRENT 1013
#define IDC_BINDING_EDIT_MANY 40000
#define IDS_APPNAME 40000
#define IDS_BAD_GAME_TYPE 40001
#define IDS_PAGE 40002
#define IDS_COL_BUTTON 40003
#define IDS_COL_ACTION 40004
#define IDS_NOT_PRESENT 40005
#define IDS_READER_P1 40006
#define IDS_READER_P2 40007
#define IDS_MUXED_TITLE 40008
#define IDS_MUXED_MSG 40009
#define IDS_COL_LIGHT_HID 40010
#define IDS_COL_LIGHT_GAME 40011
#define IDS_GENERIC_TEST 40012
#define IDS_GENERIC_SERVICE 40013
#define IDS_IIDX_SCHEMA 40014
#define IDS_IIDX_P1_1 40015
#define IDS_IIDX_P1_2 40016
#define IDS_IIDX_P1_3 40017
#define IDS_IIDX_P1_4 40018
#define IDS_IIDX_P1_5 40019
#define IDS_IIDX_P1_6 40020
#define IDS_IIDX_P1_7 40021
#define IDS_IIDX_P2_1 40022
#define IDS_IIDX_P2_2 40023
#define IDS_IIDX_P2_3 40024
#define IDS_IIDX_P2_4 40025
#define IDS_IIDX_P2_5 40026
#define IDS_IIDX_P2_6 40027
#define IDS_IIDX_P2_7 40028
#define IDS_IIDX_P1_START 40029
#define IDS_IIDX_P2_START 40030
#define IDS_IIDX_VEFX 40031
#define IDS_IIDX_EFFECT 40032
#define IDS_IIDX_P1_TT_UP 40033
#define IDS_IIDX_P1_TT_DOWN 40034
#define IDS_IIDX_P1_TT_STAB 40035
#define IDS_IIDX_P2_TT_UP 40036
#define IDS_IIDX_P2_TT_DOWN 40037
#define IDS_IIDX_P2_TT_STAB 40038
#define IDS_IIDX_P1_TT 40039
#define IDS_IIDX_P2_TT 40040
#define IDS_IIDX_SPOT_1_LIGHT 40041
#define IDS_IIDX_SPOT_2_LIGHT 40042
#define IDS_IIDX_SPOT_3_LIGHT 40043
#define IDS_IIDX_SPOT_4_LIGHT 40044
#define IDS_IIDX_SPOT_5_LIGHT 40045
#define IDS_IIDX_SPOT_6_LIGHT 40046
#define IDS_IIDX_SPOT_7_LIGHT 40047
#define IDS_IIDX_SPOT_8_LIGHT 40048
#define IDS_IIDX_NEON_LIGHT 40049
#define IDS_DDR_SCHEMA 40050
#define IDS_DDR_P1_START 40051
#define IDS_DDR_P1_MENU_UP 40052
#define IDS_DDR_P1_MENU_DOWN 40053
#define IDS_DDR_P1_MENU_LEFT 40054
#define IDS_DDR_P1_MENU_RIGHT 40055
#define IDS_DDR_P1_UP 40056
#define IDS_DDR_P1_DOWN 40057
#define IDS_DDR_P1_LEFT 40058
#define IDS_DDR_P1_RIGHT 40059
#define IDS_DDR_P2_START 40060
#define IDS_DDR_P2_MENU_UP 40061
#define IDS_DDR_P2_MENU_DOWN 40062
#define IDS_DDR_P2_MENU_LEFT 40063
#define IDS_DDR_P2_MENU_RIGHT 40064
#define IDS_DDR_P2_UP 40065
#define IDS_DDR_P2_DOWN 40066
#define IDS_DDR_P2_LEFT 40067
#define IDS_DDR_P2_RIGHT 40068
#define IDS_DDR_P1_MENU_LIGHT 40069
#define IDS_DDR_P1_TOP_LIGHT 40070
#define IDS_DDR_P1_BOTTOM_LIGHT 40071
#define IDS_DDR_P2_MENU_LIGHT 40072
#define IDS_DDR_P2_TOP_LIGHT 40073
#define IDS_DDR_P2_BOTTOM_LIGHT 40074
#define IDS_DDR_BASS_LIGHT 40075
#define IDS_PNM_SCHEMA 40076
#define IDS_PNM_BTN1 40077
#define IDS_PNM_BTN2 40078
#define IDS_PNM_BTN3 40079
#define IDS_PNM_BTN4 40080
#define IDS_PNM_BTN5 40081
#define IDS_PNM_BTN6 40082
#define IDS_PNM_BTN7 40083
#define IDS_PNM_BTN8 40084
#define IDS_PNM_BTN9 40085
#define IDS_JB_SCHEMA 40086
#define IDS_JB_PANEL1 40087
#define IDS_JB_PANEL2 40088
#define IDS_JB_PANEL3 40089
#define IDS_JB_PANEL4 40090
#define IDS_JB_PANEL5 40091
#define IDS_JB_PANEL6 40092
#define IDS_JB_PANEL7 40093
#define IDS_JB_PANEL8 40094
#define IDC_BINDING_ADV 40095
#define IDS_JB_PANEL9 40095
#define IDS_JB_PANEL10 40096
#define IDS_JB_PANEL11 40097
#define IDS_JB_PANEL12 40098
#define IDS_JB_PANEL13 40099
#define IDS_JB_PANEL14 40100
#define IDS_JB_PANEL15 40101
#define IDS_JB_PANEL16 40102
#define IDS_SDVX_SCHEMA 40103
#define IDS_SDVX_START 40104
#define IDS_SDVX_BTN_A 40105
#define IDS_SDVX_BTN_B 40106
#define IDS_SDVX_BTN_C 40107
#define IDS_SDVX_BTN_D 40108
#define IDS_SDVX_FX_L 40109
#define IDS_SDVX_FX_R 40110
#define IDS_SDVX_VOL_L 40111
#define IDS_SDVX_VOL_R 40112
#define IDS_DM_SCHEMA 40113
#define IDS_DM_START 40114
#define IDS_DM_MENU_LEFT 40115
#define IDS_DM_MENU_RIGHT 40116
#define IDS_DM_HI_HAT 40117
#define IDS_DM_SNARE 40118
#define IDS_DM_HIGH_TOM 40119
#define IDS_DM_LOW_TOM 40120
#define IDS_DM_CYMBAL 40121
#define IDS_DM_BASS 40122
#define IDS_DM_SPEAKER_LIGHT 40123
#define IDS_DM_SPOT_LIGHT 40124
#define IDS_DM_START_LIGHT 40125
#define IDS_DM_MENU_LIGHT 40126
#define IDS_GF_SCHEMA 40127
#define IDS_GF_P1_START 40128
#define IDS_GF_P1_PICK 40129
#define IDS_GF_P1_PICK_A 40130
#define IDS_GF_P1_PICK_B 40131
#define IDS_GF_P1_WAIL 40132
#define IDS_GF_P1_EFFECT 40133
#define IDS_GF_P1_RED 40134
#define IDS_GF_P1_GREEN 40135
#define IDS_GF_P1_BLUE 40136
#define IDS_GF_P2_START 40137
#define IDS_GF_P2_PICK 40138
#define IDS_GF_P2_PICK_A 40139
#define IDS_GF_P2_PICK_B 40140
#define IDS_GF_P2_WAIL 40141
#define IDS_GF_P2_EFFECT 40142
#define IDS_GF_P2_RED 40143
#define IDS_GF_P2_GREEN 40144
#define IDS_GF_P2_BLUE 40145
#define IDS_GF_P1_SPOT_LIGHT 40146
#define IDS_GF_P2_SPOT_LIGHT 40147
#define IDS_RB_SCHEMA 40148
#define IDS_SDVX_RGB1_R 40149
#define IDS_SDVX_RGB1_G 40150
#define IDS_SDVX_RGB1_B 40151
#define IDS_SDVX_RGB2_R 40152
#define IDS_SDVX_RGB2_G 40153
#define IDS_SDVX_RGB2_B 40154
#define IDS_SDVX_RGB3_R 40155
#define IDS_SDVX_RGB3_G 40156
#define IDS_SDVX_RGB3_B 40157
#define IDS_SDVX_RGB4_R 40158
#define IDS_SDVX_RGB4_G 40159
#define IDS_SDVX_RGB4_B 40160
#define IDS_SDVX_RGB5_R 40161
#define IDS_SDVX_RGB5_G 40162
#define IDS_SDVX_RGB5_B 40163
#define IDS_SDVX_RGB6_R 40164
#define IDS_SDVX_RGB6_G 40165
#define IDS_SDVX_RGB6_B 40166
#define IDS_JU5_SCHEMA 40167
#define IDS_JB_RGB_FRONT_R 40168
#define IDS_JB_RGB_FRONT_G 40169
#define IDS_JB_RGB_FRONT_B 40170
#define IDS_JB_RGB_TOP_R 40171
#define IDS_JB_RGB_TOP_G 40172
#define IDS_JB_RGB_TOP_B 40173
#define IDS_JB_RGB_LEFT_R 40174
#define IDS_JB_RGB_LEFT_G 40175
#define IDS_JB_RGB_LEFT_B 40176
#define IDS_JB_RGB_RIGHT_R 40177
#define IDS_JB_RGB_RIGHT_G 40178
#define IDS_JB_RGB_RIGHT_B 40179
#define IDS_JB_RGB_TITLE_R 40180
#define IDS_JB_RGB_TITLE_G 40181
#define IDS_JB_RGB_TITLE_B 40182
#define IDS_JB_RGB_WOOFER_R 40183
#define IDS_JB_RGB_WOOFER_G 40184
#define IDS_JB_RGB_WOOFER_B 40185
#define IDS_BST_SCHEMA 40186
#define IDS_IIDX_PANEL_SCHEMA 40187
#define IDS_IIDX_PANEL_S1_UP 40188
#define IDS_IIDX_PANEL_S1_DOWN 40189
#define IDS_IIDX_PANEL_S2_UP 40190
#define IDS_IIDX_PANEL_S2_DOWN 40191
#define IDS_IIDX_PANEL_S3_UP 40192
#define IDS_IIDX_PANEL_S3_DOWN 40193
#define IDS_IIDX_PANEL_S4_UP 40194
#define IDS_IIDX_PANEL_S4_DOWN 40195
#define IDS_IIDX_PANEL_S5_UP 40196
#define IDS_IIDX_PANEL_S5_DOWN 40197
#define IDS_IIDX_PANEL_S1 40198
#define IDS_IIDX_PANEL_S2 40199
#define IDS_IIDX_PANEL_S3 40200
#define IDS_IIDX_PANEL_S4 40201
#define IDS_IIDX_PANEL_S5 40202
+273 -317
View File
@@ -1,391 +1,347 @@
#include "config/resource.h"
#include "config/schema.h"
#include "config/resource.h"
#include "util/defs.h"
static const struct action_def dm_actions[] = {
{ 0x01, IDS_GENERIC_TEST },
{ 0x00, IDS_GENERIC_SERVICE },
static const struct action_def dm_actions[] = {{0x01, IDS_GENERIC_TEST},
{0x00, IDS_GENERIC_SERVICE},
{ 0x08, IDS_DM_START },
{ 0x0F, IDS_DM_MENU_LEFT },
{ 0x11, IDS_DM_MENU_RIGHT },
{0x08, IDS_DM_START},
{0x0F, IDS_DM_MENU_LEFT},
{0x11, IDS_DM_MENU_RIGHT},
{ 0x0A, IDS_DM_HI_HAT },
{ 0x0C, IDS_DM_SNARE },
{ 0x0E, IDS_DM_HIGH_TOM },
{ 0x10, IDS_DM_LOW_TOM },
{ 0x12, IDS_DM_CYMBAL },
{ 0x16, IDS_DM_BASS }
};
{0x0A, IDS_DM_HI_HAT},
{0x0C, IDS_DM_SNARE},
{0x0E, IDS_DM_HIGH_TOM},
{0x10, IDS_DM_LOW_TOM},
{0x12, IDS_DM_CYMBAL},
{0x16, IDS_DM_BASS}};
static const struct light_def dm_lights[] = {
{ 0x00, IDS_DM_HI_HAT },
{ 0x01, IDS_DM_SNARE },
{ 0x02, IDS_DM_HIGH_TOM },
{ 0x03, IDS_DM_LOW_TOM },
{ 0x04, IDS_DM_CYMBAL },
{ 0x09, IDS_DM_BASS },
{ 0x0A, IDS_DM_SPEAKER_LIGHT },
{ 0x08, IDS_DM_SPOT_LIGHT },
{ 0x06, IDS_DM_START_LIGHT },
{ 0x07, IDS_DM_MENU_LIGHT }
};
static const struct light_def dm_lights[] = {{0x00, IDS_DM_HI_HAT},
{0x01, IDS_DM_SNARE},
{0x02, IDS_DM_HIGH_TOM},
{0x03, IDS_DM_LOW_TOM},
{0x04, IDS_DM_CYMBAL},
{0x09, IDS_DM_BASS},
{0x0A, IDS_DM_SPEAKER_LIGHT},
{0x08, IDS_DM_SPOT_LIGHT},
{0x06, IDS_DM_START_LIGHT},
{0x07, IDS_DM_MENU_LIGHT}};
static const struct action_def gf_actions[] = {
{ 0x01, IDS_GENERIC_TEST },
{ 0x00, IDS_GENERIC_SERVICE },
{0x01, IDS_GENERIC_TEST}, {0x00, IDS_GENERIC_SERVICE},
{ 0x08, IDS_GF_P1_START },
{ 0x0A, IDS_GF_P1_PICK },
{ 0x18, IDS_GF_P1_PICK_A },
{ 0x19, IDS_GF_P1_PICK_B },
{ 0x1C, IDS_GF_P1_EFFECT },
{ 0x0C, IDS_GF_P1_WAIL },
{ 0x12, IDS_GF_P1_RED },
{ 0x14, IDS_GF_P1_GREEN },
{ 0x16, IDS_GF_P1_BLUE },
{0x08, IDS_GF_P1_START}, {0x0A, IDS_GF_P1_PICK},
{0x18, IDS_GF_P1_PICK_A}, {0x19, IDS_GF_P1_PICK_B},
{0x1C, IDS_GF_P1_EFFECT}, {0x0C, IDS_GF_P1_WAIL},
{0x12, IDS_GF_P1_RED}, {0x14, IDS_GF_P1_GREEN},
{0x16, IDS_GF_P1_BLUE},
{ 0x09, IDS_GF_P2_START },
{ 0x0B, IDS_GF_P2_PICK },
{ 0x1A, IDS_GF_P2_PICK_A },
{ 0x1B, IDS_GF_P2_PICK_B },
{ 0x1D, IDS_GF_P2_EFFECT },
{ 0x0D, IDS_GF_P2_WAIL },
{ 0x13, IDS_GF_P2_RED },
{ 0x15, IDS_GF_P2_GREEN },
{ 0x17, IDS_GF_P2_BLUE }
};
{0x09, IDS_GF_P2_START}, {0x0B, IDS_GF_P2_PICK},
{0x1A, IDS_GF_P2_PICK_A}, {0x1B, IDS_GF_P2_PICK_B},
{0x1D, IDS_GF_P2_EFFECT}, {0x0D, IDS_GF_P2_WAIL},
{0x13, IDS_GF_P2_RED}, {0x15, IDS_GF_P2_GREEN},
{0x17, IDS_GF_P2_BLUE}};
static const struct light_def gf_lights[] = {
{ 0x08, IDS_GF_P1_SPOT_LIGHT },
{ 0x09, IDS_GF_P2_SPOT_LIGHT },
{ 0x0A, IDS_GF_P1_START },
{ 0x0B, IDS_GF_P2_START }
};
static const struct light_def gf_lights[] = {{0x08, IDS_GF_P1_SPOT_LIGHT},
{0x09, IDS_GF_P2_SPOT_LIGHT},
{0x0A, IDS_GF_P1_START},
{0x0B, IDS_GF_P2_START}};
static const struct action_def iidx_actions[] = {
{ 0x1C, IDS_GENERIC_TEST },
{ 0x1D, IDS_GENERIC_SERVICE },
{0x1C, IDS_GENERIC_TEST}, {0x1D, IDS_GENERIC_SERVICE},
{ 0x08, IDS_IIDX_P1_1 },
{ 0x09, IDS_IIDX_P1_2 },
{ 0x0A, IDS_IIDX_P1_3 },
{ 0x0B, IDS_IIDX_P1_4 },
{ 0x0C, IDS_IIDX_P1_5 },
{ 0x0D, IDS_IIDX_P1_6 },
{ 0x0E, IDS_IIDX_P1_7 },
{0x08, IDS_IIDX_P1_1}, {0x09, IDS_IIDX_P1_2},
{0x0A, IDS_IIDX_P1_3}, {0x0B, IDS_IIDX_P1_4},
{0x0C, IDS_IIDX_P1_5}, {0x0D, IDS_IIDX_P1_6},
{0x0E, IDS_IIDX_P1_7},
{ 0x0F, IDS_IIDX_P2_1 },
{ 0x10, IDS_IIDX_P2_2 },
{ 0x11, IDS_IIDX_P2_3 },
{ 0x12, IDS_IIDX_P2_4 },
{ 0x13, IDS_IIDX_P2_5 },
{ 0x14, IDS_IIDX_P2_6 },
{ 0x15, IDS_IIDX_P2_7 },
{0x0F, IDS_IIDX_P2_1}, {0x10, IDS_IIDX_P2_2},
{0x11, IDS_IIDX_P2_3}, {0x12, IDS_IIDX_P2_4},
{0x13, IDS_IIDX_P2_5}, {0x14, IDS_IIDX_P2_6},
{0x15, IDS_IIDX_P2_7},
{ 0x18, IDS_IIDX_P1_START },
{ 0x19, IDS_IIDX_P2_START },
{ 0x1A, IDS_IIDX_VEFX },
{ 0x1B, IDS_IIDX_EFFECT },
{0x18, IDS_IIDX_P1_START}, {0x19, IDS_IIDX_P2_START},
{0x1A, IDS_IIDX_VEFX}, {0x1B, IDS_IIDX_EFFECT},
{ 0x00, IDS_IIDX_P1_TT_UP },
{ 0x01, IDS_IIDX_P1_TT_DOWN },
{ 0x02, IDS_IIDX_P1_TT_STAB },
{0x00, IDS_IIDX_P1_TT_UP}, {0x01, IDS_IIDX_P1_TT_DOWN},
{0x02, IDS_IIDX_P1_TT_STAB},
{ 0x03, IDS_IIDX_P2_TT_UP },
{ 0x04, IDS_IIDX_P2_TT_DOWN },
{ 0x05, IDS_IIDX_P2_TT_STAB },
{0x03, IDS_IIDX_P2_TT_UP}, {0x04, IDS_IIDX_P2_TT_DOWN},
{0x05, IDS_IIDX_P2_TT_STAB},
{ 0x20, IDS_IIDX_PANEL_S1_UP },
{ 0x21, IDS_IIDX_PANEL_S1_DOWN },
{0x20, IDS_IIDX_PANEL_S1_UP}, {0x21, IDS_IIDX_PANEL_S1_DOWN},
{ 0x22, IDS_IIDX_PANEL_S2_UP },
{ 0x23, IDS_IIDX_PANEL_S2_DOWN },
{0x22, IDS_IIDX_PANEL_S2_UP}, {0x23, IDS_IIDX_PANEL_S2_DOWN},
{ 0x24, IDS_IIDX_PANEL_S3_UP },
{ 0x25, IDS_IIDX_PANEL_S3_DOWN },
{0x24, IDS_IIDX_PANEL_S3_UP}, {0x25, IDS_IIDX_PANEL_S3_DOWN},
{ 0x26, IDS_IIDX_PANEL_S4_UP },
{ 0x27, IDS_IIDX_PANEL_S4_DOWN },
{0x26, IDS_IIDX_PANEL_S4_UP}, {0x27, IDS_IIDX_PANEL_S4_DOWN},
{ 0x28, IDS_IIDX_PANEL_S5_UP },
{ 0x29, IDS_IIDX_PANEL_S5_DOWN }
};
{0x28, IDS_IIDX_PANEL_S5_UP}, {0x29, IDS_IIDX_PANEL_S5_DOWN}};
static const struct light_def iidx_lights[] = {
{ 0x00, IDS_IIDX_P1_1 },
{ 0x01, IDS_IIDX_P1_2 },
{ 0x02, IDS_IIDX_P1_3 },
{ 0x03, IDS_IIDX_P1_4 },
{ 0x04, IDS_IIDX_P1_5 },
{ 0x05, IDS_IIDX_P1_6 },
{ 0x06, IDS_IIDX_P1_7 },
{0x00, IDS_IIDX_P1_1}, {0x01, IDS_IIDX_P1_2},
{0x02, IDS_IIDX_P1_3}, {0x03, IDS_IIDX_P1_4},
{0x04, IDS_IIDX_P1_5}, {0x05, IDS_IIDX_P1_6},
{0x06, IDS_IIDX_P1_7},
{ 0x07, IDS_IIDX_P2_1 },
{ 0x08, IDS_IIDX_P2_2 },
{ 0x09, IDS_IIDX_P2_3 },
{ 0x0A, IDS_IIDX_P2_4 },
{ 0x0B, IDS_IIDX_P2_5 },
{ 0x0C, IDS_IIDX_P2_6 },
{ 0x0D, IDS_IIDX_P2_7 },
{0x07, IDS_IIDX_P2_1}, {0x08, IDS_IIDX_P2_2},
{0x09, IDS_IIDX_P2_3}, {0x0A, IDS_IIDX_P2_4},
{0x0B, IDS_IIDX_P2_5}, {0x0C, IDS_IIDX_P2_6},
{0x0D, IDS_IIDX_P2_7},
{ 0x18, IDS_IIDX_P1_START },
{ 0x19, IDS_IIDX_P2_START },
{ 0x1A, IDS_IIDX_VEFX },
{ 0x1B, IDS_IIDX_EFFECT },
{0x18, IDS_IIDX_P1_START}, {0x19, IDS_IIDX_P2_START},
{0x1A, IDS_IIDX_VEFX}, {0x1B, IDS_IIDX_EFFECT},
{ 0x10, IDS_IIDX_SPOT_1_LIGHT },
{ 0x11, IDS_IIDX_SPOT_2_LIGHT },
{ 0x12, IDS_IIDX_SPOT_3_LIGHT },
{ 0x13, IDS_IIDX_SPOT_4_LIGHT },
{ 0x14, IDS_IIDX_SPOT_5_LIGHT },
{ 0x15, IDS_IIDX_SPOT_6_LIGHT },
{ 0x16, IDS_IIDX_SPOT_7_LIGHT },
{ 0x17, IDS_IIDX_SPOT_8_LIGHT },
{0x10, IDS_IIDX_SPOT_1_LIGHT}, {0x11, IDS_IIDX_SPOT_2_LIGHT},
{0x12, IDS_IIDX_SPOT_3_LIGHT}, {0x13, IDS_IIDX_SPOT_4_LIGHT},
{0x14, IDS_IIDX_SPOT_5_LIGHT}, {0x15, IDS_IIDX_SPOT_6_LIGHT},
{0x16, IDS_IIDX_SPOT_7_LIGHT}, {0x17, IDS_IIDX_SPOT_8_LIGHT},
{ 0x1F, IDS_IIDX_NEON_LIGHT }
};
{0x1F, IDS_IIDX_NEON_LIGHT}};
static const struct analog_def iidx_analogs[] = {
{ 0, IDS_IIDX_P1_TT },
{ 1, IDS_IIDX_P2_TT }
};
static const struct analog_def iidx_analogs[] = {{0, IDS_IIDX_P1_TT},
{1, IDS_IIDX_P2_TT}};
static const struct action_def ddr_actions[] = {
{ 0x04, IDS_GENERIC_TEST },
{ 0x06, IDS_GENERIC_SERVICE },
{0x04, IDS_GENERIC_TEST}, {0x06, IDS_GENERIC_SERVICE},
{ 0x10, IDS_DDR_P1_START },
{ 0x00, IDS_DDR_P1_MENU_UP },
{ 0x01, IDS_DDR_P1_MENU_DOWN },
{ 0x16, IDS_DDR_P1_MENU_LEFT },
{ 0x17, IDS_DDR_P1_MENU_RIGHT },
{ 0x11, IDS_DDR_P1_UP },
{ 0x12, IDS_DDR_P1_DOWN },
{ 0x13, IDS_DDR_P1_LEFT },
{ 0x14, IDS_DDR_P1_RIGHT },
{0x10, IDS_DDR_P1_START}, {0x00, IDS_DDR_P1_MENU_UP},
{0x01, IDS_DDR_P1_MENU_DOWN}, {0x16, IDS_DDR_P1_MENU_LEFT},
{0x17, IDS_DDR_P1_MENU_RIGHT}, {0x11, IDS_DDR_P1_UP},
{0x12, IDS_DDR_P1_DOWN}, {0x13, IDS_DDR_P1_LEFT},
{0x14, IDS_DDR_P1_RIGHT},
{ 0x08, IDS_DDR_P2_START },
{ 0x02, IDS_DDR_P2_MENU_UP },
{ 0x03, IDS_DDR_P2_MENU_DOWN },
{ 0x0E, IDS_DDR_P2_MENU_LEFT },
{ 0x0F, IDS_DDR_P2_MENU_RIGHT },
{ 0x09, IDS_DDR_P2_UP },
{ 0x0A, IDS_DDR_P2_DOWN },
{ 0x0B, IDS_DDR_P2_LEFT },
{ 0x0C, IDS_DDR_P2_RIGHT }
};
{0x08, IDS_DDR_P2_START}, {0x02, IDS_DDR_P2_MENU_UP},
{0x03, IDS_DDR_P2_MENU_DOWN}, {0x0E, IDS_DDR_P2_MENU_LEFT},
{0x0F, IDS_DDR_P2_MENU_RIGHT}, {0x09, IDS_DDR_P2_UP},
{0x0A, IDS_DDR_P2_DOWN}, {0x0B, IDS_DDR_P2_LEFT},
{0x0C, IDS_DDR_P2_RIGHT}};
static const struct light_def ddr_lights[] = {
/* These are split between non-overlapping P3IO and EXTIO state words */
{ 0x00, IDS_DDR_P1_MENU_LIGHT },
{ 0x07, IDS_DDR_P1_TOP_LIGHT },
{ 0x07, IDS_DDR_P1_BOTTOM_LIGHT },
{0x00, IDS_DDR_P1_MENU_LIGHT},
{0x07, IDS_DDR_P1_TOP_LIGHT},
{0x07, IDS_DDR_P1_BOTTOM_LIGHT},
{ 0x1E, IDS_DDR_P1_UP },
{ 0x1D, IDS_DDR_P1_DOWN },
{ 0x1C, IDS_DDR_P1_LEFT },
{ 0x1B, IDS_DDR_P1_RIGHT },
{0x1E, IDS_DDR_P1_UP},
{0x1D, IDS_DDR_P1_DOWN},
{0x1C, IDS_DDR_P1_LEFT},
{0x1B, IDS_DDR_P1_RIGHT},
{ 0x01, IDS_DDR_P2_MENU_LIGHT },
{ 0x05, IDS_DDR_P2_TOP_LIGHT },
{ 0x04, IDS_DDR_P2_BOTTOM_LIGHT },
{0x01, IDS_DDR_P2_MENU_LIGHT},
{0x05, IDS_DDR_P2_TOP_LIGHT},
{0x04, IDS_DDR_P2_BOTTOM_LIGHT},
{ 0x16, IDS_DDR_P2_UP },
{ 0x15, IDS_DDR_P2_DOWN },
{ 0x14, IDS_DDR_P2_LEFT },
{ 0x13, IDS_DDR_P2_RIGHT },
{0x16, IDS_DDR_P2_UP},
{0x15, IDS_DDR_P2_DOWN},
{0x14, IDS_DDR_P2_LEFT},
{0x13, IDS_DDR_P2_RIGHT},
{ 0x0E, IDS_DDR_BASS_LIGHT }
};
{0x0E, IDS_DDR_BASS_LIGHT}};
static const struct action_def pnm_actions[] = {
{ 0x07, IDS_GENERIC_TEST },
{ 0x06, IDS_GENERIC_SERVICE },
static const struct action_def pnm_actions[] = {{0x07, IDS_GENERIC_TEST},
{0x06, IDS_GENERIC_SERVICE},
{ 0x08, IDS_PNM_BTN1 },
{ 0x09, IDS_PNM_BTN2 },
{ 0x0A, IDS_PNM_BTN3 },
{ 0x0B, IDS_PNM_BTN4 },
{ 0x0C, IDS_PNM_BTN5 },
{ 0x0D, IDS_PNM_BTN6 },
{ 0x0E, IDS_PNM_BTN7 },
{ 0x0F, IDS_PNM_BTN8 },
{ 0x10, IDS_PNM_BTN9 }
};
{0x08, IDS_PNM_BTN1},
{0x09, IDS_PNM_BTN2},
{0x0A, IDS_PNM_BTN3},
{0x0B, IDS_PNM_BTN4},
{0x0C, IDS_PNM_BTN5},
{0x0D, IDS_PNM_BTN6},
{0x0E, IDS_PNM_BTN7},
{0x0F, IDS_PNM_BTN8},
{0x10, IDS_PNM_BTN9}};
static const struct light_def pnm_lights[] = {
{ 0x17, IDS_PNM_BTN1 },
{ 0x18, IDS_PNM_BTN2 },
{ 0x19, IDS_PNM_BTN3 },
{ 0x1A, IDS_PNM_BTN4 },
{ 0x1B, IDS_PNM_BTN5 },
{ 0x1C, IDS_PNM_BTN6 },
{ 0x1D, IDS_PNM_BTN7 },
{ 0x1E, IDS_PNM_BTN8 },
{ 0x1F, IDS_PNM_BTN9 },
{0x17, IDS_PNM_BTN1},
{0x18, IDS_PNM_BTN2},
{0x19, IDS_PNM_BTN3},
{0x1A, IDS_PNM_BTN4},
{0x1B, IDS_PNM_BTN5},
{0x1C, IDS_PNM_BTN6},
{0x1D, IDS_PNM_BTN7},
{0x1E, IDS_PNM_BTN8},
{0x1F, IDS_PNM_BTN9},
};
static const struct action_def jb_actions[] = {
{ 0x10, IDS_GENERIC_TEST },
{ 0x11, IDS_GENERIC_SERVICE },
static const struct action_def jb_actions[] = {{0x10, IDS_GENERIC_TEST},
{0x11, IDS_GENERIC_SERVICE},
{ 0x00, IDS_JB_PANEL1 },
{ 0x01, IDS_JB_PANEL2 },
{ 0x02, IDS_JB_PANEL3 },
{ 0x03, IDS_JB_PANEL4 },
{ 0x04, IDS_JB_PANEL5 },
{ 0x05, IDS_JB_PANEL6 },
{ 0x06, IDS_JB_PANEL7 },
{ 0x07, IDS_JB_PANEL8 },
{ 0x08, IDS_JB_PANEL9 },
{ 0x09, IDS_JB_PANEL10 },
{ 0x0A, IDS_JB_PANEL11 },
{ 0x0B, IDS_JB_PANEL12 },
{ 0x0C, IDS_JB_PANEL13 },
{ 0x0D, IDS_JB_PANEL14 },
{ 0x0E, IDS_JB_PANEL15 },
{ 0x0F, IDS_JB_PANEL16 }
};
{0x00, IDS_JB_PANEL1},
{0x01, IDS_JB_PANEL2},
{0x02, IDS_JB_PANEL3},
{0x03, IDS_JB_PANEL4},
{0x04, IDS_JB_PANEL5},
{0x05, IDS_JB_PANEL6},
{0x06, IDS_JB_PANEL7},
{0x07, IDS_JB_PANEL8},
{0x08, IDS_JB_PANEL9},
{0x09, IDS_JB_PANEL10},
{0x0A, IDS_JB_PANEL11},
{0x0B, IDS_JB_PANEL12},
{0x0C, IDS_JB_PANEL13},
{0x0D, IDS_JB_PANEL14},
{0x0E, IDS_JB_PANEL15},
{0x0F, IDS_JB_PANEL16}};
static const struct light_def jb_lights[] = {
{ 0x00, IDS_JB_RGB_FRONT_R },
{ 0x01, IDS_JB_RGB_FRONT_G },
{ 0x02, IDS_JB_RGB_FRONT_B },
{ 0x03, IDS_JB_RGB_TOP_R },
{ 0x04, IDS_JB_RGB_TOP_G },
{ 0x05, IDS_JB_RGB_TOP_B },
{ 0x06, IDS_JB_RGB_LEFT_R },
{ 0x07, IDS_JB_RGB_LEFT_G },
{ 0x08, IDS_JB_RGB_LEFT_B },
{ 0x09, IDS_JB_RGB_RIGHT_R },
{ 0x0A, IDS_JB_RGB_RIGHT_G },
{ 0x0B, IDS_JB_RGB_RIGHT_B },
{ 0x0C, IDS_JB_RGB_TITLE_R },
{ 0x0D, IDS_JB_RGB_TITLE_G },
{ 0x0E, IDS_JB_RGB_TITLE_B },
{ 0x0F, IDS_JB_RGB_WOOFER_R },
{ 0x10, IDS_JB_RGB_WOOFER_G },
{ 0x11, IDS_JB_RGB_WOOFER_B },
{0x00, IDS_JB_RGB_FRONT_R},
{0x01, IDS_JB_RGB_FRONT_G},
{0x02, IDS_JB_RGB_FRONT_B},
{0x03, IDS_JB_RGB_TOP_R},
{0x04, IDS_JB_RGB_TOP_G},
{0x05, IDS_JB_RGB_TOP_B},
{0x06, IDS_JB_RGB_LEFT_R},
{0x07, IDS_JB_RGB_LEFT_G},
{0x08, IDS_JB_RGB_LEFT_B},
{0x09, IDS_JB_RGB_RIGHT_R},
{0x0A, IDS_JB_RGB_RIGHT_G},
{0x0B, IDS_JB_RGB_RIGHT_B},
{0x0C, IDS_JB_RGB_TITLE_R},
{0x0D, IDS_JB_RGB_TITLE_G},
{0x0E, IDS_JB_RGB_TITLE_B},
{0x0F, IDS_JB_RGB_WOOFER_R},
{0x10, IDS_JB_RGB_WOOFER_G},
{0x11, IDS_JB_RGB_WOOFER_B},
};
static const struct action_def sdvx_actions[] = {
{ 0x05, IDS_GENERIC_TEST },
{ 0x04, IDS_GENERIC_SERVICE },
{ 0x0B, IDS_SDVX_START },
{ 0x0A, IDS_SDVX_BTN_A },
{ 0x09, IDS_SDVX_BTN_B },
{ 0x08, IDS_SDVX_BTN_C },
{ 0x15, IDS_SDVX_BTN_D },
{ 0x14, IDS_SDVX_FX_L },
{ 0x13, IDS_SDVX_FX_R }
};
static const struct action_def sdvx_actions[] = {{0x05, IDS_GENERIC_TEST},
{0x04, IDS_GENERIC_SERVICE},
{0x0B, IDS_SDVX_START},
{0x0A, IDS_SDVX_BTN_A},
{0x09, IDS_SDVX_BTN_B},
{0x08, IDS_SDVX_BTN_C},
{0x15, IDS_SDVX_BTN_D},
{0x14, IDS_SDVX_FX_L},
{0x13, IDS_SDVX_FX_R}};
static const struct light_def sdvx_lights[] = {
{ 0x0D, IDS_SDVX_BTN_A },
{ 0x0E, IDS_SDVX_BTN_B },
{ 0x0F, IDS_SDVX_BTN_C },
{ 0x00, IDS_SDVX_BTN_D },
{ 0x01, IDS_SDVX_FX_L },
{ 0x02, IDS_SDVX_FX_R },
{ 0x0C, IDS_SDVX_START },
{ 0x10, IDS_SDVX_RGB1_R },
{ 0x11, IDS_SDVX_RGB1_G },
{ 0x12, IDS_SDVX_RGB1_B },
{ 0x13, IDS_SDVX_RGB2_R },
{ 0x14, IDS_SDVX_RGB2_G },
{ 0x15, IDS_SDVX_RGB2_B },
{ 0x16, IDS_SDVX_RGB3_R },
{ 0x17, IDS_SDVX_RGB3_G },
{ 0x18, IDS_SDVX_RGB3_B },
{ 0x19, IDS_SDVX_RGB4_R },
{ 0x1A, IDS_SDVX_RGB4_G },
{ 0x1B, IDS_SDVX_RGB4_B },
{ 0x1C, IDS_SDVX_RGB5_R },
{ 0x1D, IDS_SDVX_RGB5_G },
{ 0x1E, IDS_SDVX_RGB5_B },
{ 0x1F, IDS_SDVX_RGB6_R },
{ 0x20, IDS_SDVX_RGB6_G },
{ 0x21, IDS_SDVX_RGB6_B }
};
{0x0D, IDS_SDVX_BTN_A}, {0x0E, IDS_SDVX_BTN_B}, {0x0F, IDS_SDVX_BTN_C},
{0x00, IDS_SDVX_BTN_D}, {0x01, IDS_SDVX_FX_L}, {0x02, IDS_SDVX_FX_R},
{0x0C, IDS_SDVX_START}, {0x10, IDS_SDVX_RGB1_R}, {0x11, IDS_SDVX_RGB1_G},
{0x12, IDS_SDVX_RGB1_B}, {0x13, IDS_SDVX_RGB2_R}, {0x14, IDS_SDVX_RGB2_G},
{0x15, IDS_SDVX_RGB2_B}, {0x16, IDS_SDVX_RGB3_R}, {0x17, IDS_SDVX_RGB3_G},
{0x18, IDS_SDVX_RGB3_B}, {0x19, IDS_SDVX_RGB4_R}, {0x1A, IDS_SDVX_RGB4_G},
{0x1B, IDS_SDVX_RGB4_B}, {0x1C, IDS_SDVX_RGB5_R}, {0x1D, IDS_SDVX_RGB5_G},
{0x1E, IDS_SDVX_RGB5_B}, {0x1F, IDS_SDVX_RGB6_R}, {0x20, IDS_SDVX_RGB6_G},
{0x21, IDS_SDVX_RGB6_B}};
static const struct analog_def sdvx_analogs[] = {
{ 0, IDS_SDVX_VOL_L },
{ 1, IDS_SDVX_VOL_R }
};
static const struct analog_def sdvx_analogs[] = {{0, IDS_SDVX_VOL_L},
{1, IDS_SDVX_VOL_R}};
static const struct action_def rb_actions[] = {
{ 0x00, IDS_GENERIC_TEST },
{ 0x01, IDS_GENERIC_SERVICE }
};
static const struct action_def rb_actions[] = {{0x00, IDS_GENERIC_TEST},
{0x01, IDS_GENERIC_SERVICE}};
static const struct action_def bst_actions[] = {
{ 0x05, IDS_GENERIC_TEST },
{ 0x04, IDS_GENERIC_SERVICE },
{0x05, IDS_GENERIC_TEST},
{0x04, IDS_GENERIC_SERVICE},
};
static const struct eam_unit_def schema_eam_unit_defs[] = {
{ IDS_READER_P1, 0 },
{ IDS_READER_P2, 1 }
};
static const struct eam_unit_def schema_eam_unit_defs[] = {{IDS_READER_P1, 0},
{IDS_READER_P2, 1}};
const struct schema schemas[] = {
{ "iidx", IDS_IIDX_SCHEMA,
iidx_actions, lengthof(iidx_actions),
iidx_lights, lengthof(iidx_lights),
iidx_analogs, lengthof(iidx_analogs),
schema_eam_unit_defs, 2 },
const struct schema schemas[] = {
{"iidx",
IDS_IIDX_SCHEMA,
iidx_actions,
lengthof(iidx_actions),
iidx_lights,
lengthof(iidx_lights),
iidx_analogs,
lengthof(iidx_analogs),
schema_eam_unit_defs,
2},
{ "pnm", IDS_PNM_SCHEMA,
pnm_actions, lengthof(pnm_actions),
pnm_lights, lengthof(pnm_lights),
NULL, 0,
schema_eam_unit_defs, 1 },
{"pnm",
IDS_PNM_SCHEMA,
pnm_actions,
lengthof(pnm_actions),
pnm_lights,
lengthof(pnm_lights),
NULL,
0,
schema_eam_unit_defs,
1},
{ "gf", IDS_GF_SCHEMA,
gf_actions, lengthof(gf_actions),
gf_lights, lengthof(gf_lights),
NULL, 0,
schema_eam_unit_defs, 2 },
{"gf",
IDS_GF_SCHEMA,
gf_actions,
lengthof(gf_actions),
gf_lights,
lengthof(gf_lights),
NULL,
0,
schema_eam_unit_defs,
2},
{ "dm", IDS_DM_SCHEMA,
dm_actions, lengthof(dm_actions),
dm_lights, lengthof(dm_lights),
NULL, 0,
schema_eam_unit_defs, 1 },
{"dm",
IDS_DM_SCHEMA,
dm_actions,
lengthof(dm_actions),
dm_lights,
lengthof(dm_lights),
NULL,
0,
schema_eam_unit_defs,
1},
{ "ddr", IDS_DDR_SCHEMA,
ddr_actions, lengthof(ddr_actions),
ddr_lights, lengthof(ddr_lights),
NULL, 0,
schema_eam_unit_defs, 2 },
{"ddr",
IDS_DDR_SCHEMA,
ddr_actions,
lengthof(ddr_actions),
ddr_lights,
lengthof(ddr_lights),
NULL,
0,
schema_eam_unit_defs,
2},
{ "jb", IDS_JB_SCHEMA,
jb_actions, lengthof(jb_actions),
jb_lights, lengthof(jb_lights),
NULL, 0,
schema_eam_unit_defs, 1 },
{"jb",
IDS_JB_SCHEMA,
jb_actions,
lengthof(jb_actions),
jb_lights,
lengthof(jb_lights),
NULL,
0,
schema_eam_unit_defs,
1},
{ "sdvx", IDS_SDVX_SCHEMA,
sdvx_actions, lengthof(sdvx_actions),
sdvx_lights, lengthof(sdvx_lights),
sdvx_analogs, lengthof(sdvx_analogs),
schema_eam_unit_defs, 1 },
{"sdvx",
IDS_SDVX_SCHEMA,
sdvx_actions,
lengthof(sdvx_actions),
sdvx_lights,
lengthof(sdvx_lights),
sdvx_analogs,
lengthof(sdvx_analogs),
schema_eam_unit_defs,
1},
{ "rb", IDS_RB_SCHEMA,
rb_actions, lengthof(rb_actions),
NULL, 0,
NULL, 0,
schema_eam_unit_defs, 1 },
{"rb",
IDS_RB_SCHEMA,
rb_actions,
lengthof(rb_actions),
NULL,
0,
NULL,
0,
schema_eam_unit_defs,
1},
{ "bst", IDS_BST_SCHEMA,
bst_actions, lengthof(bst_actions),
NULL, 0,
NULL, 0,
schema_eam_unit_defs, 1 },
{"bst",
IDS_BST_SCHEMA,
bst_actions,
lengthof(bst_actions),
NULL,
0,
NULL,
0,
schema_eam_unit_defs,
1},
};
const size_t nschemas = lengthof(schemas);
+38 -37
View File
@@ -12,10 +12,7 @@
#include "util/log.h"
#include "util/mem.h"
enum snap_control_heuristic {
CONTROL_CENTERING_AXIS,
CONTROL_MULTISWITCH
};
enum snap_control_heuristic { CONTROL_CENTERING_AXIS, CONTROL_MULTISWITCH };
struct snap_known_control {
uint32_t usage;
@@ -24,32 +21,34 @@ struct snap_known_control {
static struct snap_known_control snap_known_controls[] = {
/* X axis */
{ 0x00010030, CONTROL_CENTERING_AXIS },
{0x00010030, CONTROL_CENTERING_AXIS},
/* Y axis */
{ 0x00010031, CONTROL_CENTERING_AXIS },
{0x00010031, CONTROL_CENTERING_AXIS},
/* Z axis */
{ 0x00010032, CONTROL_CENTERING_AXIS },
{0x00010032, CONTROL_CENTERING_AXIS},
/* X rotation */
{ 0x00010033, CONTROL_CENTERING_AXIS },
{0x00010033, CONTROL_CENTERING_AXIS},
/* Y rotation */
{ 0x00010034, CONTROL_CENTERING_AXIS },
{0x00010034, CONTROL_CENTERING_AXIS},
/* Z rotation */
{ 0x00010035, CONTROL_CENTERING_AXIS },
{0x00010035, CONTROL_CENTERING_AXIS},
/* I don't have an adapter that presents a slider/dial/wheel so I don't
know how to deal with those things right now */
/* Hat switch */
{ 0x00010039, CONTROL_MULTISWITCH }
};
{0x00010039, CONTROL_MULTISWITCH}};
static bool snap_check_for_edge(const struct hid_control *ctl, int32_t val,
int32_t other_val, struct mapped_action *ma);
static bool snap_check_for_edge(
const struct hid_control *ctl,
int32_t val,
int32_t other_val,
struct mapped_action *ma);
void snap_init(struct snap *snap)
{
@@ -63,10 +62,8 @@ void snap_init(struct snap *snap)
ndevs = 0;
for (pos = hid_mgr_get_first_stub()
; pos != NULL
; pos = hid_mgr_get_next_stub(pos)) {
for (pos = hid_mgr_get_first_stub(); pos != NULL;
pos = hid_mgr_get_next_stub(pos)) {
ndevs++;
}
@@ -75,10 +72,8 @@ void snap_init(struct snap *snap)
i = 0;
for (pos = hid_mgr_get_first_stub(), i = 0
; pos != NULL && i < ndevs
; pos = hid_mgr_get_next_stub(pos), i++) {
for (pos = hid_mgr_get_first_stub(), i = 0; pos != NULL && i < ndevs;
pos = hid_mgr_get_next_stub(pos), i++) {
if (!hid_stub_is_attached(pos)) {
continue;
}
@@ -89,13 +84,13 @@ void snap_init(struct snap *snap)
snap->devs[i].hid = pos;
snap->devs[i].ncontrols = ncontrols;
snap->devs[i].controls = xcalloc(ncontrols
* sizeof(struct hid_control));
snap->devs[i].controls =
xcalloc(ncontrols * sizeof(struct hid_control));
snap->devs[i].states = xcalloc(ncontrols * sizeof(int32_t));
hid_stub_get_controls(pos, snap->devs[i].controls, &ncontrols);
for (j = 0 ; j < ncontrols ; j++) {
for (j = 0; j < ncontrols; j++) {
hid_stub_get_value(pos, j, &snap->devs[i].states[j]);
}
}
@@ -103,8 +98,10 @@ void snap_init(struct snap *snap)
hid_mgr_unlock();
}
bool snap_find_edge(const struct snap *snap, const struct snap *other_snap,
struct mapped_action *ma)
bool snap_find_edge(
const struct snap *snap,
const struct snap *other_snap,
struct mapped_action *ma)
{
const struct hid_control *ctl;
int32_t val;
@@ -125,7 +122,7 @@ bool snap_find_edge(const struct snap *snap, const struct snap *other_snap,
return false;
}
for (i = 0 ; i < snap->ndevs ; i++) {
for (i = 0; i < snap->ndevs; i++) {
if (snap->devs[i].hid != other_snap->devs[i].hid) {
return false;
}
@@ -134,12 +131,14 @@ bool snap_find_edge(const struct snap *snap, const struct snap *other_snap,
return false;
}
if (memcmp(snap->devs[i].controls, other_snap->devs[i].controls,
if (memcmp(
snap->devs[i].controls,
other_snap->devs[i].controls,
snap->devs[i].ncontrols * sizeof(struct hid_control)) != 0) {
return false;
}
for (j = 0 ; j < snap->devs[i].ncontrols ; j++) {
for (j = 0; j < snap->devs[i].ncontrols; j++) {
ctl = &snap->devs[i].controls[j];
val = snap->devs[i].states[j];
other_val = other_snap->devs[i].states[j];
@@ -156,8 +155,11 @@ bool snap_find_edge(const struct snap *snap, const struct snap *other_snap,
return false;
}
static bool snap_check_for_edge(const struct hid_control *ctl, int32_t val,
int32_t other_val, struct mapped_action *ma)
static bool snap_check_for_edge(
const struct hid_control *ctl,
int32_t val,
int32_t other_val,
struct mapped_action *ma)
{
size_t i;
int32_t range;
@@ -179,7 +181,7 @@ static bool snap_check_for_edge(const struct hid_control *ctl, int32_t val,
} else {
/* Here we kinda have to take things on a case by case basis */
for (i = 0 ; i < lengthof(snap_known_controls) ; i++) {
for (i = 0; i < lengthof(snap_known_controls); i++) {
if (snap_known_controls[i].usage != ctl->usage) {
continue;
}
@@ -213,8 +215,8 @@ static bool snap_check_for_edge(const struct hid_control *ctl, int32_t val,
/* Assume positions are discrete. Precisely match any
transitioned-to value that isn't a null state. */
if (val >= ctl->value_min && val <= ctl->value_max
&& val != other_val) {
if (val >= ctl->value_min && val <= ctl->value_max &&
val != other_val) {
ma->value_min = val;
ma->value_max = val;
@@ -237,11 +239,10 @@ void snap_fini(struct snap *snap)
{
size_t i;
for (i = 0 ; i < snap->ndevs ; i++) {
for (i = 0; i < snap->ndevs; i++) {
free(snap->devs[i].states);
free(snap->devs[i].controls);
}
free(snap->devs);
}
+4 -2
View File
@@ -20,8 +20,10 @@ struct snap {
};
void snap_init(struct snap *snap);
bool snap_find_edge(const struct snap *snap, const struct snap *other_snap,
struct mapped_action *ma);
bool snap_find_edge(
const struct snap *snap,
const struct snap *other_snap,
struct mapped_action *ma);
void snap_fini(struct snap *snap);
#endif
+25 -22
View File
@@ -4,15 +4,15 @@
#include <stdint.h>
#include <string.h>
#define METRIC_COLOR RGB(0, 0, 0)
#define METRIC_RADIUS_CIRCLE 0.8f
#define METRIC_RADIUS_NOTCH 0.2f
#define METRIC_THICKNESS 3
#define METRIC_COLOR RGB(0, 0, 0)
#define METRIC_RADIUS_CIRCLE 0.8f
#define METRIC_RADIUS_NOTCH 0.2f
#define METRIC_THICKNESS 3
static const wchar_t spinner_cls[] = L"spinner";
static LRESULT CALLBACK spinner_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam);
static LRESULT CALLBACK
spinner_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static LRESULT spinner_handle_paint(HWND hwnd);
static LRESULT spinner_handle_update(HWND hwnd, uint8_t pos);
@@ -24,14 +24,14 @@ void spinner_init(HINSTANCE inst)
wcx.cbSize = sizeof(wcx);
wcx.lpfnWndProc = spinner_wnd_proc;
wcx.hInstance = inst;
wcx.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
wcx.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wcx.lpszClassName = spinner_cls;
RegisterClassEx(&wcx);
}
static LRESULT CALLBACK spinner_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam,
LPARAM lparam)
static LRESULT CALLBACK
spinner_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg) {
case WM_CREATE:
@@ -80,22 +80,26 @@ static LRESULT spinner_handle_paint(HWND hwnd)
SelectObject(dc, pen);
SelectObject(dc, GetStockObject(WHITE_BRUSH));
Ellipse(dc,
(int) (cx * (1.0f - METRIC_RADIUS_CIRCLE)),
(int) (cy * (1.0f - METRIC_RADIUS_CIRCLE)),
(int) (cx * (1.0f + METRIC_RADIUS_CIRCLE)),
(int) (cy * (1.0f + METRIC_RADIUS_CIRCLE)));
Ellipse(
dc,
(int) (cx * (1.0f - METRIC_RADIUS_CIRCLE)),
(int) (cy * (1.0f - METRIC_RADIUS_CIRCLE)),
(int) (cx * (1.0f + METRIC_RADIUS_CIRCLE)),
(int) (cy * (1.0f + METRIC_RADIUS_CIRCLE)));
dx = sinf(theta);
dx = sinf(theta);
dy = -cosf(theta);
MoveToEx(dc,
(int) (cx * (1.0f + dx * METRIC_RADIUS_NOTCH)),
(int) (cy * (1.0f + dy * METRIC_RADIUS_NOTCH)), NULL);
MoveToEx(
dc,
(int) (cx * (1.0f + dx * METRIC_RADIUS_NOTCH)),
(int) (cy * (1.0f + dy * METRIC_RADIUS_NOTCH)),
NULL);
LineTo(dc,
(int) (cx * (1.0f + dx * METRIC_RADIUS_CIRCLE)),
(int) (cy * (1.0f + dy * METRIC_RADIUS_CIRCLE)));
LineTo(
dc,
(int) (cx * (1.0f + dx * METRIC_RADIUS_CIRCLE)),
(int) (cy * (1.0f + dy * METRIC_RADIUS_CIRCLE)));
DeleteObject(pen);
EndPaint(hwnd, &ps);
@@ -115,4 +119,3 @@ void spinner_fini(HINSTANCE inst)
{
UnregisterClass(spinner_cls, inst);
}
+14 -13
View File
@@ -50,8 +50,8 @@ void usages_init(HINSTANCE inst)
nchars = strlen(line);
if (nchars == 0 || line[0] == '#'
|| strspn(line, " \t\r\n") == nchars) {
if (nchars == 0 || line[0] == '#' ||
strspn(line, " \t\r\n") == nchars) {
continue;
}
@@ -59,8 +59,9 @@ void usages_init(HINSTANCE inst)
if (!isspace(line[0])) {
if (!usages_begin_page(line, &tmp_page)) {
log_fatal("IDR_USAGES:%u: Invalid usage page",
(unsigned int) line_no);
log_fatal(
"IDR_USAGES:%u: Invalid usage page",
(unsigned int) line_no);
break;
}
@@ -69,15 +70,16 @@ void usages_init(HINSTANCE inst)
memcpy(cur_page, &tmp_page, sizeof(tmp_page));
} else {
if (cur_page == NULL) {
log_fatal("IDR_USAGES:%u: Usage before first page",
(unsigned int) line_no);
log_fatal(
"IDR_USAGES:%u: Usage before first page",
(unsigned int) line_no);
break;
}
if (!usages_read_usage(line, cur_page)) {
log_fatal("IDR_USAGES:%u: Invalid usage",
(unsigned int) line_no);
log_fatal(
"IDR_USAGES:%u: Invalid usage", (unsigned int) line_no);
break;
}
@@ -134,16 +136,16 @@ void usages_get(char *chars, size_t nchars, uint32_t usage_id)
size_t j;
hi = ((usage_id >> 16) & 0xFFFF);
lo = ((usage_id >> 0) & 0xFFFF);
lo = ((usage_id >> 0) & 0xFFFF);
for (i = 0 ; i < usages.nitems ; i++) {
for (i = 0; i < usages.nitems; i++) {
page = array_item(struct usage_page, &usages, i);
if (page->id != hi) {
continue;
}
for (j = 0 ; j < page->usages.nitems ; j++) {
for (j = 0; j < page->usages.nitems; j++) {
usage = array_item(struct usage, &page->usages, j);
if (usage->id == lo) {
@@ -168,10 +170,9 @@ void usages_fini(void)
{
size_t i;
for (i = 0 ; i < usages.nitems ; i++) {
for (i = 0; i < usages.nitems; i++) {
array_fini(&array_item(struct usage_page, &usages, i)->usages);
}
array_fini(&usages);
}