/***************************************************************************
                          CdboPlayerPnl.h  -  description
                             -------------------
    begin                : Wed Jan 30 2002
    copyright            : (C) 2002 by Alex Podolsky
    email                : alexpod@users.sourceforge.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
#ifndef CDBOPLAYERPNL_H
#define CDBOPLAYERPNL_H

#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QFrame;
class QLabel;
class QPushButton;
class InputStream;

class CdboAudioActionFactory;


//class CDDAPlugin;
//class OutputStream;


class CdboPlayerPnl : public QWidget
{
    Q_OBJECT

public:
    CdboPlayerPnl( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~CdboPlayerPnl();
	//a must call
	void setDevice(QString d, int t);
	//a must call
	void setFactory(CdboAudioActionFactory *f);
	void play(int);
	
public slots:
	void stop();
	
protected slots:
	virtual void timerEvent(QTimerEvent *event);
	void slotSongDone();
	void slotPlayDone();
	
	void play();
	void forward();
	void back();
	void prev();
	void next();
	
protected:
    QHBoxLayout* CdboPlayerPnlLayout;
    QHBoxLayout* cntPnlLayout;

    QFrame* cntPnl;
    QPushButton* playBtn;
    QPushButton* stopBtn;
    QPushButton* forwardBtn;
    QPushButton* backBtn;
    QPushButton* prevBtn;
    QPushButton* nextBtn;
    QLabel *timeLbl;
    QLabel *curLbl;

    QString device;
	int timeOutId;
	CdboAudioActionFactory *factory;
	
	int curTrack;
	int totalTracks;
	bool plaing;
	bool continuesPlay;
};

#endif // CDBOPLAYERPNL_H
