#include "control.h"
#include "player.h"
#include "keys.h"

#include <vdr/status.h>

cClusterKeys ClusterKeys;

cClusterControl::cClusterControl(const char *Filename):
		cControl(m_Player = new cClusterPlayer(Filename)) {
	cStatus::MsgReplaying(this, Filename);
}

cClusterControl::~cClusterControl() {
	cStatus::MsgReplaying(this, NULL);
	Stop();
}

void cClusterControl::Stop(void) {
  delete m_Player;
  m_Player = NULL;
}

eOSState cClusterControl::ProcessKey(eKeys Key) {
  switch (Key) {
	case kNone:
		return osContinue;

	case kBack: 
	case kBlue: 
		return osEnd; 
		break;

	default:
		return m_Player->PutRemote(Key);
  }
}

void cClusterControl::Hide(void) {
}
