/*
 * Least Cost Routing plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */

#ifndef __LCROSD_H
#define __LCROSD_H

#include <sys/time.h>
#include <sys/ioctl.h>
#include <vdr/osd.h>
#include <vdr/thread.h>
#include <vdr/status.h>
#include <vdr/channels.h>
#include <vdr/transfer.h>
#include <vdr/tools.h>

class cLcrOsd : public cOsdObject, public cThread, public cStatus {
private:
  bool m_Active;
  cOsd *m_Osd;
  int m_Number;
  int m_OldNumber;

  const cFont *m_Font;
  cTimeMs m_InputTime;
  cMutex* m_Mutex;
  static cBitmap bmLogo;
  int inc;
  int logoOffset;
  const char *rates_line[21];
  FILE *rates;
  
  void DrawWindow(void);

protected:
  virtual void Action(void);
// TODO: implement the listener (maybe this fixes the cpu usage)
//  virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber);

public:
  cLcrOsd(void);
  ~cLcrOsd();

  virtual void Show(void);
  virtual eOSState ProcessKey(eKeys Key);
};

#endif //__LCROSD_H

