diff --git a/Controllers/AMDWraithPrismController/AMDWraithPrismController.cpp b/Controllers/AMDWraithPrismController/AMDWraithPrismController.cpp index a8f4c279..e72be409 100644 --- a/Controllers/AMDWraithPrismController/AMDWraithPrismController.cpp +++ b/Controllers/AMDWraithPrismController/AMDWraithPrismController.cpp @@ -16,25 +16,6 @@ AMDWraithPrismController::AMDWraithPrismController(hid_device* dev_handle, const { dev = dev_handle; location = path; - - strcpy(device_name, "AMD Wraith Prism"); - - current_fan_mode = AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC; - current_fan_speed = 0xFF; - current_fan_random_color = false; - current_fan_brightness = 0xFF; - - current_logo_mode = AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC; - current_logo_speed = 0xFF; - current_logo_random_color = false; - current_logo_brightness = 0xFF; - - current_ring_mode = AMD_WRAITH_PRISM_EFFECT_CHANNEL_STATIC; - current_ring_speed = 0xFF; - current_ring_direction = false; - current_ring_brightness = 0xFF; - - SendEnableCommand(); } AMDWraithPrismController::~AMDWraithPrismController() @@ -47,11 +28,6 @@ std::string AMDWraithPrismController::GetLocationString() return("HID: " + location); } -char* AMDWraithPrismController::GetDeviceName() -{ - return device_name; -} - std::string AMDWraithPrismController::GetSerialString() { wchar_t serial_string[128]; @@ -68,41 +44,6 @@ std::string AMDWraithPrismController::GetSerialString() return(return_string); } -std::string AMDWraithPrismController::GetEffectChannelString(unsigned char channel) -{ - std::string ret_string = ""; - - unsigned char usb_buf[] = - { - 0x00, - 0x40, 0x21, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - }; - - usb_buf[0x03] = channel; - - hid_write(dev, usb_buf, 65); - hid_read(dev, usb_buf, 64); - - ret_string.append((char *)&usb_buf[0x08]); - - return(ret_string); -} - std::string AMDWraithPrismController::GetFirmwareVersionString() { std::string ret_string = ""; @@ -150,94 +91,12 @@ std::string AMDWraithPrismController::GetFirmwareVersionString() return(ret_string); } -void AMDWraithPrismController::SetFanMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool random_color) -{ - current_fan_mode = mode; - current_fan_speed = speed_values_fan_logo[mode][speed]; - current_fan_brightness = brightness; - current_fan_random_color = random_color; -} - -void AMDWraithPrismController::SetFanColor(unsigned char red, unsigned char green, unsigned char blue) -{ - SendEffectChannelUpdate - ( - AMD_WRAITH_PRISM_EFFECT_CHANNEL_FAN_LED, - current_fan_speed, - false, - current_fan_random_color, - current_fan_mode, - current_fan_brightness, - red, - green, - blue - ); -} - -void AMDWraithPrismController::SetLogoMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool random_color) -{ - current_logo_mode = mode; - current_logo_speed = speed_values_fan_logo[mode][speed]; - current_logo_brightness = brightness; - current_logo_random_color = random_color; -} - -void AMDWraithPrismController::SetLogoColor(unsigned char red, unsigned char green, unsigned char blue) -{ - SendEffectChannelUpdate - ( - AMD_WRAITH_PRISM_EFFECT_CHANNEL_LOGO_LED, - current_logo_speed, - false, - current_logo_random_color, - current_logo_mode, - current_logo_brightness, - red, - green, - blue - ); -} - -void AMDWraithPrismController::SetRingMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool direction, bool random_color) -{ - current_ring_mode = mode; - current_ring_speed = speed_values_ring[mode][speed]; - current_ring_direction = direction; - current_ring_brightness = brightness; - current_ring_random_color = random_color; -} - -void AMDWraithPrismController::SetRingColor(unsigned char red, unsigned char green, unsigned char blue) -{ - SetRingEffectChannel(current_ring_mode); - - SendEffectChannelUpdate - ( - current_ring_mode, - current_ring_speed, - current_ring_direction, - current_ring_random_color, - mode_value_ring[current_ring_mode], - current_ring_brightness, - red, - green, - blue - ); - - SendApplyCommand(); -} - -void AMDWraithPrismController::SetRingEffectChannel(unsigned char channel) -{ - SendChannelRemap(channel, AMD_WRAITH_PRISM_EFFECT_CHANNEL_LOGO_LED, AMD_WRAITH_PRISM_EFFECT_CHANNEL_FAN_LED); -} - void AMDWraithPrismController::SendEnableCommand() { unsigned char usb_buf[] = { 0x00, - 0x41, 0x80, 0x00, 0x00, + 0x41, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -265,7 +124,7 @@ void AMDWraithPrismController::SendApplyCommand() { 0x00, 0x51, 0x28, 0x00, 0x00, - 0xE0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -286,67 +145,23 @@ void AMDWraithPrismController::SendApplyCommand() hid_read(dev, usb_buf, 64); } -void AMDWraithPrismController::SendEffectChannelUpdate +void AMDWraithPrismController::SendDirectPacket ( - unsigned char effect_channel, - unsigned char speed, - bool direction, - bool random_color, - unsigned char mode, - unsigned char brightness, - unsigned char red, - unsigned char green, - unsigned char blue + unsigned char size, + unsigned char * led_ids, + RGBColor * colors ) { unsigned char usb_buf[] = { 0x00, - 0x51, 0x2C, 0x01, 0x00, - 0x05, 0xFF, 0x00, 0x01, - 0xFF, 0xFF, 0x00, 0xFF, + 0xC0, 0x01, size, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF - }; - - usb_buf[0x05] = effect_channel; - usb_buf[0x06] = speed; - usb_buf[0x07] = (direction ? 0x01 : 0x00) | (random_color ? 0x80 : 0x00); - usb_buf[0x08] = mode; - - usb_buf[0x0A] = brightness; - - usb_buf[0x0B] = red; - usb_buf[0x0C] = green; - usb_buf[0x0D] = blue; - - hid_write(dev, usb_buf, 65); - hid_read(dev, usb_buf, 64); -} - -void AMDWraithPrismController::SendChannelRemap(unsigned char ring_channel, unsigned char logo_channel, unsigned char fan_channel) -{ - unsigned char usb_buf[] = - { - 0x00, - 0x51, 0xA0, 0x01, 0x00, - 0x00, 0x03, 0x00, 0x00, - 0x05, 0x06, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, - 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -358,12 +173,14 @@ void AMDWraithPrismController::SendChannelRemap(unsigned char ring_channel, unsi 0x00, 0x00, 0x00, 0x00, }; - usb_buf[0x09] = logo_channel; - usb_buf[0x0A] = fan_channel; - - for(int led = 0x0B; led <= 0x19; led++) + for(unsigned int led_idx = 0; led_idx < size; led_idx++) { - usb_buf[led] = ring_channel; + unsigned int index = led_idx * 4; + + usb_buf[index + 5] = led_ids[led_idx]; + usb_buf[index + 6] = RGBGetRValue(colors[led_idx]); + usb_buf[index + 7] = RGBGetGValue(colors[led_idx]); + usb_buf[index + 8] = RGBGetBValue(colors[led_idx]); } hid_write(dev, usb_buf, 65); diff --git a/Controllers/AMDWraithPrismController/AMDWraithPrismController.h b/Controllers/AMDWraithPrismController/AMDWraithPrismController.h index 59a2555a..ce10b4cd 100644 --- a/Controllers/AMDWraithPrismController/AMDWraithPrismController.h +++ b/Controllers/AMDWraithPrismController/AMDWraithPrismController.h @@ -10,6 +10,8 @@ #include #include +#include "RGBController.h" + #pragma once #define AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX 0xFF @@ -91,61 +93,23 @@ public: AMDWraithPrismController(hid_device* dev_handle, const char* path); ~AMDWraithPrismController(); - char* GetDeviceName(); - std::string GetEffectChannelString(unsigned char channel); std::string GetFirmwareVersionString(); std::string GetLocationString(); std::string GetSerialString(); - void SetRingEffectChannel(unsigned char channel); - - void SetFanMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool random_color); - void SetFanColor(unsigned char red, unsigned char green, unsigned char blue); - - void SetLogoMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool random_color); - void SetLogoColor(unsigned char red, unsigned char green, unsigned char blue); - - void SetRingMode(unsigned char mode, unsigned char speed, unsigned char brightness, bool direction, bool random_color); - void SetRingColor(unsigned char red, unsigned char green, unsigned char blue); - -private: - char device_name[32]; - hid_device* dev; - std::string location; - - unsigned char current_fan_mode; - unsigned char current_fan_speed; - unsigned char current_fan_brightness; - bool current_fan_random_color; - - unsigned char current_logo_mode; - unsigned char current_logo_speed; - unsigned char current_logo_brightness; - bool current_logo_random_color; - - unsigned char current_ring_mode; - unsigned char current_ring_speed; - unsigned char current_ring_brightness; - bool current_ring_direction; - bool current_ring_random_color; + void SendDirectPacket + ( + unsigned char size, + unsigned char * led_ids, + RGBColor * colors + ); void SendEnableCommand(); void SendApplyCommand(); - void SendEffectChannelUpdate - ( - unsigned char effect_channel, - unsigned char speed, - bool direction, - bool random_color, - unsigned char mode, - unsigned char brightness, - unsigned char red, - unsigned char green, - unsigned char blue - ); - - void SendChannelRemap(unsigned char ring_channel, unsigned char logo_channel, unsigned char fan_channel); +private: + hid_device* dev; + std::string location; }; diff --git a/Controllers/AMDWraithPrismController/RGBController_AMDWraithPrism.cpp b/Controllers/AMDWraithPrismController/RGBController_AMDWraithPrism.cpp index f3c286e8..504a9cf3 100644 --- a/Controllers/AMDWraithPrismController/RGBController_AMDWraithPrism.cpp +++ b/Controllers/AMDWraithPrismController/RGBController_AMDWraithPrism.cpp @@ -33,99 +33,19 @@ RGBController_AMDWraithPrism::RGBController_AMDWraithPrism(AMDWraithPrismControl description = "AMD Wraith Prism Device"; version = controller->GetFirmwareVersionString(); location = controller->GetLocationString(); - /*-----------------------------------------------------*\ - | Don't use HID serial string, it is inconsistent on my | - | Wraith Prism | - \*-----------------------------------------------------*/ - serial = "";//controller->GetSerialString(); mode Direct; Direct.name = "Direct"; - Direct.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_STATIC; + Direct.value = 0; Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS; Direct.brightness_min = 0; - Direct.brightness_max = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; - Direct.brightness = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; + Direct.brightness_max = 0; + Direct.brightness = 0; Direct.color_mode = MODE_COLORS_PER_LED; modes.push_back(Direct); - mode Breathing; - Breathing.name = "Breathing"; - Breathing.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_BREATHING; - Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS; - Breathing.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST; - Breathing.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST; - Breathing.brightness_min = 0; - Breathing.brightness_max = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; - Breathing.brightness = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; - Breathing.color_mode = MODE_COLORS_PER_LED; - Breathing.speed = AMD_WRAITH_PRISM_SPEED_NORMAL; - modes.push_back(Breathing); - - mode ColorCycle; - ColorCycle.name = "Spectrum Cycle"; - ColorCycle.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_COLOR_CYCLE; - ColorCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS; - ColorCycle.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST; - ColorCycle.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST; - ColorCycle.brightness_min = 0; - ColorCycle.brightness_max = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_CYCLE_MAX; - ColorCycle.brightness = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_CYCLE_MAX; - ColorCycle.color_mode = MODE_COLORS_NONE; - ColorCycle.speed = AMD_WRAITH_PRISM_SPEED_NORMAL; - modes.push_back(ColorCycle); - - mode Rainbow; - Rainbow.name = "Rainbow Wave"; - Rainbow.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_RAINBOW; - Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS; - Rainbow.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST; - Rainbow.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST; - Rainbow.brightness_min = 0; - Rainbow.brightness_max = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; - Rainbow.brightness = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; //The Ring zone can not get brighter but Logo / Fan can - Rainbow.color_mode = MODE_COLORS_NONE; - Rainbow.speed = AMD_WRAITH_PRISM_SPEED_NORMAL; - modes.push_back(Rainbow); - - mode Bounce; - Bounce.name = "Bounce"; - Bounce.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_BOUNCE; - Bounce.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS; - Bounce.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST; - Bounce.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST; - Bounce.brightness_min = 0; - Bounce.brightness_max = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; - Bounce.brightness = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; //The Ring zone can not get brighter but Logo / Fan can - Bounce.color_mode = MODE_COLORS_NONE; - Bounce.speed = AMD_WRAITH_PRISM_SPEED_NORMAL; - modes.push_back(Bounce); - - mode Chase; - Chase.name = "Chase"; - Chase.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_CHASE; - Chase.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS; - Chase.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST; - Chase.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST; - Chase.brightness_min = 0; - Chase.brightness_max = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; - Chase.brightness = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; - Chase.color_mode = MODE_COLORS_PER_LED; - Chase.speed = AMD_WRAITH_PRISM_SPEED_NORMAL; - modes.push_back(Chase); - - mode Swirl; - Swirl.name = "Swirl"; - Swirl.value = AMD_WRAITH_PRISM_EFFECT_CHANNEL_SWIRL; - Swirl.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS; - Swirl.speed_min = AMD_WRAITH_PRISM_SPEED_SLOWEST; - Swirl.speed_max = AMD_WRAITH_PRISM_SPEED_FASTEST; - Swirl.brightness_min = 0; - Swirl.brightness_max = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; - Swirl.brightness = AMD_WRAITH_PRISM_FAN_BRIGHTNESS_DEFAULT_MAX; - Swirl.color_mode = MODE_COLORS_PER_LED; - Swirl.speed = AMD_WRAITH_PRISM_SPEED_NORMAL; - modes.push_back(Swirl); + controller->SendEnableCommand(); + controller->SendApplyCommand(); SetupZones(); } @@ -137,6 +57,14 @@ RGBController_AMDWraithPrism::~RGBController_AMDWraithPrism() void RGBController_AMDWraithPrism::SetupZones() { + /*---------------------------------------------------------*\ + | LED maps | + \*---------------------------------------------------------*/ + const unsigned int logo_leds[1] = { 0x00 }; + const unsigned int fan_leds[1] = { 0x01 }; + const unsigned int ring_leds[14] = { 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; + /*---------------------------------------------------------*\ | Set up zones | \*---------------------------------------------------------*/ @@ -160,27 +88,39 @@ void RGBController_AMDWraithPrism::SetupZones() zone ring_zone; ring_zone.name = "Ring"; - ring_zone.type = ZONE_TYPE_SINGLE; - ring_zone.leds_min = 1; - ring_zone.leds_max = 1; - ring_zone.leds_count = 1; + ring_zone.type = ZONE_TYPE_LINEAR; + ring_zone.leds_min = 14; + ring_zone.leds_max = 14; + ring_zone.leds_count = 14; ring_zone.matrix_map = NULL; zones.push_back(ring_zone); /*---------------------------------------------------------*\ | Set up LEDs | \*---------------------------------------------------------*/ - led logo_led; - logo_led.name = "Logo LED"; - leds.push_back(logo_led); + for(unsigned int led_idx = 0; led_idx < 1; led_idx++) + { + led logo_led; + logo_led.name = "Logo LED"; + logo_led.value = logo_leds[led_idx]; + leds.push_back(logo_led); + } - led fan_led; - fan_led.name = "Fan LED"; - leds.push_back(fan_led); + for(unsigned int led_idx = 0; led_idx < 1; led_idx++) + { + led fan_led; + fan_led.name = "Fan LED"; + fan_led.value = fan_leds[led_idx]; + leds.push_back(fan_led); + } - led ring_led; - ring_led.name = "Ring LED"; - leds.push_back(ring_led); + for(unsigned int led_idx = 0; led_idx < 14; led_idx++) + { + led ring_led; + ring_led.name = "Ring LED"; + ring_led.value = ring_leds[led_idx]; + leds.push_back(ring_led); + } SetupColors(); } @@ -194,85 +134,41 @@ void RGBController_AMDWraithPrism::ResizeZone(int /*zone*/, int /*new_size*/) void RGBController_AMDWraithPrism::DeviceUpdateLEDs() { - unsigned char red = RGBGetRValue(colors[0]); - unsigned char grn = RGBGetGValue(colors[0]); - unsigned char blu = RGBGetBValue(colors[0]); - controller->SetLogoColor(red, grn, blu); + unsigned char led_ids[15]; + RGBColor color_buf[15]; + unsigned int leds_count = 0; - red = RGBGetRValue(colors[1]); - grn = RGBGetGValue(colors[1]); - blu = RGBGetBValue(colors[1]); - controller->SetFanColor(red, grn, blu); + for(unsigned int led_idx = 0; led_idx < colors.size(); led_idx++) + { + led_ids[leds_count] = (unsigned char)leds[led_idx].value; + color_buf[leds_count] = colors[led_idx]; - red = RGBGetRValue(colors[2]); - grn = RGBGetGValue(colors[2]); - blu = RGBGetBValue(colors[2]); - controller->SetRingColor(red, grn, blu); + leds_count++; + + if(leds_count >= 15) + { + controller->SendDirectPacket(15, led_ids, color_buf); + leds_count = 0; + } + } + + if(leds_count > 0) + { + controller->SendDirectPacket(leds_count, led_ids, color_buf); + } } void RGBController_AMDWraithPrism::UpdateZoneLEDs(int zone) { - RGBColor color = colors[zone]; - unsigned char red = RGBGetRValue(color); - unsigned char grn = RGBGetGValue(color); - unsigned char blu = RGBGetBValue(color); - if(zone == 0) - { - controller->SetLogoColor(red, grn, blu); - } - else if(zone == 1) - { - controller->SetFanColor(red, grn, blu); - } - else if(zone == 2) - { - controller->SetRingColor(red, grn, blu); - } } void RGBController_AMDWraithPrism::UpdateSingleLED(int led) { - UpdateZoneLEDs(led); + } void RGBController_AMDWraithPrism::DeviceUpdateMode() { - bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM); - controller->SetRingMode(modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, modes[active_mode].direction, random); - - switch(modes[active_mode].value) - { - case AMD_WRAITH_PRISM_EFFECT_CHANNEL_COLOR_CYCLE: - controller->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random); - controller->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random); - break; - - case AMD_WRAITH_PRISM_EFFECT_CHANNEL_RAINBOW: - case AMD_WRAITH_PRISM_EFFECT_CHANNEL_BOUNCE: - controller->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, (modes[active_mode].brightness >> 1), random); - controller->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, (modes[active_mode].brightness >> 1), random); - break; - - case AMD_WRAITH_PRISM_EFFECT_CHANNEL_BREATHING: - controller->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_BREATHING, modes[active_mode].speed, modes[active_mode].brightness, random); - controller->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_BREATHING, modes[active_mode].speed, modes[active_mode].brightness, random); - break; - - default: - if(random) - { - controller->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random); - controller->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_COLOR_CYCLE, modes[active_mode].speed, modes[active_mode].brightness, random); - } - else - { - controller->SetFanMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC, modes[active_mode].speed, modes[active_mode].brightness, random); - controller->SetLogoMode(AMD_WRAITH_PRISM_FAN_LOGO_MODE_STATIC, modes[active_mode].speed, modes[active_mode].brightness, random); - } - break; - } - - DeviceUpdateLEDs(); }