These are chat archives for CoraleStudios/Colore

28th
Nov 2015
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 08:27
is someone online by any chance?
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 08:40

I was wondering what the correct syntax is for setting a breathing effect between 2 colours on my keyboard? I can set static colours just fine but I just can't get breathing to work (ie. nothing happens) when i use the same syntax:

Keyboard.Instance.SetBreathing(Corale.Colore.Core.Color.Green, Corale.Colore.Core.Color.Red);

Roxas Keyheart
@roxaskeyheart
Nov 28 2015 09:27
@WolfspiritM
Adrian
@WolfspiritM
Nov 28 2015 11:30
@technicaldaniel Seems like you found an issue with the Colore implementation of the Breathing struct. Going to fix it
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 11:38
greatly appreciated
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 11:51

@WolfspiritM I'm not sure if this is part of the same issue but whenever I try and use a different device to set a .SetBreathing() effect it returns the following error:

The type 'System.Windows.Media.Color' is defined in an assembly that is not referenced. You must add a reference to assembly 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

It doesn't do this for Keyboard though, however it does it for all other devices.

Additionally, the Headset .setBreathing() method only has one parameter so I can't set 2 colours to breath between.

Adrian
@WolfspiritM
Nov 28 2015 12:06
@technicaldaniel Headsets only support one Color for breathing.
What other devices are you trying to set breathing and it fails with the error you got? Mouse?
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 12:07
@WolfspiritM It appears the error throws for all devices except Keyboard.
I will double check in a sec when i can recompile
Adam Hellberg
@Sharparam
Nov 28 2015 12:07
@WolfspiritM Since Colore 3.0 we are supporting setting WPF colors as well as System.Drawing colors, this unfortunately means that apps will have to add a reference to the WPF library (PresentationCore.dll) if they reference code that itself has direct or in-direct references to System.Windows.Media.Color.
@technicaldaniel i mean*
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 12:09
@Sharparam does the Colore library reference WPF in the .setBreathing() method? I'm using the exact same colour syntax as my .setAll() methods which has been working perfectly without PresentationCore?
Adrian
@WolfspiritM
Nov 28 2015 12:10
@Sharparam I have a test Winforms app that doesn't reference PresentationCore and works. As long as Colore does reference it it should be fine I think
Adam Hellberg
@Sharparam
Nov 28 2015 12:10
@technicaldaniel System.Windows.Media.Color is only ever directly referenced in the casting operators inside Corale.Colore.Core.Color, i'm not entirely sure when .NET/the compiler decides that the reference is needed on a project level.
@WolfspiritM On StackOverflow the answers seemed to be that as long as an external type is not referenced in a constructor it's fine, but it seems to not always be the case.
Adrian
@WolfspiritM
Nov 28 2015 12:19
@technicaldaniel Mouse.Instance.SetBreathing(Color.Red, Color.Green, Led.All); works for me without PresentationCore. How do you generate your colors? Are you just using Color.Red for example?
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 12:21
@WolfspiritM Headset.Instance.SetBreathing(Corale.Colore.Core.Color.Red);
is throwing me the error

Keyboard.Instance.SetBreathing(Corale.Colore.Core.Color.Red, Corale.Colore.Core.Color.Green);

seems to work but nothing happens on the keyboard, but that might be an actual bug as you were saying.

