Source: kmms/kmmsdock.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
                          kmmsdock.h  -  description
                             -------------------
    begin                : Mon Mar  5 16:18:00 CET 2001
    copyright            : (C) 2001 by Janosch Rolles
    email                : janosch@base2.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 KMMSDOCK_H
#define KMMSDOCK_H

#include "kmmsprefsImpl.h"


#include <klocale.h>
#include <kprocess.h>
#include <ksimpleconfig.h>

#include <stdio.h>

#include <qvariant.h>
#include <qwidget.h>

#include <qstring.h>
#include <qdir.h>
#include <qtimer.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qfont.h>
#include <qfontmetrics.h>
#include <qdragobject.h>
#include <qevent.h>


#include <stdio.h>
#include <glib.h>
#include <glibconfig.h>


#include <xmms/plugin.h>
#include <xmms/xmmsctrl.h>


#define KMMSDOCK_WIDTH 114
#define KMMSDOCK_FULLHEIGHT 54
#define HORIZ 1
#define VERTI 2


#define SCROLL_DELAY_NS 20
#define RECEIVE_DELAY_NS 100



class kmmsdock : public QWidget
{ 
    Q_OBJECT

public:
    kmmsdock( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~kmmsdock();

		/* Preferences Variables */
		QColor titleColor;
		QColor osdColor;
		bool clearPlaylistOnDrop;
		bool autoPlayAddedSongs;

public slots:
		void loadPreferences();
		void savePreferences();

		void initialize(const char* version = 0);
		void prefsPopup();

		int widthForHeight( int height );
		int heightForWidth( int width );

private:
		QString homeDir;
		KSimpleConfig *kmmsConfig;

		int kmmsWidth, titleWidth, kmmsFullHeight, kmmsCurrentHeight;
		int kmmsOrientation;

		int xPos, scrollStep;
		int scrollDelay;
		int receiveDelay;

		bool xmmsStarted;
		bool welcomeDisplayed;

	  int playlistpos, volume, lastvolume, currentTime, trackTime;
		QString lasttitle, title, temptitle; // chronological order

		int displayVolume;
	
		QPixmap skinpm;

		// for paint() (not recreate these 50 times in one second)
	  QPixmap pmt;
	  QPainter pt;
  	QPainter hvpainter;

private slots:
  	void scroll();
	  void receive();

		void makeSkinBuffer();
		void paintSkin( QPainter *pskin );

		void paint();
		void speedup();

		void updateTitle();

		void dragEnterEvent(QDragEnterEvent* event);
		void dropEvent(QDropEvent *event);
	  void mouseReleaseEvent(QMouseEvent *event);
		void wheelEvent(QWheelEvent *event);

		void xmmsStart();
		void xmmsBack();
		void xmmsPlay();
		void xmmsPause();
		void xmmsStop();
		void xmmsSkip();
		void xmmsVolup();
		void xmmsVoldw();
};

#endif // KMMSDOCK_H

Generated by: cunn@cun on Tue Apr 3 21:42:13 2001, using kdoc 2.0a49.