summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 3d6428d..8dbfb3d 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -16,129 +16,129 @@
16    .%`+i>       _;_. 16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that 17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more 22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with 26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34#include <qpe/qpeapplication.h> 34#include <qpe/qpeapplication.h>
35#include <qpe/resource.h> 35#include <qpe/resource.h>
36#include <qpe/config.h> 36#include <qpe/config.h>
37#include <opie/oticker.h> 37#include <opie/oticker.h>
38 38
39#include <qwidget.h> 39#include <qwidget.h>
40#include <qpixmap.h> 40#include <qpixmap.h>
41#include <qbutton.h> 41#include <qbutton.h>
42#include <qpainter.h> 42#include <qpainter.h>
43#include <qframe.h> 43#include <qframe.h>
44#include <qlayout.h> 44#include <qlayout.h>
45#include <qdir.h> 45#include <qdir.h>
46#include <stdlib.h> 46#include <stdlib.h>
47#include <stdio.h> 47#include <stdio.h>
48 48
49#include "audiowidget.h" 49#include "audiowidget.h"
50#include "mediaplayerstate.h" 50#include "mediaplayerstate.h"
51#include "playlistwidget.h" 51#include "playlistwidget.h"
52 52
53static const int xo = -2; // movable x offset 53static const int xo = -2; // movable x offset
54static const int yo = 22; // movable y offset 54static const int yo = 22; // movable y offset
55 55
56struct MediaButton { 56struct MediaButton {
57 bool isToggle, isHeld, isDown; 57 bool isToggle, isHeld, isDown;
58}; 58};
59 59
60//Layout information for the audioButtons (and if it is a toggle button or not) 60//Layout information for the audioButtons (and if it is a toggle button or not)
61MediaButton audioButtons[] = { 61MediaButton audioButtons[] = {
62 { TRUE, FALSE, FALSE }, // play 62 { TRUE, FALSE, FALSE }, // play
63 { FALSE, FALSE, FALSE }, // stop 63 { FALSE, FALSE, FALSE }, // stop
64 { FALSE, FALSE, FALSE }, // next 64 { FALSE, FALSE, FALSE }, // next
65 { FALSE, FALSE, FALSE }, // previous 65 { FALSE, FALSE, FALSE }, // previous
66 { FALSE, FALSE, FALSE }, // volume up 66 { FALSE, FALSE, FALSE }, // volume up
67 { FALSE, FALSE, FALSE }, // volume down 67 { FALSE, FALSE, FALSE }, // volume down
68 { TRUE, FALSE, FALSE }, // repeat/loop 68 { TRUE, FALSE, FALSE }, // repeat/loop
69 { FALSE, FALSE, FALSE }, // playlist 69 { FALSE, FALSE, FALSE }, // playlist
70 { FALSE, FALSE, FALSE }, // forward 70 { FALSE, FALSE, FALSE }, // forward
71 { FALSE, FALSE, FALSE } // back 71 { FALSE, FALSE, FALSE } // back
72}; 72};
73 73
74const char * const skin_mask_file_names[10] = { 74const char * const skin_mask_file_names[10] = {
75 "play", "stop", "next", "prev", "up", 75 "play", "stop", "next", "prev", "up",
76 "down", "loop", "playlist", "forward", "back" 76 "down", "loop", "playlist", "forward", "back"
77}; 77};
78 78
79 79
80static void changeTextColor( QWidget * ) { 80static void changeTextColor( QWidget * w) {
81 QPalette p = w->palette(); 81 QPalette p = w->palette();
82 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); 82 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) );
83 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); 83 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) );
84 w->setPalette( p ); 84 w->setPalette( p );
85} 85}
86 86
87static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); 87static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton));
88 88
89 89
90AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : 90AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) :
91 91
92 MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { 92 MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) {
93 93
94 setCaption( tr("OpiePlayer") ); 94 setCaption( tr("OpiePlayer") );
95 95
96 Config cfg("OpiePlayer"); 96 Config cfg("OpiePlayer");
97 cfg.setGroup("Options"); 97 cfg.setGroup("Options");
98 skin = cfg.readEntry("Skin","default"); 98 skin = cfg.readEntry("Skin","default");
99 //skin = "scaleTest"; 99 //skin = "scaleTest";
100 // color of background, frame, degree of transparency 100 // color of background, frame, degree of transparency
101 101
102 QString skinPath = "opieplayer2/skins/" + skin; 102 QString skinPath = "opieplayer2/skins/" + skin;
103 pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); 103 pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
104 imgUp = QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); 104 imgUp = QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) );
105 imgDn = QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); 105 imgDn = QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) );
106 106
107 imgButtonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); 107 imgButtonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 );
108 imgButtonMask.fill( 0 ); 108 imgButtonMask.fill( 0 );
109 109
110 for ( int i = 0; i < 10; i++ ) { 110 for ( int i = 0; i < 10; i++ ) {
111 QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png" ); 111 QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png" );
112 masks[i] = new QBitmap( filename ); 112 masks[i] = new QBitmap( filename );
113 113
114 if ( !masks[i]->isNull() ) { 114 if ( !masks[i]->isNull() ) {
115 QImage imgMask = masks[i]->convertToImage(); 115 QImage imgMask = masks[i]->convertToImage();
116 uchar **dest = imgButtonMask.jumpTable(); 116 uchar **dest = imgButtonMask.jumpTable();
117 for ( int y = 0; y < imgUp.height(); y++ ) { 117 for ( int y = 0; y < imgUp.height(); y++ ) {
118 uchar *line = dest[y]; 118 uchar *line = dest[y];
119 for ( int x = 0; x < imgUp.width(); x++ ) 119 for ( int x = 0; x < imgUp.width(); x++ )
120 if ( !qRed( imgMask.pixel( x, y ) ) ) 120 if ( !qRed( imgMask.pixel( x, y ) ) )
121 line[x] = i + 1; 121 line[x] = i + 1;
122 } 122 }
123 } 123 }
124 124
125 } 125 }
126 126
127 for ( int i = 0; i < 10; i++ ) { 127 for ( int i = 0; i < 10; i++ ) {
128 buttonPixUp[i] = 0l; 128 buttonPixUp[i] = 0l;
129 buttonPixDown[i] = 0l; 129 buttonPixDown[i] = 0l;
130 } 130 }
131 131
132 setBackgroundPixmap( pixBg ); 132 setBackgroundPixmap( pixBg );
133 133
134 songInfo.setFocusPolicy( QWidget::NoFocus ); 134 songInfo.setFocusPolicy( QWidget::NoFocus );
135// changeTextColor( &songInfo ); 135// changeTextColor( &songInfo );
136// songInfo.setBackgroundColor( QColor( 167, 212, 167 )); 136// songInfo.setBackgroundColor( QColor( 167, 212, 167 ));
137// songInfo.setFrameStyle( QFrame::NoFrame); 137// songInfo.setFrameStyle( QFrame::NoFrame);
138 songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken ); 138 songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken );
139// songInfo.setForegroundColor(Qt::white); 139// songInfo.setForegroundColor(Qt::white);
140 140
141 slider.setFixedHeight( 20 ); 141 slider.setFixedHeight( 20 );
142 slider.setMinValue( 0 ); 142 slider.setMinValue( 0 );
143 slider.setMaxValue( 1 ); 143 slider.setMaxValue( 1 );
144 slider.setFocusPolicy( QWidget::NoFocus ); 144 slider.setFocusPolicy( QWidget::NoFocus );