KeyboardVisualizer icon indicating copy to clipboard operation
KeyboardVisualizer copied to clipboard

Added visualizer modes for Firefly and Blackwidow Chroma + Settings saving/reloading

Open helionmusic opened this issue 7 years ago • 8 comments

First time contributing to a project on github, please lemme know if I'm doing anything wrong.

I've decided to contribute to this and add the extra visualization modes I've been using for myself for both the blackwidow chroma keyboard and firefly mouse pad, as well as the super basic settings saving I've implemented just so I don't need to reset everything every time, and finally a setting to control which piece of the spectrum to use for single-color and bar visualizations because I didn't always want the 5th horizontal column of pixels to be it.

With this pull request you get basically the following: Blackwidow chroma visualization new modes:

  • Single color brightness based mode. (whole keyboard)
  • Down to up bar mode (just like the already existing firefly visualization except all across the keyboard)
  • Up to down bar mode. Reverse of the above
  • Mid to side bar mode. From the center to the right and left as a mirror bar mode on the horizontal
  • Side to mid bar mode. From both sides coming into the middle of the keyboard, basically reversed of the mid to side.

Firefly mousepad visualization new modes:

  • Single color brightness based mode (whole mousepad)
  • Up to down bar mode. Basically a reverse of the pre-existing firefly visualization mode.

App settings saving:

  • Click the button at the bottom right to save settings and next time the app is run, they are loaded in and auto-populate the entries.
  • If no settings file is found, it'll just load defaults and auto-populate as well.

Control over bar and single-color visualization modes section of the spectrum:

  • Can be selected from anywhere without being limited to 5th pixel of the visualization preview
  • Draws a red vertical line on the visualization preview to show where it will pull data from.

I've attached below a screenshot of the dialog window to show what I've added in (I'm the worst at UI, you could probably fit them better than me), and below it is an unlisted youtube video I've taken a while back showing the blackwidow and firefly extra modes in action.

keyboardvisualizervc_2016-11-18_16-39-38

https://www.youtube.com/watch?v=BJfMwDKJ3Hs

That's about it. :)

helionmusic avatar Nov 18 '16 12:11 helionmusic

Nice work! I will have plenty of free time next week so I should be able to review and merge. Might try to make the settings generic for all strip/grid type peripherals rather than just the BW and FF (maybe they already are, haven't looked at your code yet).

CalcProgrammer1 avatar Nov 18 '16 19:11 CalcProgrammer1

I like the LED strip position idea too! I've been wanting to make it configurable but wasn't sure the best way to do so. I eventually want to make a way to define custom mappings for ledstrip type devices so you can make a grid of custom LED strips and map it to a visualizer grid, but that wouldn't be for most peripherals.

CalcProgrammer1 avatar Nov 18 '16 19:11 CalcProgrammer1

All good, I initially just kept playing around with it because I wanted to control which part to display on the firefly, since I didn't like that it was only showing bass all the time, then I just decided to try and figure out how to make a few different modes for both BW and FF since those are the only supported devices I currently have. I think it'd definitely be nice to be able to configure each and every device separately and sort of standardize it so you don't have to rewrite the code each time something new comes up.

I doubt the modes I've added in change for other devices since I made it check which mode the specific device was in right before outputting the LEDs in the SetLEDs method inside RazerChroma.cpp

I was also thinking of maybe trying to add a way to set custom foreground/background light maps without coding them in but I'm fairly clueless on how to get that done.

Love the work you've done mate, keep it up!

helionmusic avatar Nov 18 '16 20:11 helionmusic

I might take your modes and make them applicable per device. I might add a second tab to the UI with drop down boxes for each device. I might try to come up with a helper function to implement the effect changes so it isn't a copy paste job for each device in the list.

The version 2.0 branch has a separate foreground and background effect layer, which I think is what you're talking about. You can have a rainbow foreground and a static background, or any combination thereof. It's still rough around the edges but it was something I was working on.

CalcProgrammer1 avatar Nov 18 '16 20:11 CalcProgrammer1

A second tab to the UI makes more sense yeah. I'd say the best part in that is you could possibly give people a chance to disable devices they don't want affected by the app while it's running as well. Either way I'm super satisfied with what I have currently :) and I hope it could have made any work you decide to continue with just a little bit simpler

helionmusic avatar Nov 18 '16 20:11 helionmusic

The disabling on certain devices might not be possible due to how the SDK works. If you initialize the Chroma SDK then all supported devices go dark and respond to SDK inputs. If I give the option to disable, I think it will just make that device go dark rather than keep doing what it's configured to do in Synapse. For non-Razer devices I have more control, but I'll have to see if the Chroma SDK even allows for that.

CalcProgrammer1 avatar Nov 18 '16 20:11 CalcProgrammer1

I wouldn't worry about cleaning it up. I don't think I'm going to take it as-is anyways. I mainly use pull requests and other people's commits as guidelines for implementing features, but often I rewrite them in some way or another rather than taking them directly. I'm working on my own implementation of the save file now and I plan to rework the ability to set different settings per device with version 2.0 (where I have multiple layers to play with and more flexibility when it comes to using them). I will have the same effect modes you give but the way yours is the keyboard background layer also gets squashed to a single line. Version 2.0 will have a way around this (I plan to create a mask layer for several bar types and a mask for spectrograph and use the mask to generate the final image per device).

CalcProgrammer1 avatar Nov 22 '16 00:11 CalcProgrammer1

Oh alright cool, I was about to look into fixing what was mentioned as I just got a bit of free time now. I suppose I will leave it at that and hopefully what I've already done will help progress the project :)

helionmusic avatar Nov 22 '16 12:11 helionmusic