1#ifndef __LEDANIMATION_H__ 2#define __LEDANIMATION_H__ 3 4//! Keyboard LED Animation class. 5 6#include <SupportDefs.h> 7#include <OS.h> 8 9class LEDAnimation { 10public: 11 //! Constructor 12 LEDAnimation(); 13 //! Destructor 14 ~LEDAnimation(); 15 //!Start LED animation. 16 void Start(); 17 //!Stop LED animation. 18 void Stop(); 19 //! Check animation thread is running. 20 bool IsRunning() const {return fRunning;} 21private: 22 //!Anination thread. 23 static int32 AnimationThread(void *data); 24 //!Set LED on or off. 25 static void LED(uint32 mod/*!Modifier key*/,bool on/*!If LED on, value is true*/); 26 //!Animation thread ID. 27 thread_id fThread; 28 //!Thread running flag. 29 volatile bool fRunning; 30 uint32 fOrigModifiers; 31}; 32 33#endif 34