From 09d1eb079182e06e01cc9bea8bf9410e40a189c2 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Fri, 18 Feb 2011 21:44:39 +0000 Subject: improved text scroller, added numerical values for balance and volume (Closes issue 415) git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2057 90c681e8-e032-0410-971d-27865f9a5e38 --- src/ui/textscroller.h | 66 +++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 34 deletions(-) (limited to 'src/ui/textscroller.h') diff --git a/src/ui/textscroller.h b/src/ui/textscroller.h index bf4a0185d..b4c5909db 100644 --- a/src/ui/textscroller.h +++ b/src/ui/textscroller.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * + * Copyright (C) 2006-2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -21,65 +21,63 @@ #define TEXTSCROLLER_H #include - -/** - @author Ilya Kotov -*/ +#include class QTimer; class QMenu; - +class QAction; class Skin; +class SoundCore; +/** + @author Ilya Kotov +*/ class TextScroller : public QWidget { Q_OBJECT public: TextScroller(QWidget *parent = 0); + virtual ~TextScroller(); - ~TextScroller(); - - static TextScroller *getPointer(); - void setText(const QString&); - void readSettings(); - + void setText(const QString &text); public slots: - void setProgress(int); + void clear(); private slots: + void setProgress(int); void addOffset(); void updateSkin(); - void setAutoscroll(bool); - -protected: - void hideEvent (QHideEvent *); - void showEvent (QShowEvent *); - void paintEvent (QPaintEvent *); - void mousePressEvent (QMouseEvent *); - void mouseReleaseEvent (QMouseEvent *); - void mouseMoveEvent (QMouseEvent *); + void processState(Qmmp::State state); + void processMetaData(); + void updateText(); private: - bool m_pressing; - int press_pos; - bool m_update; - static TextScroller *pointer; + void hideEvent(QHideEvent *); + void showEvent(QShowEvent *); + void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void readSettings(); + void preparePixmap(const QString &text, bool scrollable = false); + QString m_defautText; + QString m_bufferText; + QString m_sliderText; + QString m_titleText; + QPixmap m_pixmap; - int x; + int m_x1, m_x2; + bool m_scroll, m_bitmap, m_pressed; + int m_press_pos; QFont m_font; QFontMetrics *m_metrics; - QString m_text; - QString m_scrollText; Skin *m_skin; QColor m_color; QTimer *m_timer; - int m_progress; - bool m_autoscroll; - bool m_bitmapConf; - bool m_bitmap; QMenu *m_menu; - int m_offset; + QAction *m_scrollAction; + SoundCore *m_core; }; #endif -- cgit v1.2.3-13-gbd6f