Adrian
@WolfspiritM
Nov 28 2015 12:23
Hm I don't have that problem. I don't have a headset to test it but it doesn't give me an error
Yes that won't work but actually should throw an invalid parameter exception from the native call
cause Razer added a BreathingType which Colore doesn't seem to have yet
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 12:25
The mouse code you posted seems to be accepted as i didn't have the led parameter on the end, however i don't have a mouse to test if it actually works.
Adam Hellberg
@Sharparam
Nov 28 2015 12:26
@WolfspiritM In what version of the SDK? THe docs download is still for 1.0.4 while synapse ships with 1.1.5 so i'm unable to check it out atm
unless synapse saves the headers somewhere but i don't know where
Adrian
@WolfspiritM
Nov 28 2015 12:26
1.1.2
CoraleStudios/Colore#129
but 1.0.4 should also have it like that
yep just checked...1.0.4 also has the Type
Sharparam @Sharparam slaps self
Adam Hellberg
@Sharparam
Nov 28 2015 12:33
apparently that change went past us
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 12:33
Okay i fixed the headset by just referencing PresentationCore. Ideally I would like to do it without that but it works so thats that
Adrian
@WolfspiritM
Nov 28 2015 12:34
@Sharparam Actually the UsedImplicitly is just a copy and paste from the Mouse Breathing Effect which also doesn't have PublicAPI :P
But what do you mean that it doesn't have an invalid value?
Adam Hellberg
@Sharparam
Nov 28 2015 12:36
myep, hence my comment about our usage not being consistent. UsedImplicitlyshould be on code that is not necessarily publicly accessible but used in some way, to prevent toolings from marking it as unused. (like fields that will be consumed by the SDK but can't actually be seen/used by external code)
the enum in the SDK docs only has "Two" and "Random", not "Invalid"
is the header different?
Adrian
@WolfspiritM
Nov 28 2015 12:36
//! Breathing effects.
enum Type
{
TWO_COLORS = 1, //!< 2 colors
RANDOM_COLORS, //!< Random colors
INVALID
} Type;
Adam Hellberg
@Sharparam
Nov 28 2015 12:37
that's interesting
this is in the docs (1.0.4)
i checked the header file for 1.0.4 and indeed it is like your paste
this is really weird
Adrian
@WolfspiritM
Nov 28 2015 12:38
haha yeah that's in the Docs for 1.1.2, too
the types file itself however does have it
RzChromaSDKTypes.h
Adam Hellberg
@Sharparam
Nov 28 2015 12:39
we should probably follow the header file then
i have a feeling the docs have not been updated...
updated my PR comment
Adrian
@WolfspiritM
Nov 28 2015 12:41
Or they don't add invalid values to the docs? The Keypad doesn't have that, too, it seems.
Adam Hellberg
@Sharparam
Nov 28 2015 12:42
the docs are generated from the source/headers, so it'd include whatever is in there
we use the same tool (Doxygen) to generate the docs for Colore
Adrian
@WolfspiritM
Nov 28 2015 12:43
yeah but not sure if you can maybe leave out specific enum values when it's getting generated
Adam Hellberg
@Sharparam
Nov 28 2015 12:43
hm, the "INVALID" value is missing a doc comment. so it might be they are only extracting values that have doc comments. the default setting in doxygen
in whatever case that's a blunder on their part.
Adrian
@WolfspiritM
Nov 28 2015 12:43
yep
Adam Hellberg
@Sharparam
Nov 28 2015 12:44
especially considering the INVALID field in other enums do have doc comments
Adrian
@WolfspiritM
Nov 28 2015 12:52
Great...structs don't support parameterless constructors...
Adam Hellberg
@Sharparam
Nov 28 2015 12:52
yep
IIRC C# 7 or so is going to change that, or if it was just a proposed feature
Adrian
@WolfspiritM
Nov 28 2015 12:54
Never worked that much with structs
Adam Hellberg
@Sharparam
Nov 28 2015 12:55
it's supposed in IL, but not C#. IIRC the reasoning was something about how since structs are value types they can't be null. so an array of structs needs to call the parameterless constructor for each element. and if they allow custom it can incur problems or something
supported in IL*
oh actually quite a different reason
Although the CLR allows it, C# does not allow structs to have a default parameterless constructor. The reason is that, for a value type, compilers by default neither generate a default constructor, nor do they generate a call to the default constructor. So, even if you happened to define a default constructor, it will not be called and that will only confuse you. To avoid such problems, the C# compiler disallows definition of a default constructor by the user.
Adrian
@WolfspiritM
Nov 28 2015 12:58
ah okay
so I think this should work. The color won't really matter, right? NativeWrapper.CreateKeyboardEffect(new Breathing(BreathingType.Random,Color.Black,Color.Black)
Adam Hellberg
@Sharparam
Nov 28 2015 13:00
yes, it's what we do for the random breathing on mouse
Adrian
@WolfspiritM
Nov 28 2015 13:00
alright
Adam Hellberg
@Sharparam
Nov 28 2015 13:00
you should call SetBreathing with that breathing effect though, rather than a direct call to CreateEffect
Adrian
@WolfspiritM
Nov 28 2015 13:01
okay yep was just going to do that
Adam Hellberg
@Sharparam
Nov 28 2015 13:01
:P
Adrian
@WolfspiritM
Nov 28 2015 13:11
OMG
Random doesn't seem to work...even in native C++
Adam Hellberg
@Sharparam
Nov 28 2015 13:11
#JustRazerThings
oh right there's markdown here
Adrian
@WolfspiritM
Nov 28 2015 13:14
It does work as if it is set as TWO_COLORS...fading between black and black :P
Adam Hellberg
@Sharparam
Nov 28 2015 13:14
"Let's add a feature that doesn't do anything."
sound logic
does the random effect on mouse work? i think when i tested it didn't
Adrian
@WolfspiritM
Nov 28 2015 13:15
that does work
Adam Hellberg
@Sharparam
Nov 28 2015 13:15
interesting
it works on my mamba TE but not deathadder
while the two_color breathing only works on deathadder (but uses only the first color)
Adrian
@WolfspiritM
Nov 28 2015 13:16
Seems like this SDK is well designed
Adam Hellberg
@Sharparam
Nov 28 2015 13:17
so if set to breathe between greend and red, deathadder will breathe between greend and green while the mamba will breathe to green, then have no color for the second breathe, then back to green
Adrian
@WolfspiritM
Nov 28 2015 13:23
I will add the random breathing mode anyways even so it won't work...can't test it but I think it should work if Razer makes it work in the SDK
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 13:38
Not sure where you guys are at with this but I was wondering if you knew when an update will be pushed with that fix? Need to work around it tis all, no rush.
Adrian
@WolfspiritM
Nov 28 2015 13:40
If you use git and build colore yourself you can pull the fix/keyboard_breathing branch from here for now: https://github.com/WolfspiritM/Colore otherwise I think it will take a while for a nuget package with that being available
Adam Hellberg
@Sharparam
Nov 28 2015 13:56
it's in queue as next hotfix atm, waiting on brandon to review. for future reference, bugfixes should be branched from master with a name like hotfix/missing-keyboard-effect-enum since bugfixes are done on the master branch and then integrated to develop
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 13:57
Alrighty, I'll grab the branch and build it. Thanks!!
Adrian
@WolfspiritM
Nov 28 2015 13:57
alright
@technicaldaniel grab the develop branch from Colore directly now as mine doesn't include latest hotfix
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 13:58
Yup that's what I did :)
Adrian
@WolfspiritM
Nov 28 2015 13:59
good :-)
@technicaldaniel nevermind. You can even use master now :P
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:00
lol okay, probably better to use that.
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:06
Okay that's been built and applied to my project. Did you change the parameters for SetBreathing() or is it still just (col1, col2)?
Adrian
@WolfspiritM
Nov 28 2015 14:06
still the same
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:10

