Coder Social home page Coder Social logo

Quick start guide? about rgb.net HOT 2 CLOSED

darthaffe avatar darthaffe commented on May 19, 2024
Quick start guide?

from rgb.net.

Comments (2)

DarthAffe avatar DarthAffe commented on May 19, 2024 5

Hey, first of all I'd like to make sure, that you're aware that this library is still in heavy development (even if it doesn't seem so - I'm a bit short on time lately) and will definitely have breaking api-changes in the near future.


Settings things up to use it right now is a bit tricky. I think the best way is the following:

  1. Clone and build the solution.
  2. Run the pack_all.bat in the NuGet directory
  3. Add the NuGet-directory as a local nuget-repository (you can do that by adding a nuget.config to the solution directory of the solution you want to use it in https://gist.github.com/DarthAffe/c2f3cfa7af30e4d94025ac314e029b40)
  4. Install the packages you want to use (You need core and the device-packages for all devices you want to use, I recommend the brushes, groups and decorators package - but that depends on what you want to do).

If this is done using the library is quite simple:
The first thing you need is the surface. You can get it from the static property RGBSurface.Instance.
You can configure how the library updates the devices but I'd recommend to only change the UpdateMode to Continuous and leave everything as is, as long as you don't have any problems with how it works by default.
You'll need to load your devices once (application start or something similar) by calling LoadDevices in the surface.
It doesn't matter if a device of a provider is connected so I personally just call everything like this:

RGBSurface surface = RGBSurface.Instance;
surface.Exception += args => Debug.WriteLine(args.Exception.Message));

surface.LoadDevices(AuraDeviceProvider.Instance); // This one can cause some trouble right now
surface.LoadDevices(CorsairDeviceProvider.Instance);
surface.LoadDevices(LogitechDeviceProvider.Instance);
surface.LoadDevices(CoolerMasterDeviceProvider.Instance);
surface.LoadDevices(NovationDeviceProvider.Instance);

After that you can access all loaded devices trough the Devices-enumerable on the surface.

Now the decisions depends more on how you want to work with the library. If you want to work surface-based you should loop through all devices and set their location to represent your table layout, if you want to work strictly device-based you can skip this step.

Lighting something up now is quite easy. Just create a group containing all the leds you want to use for one specific thing and apply a brush and if needed decorators (some sort of effects) to make something fancy. Just browse through the preset-projects to see what is currently available and how they are implemented (if you want to create your own).

You can also check https://github.com/DarthAffe/KeyboardAudioVisualizer/tree/master/KeyboardAudioVisualizer as an example project, but the device-access thing done there is not really good so it might not be the best reference :(

If you need any more information feel free to ask :)

from rgb.net.

BrianLima avatar BrianLima commented on May 19, 2024

This is exactly what i needed, thanks man!

I noticed that you are busy and there are many thing to make in the API yet, but i think that contributing is better than reinventing the wheel, if i face any bugs or need something implemented i'll talk to you and ask for directions for pull-requests.

Thanks, this library is shaping to be perfect to my Arduino LED project, loving it.

from rgb.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.