fixed OpenRazer compiling error on windows

This commit is contained in:
Cooper Hall 2023-07-10 19:51:27 +00:00 committed by Adam Honse
parent 3ee6af0dfd
commit 14c74248dd
2 changed files with 251 additions and 251 deletions

View file

@ -22,9 +22,9 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
{
switch(matrix_type)
{
case RAZER_TYPE_MATRIX_FRAME:
case RAZER_TYPE_MATRIX_NOFRAME:
case RAZER_TYPE_MATRIX_STATIC:
case OPEN_RAZER_TYPE_MATRIX_FRAME:
case OPEN_RAZER_TYPE_MATRIX_NOFRAME:
case OPEN_RAZER_TYPE_MATRIX_STATIC:
{
char update_value = 1;
@ -34,7 +34,7 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
unsigned int output_offset;
unsigned int row_offset = (row * matrix_cols);
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
output_array_size = 3 + (matrix_cols* 3);
output_offset = 3;
@ -47,7 +47,7 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
char* output_array = new char[output_array_size];
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
output_array[0] = row;
output_array[1] = 0;
@ -62,17 +62,17 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
output_array[(col * 3) + 2 + output_offset] = (char)RGBGetBValue(colors[color_idx]);
}
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
razer_functions->matrix_custom_frame->store(razer_device, NULL, output_array, output_array_size);
open_razer_functions->matrix_custom_frame->store(open_razer_device, NULL, output_array, output_array_size);
}
else if(matrix_type == RAZER_TYPE_MATRIX_NOFRAME)
else if(matrix_type == OPEN_RAZER_TYPE_MATRIX_NOFRAME)
{
razer_functions->matrix_effect_custom->store(razer_device, NULL, output_array, output_array_size);
open_razer_functions->matrix_effect_custom->store(open_razer_device, NULL, output_array, output_array_size);
}
else
{
razer_functions->matrix_effect_static->store(razer_device, NULL, output_array, output_array_size);
open_razer_functions->matrix_effect_static->store(open_razer_device, NULL, output_array, output_array_size);
}
delete[] output_array;
@ -80,14 +80,14 @@ void RGBController_OpenRazer::DeviceUpdateLEDs()
std::this_thread::sleep_for(1ms);
}
if(matrix_type == RAZER_TYPE_MATRIX_FRAME)
if(matrix_type == OPEN_RAZER_TYPE_MATRIX_FRAME)
{
razer_functions->matrix_effect_custom->store(razer_device, NULL, &update_value, 1);
open_razer_functions->matrix_effect_custom->store(open_razer_device, NULL, &update_value, 1);
}
}
break;
case RAZER_TYPE_NOMATRIX:
case OPEN_RAZER_TYPE_NOMATRIX:
{
DeviceUpdateMode();
}
@ -105,17 +105,17 @@ void RGBController_OpenRazer::UpdateSingleLED(int /*led*/)
DeviceUpdateLEDs();
}
void RGBController_OpenRazer::SetupMatrixDevice(device_fn_type* razer_functions, unsigned int rows, unsigned int cols)
void RGBController_OpenRazer::SetupMatrixDevice(device_fn_type* open_razer_functions, unsigned int rows, unsigned int cols)
{
if(!razer_functions->matrix_custom_frame)
if(!open_razer_functions->matrix_custom_frame)
{
if(!razer_functions->matrix_effect_custom)
if(!open_razer_functions->matrix_effect_custom)
{
matrix_type = RAZER_TYPE_MATRIX_STATIC;
matrix_type = OPEN_RAZER_TYPE_MATRIX_STATIC;
}
else
{
matrix_type = RAZER_TYPE_MATRIX_NOFRAME;
matrix_type = OPEN_RAZER_TYPE_MATRIX_NOFRAME;
}
matrix_rows = 1;
@ -123,7 +123,7 @@ void RGBController_OpenRazer::SetupMatrixDevice(device_fn_type* razer_functions,
}
else
{
matrix_type = RAZER_TYPE_MATRIX_FRAME;
matrix_type = OPEN_RAZER_TYPE_MATRIX_FRAME;
matrix_rows = rows;
matrix_cols = cols;
@ -132,7 +132,7 @@ void RGBController_OpenRazer::SetupMatrixDevice(device_fn_type* razer_functions,
void RGBController_OpenRazer::SetupNonMatrixDevice()
{
matrix_type = RAZER_TYPE_NOMATRIX;
matrix_type = OPEN_RAZER_TYPE_NOMATRIX;
}
/**------------------------------------------------------------------*\
@ -147,12 +147,12 @@ void RGBController_OpenRazer::SetupNonMatrixDevice()
the in built Razer controller.
\*-------------------------------------------------------------------*/
RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_fn_type* razer_functions)
RGBController_OpenRazer::RGBController_OpenRazer(device * open_razer_device, device_fn_type* open_razer_functions)
{
char string_buf[1024];
this->razer_device = razer_device;
this->razer_functions = razer_functions;
this->open_razer_device = open_razer_device;
this->open_razer_functions = open_razer_functions;
/*-----------------------------------------------------------------*\
| Start device at -1. This indicates the device was not detected |
@ -162,7 +162,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*-----------------------------------------------------------------*\
| Get the device name from the OpenRazer driver |
\*-----------------------------------------------------------------*/
razer_functions->device_type->show(razer_device, NULL, string_buf);
open_razer_functions->device_type->show(open_razer_device, NULL, string_buf);
name = string_buf;
name.erase(std::remove(name.begin(), name.end(), '\n'), name.end());
name.erase(std::remove(name.begin(), name.end(), '\r'), name.end());
@ -180,7 +180,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*-----------------------------------------------------------------*\
| Get the serial number from the dev path |
\*-----------------------------------------------------------------*/
razer_functions->device_serial->show(razer_device, NULL, string_buf);
open_razer_functions->device_serial->show(open_razer_device, NULL, string_buf);
serial = string_buf;
serial.erase(std::remove(serial.begin(), serial.end(), '\n'), serial.end());
serial.erase(std::remove(serial.begin(), serial.end(), '\r'), serial.end());
@ -188,7 +188,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*-----------------------------------------------------------------*\
| Get the firmware version from the dev path |
\*-----------------------------------------------------------------*/
razer_functions->firmware_version->show(razer_device, NULL, string_buf);
open_razer_functions->firmware_version->show(open_razer_device, NULL, string_buf);
version = string_buf;
version.erase(std::remove(version.begin(), version.end(), '\n'), version.end());
version.erase(std::remove(version.begin(), version.end(), '\r'), version.end());
@ -201,7 +201,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*-----------------------------------------------------------------*\
| Loop through all known devices to look for a name match |
\*-----------------------------------------------------------------*/
for (unsigned int i = 0; i < RAZER_NUM_DEVICES; i++)
for (unsigned int i = 0; i < OPEN_RAZER_NUM_DEVICES; i++)
{
if (device_list[i]->name == name)
{
@ -218,11 +218,11 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has Direct mode if matrix_custom_frame exists |
\*---------------------------------------------------------*/
if(razer_functions->matrix_effect_custom)
if(open_razer_functions->matrix_effect_custom)
{
mode Direct;
Direct.name = "Direct";
Direct.value = RAZER_MODE_CUSTOM;
Direct.value = OPEN_RAZER_MODE_CUSTOM;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
@ -232,18 +232,18 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
| Device has Off mode if any _effect_none or any _state |
| exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_none
|| razer_functions->logo_matrix_effect_none
|| razer_functions->scroll_matrix_effect_none
|| razer_functions->left_matrix_effect_none
|| razer_functions->right_matrix_effect_none
/*|| razer_functions->backlight_led_state*/
|| razer_functions->logo_led_state
|| razer_functions->scroll_led_state)
if( open_razer_functions->matrix_effect_none
|| open_razer_functions->logo_matrix_effect_none
|| open_razer_functions->scroll_matrix_effect_none
|| open_razer_functions->left_matrix_effect_none
|| open_razer_functions->right_matrix_effect_none
/*|| open_razer_functions->backlight_led_state*/
|| open_razer_functions->logo_led_state
|| open_razer_functions->scroll_led_state)
{
mode Off;
Off.name = "Off";
Off.value = RAZER_MODE_OFF;
Off.value = OPEN_RAZER_MODE_OFF;
Off.flags = 0;
Off.color_mode = MODE_COLORS_NONE;
modes.push_back(Off);
@ -253,18 +253,18 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
| Device has Static mode if any _effect_static or any |
| _effect exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_static
|| razer_functions->logo_matrix_effect_static
|| razer_functions->scroll_matrix_effect_static
|| razer_functions->left_matrix_effect_static
|| razer_functions->right_matrix_effect_static
/*|| razer_functions->backlight_led_effect*/
|| razer_functions->logo_led_effect
|| razer_functions->scroll_led_effect)
if( open_razer_functions->matrix_effect_static
|| open_razer_functions->logo_matrix_effect_static
|| open_razer_functions->scroll_matrix_effect_static
|| open_razer_functions->left_matrix_effect_static
|| open_razer_functions->right_matrix_effect_static
/*|| open_razer_functions->backlight_led_effect*/
|| open_razer_functions->logo_led_effect
|| open_razer_functions->scroll_led_effect)
{
mode Static;
Static.name = "Static";
Static.value = RAZER_MODE_STATIC;
Static.value = OPEN_RAZER_MODE_STATIC;
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Static.colors_min = 1;
Static.colors_max = 1;
@ -276,15 +276,15 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has Breathing mode if any _effect_breath exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_breath
|| razer_functions->logo_matrix_effect_breath
|| razer_functions->scroll_matrix_effect_breath
|| razer_functions->left_matrix_effect_breath
|| razer_functions->right_matrix_effect_breath)
if( open_razer_functions->matrix_effect_breath
|| open_razer_functions->logo_matrix_effect_breath
|| open_razer_functions->scroll_matrix_effect_breath
|| open_razer_functions->left_matrix_effect_breath
|| open_razer_functions->right_matrix_effect_breath)
{
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = RAZER_MODE_BREATHING;
Breathing.value = OPEN_RAZER_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
Breathing.colors_min = 1;
Breathing.colors_max = 2;
@ -296,13 +296,13 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has limited Breathing mode if any _effect exists |
\*---------------------------------------------------------*/
if( /*razer_functions->backlight_led_effect ||*/
razer_functions->logo_led_effect
|| razer_functions->scroll_led_effect)
if( /*open_razer_functions->backlight_led_effect ||*/
open_razer_functions->logo_led_effect
|| open_razer_functions->scroll_led_effect)
{
mode Breathing;
Breathing.name = "Breathing";
Breathing.value = RAZER_MODE_BREATHING;
Breathing.value = OPEN_RAZER_MODE_BREATHING;
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Breathing.colors_min = 1;
Breathing.colors_max = 1;
@ -314,13 +314,13 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has Flashing mode if any _effect exists |
\*---------------------------------------------------------*/
if( /*razer_functions->backlight_led_effect ||*/
razer_functions->logo_led_effect
|| razer_functions->scroll_led_effect)
if( /*open_razer_functions->backlight_led_effect ||*/
open_razer_functions->logo_led_effect
|| open_razer_functions->scroll_led_effect)
{
mode Flashing;
Flashing.name = "Flashing";
Flashing.value = RAZER_MODE_FLASHING;
Flashing.value = OPEN_RAZER_MODE_FLASHING;
Flashing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
Flashing.colors_min = 1;
Flashing.colors_max = 1;
@ -333,18 +333,18 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
| Device has Spectrum Cycle mode if any _effect_spectrum or |
| _effect exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_spectrum
|| razer_functions->logo_matrix_effect_spectrum
|| razer_functions->scroll_matrix_effect_spectrum
|| razer_functions->left_matrix_effect_spectrum
|| razer_functions->right_matrix_effect_spectrum
/*|| razer_functions->backlight_led_effect*/
|| razer_functions->logo_led_effect
|| razer_functions->scroll_led_effect)
if( open_razer_functions->matrix_effect_spectrum
|| open_razer_functions->logo_matrix_effect_spectrum
|| open_razer_functions->scroll_matrix_effect_spectrum
|| open_razer_functions->left_matrix_effect_spectrum
|| open_razer_functions->right_matrix_effect_spectrum
/*|| open_razer_functions->backlight_led_effect*/
|| open_razer_functions->logo_led_effect
|| open_razer_functions->scroll_led_effect)
{
mode SpectrumCycle;
SpectrumCycle.name = "Spectrum Cycle";
SpectrumCycle.value = RAZER_MODE_SPECTRUM_CYCLE;
SpectrumCycle.value = OPEN_RAZER_MODE_SPECTRUM_CYCLE;
SpectrumCycle.flags = 0;
SpectrumCycle.color_mode = MODE_COLORS_NONE;
modes.push_back(SpectrumCycle);
@ -353,13 +353,13 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has Wave mode if any _effect_wave exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_wave
|| razer_functions->left_matrix_effect_wave
|| razer_functions->right_matrix_effect_wave)
if( open_razer_functions->matrix_effect_wave
|| open_razer_functions->left_matrix_effect_wave
|| open_razer_functions->right_matrix_effect_wave)
{
mode Wave;
Wave.name = "Wave";
Wave.value = RAZER_MODE_WAVE;
Wave.value = OPEN_RAZER_MODE_WAVE;
Wave.flags = MODE_FLAG_HAS_DIRECTION_LR;
Wave.direction = MODE_DIRECTION_RIGHT;
Wave.color_mode = MODE_COLORS_NONE;
@ -369,15 +369,15 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
/*---------------------------------------------------------*\
| Device has Reactive mode if any _effect_reactive exists |
\*---------------------------------------------------------*/
if( razer_functions->matrix_effect_reactive
|| razer_functions->logo_matrix_effect_reactive
|| razer_functions->scroll_matrix_effect_reactive
|| razer_functions->left_matrix_effect_reactive
|| razer_functions->right_matrix_effect_reactive)
if( open_razer_functions->matrix_effect_reactive
|| open_razer_functions->logo_matrix_effect_reactive
|| open_razer_functions->scroll_matrix_effect_reactive
|| open_razer_functions->left_matrix_effect_reactive
|| open_razer_functions->right_matrix_effect_reactive)
{
mode Reactive;
Reactive.name = "Reactive";
Reactive.value = RAZER_MODE_REACTIVE;
Reactive.value = OPEN_RAZER_MODE_REACTIVE;
Reactive.flags = 0;
Reactive.color_mode = MODE_COLORS_NONE;
modes.push_back(Reactive);
@ -388,7 +388,7 @@ RGBController_OpenRazer::RGBController_OpenRazer(device * razer_device, device_f
\*---------------------------------------------------------*/
if(device_list[i]->matrix_type == true)
{
SetupMatrixDevice(razer_functions, device_list[i]->rows, device_list[i]->cols);
SetupMatrixDevice(open_razer_functions, device_list[i]->rows, device_list[i]->cols);
}
else
{
@ -425,7 +425,7 @@ void RGBController_OpenRazer::SetupZones()
/*---------------------------------------------------------*\
| Fill in zone information based on device table |
\*---------------------------------------------------------*/
for(unsigned int zone_id = 0; zone_id < RAZER_MAX_ZONES; zone_id++)
for(unsigned int zone_id = 0; zone_id < OPEN_RAZER_MAX_ZONES; zone_id++)
{
if(device_list[device_index]->zones[zone_id] != NULL)
{
@ -514,7 +514,7 @@ void RGBController_OpenRazer::SetCustomMode()
/*---------------------------------------------------------*\
| If device supports custom mode, it will be mode index 0 |
\*---------------------------------------------------------*/
if(modes[0].value == RAZER_MODE_CUSTOM)
if(modes[0].value == OPEN_RAZER_MODE_CUSTOM)
{
active_mode = 0;
}
@ -525,7 +525,7 @@ void RGBController_OpenRazer::SetCustomMode()
{
for(unsigned int i = 0; i < modes.size(); i++)
{
if(modes[i].value == RAZER_MODE_STATIC)
if(modes[i].value == OPEN_RAZER_MODE_STATIC)
{
active_mode = i;
break;
@ -543,193 +543,193 @@ void RGBController_OpenRazer::DeviceUpdateMode()
switch(modes[active_mode].value)
{
case RAZER_MODE_CUSTOM:
if(razer_functions->matrix_effect_custom)
case OPEN_RAZER_MODE_CUSTOM:
if(open_razer_functions->matrix_effect_custom)
{
razer_functions->matrix_effect_custom->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_custom->store(open_razer_device, NULL, update_value, 1);
}
break;
case RAZER_MODE_OFF:
if(razer_functions->matrix_effect_none)
case OPEN_RAZER_MODE_OFF:
if(open_razer_functions->matrix_effect_none)
{
razer_functions->matrix_effect_none->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_none->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->logo_matrix_effect_none)
if(open_razer_functions->logo_matrix_effect_none)
{
razer_functions->logo_matrix_effect_none->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_matrix_effect_none->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_matrix_effect_none)
if(open_razer_functions->scroll_matrix_effect_none)
{
razer_functions->scroll_matrix_effect_none->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_matrix_effect_none->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->left_matrix_effect_none)
if(open_razer_functions->left_matrix_effect_none)
{
razer_functions->left_matrix_effect_none->store(razer_device, NULL, update_value, 1);
open_razer_functions->left_matrix_effect_none->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->right_matrix_effect_none)
if(open_razer_functions->right_matrix_effect_none)
{
razer_functions->right_matrix_effect_none->store(razer_device, NULL, update_value, 1);
open_razer_functions->right_matrix_effect_none->store(open_razer_device, NULL, update_value, 1);
}
//if(razer_functions->backlight_led_state)
//if(open_razer_functions->backlight_led_state)
//{
// update_value[0] = '0';
// razer_functions->backlight_led_state->store(razer_device, NULL, update_value, 1);
// open_razer_functions->backlight_led_state->store(open_razer_device, NULL, update_value, 1);
//}
if(razer_functions->logo_led_state)
if(open_razer_functions->logo_led_state)
{
update_value[0] = '0';
razer_functions->logo_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_led_state)
if(open_razer_functions->scroll_led_state)
{
update_value[0] = '0';
razer_functions->scroll_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_led_state->store(open_razer_device, NULL, update_value, 1);
}
break;
case RAZER_MODE_STATIC:
case OPEN_RAZER_MODE_STATIC:
effect_value[0] = '0';
//if(razer_functions->backlight_led_state)
//if(open_razer_functions->backlight_led_state)
//{
// update_value[0] = '1';
// razer_functions->backlight_led_state->store(razer_device, NULL, update_value, 1);
// open_razer_functions->backlight_led_state->store(open_razer_device, NULL, update_value, 1);
//}
if(razer_functions->logo_led_state)
if(open_razer_functions->logo_led_state)
{
update_value[0] = '1';
razer_functions->logo_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_led_state)
if(open_razer_functions->scroll_led_state)
{
update_value[0] = '1';
razer_functions->scroll_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_led_state->store(open_razer_device, NULL, update_value, 1);
}
update_value[0] = RGBGetRValue(modes[active_mode].colors[0]);
update_value[1] = RGBGetGValue(modes[active_mode].colors[0]);
update_value[2] = RGBGetBValue(modes[active_mode].colors[0]);
if(razer_functions->matrix_effect_static)
if(open_razer_functions->matrix_effect_static)
{
razer_functions->matrix_effect_static->store(razer_device, NULL, update_value, 3);
open_razer_functions->matrix_effect_static->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->logo_matrix_effect_static)
if(open_razer_functions->logo_matrix_effect_static)
{
razer_functions->logo_matrix_effect_static->store(razer_device, NULL, update_value, 3);
open_razer_functions->logo_matrix_effect_static->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->scroll_matrix_effect_static)
if(open_razer_functions->scroll_matrix_effect_static)
{
razer_functions->scroll_matrix_effect_static->store(razer_device, NULL, update_value, 3);
open_razer_functions->scroll_matrix_effect_static->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->left_matrix_effect_static)
if(open_razer_functions->left_matrix_effect_static)
{
razer_functions->left_matrix_effect_static->store(razer_device, NULL, update_value, 3);
open_razer_functions->left_matrix_effect_static->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->right_matrix_effect_static)
if(open_razer_functions->right_matrix_effect_static)
{
razer_functions->right_matrix_effect_static->store(razer_device, NULL, update_value, 3);
open_razer_functions->right_matrix_effect_static->store(open_razer_device, NULL, update_value, 3);
}
//if(razer_functions->backlight_led_effect && razer_functions->backlight_led_rgb)
//if(open_razer_functions->backlight_led_effect && open_razer_functions->backlight_led_rgb)
//{
// razer_functions->backlight_led_rgb->store(razer_device, NULL, update_value, 3);
// razer_functions->backlight_led_effect->store(razer_device, NULL, effect_value, 1);
// open_razer_functions->backlight_led_rgb->store(open_razer_device, NULL, update_value, 3);
// open_razer_functions->backlight_led_effect->store(open_razer_device, NULL, effect_value, 1);
//}
if(razer_functions->logo_led_effect && razer_functions->logo_led_rgb)
if(open_razer_functions->logo_led_effect && open_razer_functions->logo_led_rgb)
{
razer_functions->logo_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->logo_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->logo_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->logo_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
if(razer_functions->scroll_led_effect && razer_functions->scroll_led_rgb)
if(open_razer_functions->scroll_led_effect && open_razer_functions->scroll_led_rgb)
{
razer_functions->scroll_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->scroll_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->scroll_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->scroll_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
break;
case RAZER_MODE_FLASHING:
case OPEN_RAZER_MODE_FLASHING:
effect_value[0] = '1';
//if(razer_functions->backlight_led_state)
//if(open_razer_functions->backlight_led_state)
//{
// update_value[0] = '1';
// razer_functions->backlight_led_state->store(razer_device, NULL, update_value, 1);
// open_razer_functions->backlight_led_state->store(open_razer_device, NULL, update_value, 1);
//}
if(razer_functions->logo_led_state)
if(open_razer_functions->logo_led_state)
{
update_value[0] = '1';
razer_functions->logo_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_led_state)
if(open_razer_functions->scroll_led_state)
{
update_value[0] = '1';
razer_functions->scroll_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_led_state->store(open_razer_device, NULL, update_value, 1);
}
update_value[0] = RGBGetRValue(modes[active_mode].colors[0]);
update_value[1] = RGBGetGValue(modes[active_mode].colors[0]);
update_value[2] = RGBGetBValue(modes[active_mode].colors[0]);
//if(razer_functions->backlight_led_effect && razer_functions->backlight_led_rgb)
//if(open_razer_functions->backlight_led_effect && open_razer_functions->backlight_led_rgb)
//{
// razer_functions->backlight_led_rgb->store(razer_device, NULL, update_value, 3);
// razer_functions->backlight_led_effect->store(razer_device, NULL, effect_value, 1);
// open_razer_functions->backlight_led_rgb->store(open_razer_device, NULL, update_value, 3);
// open_razer_functions->backlight_led_effect->store(open_razer_device, NULL, effect_value, 1);
//}
if(razer_functions->logo_led_effect && razer_functions->logo_led_rgb)
if(open_razer_functions->logo_led_effect && open_razer_functions->logo_led_rgb)
{
razer_functions->logo_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->logo_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->logo_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->logo_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
if(razer_functions->scroll_led_effect && razer_functions->scroll_led_rgb)
if(open_razer_functions->scroll_led_effect && open_razer_functions->scroll_led_rgb)
{
razer_functions->scroll_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->scroll_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->scroll_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->scroll_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
break;
case RAZER_MODE_BREATHING:
case OPEN_RAZER_MODE_BREATHING:
effect_value[0] = '2';
switch(modes[active_mode].color_mode)
{
case MODE_COLORS_MODE_SPECIFIC:
//if(razer_functions->backlight_led_state)
//if(open_razer_functions->backlight_led_state)
//{
// update_value[0] = '1';
// razer_functions->backlight_led_state->store(razer_device, NULL, update_value, 1);
// open_razer_functions->backlight_led_state->store(open_razer_device, NULL, update_value, 1);
//}
if(razer_functions->logo_led_state)
if(open_razer_functions->logo_led_state)
{
update_value[0] = '1';
razer_functions->logo_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_led_state)
if(open_razer_functions->scroll_led_state)
{
update_value[0] = '1';
razer_functions->scroll_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_led_state->store(open_razer_device, NULL, update_value, 1);
}
update_value[0] = RGBGetRValue(modes[active_mode].colors[0]);
@ -742,170 +742,170 @@ void RGBController_OpenRazer::DeviceUpdateMode()
update_value[4] = RGBGetGValue(modes[active_mode].colors[1]);
update_value[5] = RGBGetBValue(modes[active_mode].colors[1]);
if(razer_functions->matrix_effect_breath)
if(open_razer_functions->matrix_effect_breath)
{
razer_functions->matrix_effect_breath->store(razer_device, NULL, update_value, 6);
open_razer_functions->matrix_effect_breath->store(open_razer_device, NULL, update_value, 6);
}
if(razer_functions->logo_matrix_effect_breath)
if(open_razer_functions->logo_matrix_effect_breath)
{
razer_functions->logo_matrix_effect_breath->store(razer_device, NULL, update_value, 6);
open_razer_functions->logo_matrix_effect_breath->store(open_razer_device, NULL, update_value, 6);
}
if(razer_functions->scroll_matrix_effect_breath)
if(open_razer_functions->scroll_matrix_effect_breath)
{
razer_functions->scroll_matrix_effect_breath->store(razer_device, NULL, update_value, 6);
open_razer_functions->scroll_matrix_effect_breath->store(open_razer_device, NULL, update_value, 6);
}
if(razer_functions->left_matrix_effect_breath)
if(open_razer_functions->left_matrix_effect_breath)
{
razer_functions->left_matrix_effect_breath->store(razer_device, NULL, update_value, 6);
open_razer_functions->left_matrix_effect_breath->store(open_razer_device, NULL, update_value, 6);
}
if(razer_functions->right_matrix_effect_breath)
if(open_razer_functions->right_matrix_effect_breath)
{
razer_functions->right_matrix_effect_breath->store(razer_device, NULL, update_value, 6);
open_razer_functions->right_matrix_effect_breath->store(open_razer_device, NULL, update_value, 6);
}
}
else
{
if(razer_functions->matrix_effect_breath)
if(open_razer_functions->matrix_effect_breath)
{
razer_functions->matrix_effect_breath->store(razer_device, NULL, update_value, 3);
open_razer_functions->matrix_effect_breath->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->logo_matrix_effect_breath)
if(open_razer_functions->logo_matrix_effect_breath)
{
razer_functions->logo_matrix_effect_breath->store(razer_device, NULL, update_value, 3);
open_razer_functions->logo_matrix_effect_breath->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->scroll_matrix_effect_breath)
if(open_razer_functions->scroll_matrix_effect_breath)
{
razer_functions->scroll_matrix_effect_breath->store(razer_device, NULL, update_value, 3);
open_razer_functions->scroll_matrix_effect_breath->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->left_matrix_effect_breath)
if(open_razer_functions->left_matrix_effect_breath)
{
razer_functions->left_matrix_effect_breath->store(razer_device, NULL, update_value, 3);
open_razer_functions->left_matrix_effect_breath->store(open_razer_device, NULL, update_value, 3);
}
if(razer_functions->right_matrix_effect_breath)
if(open_razer_functions->right_matrix_effect_breath)
{
razer_functions->right_matrix_effect_breath->store(razer_device, NULL, update_value, 3);
open_razer_functions->right_matrix_effect_breath->store(open_razer_device, NULL, update_value, 3);
}
//if(razer_functions->backlight_led_effect && razer_functions->backlight_led_rgb)
//if(open_razer_functions->backlight_led_effect && open_razer_functions->backlight_led_rgb)
//{
// razer_functions->backlight_led_rgb->store(razer_device, NULL, update_value, 3);
// razer_functions->backlight_led_effect->store(razer_device, NULL, effect_value, 1);
// open_razer_functions->backlight_led_rgb->store(open_razer_device, NULL, update_value, 3);
// open_razer_functions->backlight_led_effect->store(open_razer_device, NULL, effect_value, 1);
//}
if(razer_functions->logo_led_effect && razer_functions->logo_led_rgb)
if(open_razer_functions->logo_led_effect && open_razer_functions->logo_led_rgb)
{
razer_functions->logo_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->logo_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->logo_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->logo_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
if(razer_functions->scroll_led_effect && razer_functions->scroll_led_rgb)
if(open_razer_functions->scroll_led_effect && open_razer_functions->scroll_led_rgb)
{
razer_functions->scroll_led_rgb->store(razer_device, NULL, update_value, 3);
razer_functions->scroll_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->scroll_led_rgb->store(open_razer_device, NULL, update_value, 3);
open_razer_functions->scroll_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
}
break;
case MODE_COLORS_RANDOM:
if(razer_functions->matrix_effect_breath)
if(open_razer_functions->matrix_effect_breath)
{
razer_functions->matrix_effect_breath->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_breath->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->logo_matrix_effect_breath)
if(open_razer_functions->logo_matrix_effect_breath)
{
razer_functions->logo_matrix_effect_breath->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_matrix_effect_breath->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_matrix_effect_breath)
if(open_razer_functions->scroll_matrix_effect_breath)
{
razer_functions->scroll_matrix_effect_breath->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_matrix_effect_breath->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->left_matrix_effect_breath)
if(open_razer_functions->left_matrix_effect_breath)
{
razer_functions->left_matrix_effect_breath->store(razer_device, NULL, update_value, 1);
open_razer_functions->left_matrix_effect_breath->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->right_matrix_effect_breath)
if(open_razer_functions->right_matrix_effect_breath)
{
razer_functions->right_matrix_effect_breath->store(razer_device, NULL, update_value, 1);
open_razer_functions->right_matrix_effect_breath->store(open_razer_device, NULL, update_value, 1);
}
break;
}
break;
case RAZER_MODE_SPECTRUM_CYCLE:
case OPEN_RAZER_MODE_SPECTRUM_CYCLE:
effect_value[0] = '4';
//if(razer_functions->backlight_led_state)
//if(open_razer_functions->backlight_led_state)
//{
// update_value[0] = '1';
// razer_functions->backlight_led_state->store(razer_device, NULL, update_value, 1);
// open_razer_functions->backlight_led_state->store(open_razer_device, NULL, update_value, 1);
//}
if(razer_functions->logo_led_state)
if(open_razer_functions->logo_led_state)
{
update_value[0] = '1';
razer_functions->logo_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_led_state)
if(open_razer_functions->scroll_led_state)
{
update_value[0] = '1';
razer_functions->scroll_led_state->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_led_state->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->matrix_effect_spectrum)
if(open_razer_functions->matrix_effect_spectrum)
{
razer_functions->matrix_effect_spectrum->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_spectrum->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->logo_matrix_effect_spectrum)
if(open_razer_functions->logo_matrix_effect_spectrum)
{
razer_functions->logo_matrix_effect_spectrum->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_matrix_effect_spectrum->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_matrix_effect_spectrum)
if(open_razer_functions->scroll_matrix_effect_spectrum)
{
razer_functions->scroll_matrix_effect_spectrum->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_matrix_effect_spectrum->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->left_matrix_effect_spectrum)
if(open_razer_functions->left_matrix_effect_spectrum)
{
razer_functions->left_matrix_effect_spectrum->store(razer_device, NULL, update_value, 1);
open_razer_functions->left_matrix_effect_spectrum->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->right_matrix_effect_spectrum)
if(open_razer_functions->right_matrix_effect_spectrum)
{
razer_functions->right_matrix_effect_spectrum->store(razer_device, NULL, update_value, 1);
open_razer_functions->right_matrix_effect_spectrum->store(open_razer_device, NULL, update_value, 1);
}
//if(razer_functions->backlight_led_effect)
//if(open_razer_functions->backlight_led_effect)
//{
// razer_functions->backlight_led_effect->store(razer_device, NULL, effect_value, 1);
// open_razer_functions->backlight_led_effect->store(open_razer_device, NULL, effect_value, 1);
//}
if(razer_functions->logo_led_effect)
if(open_razer_functions->logo_led_effect)
{
razer_functions->logo_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->logo_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
if(razer_functions->scroll_led_effect)
if(open_razer_functions->scroll_led_effect)
{
razer_functions->scroll_led_effect->store(razer_device, NULL, effect_value, 1);
open_razer_functions->scroll_led_effect->store(open_razer_device, NULL, effect_value, 1);
}
break;
case RAZER_MODE_WAVE:
case OPEN_RAZER_MODE_WAVE:
switch(modes[active_mode].direction)
{
case MODE_DIRECTION_LEFT:
@ -917,46 +917,46 @@ void RGBController_OpenRazer::DeviceUpdateMode()
break;
}
if(razer_functions->matrix_effect_wave)
if(open_razer_functions->matrix_effect_wave)
{
razer_functions->matrix_effect_wave->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_wave->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->left_matrix_effect_wave)
if(open_razer_functions->left_matrix_effect_wave)
{
razer_functions->left_matrix_effect_wave->store(razer_device, NULL, update_value, 1);
open_razer_functions->left_matrix_effect_wave->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->right_matrix_effect_wave)
if(open_razer_functions->right_matrix_effect_wave)
{
razer_functions->right_matrix_effect_wave->store(razer_device, NULL, update_value, 1);
open_razer_functions->right_matrix_effect_wave->store(open_razer_device, NULL, update_value, 1);
}
break;
case RAZER_MODE_REACTIVE:
if(razer_functions->matrix_effect_reactive)
case OPEN_RAZER_MODE_REACTIVE:
if(open_razer_functions->matrix_effect_reactive)
{
razer_functions->matrix_effect_reactive->store(razer_device, NULL, update_value, 1);
open_razer_functions->matrix_effect_reactive->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->logo_matrix_effect_reactive)
if(open_razer_functions->logo_matrix_effect_reactive)
{
razer_functions->logo_matrix_effect_reactive->store(razer_device, NULL, update_value, 1);
open_razer_functions->logo_matrix_effect_reactive->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->scroll_matrix_effect_reactive)
if(open_razer_functions->scroll_matrix_effect_reactive)
{
razer_functions->scroll_matrix_effect_reactive->store(razer_device, NULL, update_value, 1);
open_razer_functions->scroll_matrix_effect_reactive->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->left_matrix_effect_reactive)
if(open_razer_functions->left_matrix_effect_reactive)
{
razer_functions->left_matrix_effect_reactive->store(razer_device, NULL, update_value, 1);
open_razer_functions->left_matrix_effect_reactive->store(open_razer_device, NULL, update_value, 1);
}
if(razer_functions->right_matrix_effect_reactive)
if(open_razer_functions->right_matrix_effect_reactive)
{
razer_functions->right_matrix_effect_reactive->store(razer_device, NULL, update_value, 1);
open_razer_functions->right_matrix_effect_reactive->store(open_razer_device, NULL, update_value, 1);
}
break;
}

View file

@ -76,28 +76,28 @@ class RGBController_OpenRazer : public RGBController
public:
enum
{
RAZER_MODE_CUSTOM,
RAZER_MODE_OFF,
RAZER_MODE_STATIC,
RAZER_MODE_BREATHING,
RAZER_MODE_SPECTRUM_CYCLE,
RAZER_MODE_WAVE,
RAZER_MODE_REACTIVE,
RAZER_MODE_FLASHING,
RAZER_NUM_MODES
OPEN_RAZER_MODE_CUSTOM,
OPEN_RAZER_MODE_OFF,
OPEN_RAZER_MODE_STATIC,
OPEN_RAZER_MODE_BREATHING,
OPEN_RAZER_MODE_SPECTRUM_CYCLE,
OPEN_RAZER_MODE_WAVE,
OPEN_RAZER_MODE_REACTIVE,
OPEN_RAZER_MODE_FLASHING,
OPEN_RAZER_NUM_MODES
};
enum
{
RAZER_TYPE_MATRIX_FRAME,
RAZER_TYPE_MATRIX_NOFRAME,
RAZER_TYPE_MATRIX_STATIC,
RAZER_TYPE_NOMATRIX,
RAZER_NUM_TYPES
OPEN_RAZER_TYPE_MATRIX_FRAME,
OPEN_RAZER_TYPE_MATRIX_NOFRAME,
OPEN_RAZER_TYPE_MATRIX_STATIC,
OPEN_RAZER_TYPE_NOMATRIX,
OPEN_RAZER_NUM_TYPES
};
public:
RGBController_OpenRazer(device * razer_device, device_fn_type* razer_functions);
RGBController_OpenRazer(device * open_razer_device, device_fn_type* open_razer_functions);
~RGBController_OpenRazer();
void SetupZones();
@ -114,15 +114,15 @@ public:
int device_index;
private:
void SetupMatrixDevice(device_fn_type* razer_functions, unsigned int rows, unsigned int cols);
void SetupMatrixDevice(device_fn_type* open_razer_functions, unsigned int rows, unsigned int cols);
void SetupNonMatrixDevice();
unsigned int matrix_type;
unsigned int matrix_rows;
unsigned int matrix_cols;
device* razer_device;
device_fn_type* razer_functions;
device* open_razer_device;
device_fn_type* open_razer_functions;
//OpenRazer Sysfs Entries for Matrix Devices
std::ofstream matrix_custom_frame;