I'm getting a:

Corale.Colore.Razer.NativeCallException was unhandled
Message: An unhandled exception of type 'Corale.Colore.Razer.NativeCallException' occurred in Corale.Colore.dll
Additional information: Call to native Chroma SDK function CreateKeyboardEffect failed with error: RzInvalidParameter: Invalid parameter. (87)

when trying to call the method.

Keyboard.Instance.SetBreathing(Corale.Colore.Core.Color.FromSystemColor(System.Drawing.Color.Red), Corale.Colore.Core.Color.FromSystemColor(System.Drawing.Color.Green));

Adrian
@WolfspiritM
Nov 28 2015 14:14
Can you try Keyboard.Instance.SetBreathing(new Corale.Colore.Razer.Keyboard.Effects.Breathing(Corale.Colore.Razer.Keyboard.Effects.BreathingType.Two,Color.Red,Color.Green));
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:16

Okay now I'm getting a:

System.MissingMethodException was unhandled
Message: An unhandled exception of type 'System.MissingMethodException' occurred in Chromatics.cs-635843546859366557.dll
Additional information: Method not found: 'Void Corale.Colore.Razer.Keyboard.Effects.Breathing..ctor(Corale.Colore.Razer.Keyboard.Effects.BreathingType, Corale.Colore.Core.Color, Corale.Colore.Core.Color)'.

Adrian
@WolfspiritM
Nov 28 2015 14:20
And I assume this works but gives the invalid parameter again? Keyboard.Instance.SetBreathing(new Corale.Colore.Razer.Keyboard.Effects.Breathing(Color.Red, Color.Green));
It looks like you don't have the change yet with the breathingtype
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:21
I double checked that your patch code was in the project before building it, so I'm fairly sure its there.
I'll try building off the developer branch
Adrian
@WolfspiritM
Nov 28 2015 14:24
Can you output the result of "Corale.Colore.Razer.Keyboard.Effects.BreathingType.Two.ToString()" to see if that type is there?
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:32

throws:

Could not load type 'Corale.Colore.Razer.Keyboard.Effects.BreathingType' from assembly 'Corale.Colore, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null'

when i try and write that string to the console

Adrian
@WolfspiritM
Nov 28 2015 14:33
I really think you're loading the wrong assembly
Just wondering...What are you using to develop with Chroma? Doesn't seem like Visual Studio?
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:34
Visual Studio 2015
However I'm building a class library so I'm using an external debugger
Adrian
@WolfspiritM
Nov 28 2015 14:35
Could it be possible you have another (old) colore dll in the same output folder?
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:36
I'll check again but I went through an deleted them all before inserting the new ones. I'm just building the develop branch to see if that works
Adrian
@WolfspiritM
Nov 28 2015 14:37
If VS doesn't struggle while building the library it is using the new Version of Colore cause it can find the Type. But it seems once your application runs it's using an older version
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:37
VS is picking up .BreathingType in its syntax
Adrian
@WolfspiritM
Nov 28 2015 14:38
Make sure the Colore Refernce is also set to Copy Local = True (which should be default)
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:39
Yeah I actually just checked that
Adrian
@WolfspiritM
Nov 28 2015 14:39
hm
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:40

Okay well I'm getting a:

System.Reflection.TargetInvocationException was unhandled
Message: An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an invocation.

when using the develop branch .dll's

Adrian
@WolfspiritM
Nov 28 2015 14:41
Did you use the nuget package before?
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:42
What do you mean?
Adrian
@WolfspiritM
Nov 28 2015 14:43
Have you ever used the nuget package of Colore in your project? Cause I'm wondering why it said "'Corale.Colore, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null'" in an early message.
I think only the Nuget versions have a Version Set
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:44
Oh no I haven't been using nuget I don't think
I'll try that
Adrian
@WolfspiritM
Nov 28 2015 14:45
you can try now...I think Sharparam just released 3.0.2 with your fix as nuget package
The Develop branch and the Master branch are the same...so there shouldn't be a different result at the moment
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 14:51
Hold on now Colore isn't even loading and the app is just crashing on boot, need to step though this.. >.>
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 15:27

Alright problem solved. The nuget release seemed to fix the breathing issues. You guys are awesome.

The only downside is now my headset appears to be completely unresponsive to Colore. When I run my program it just defaults to a very dim blue and freezes until I release the program and Synapse takes over. can never win with developing. :/

Roxas Keyheart
@roxaskeyheart
Nov 28 2015 15:39
For the record, I have concluded that the headset isn't working because Razer released a new version of Synapse+SDK yesterday and I just updated. I believe they changed the GUIDs for Razer Kraken 7.1 rendering the Query() method useless like the Razer Deathstalker.
Adrian
@WolfspiritM
Nov 28 2015 15:44
@technicaldaniel I compared 1.0.4 and 1.1.2 and the guid for the kraken is the same in both SDK Versions
@technicaldaniel Take a look at CoraleStudios/Colore#125
Roxas Keyheart
@roxaskeyheart
Nov 28 2015 16:13
Hmm well its certainly rejecting the .Query() when i use the guid. It's only a problem because i poll for all devices connected, I can still send colours and what not to the headset fine.
That being said could you please check the GUID's in 1.1.2 for the Deathstalker and Diamondback?
CoraleStudios/Colore#128
Adrian
@WolfspiritM
Nov 28 2015 16:20
Deathstalker wasn't present in 1.0.4 but is in 1.1.2 and has the same guid defined in Colore
And Diamondback guid is the same everywhere
Adam Hellberg
@Sharparam
Nov 28 2015 16:37
Deathstalker is confirmed to be on Razer's side. Unsure about diamondback but probably the same