@@ -30,8 +30,8 @@ CFMutableDictionaryRef getFirstProfileWithName(CFArrayRef profiles, CFStringRef
30
30
31
31
int main (int argc, const char *argv[])
32
32
{
33
- if (argc != 5 ) {
34
- fprintf (stderr, " Usage: ./chroma device_id red green blue\n For example ./chroma 4 1 0.1 0\n " );
33
+ if (argc < 5 ) {
34
+ fprintf (stderr, " Usage: ./chroma device_id red green blue [static|breathing] \n For example: \n ./chroma 4 1 0.1 0\n ./chroma 4 1 0.1 0 breathing \n " );
35
35
return 1 ;
36
36
}
37
37
SInt32 connectStatus = GERazerConnect (NULL );
@@ -115,6 +115,7 @@ int main(int argc, const char *argv[])
115
115
// Configure effects
116
116
CFMutableDictionaryRef deviceEffects = CFDictionaryCreateMutable (kCFAllocatorDefault , 0 , &kCFTypeDictionaryKeyCallBacks , &kCFTypeDictionaryValueCallBacks );
117
117
GERazerDictionarySetThenReleaseValue (deviceEffects, kGERazerEffectNameStatic , GERazerEffectCreateStatic (red, green, blue));
118
+ GERazerDictionarySetThenReleaseValue (deviceEffects, kGERazerEffectNameBreathing , GERazerEffectCreateBreathing (red, green, blue, red, green, blue));
118
119
119
120
CFStringRef deviceIdString = GERazerStringCreateFromInt (deviceId);
120
121
@@ -128,7 +129,14 @@ int main(int argc, const char *argv[])
128
129
129
130
CFRelease (effectList);
130
131
131
- GERazerDictionaryRecursivelyMergeThenReleaseDictionary (deviceSettings, GERazerDeviceSettingsCreateWithEnabledLightingEffect (deviceId, kGERazerEffectIdStatic , kGERazerLightingBrightnessNormal ));
132
+ SInt32 effect_type;
133
+ if (argc == 6 && strcmp (argv[5 ], " breathing" ) == 0 ) {
134
+ effect_type = kGERazerEffectIdBreathing ;
135
+ } else {
136
+ effect_type = kGERazerEffectIdStatic ;
137
+ }
138
+
139
+ GERazerDictionaryRecursivelyMergeThenReleaseDictionary (deviceSettings, GERazerDeviceSettingsCreateWithEnabledLightingEffect (deviceId, effect_type, kGERazerLightingBrightnessNormal ));
132
140
133
141
if (followingProductId >= 0 )
134
142
{
0 commit comments