#ifndef KARAOKE_H
#define KARAOKE_H


#include <stdlib.h>
#include <getopt.h>
#include <strings.h>
#include <typeinfo>
#include <vdr/menuitems.h>
#include <vdr/status.h>
#include <vdr/plugin.h>
#include <vdr/osd.h>
#include <vdr/interface.h>
#include <vdr/skins.h>
#include <vdr/menu.h>

#include "common.h"
#include "setup.h"
#include "setup-karaoke.h"
#include "data-mp3.h"
#include "player-mp3.h"
#include "menu.h"
#include "menu-async.h"
#include "decoder.h"
#include "decoder-mp3.h"
#include "i18n.h"
#include "version.h"


// --- CKaraokeControl
// --------------------------------------------------------
#define eDvbColor int
#define MAXROWS 120
#define INLINE
class CKaraokeControl:public cControl
{
private:
public:
  cOsd * osd;
  std::string imagefile;
  const cFont *font;
  int fw, fh;
  // 
  cMP3Player *player;
  bool showtrans, visible, statusActive, copyfile, recordstream, pressedOk,
    flush;
  time_t timeoutShow, greentime, oktime;
  int lastkeytime, num, number, tracknr, oldtracknr;
  bool selecting, selecthide;
  // 
  cMP3PlayInfo *lastMode;
  time_t fliptime, listtime;
  int hashlist[MAXROWS];
  int flip, flipint, top, rows, lh;
  int lastIndex, lastTotal, lastTop;
  int framesPerSecond;
  // 
  static cBitmap bmShuffle, bmLoop, bmCopy;
  // 
  bool jumpactive, jumphide, jumpsecs;
  int jumpmm;
  // 
  int clrBackground;
  int clrBackground2;
  int clrNormalText;
  int clrTracklistText;
  int clrListItemActiveBackground;
  int clrListItemActiveText;
  int clrProgress;
  int clrProgressBackground;
  // 
  void ShowTimed( int Seconds = 0 );
  void ShowProgress( bool open = false );
  void ShowStatus( bool force );
  void HideStatus( void );
  void DisplayInfo( const char *s = 0 );
  void JumpDisplay( void );
  void JumpProcess( eKeys Key );
  void Jump( void );
  void Stop( void );
  void CopyFile( void );
  void StartRecord( void );
  void StopRecord( void );
  void LoadCover( void );
  inline void Flush( void );
public:
    CKaraokeControl( void );
    virtual ~ CKaraokeControl(  );
  virtual eOSState ProcessKey( eKeys Key );
  virtual void Show( void )
  {
    ShowTimed(  );
  }
  virtual void Hide( void );
  bool Visible( void )
  {
    return visible;
  }
  static bool SetPlayList( cPlayList * plist );
};

#endif
