Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

helionmusic
Copy link

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. :)

AVA added 2 commits November 18, 2016 16:12
…ngs are reloaded next time the app is run.

Added firefly modes. Now contains Single-color, Upper-bottom and Bottom-up visualization modes.
Added Blackwidow modes. Now caintains the pre-existing EQ Visualizer and new Single-color, Bottom-up, Upper-bottom, Mid-to-side and Side-to-Mid modes
Added LED strip position control to select where the single color and upper-bottom, bottom-up, mid-to-side and side-to-mid visualization would be selected from the spectrum
Added visual indicator for this last strip position control. Draws a red line where it will be pulling the data from on the preview.
Added save settings button. All settings saved when clicked and settings are reloaded next time the app is run.
Added firefly modes. Now contains Single-color, Upper-bottom and Bottom-up visualization modes.
Added Blackwidow modes. Now caintains the pre-existing EQ Visualizer and new Single-color, Bottom-up, Upper-bottom, Mid-to-side and Side-to-Mid modes
Added LED strip position control to select where the single color and upper-bottom, bottom-up, mid-to-side and side-to-mid visualization would be selected from the spectrum
Added visual indicator for this last strip position control. Draws a red line where it will be pulling the data from on the preview.
@CalcProgrammer1
Copy link
Owner

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
Copy link
Owner

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.

@helionmusic
Copy link
Author

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!

@CalcProgrammer1
Copy link
Owner

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.

@helionmusic
Copy link
Author

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

@CalcProgrammer1
Copy link
Owner

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.

Copy link
Contributor

@d-rez d-rez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@helionmusic, some good work here, I didn't have the time to look much into your code but I have two comments if I may:

  • Your commit is full of whitespace (end-of-line and start-of-line) conflicts. You should probably fix them and update the pull request
  • You also should not explicitly commit an empty .gitignore file to the repository :)

@CalcProgrammer1
Copy link
Owner

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).

@helionmusic
Copy link
Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants