mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-10 09:56:23 +00:00
General codebase clean-ups (no code changes)
* Remove trailing spaces * Replace TABs with spaces * Add missing indentation
This commit is contained in:
@@ -64,7 +64,7 @@ static void on_cec_keypress(void* userdata, const cec_keypress* key) {
|
||||
value = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (value != 0) {
|
||||
short code = 0x80 << 8 | value;
|
||||
LiSendKeyboardEvent(code, (key->duration > 0)?KEY_ACTION_UP:KEY_ACTION_DOWN, 0);
|
||||
@@ -80,25 +80,25 @@ void cec_init() {
|
||||
snprintf(g_config.strDeviceName, sizeof(g_config.strDeviceName), "Moonlight");
|
||||
g_config.callbacks = &g_callbacks;
|
||||
g_config.deviceTypes.types[0] = CEC_DEVICE_TYPE_PLAYBACK_DEVICE;
|
||||
|
||||
|
||||
if (libcecc_initialise(&g_config, &g_iface, NULL) != 1) {
|
||||
fprintf(stderr, "Failed to initialize libcec interface\n");
|
||||
fflush(stderr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
g_iface.init_video_standalone(g_iface.connection);
|
||||
|
||||
|
||||
cec_adapter devices[10];
|
||||
int8_t iDevicesFound = g_iface.find_adapters(g_iface.connection, devices, sizeof(devices) / sizeof(devices), NULL);
|
||||
|
||||
|
||||
if (iDevicesFound <= 0) {
|
||||
fprintf(stderr, "No CEC devices found\n");
|
||||
fflush(stderr);
|
||||
libcecc_destroy(&g_iface);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
strcpy(g_strPort, devices[0].comm);
|
||||
if (!g_iface.open(g_iface.connection, g_strPort, 5000)) {
|
||||
fprintf(stderr, "Unable to open the device on port %s\n", g_strPort);
|
||||
@@ -106,6 +106,6 @@ void cec_init() {
|
||||
libcecc_destroy(&g_iface);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
g_iface.set_active_source(g_iface.connection, g_config.deviceTypes.types[0]);
|
||||
}
|
||||
|
||||
@@ -645,7 +645,7 @@ void evdev_map(char* device) {
|
||||
char* buf = str_guid;
|
||||
for (int i = 0; i < 16; i++)
|
||||
buf += sprintf(buf, "%02x", ((unsigned char*) guid)[i]);
|
||||
|
||||
|
||||
struct mapping map;
|
||||
strncpy(map.name, libevdev_get_name(evdev), sizeof(map.name));
|
||||
strncpy(map.guid, str_guid, sizeof(map.guid));
|
||||
|
||||
@@ -28,20 +28,20 @@ struct mapping {
|
||||
|
||||
bool reverse_leftx, reverse_lefty;
|
||||
bool reverse_rightx, reverse_righty;
|
||||
|
||||
|
||||
short abs_leftx, abs_lefty;
|
||||
short abs_rightx, abs_righty;
|
||||
|
||||
short hat_dpright, hat_dpleft, hat_dpup, hat_dpdown;
|
||||
short hat_dir_dpright, hat_dir_dpleft, hat_dir_dpup, hat_dir_dpdown;
|
||||
short btn_dpup, btn_dpdown, btn_dpleft, btn_dpright;
|
||||
|
||||
|
||||
short btn_a, btn_x, btn_y, btn_b;
|
||||
short btn_back, btn_start, btn_guide;
|
||||
short btn_leftstick, btn_rightstick;
|
||||
short btn_leftshoulder, btn_rightshoulder;
|
||||
|
||||
short abs_lefttrigger, abs_righttrigger;
|
||||
|
||||
short abs_lefttrigger, abs_righttrigger;
|
||||
short btn_lefttrigger, btn_righttrigger;
|
||||
|
||||
struct mapping* next;
|
||||
|
||||
Reference in New Issue
Block a user