author | simon <simon> | 2002-12-09 14:22:05 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 14:22:05 (UTC) |
commit | 8746877e7ed89fc4c227d5d79d63c35c69ceacd6 (patch) (side-by-side diff) | |
tree | 3e8b175d266dcf97062278af0592118b70af533d | |
parent | 2bcd5795a30de05820edaf253dc34717de498fca (diff) | |
download | opie-8746877e7ed89fc4c227d5d79d63c35c69ceacd6.zip opie-8746877e7ed89fc4c227d5d79d63c35c69ceacd6.tar.gz opie-8746877e7ed89fc4c227d5d79d63c35c69ceacd6.tar.bz2 |
- moving some variables to the base class
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 73ce1e5..332fb4b 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -62,56 +62,50 @@ public slots: void setLooping( bool b) { setToggleButton( Loop, b ); } void setPosition( long ); void setSeekable( bool ); public: virtual void setLength( long ); virtual void setPlaying( bool b) { setToggleButton( Play, b ); } virtual void setDisplayType( MediaPlayerState::DisplayType displayType ); signals: void moreClicked(); void lessClicked(); void forwardClicked(); void backClicked(); void sliderMoved(long); protected: void doBlank(); void doUnblank(); void paintEvent( QPaintEvent *pe ); void showEvent( QShowEvent *se ); void resizeEvent( QResizeEvent *re ); void mouseMoveEvent( QMouseEvent *event ); void mousePressEvent( QMouseEvent *event ); void mouseReleaseEvent( QMouseEvent *event ); void timerEvent( QTimerEvent *event ); void keyReleaseEvent( QKeyEvent *e); private slots: void skipFor(); void skipBack(); void stopSkip(); private: - typedef std::vector<QBitmap> MaskVector; - typedef std::vector<QPixmap> PixmapVector; - void setToggleButton( int, bool ); virtual void paintButton( QPainter &p, int i ); int skipDirection; QString skin; QPixmap pixBg; QImage imgUp; QImage imgDn; - MaskVector masks; - PixmapVector buttonPixUp; - PixmapVector buttonPixDown; OTicker songInfo; QSlider slider; QLineEdit time; bool isStreaming : 1; bool audioSliderBeingMoved : 1; }; #endif // AUDIO_WIDGET_H diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 9fb3499..2641df6 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -25,71 +25,78 @@ #include <qwidget.h> #include "mediaplayerstate.h" #include "playlistwidget.h" #include <vector> class MediaWidget : public QWidget { Q_OBJECT public: enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back }; enum ButtonType { NormalButton, ToggleButton }; struct Button { Button() : type( NormalButton ), isHeld( false ), isDown( false ) {} ButtonType type : 1; bool isHeld : 1; bool isDown : 1; }; typedef std::vector<Button> ButtonVector; struct SkinButtonInfo { Command command; const char *fileName; ButtonType type; }; + typedef std::vector<QBitmap> MaskVector; + typedef std::vector<QPixmap> PixmapVector; + MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); virtual ~MediaWidget(); public slots: virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; virtual void setLength( long length ) = 0; virtual void setPlaying( bool playing ) = 0; signals: void moreReleased(); void lessReleased(); void forwardReleased(); void backReleased(); protected: virtual void closeEvent( QCloseEvent * ); void handleCommand( Command command, bool buttonDown ); bool isOverButton( const QPoint &position, int buttonId ) const; void paintButton( int buttonId ); virtual void paintButton( QPainter &p, int i ) = 0; void toggleButton( int buttonId ); MediaPlayerState &mediaPlayerState; PlayListWidget &playList; ButtonVector buttons; QImage buttonMask; + MaskVector masks; + PixmapVector buttonPixUp; + PixmapVector buttonPixDown; + QPoint upperLeftOfButtonMask; }; #endif // MEDIAWIDGET_H /* vim: et sw=4 ts=4 */ |