Diffstat (limited to 'core/multimedia/opieplayer/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index 94b979f..aa48961 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp | |||
@@ -10,24 +10,25 @@ | |||
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/resource.h> | 21 | #include <qpe/resource.h> |
22 | #include <qpe/config.h> | ||
22 | 23 | ||
23 | #include <qwidget.h> | 24 | #include <qwidget.h> |
24 | #include <qpixmap.h> | 25 | #include <qpixmap.h> |
25 | #include <qbutton.h> | 26 | #include <qbutton.h> |
26 | #include <qpainter.h> | 27 | #include <qpainter.h> |
27 | #include <qframe.h> | 28 | #include <qframe.h> |
28 | #include <qlayout.h> | 29 | #include <qlayout.h> |
29 | 30 | ||
30 | #include "audiowidget.h" | 31 | #include "audiowidget.h" |
31 | #include "mediaplayerstate.h" | 32 | #include "mediaplayerstate.h" |
32 | 33 | ||
33 | extern MediaPlayerState *mediaPlayerState; | 34 | extern MediaPlayerState *mediaPlayerState; |
@@ -56,46 +57,53 @@ MediaButton audioButtons[] = { | |||
56 | { 5*30+xo, 1*30+yo, 0, TRUE, FALSE, FALSE, FALSE }, // repeat/loop | 57 | { 5*30+xo, 1*30+yo, 0, TRUE, FALSE, FALSE, FALSE }, // repeat/loop |
57 | { 1*30+xo, 1*30+yo, 0, FALSE, FALSE, FALSE, FALSE } // playlist | 58 | { 1*30+xo, 1*30+yo, 0, FALSE, FALSE, FALSE, FALSE } // playlist |
58 | }; | 59 | }; |
59 | 60 | ||
60 | 61 | ||
61 | static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); | 62 | static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); |
62 | 63 | ||
63 | 64 | ||
64 | AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | 65 | AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : |
65 | QWidget( parent, name, f ) | 66 | QWidget( parent, name, f ) |
66 | { | 67 | { |
67 | setCaption( tr("OpiePlayer") ); | 68 | setCaption( tr("OpiePlayer") ); |
68 | 69 | Config cfg("OpiePlayer"); | |
70 | cfg.setGroup("AudioWidget"); | ||
69 | // QGridLayout *layout = new QGridLayout( this ); | 71 | // QGridLayout *layout = new QGridLayout( this ); |
70 | // layout->setSpacing( 2); | 72 | // layout->setSpacing( 2); |
71 | // layout->setMargin( 2); | 73 | // layout->setMargin( 2); |
72 | 74 | QString backgroundPix, buttonsAllPix, buttonsBigPix, controlsPix, animatedPix; | |
73 | setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); | 75 | backgroundPix=cfg.readEntry( " backgroundPix", "opieplayer/metalFinish"); |
74 | pixmaps[0] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButtonsAll" ) ); | 76 | buttonsAllPix=cfg.readEntry( "buttonsAllPix","opieplayer/mediaButtonsAll"); |
75 | pixmaps[1] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButtonsBig" ) ); | 77 | buttonsBigPix=cfg.readEntry( "buttonsBigPix","opieplayer/mediaButtonsBig"); |
76 | pixmaps[2] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaControls" ) ); | 78 | controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls"); |
77 | pixmaps[3] = new QPixmap( Resource::loadPixmap( "opieplayer/animatedButton" ) ); | 79 | animatedPix=cfg.readEntry( "animatedPix", "opieplayer/animatedButton"); |
80 | |||
81 | setBackgroundPixmap( Resource::loadPixmap( backgroundPix) ); | ||
82 | pixmaps[0] = new QPixmap( Resource::loadPixmap( buttonsAllPix ) ); | ||
83 | pixmaps[1] = new QPixmap( Resource::loadPixmap( buttonsBigPix ) ); | ||
84 | pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix ) ); | ||
85 | pixmaps[3] = new QPixmap( Resource::loadPixmap( animatedPix) ); | ||
78 | 86 | ||
79 | songInfo = new Ticker( this ); | 87 | songInfo = new Ticker( this ); |
80 | songInfo->setFocusPolicy( QWidget::NoFocus ); | 88 | songInfo->setFocusPolicy( QWidget::NoFocus ); |
81 | songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); | 89 | songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); |
82 | // layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 ); | 90 | // layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 ); |
83 | 91 | ||
84 | slider = new QSlider( Qt::Horizontal, this ); | 92 | slider = new QSlider( Qt::Horizontal, this ); |
85 | slider->setFixedWidth( 220 ); | 93 | slider->setFixedWidth( 220 ); |
86 | slider->setFixedHeight( 20 ); | 94 | slider->setFixedHeight( 20 ); |
87 | slider->setMinValue( 0 ); | 95 | slider->setMinValue( 0 ); |
88 | slider->setMaxValue( 1 ); | 96 | slider->setMaxValue( 1 ); |
89 | slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); | 97 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); |
90 | slider->setFocusPolicy( QWidget::NoFocus ); | 98 | slider->setFocusPolicy( QWidget::NoFocus ); |
91 | slider->setGeometry( QRect( 7, 262, 220, 20 ) ); | 99 | slider->setGeometry( QRect( 7, 262, 220, 20 ) ); |
92 | // layout->addMultiCellWidget( slider, 4, 4, 0, 2 ); | 100 | // layout->addMultiCellWidget( slider, 4, 4, 0, 2 ); |
93 | 101 | ||
94 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 102 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
95 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 103 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
96 | 104 | ||
97 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 105 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
98 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 106 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
99 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 107 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
100 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); | 108 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); |
101 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 109 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |