//-*-c++-*-
#ifndef INCLUDED_BarkBowlBlinkBehavior_h_
#define INCLUDED_BarkBowlBlinkBehavior_h_

#include "Behaviors/StateMachine.h"
#include "Events/EventRouter.h"

class BarkBowlBlinkBehavior : public StateNode {
  public:
    BarkBowlBlinkBehavior() : StateNode("BarkBowlBlinkBehavior") {}

    virtual void setup() {
     #statemachine
      	startnode: StateNode =N=> {noblink, bark}
	
	noblink: LedNode [setPriority(MotionManager::kBackgroundPriority);
			  getMC() ->set(RobotInfo::FaceLEDMask, 0.0);]

	bark: SoundNode($, "barkmed.wav")
	>==EventTrans($,$$,EventBase::buttonEGID, ChiaraInfo::GreenButOffset, EventBase::activateETID)
	[setSound("ping.wav");]==>wait: StateNode =T(15000)=> bark

	bark =T(5000)=>{howl, blink}

	howl: SoundNode($, "howl.wav")
	
	//blink: LedNode [getMC() ->cycle(RobotInfo::AllLEDMask, 1500, 1.0);]
	blink: LedNode [getMC() ->flash(RobotInfo::AllLEDMask, 500);]
	
	{howl, blink} =C(1)=> wait
    #endstatemachine
  }
};
#endif	
