author | ar <ar> | 2004-05-02 17:04:41 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-02 17:04:41 (UTC) |
commit | 4d3379027557e251201b531896974a69ae4c665a (patch) (unidiff) | |
tree | 6e813be1aa29131f8f8e91f532f38f8a381e38f4 /core/multimedia/opieplayer/audiowidget.cpp | |
parent | f8add41b2e0b0371754521b44d95f87fa70a6ff2 (diff) | |
download | opie-4d3379027557e251201b531896974a69ae4c665a.zip opie-4d3379027557e251201b531896974a69ae4c665a.tar.gz opie-4d3379027557e251201b531896974a69ae4c665a.tar.bz2 |
- convert qDebug to odebug
Diffstat (limited to 'core/multimedia/opieplayer/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index 7da2d54..376f8d3 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp | |||
@@ -16,16 +16,21 @@ | |||
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 "audiowidget.h" | ||
21 | #include "mediaplayerstate.h" | ||
22 | |||
23 | /* OPIE */ | ||
20 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
22 | #include <qpe/config.h> | 26 | #include <qpe/config.h> |
27 | #include <opie2/odebug.h> | ||
23 | 28 | ||
29 | /* QT */ | ||
24 | #include <qdir.h> | 30 | #include <qdir.h> |
25 | #include "audiowidget.h" | ||
26 | #include "mediaplayerstate.h" | ||
27 | 31 | ||
32 | /* STD */ | ||
28 | #include <stdlib.h> | 33 | #include <stdlib.h> |
29 | #include <stdio.h> | 34 | #include <stdio.h> |
30 | 35 | ||
31 | extern MediaPlayerState *mediaPlayerState; | 36 | extern MediaPlayerState *mediaPlayerState; |
@@ -70,10 +75,10 @@ static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); | |||
70 | AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | 75 | AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : |
71 | QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) | 76 | QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) |
72 | { | 77 | { |
73 | setCaption( tr("OpiePlayer") ); | 78 | setCaption( tr("OpiePlayer") ); |
74 | // qDebug("<<<<<audioWidget"); | 79 | // odebug << "<<<<<audioWidget" << oendl; |
75 | 80 | ||
76 | Config cfg("OpiePlayer"); | 81 | Config cfg("OpiePlayer"); |
77 | cfg.setGroup("Options"); | 82 | cfg.setGroup("Options"); |
78 | skin = cfg.readEntry("Skin","default"); | 83 | skin = cfg.readEntry("Skin","default"); |
79 | //skin = "scaleTest"; | 84 | //skin = "scaleTest"; |
@@ -83,11 +88,11 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
83 | QString skinPath; | 88 | QString skinPath; |
84 | skinPath = "opieplayer2/skins/" + skin; | 89 | skinPath = "opieplayer2/skins/" + skin; |
85 | if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists()) | 90 | if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists()) |
86 | skinPath = "opieplayer2/skins/default"; | 91 | skinPath = "opieplayer2/skins/default"; |
87 | 92 | ||
88 | // qDebug("skin path " + skinPath); | 93 | // odebug << "skin path " + skinPath << oendl; |
89 | 94 | ||
90 | pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); | 95 | pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); |
91 | imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); | 96 | imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); |
92 | imgDn = new QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); | 97 | imgDn = new QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); |
93 | 98 | ||
@@ -102,10 +107,10 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
102 | QImage imgMask = masks[i]->convertToImage(); | 107 | QImage imgMask = masks[i]->convertToImage(); |
103 | uchar **dest = imgButtonMask->jumpTable(); | 108 | uchar **dest = imgButtonMask->jumpTable(); |
104 | for ( int y = 0; y < imgUp->height(); y++ ) { | 109 | for ( int y = 0; y < imgUp->height(); y++ ) { |
105 | uchar *line = dest[y]; | 110 | uchar *line = dest[y]; |
106 | for ( int x = 0; x < imgUp->width(); x++ ) | 111 | for ( int x = 0; x < imgUp->width(); x++ ) |
107 | if ( !qRed( imgMask.pixel( x, y ) ) ) | 112 | if ( !qRed( imgMask.pixel( x, y ) ) ) |
108 | line[x] = i + 1; | 113 | line[x] = i + 1; |
109 | } | 114 | } |
110 | } | 115 | } |
111 | 116 | ||
@@ -115,29 +120,29 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
115 | buttonPixUp[i] = NULL; | 120 | buttonPixUp[i] = NULL; |
116 | buttonPixDown[i] = NULL; | 121 | buttonPixDown[i] = NULL; |
117 | } | 122 | } |
118 | 123 | ||
119 | QWidget *d = QApplication::desktop(); | 124 | QWidget *d = QApplication::desktop(); |
120 | int width = d->width(); | 125 | int width = d->width(); |
121 | int height = d->height(); | 126 | int height = d->height(); |
122 | 127 | ||
123 | if( (width != pixBg->width() ) || (height != pixBg->height() ) ) { | 128 | if( (width != pixBg->width() ) || (height != pixBg->height() ) ) { |
124 | // qDebug("<<<<<<<< scale image >>>>>>>>>>>>"); | 129 | // odebug << "<<<<<<<< scale image >>>>>>>>>>>>" << oendl; |
125 | QImage img; | 130 | QImage img; |
126 | img = pixBg->convertToImage(); | 131 | img = pixBg->convertToImage(); |
127 | pixBg->convertFromImage( img.smoothScale( width, height)); | 132 | pixBg->convertFromImage( img.smoothScale( width, height)); |
128 | } | 133 | } |
129 | setBackgroundPixmap( *pixBg); | 134 | setBackgroundPixmap( *pixBg); |
130 | 135 | ||
131 | songInfo.setFocusPolicy( QWidget::NoFocus ); | 136 | songInfo.setFocusPolicy( QWidget::NoFocus ); |
132 | 137 | ||
133 | // changeTextColor( &songInfo ); | 138 | // changeTextColor( &songInfo ); |
134 | // songInfo.setBackgroundColor( QColor( 167, 212, 167 )); | 139 | // songInfo.setBackgroundColor( QColor( 167, 212, 167 )); |
135 | // songInfo.setFrameStyle( QFrame::NoFrame); | 140 | // songInfo.setFrameStyle( QFrame::NoFrame); |
136 | // songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken ); | 141 | // songInfo.setFrameStyle( QFrame::WinPanel | QFrame::Sunken ); |
137 | //NoFrame | 142 | //NoFrame |
138 | // songInfo.setForegroundColor(Qt::white); | 143 | // songInfo.setForegroundColor(Qt::white); |
139 | 144 | ||
140 | slider.setFixedHeight( 20 ); | 145 | slider.setFixedHeight( 20 ); |
141 | slider.setMinValue( 0 ); | 146 | slider.setMinValue( 0 ); |
142 | slider.setMaxValue( 1 ); | 147 | slider.setMaxValue( 1 ); |
143 | slider.setFocusPolicy( QWidget::NoFocus ); | 148 | slider.setFocusPolicy( QWidget::NoFocus ); |
@@ -171,9 +176,9 @@ this->setFocus(); | |||
171 | 176 | ||
172 | 177 | ||
173 | AudioWidget::~AudioWidget() { | 178 | AudioWidget::~AudioWidget() { |
174 | // setPlaying( false); | 179 | // setPlaying( false); |
175 | 180 | ||
176 | for ( int i = 0; i < 10; i++ ) { | 181 | for ( int i = 0; i < 10; i++ ) { |
177 | if(buttonPixUp[i]) delete buttonPixUp[i]; | 182 | if(buttonPixUp[i]) delete buttonPixUp[i]; |
178 | if(buttonPixDown[i]) delete buttonPixDown[i]; | 183 | if(buttonPixDown[i]) delete buttonPixDown[i]; |
179 | } | 184 | } |
@@ -252,9 +257,9 @@ void AudioWidget::sliderReleased() { | |||
252 | } | 257 | } |
253 | 258 | ||
254 | 259 | ||
255 | void AudioWidget::setPosition( long i ) { | 260 | void AudioWidget::setPosition( long i ) { |
256 | // qDebug("set position %d",i); | 261 | // odebug << "set position " << i << "" << oendl; |
257 | long length = mediaPlayerState->length(); | 262 | long length = mediaPlayerState->length(); |
258 | updateSlider( i, length ); | 263 | updateSlider( i, length ); |
259 | } | 264 | } |
260 | 265 | ||
@@ -299,9 +304,9 @@ static QString timeAsString( long length ) { | |||
299 | 304 | ||
300 | void AudioWidget::updateSlider( long i, long max ) { | 305 | void AudioWidget::updateSlider( long i, long max ) { |
301 | this->setFocus(); | 306 | this->setFocus(); |
302 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); | 307 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); |
303 | 308 | ||
304 | if ( max == 0 ) | 309 | if ( max == 0 ) |
305 | return; | 310 | return; |
306 | // Will flicker too much if we don't do this | 311 | // Will flicker too much if we don't do this |
307 | // Scale to something reasonable | 312 | // Scale to something reasonable |
@@ -365,21 +370,21 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
365 | 370 | ||
366 | bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() | 371 | bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() |
367 | && y < imgButtonMask->height() && imgButtonMask->pixelIndex( x, y ) == i + 1 ); | 372 | && y < imgButtonMask->height() && imgButtonMask->pixelIndex( x, y ) == i + 1 ); |
368 | 373 | ||
369 | // if ( isOnButton && i == AudioVolumeUp ) | 374 | // if ( isOnButton && i == AudioVolumeUp ) |
370 | // qDebug("on up"); | 375 | // odebug << "on up" << oendl; |
371 | 376 | ||
372 | if ( isOnButton && !audioButtons[i].isHeld ) { | 377 | if ( isOnButton && !audioButtons[i].isHeld ) { |
373 | audioButtons[i].isHeld = TRUE; | 378 | audioButtons[i].isHeld = TRUE; |
374 | toggleButton(i); | 379 | toggleButton(i); |
375 | switch (i) { | 380 | switch (i) { |
376 | case AudioVolumeUp: | 381 | case AudioVolumeUp: |
377 | // qDebug("more clicked"); | 382 | // odebug << "more clicked" << oendl; |
378 | emit moreClicked(); | 383 | emit moreClicked(); |
379 | return; | 384 | return; |
380 | case AudioVolumeDown: | 385 | case AudioVolumeDown: |
381 | // qDebug("less clicked"); | 386 | // odebug << "less clicked" << oendl; |
382 | emit lessClicked(); | 387 | emit lessClicked(); |
383 | return; | 388 | return; |
384 | case AudioForward: | 389 | case AudioForward: |
385 | emit forwardClicked(); | 390 | emit forwardClicked(); |
@@ -469,9 +474,9 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) | |||
469 | case Key_Home: | 474 | case Key_Home: |
470 | break; | 475 | break; |
471 | case Key_F9: //activity | 476 | case Key_F9: //activity |
472 | hide(); | 477 | hide(); |
473 | // qDebug("Audio F9"); | 478 | // odebug << "Audio F9" << oendl; |
474 | break; | 479 | break; |
475 | case Key_F10: //contacts | 480 | case Key_F10: //contacts |
476 | break; | 481 | break; |
477 | case Key_F11: //menu | 482 | case Key_F11: //menu |