#include "Behaviors/StateMachine.h"
#include "Behaviors/Controls/EventLogger.h"
#include "Shared/ProjectInterface.h"
#include "Vision/JPEGGenerator.h"

$nodeclass LogTestMachine : StateNode {

  $nodeclass Message : StateNode : doStart {
    std::string const msg = "Hooray for Captain Spaulding!";
      EventLogger::logMessage(msg,this);
  }

  $nodeclass Image : StateNode : doStart {
      EventLogger::logImage(*ProjectInterface::defColorJPEGGenerator,ProjectInterface::fullLayer,0,this);
      sndman->playFile("camera.wav");
  }

  $nodeclass Webcam : StateNode : doStart {
    EventLogger::logWebcam(this);
  }

  $setupmachine{

    startnode: StateNode
    startnode =TM("message")=> Message =N=> startnode
    startnode =TM("image")=> Image =N=> startnode
    startnode =TM("webcam")=> Webcam =N=> startnode

  }

}

REGISTER_BEHAVIOR(LogTestMachine);
