Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

audiowidget.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2000 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 
00021 #ifndef AUDIO_WIDGET_H
00022 #define AUDIO_WIDGET_H
00023 
00024 #include <qwidget.h>
00025 #include <qpainter.h>
00026 #include <qdrawutil.h>
00027 #include <qpixmap.h>
00028 #include <qbitmap.h>
00029 #include <qstring.h>
00030 #include <qslider.h>
00031 #include <qlineedit.h>
00032 #include <qframe.h>
00033 
00034 #include <opie2/oticker.h>
00035 
00036 class QPixmap;
00037 
00038 enum AudioButtons {
00039     AudioPlay=0,
00040     AudioStop,
00041     AudioNext,
00042     AudioPrevious,
00043     AudioVolumeUp,
00044     AudioVolumeDown,
00045     AudioLoop,
00046     AudioPlayList,
00047     AudioForward,
00048     AudioBack
00049 };
00050 
00051 
00052 //#define USE_DBLBUF
00053 
00054 class AudioWidget : public QWidget {
00055     Q_OBJECT
00056 public:
00057     AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 );
00058     ~AudioWidget();
00059     void setTickerText( const QString &text ) { songInfo.setText( text ); }
00060     bool isStreaming;
00061 public slots:
00062     void updateSlider( long, long );
00063     void sliderPressed( );
00064     void sliderReleased( );
00065 //    void setPaused( bool b)  { setToggleButton( AudioPause, b ); }
00066     void setLooping( bool b) { setToggleButton( AudioLoop, b ); }
00067     void setPlaying( bool b) { setToggleButton( AudioPlay, b ); }
00068     void setPosition( long );
00069     void setLength( long );
00070     void setView( char );
00071 
00072 signals:
00073     void moreClicked();
00074     void lessClicked();
00075     void moreReleased();
00076     void lessReleased();
00077     void sliderMoved(long);
00078     void forwardClicked();
00079     void backClicked();
00080     void forwardReleased();
00081     void backReleased();
00082 
00083 protected:
00084     void doBlank();
00085     void doUnblank();
00086     void paintEvent( QPaintEvent *pe );
00087     void showEvent( QShowEvent *se );
00088     void resizeEvent( QResizeEvent *re );
00089     void mouseMoveEvent( QMouseEvent *event );
00090     void mousePressEvent( QMouseEvent *event );
00091     void mouseReleaseEvent( QMouseEvent *event );
00092     void timerEvent( QTimerEvent *event );
00093     void closeEvent( QCloseEvent *event );
00094     void keyReleaseEvent( QKeyEvent *e);
00095 private:
00096     void toggleButton( int );
00097     void setToggleButton( int, bool );
00098     void paintButton( QPainter *p, int i );
00099     QString skin;
00100     QPixmap *pixBg;
00101     QImage  *imgUp;
00102     QImage  *imgDn;
00103     QImage  *imgButtonMask;
00104     QBitmap *masks[11];
00105     QPixmap *buttonPixUp[11];
00106     QPixmap *buttonPixDown[11];
00107     
00108     QPixmap *pixmaps[4];
00109     Opie::Ui::OTicker  songInfo;
00110     QSlider slider;
00111     QLineEdit time;
00112     int xoff, yoff;
00113     
00114 };
00115 
00116 
00117 #endif // AUDIO_WIDGET_H
00118 

Generated on Sat Nov 5 16:15:34 2005 for OPIE by  doxygen 1.4.2