Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 3b33209..6e9c14a 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -67,49 +67,49 @@ const MediaWidget::SkinButtonInfo skinInfo[] = | |||
67 | { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, | 67 | { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, |
68 | { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, | 68 | { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, |
69 | { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, | 69 | { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, |
70 | { MediaWidget::Back, "back", MediaWidget::NormalButton } | 70 | { MediaWidget::Back, "back", MediaWidget::NormalButton } |
71 | }; | 71 | }; |
72 | 72 | ||
73 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); | 73 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); |
74 | 74 | ||
75 | void changeTextColor( QWidget * w) { | 75 | void changeTextColor( QWidget * w) { |
76 | QPalette p = w->palette(); | 76 | QPalette p = w->palette(); |
77 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); | 77 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); |
78 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); | 78 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); |
79 | w->setPalette( p ); | 79 | w->setPalette( p ); |
80 | } | 80 | } |
81 | 81 | ||
82 | } | 82 | } |
83 | 83 | ||
84 | AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : | 84 | AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : |
85 | 85 | ||
86 | MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), | 86 | MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), |
87 | audioSliderBeingMoved( false ) | 87 | audioSliderBeingMoved( false ) |
88 | { | 88 | { |
89 | for ( uint i = 0; i < buttonCount; ++i ) { | 89 | for ( uint i = 0; i < buttonCount; ++i ) { |
90 | Button button; | 90 | Button button; |
91 | button.buttonType = skinInfo[ i ].buttonType; | 91 | button.type = skinInfo[ i ].type; |
92 | buttons.push_back( button ); | 92 | buttons.push_back( button ); |
93 | } | 93 | } |
94 | 94 | ||
95 | setCaption( tr("OpiePlayer") ); | 95 | setCaption( tr("OpiePlayer") ); |
96 | 96 | ||
97 | Config cfg("OpiePlayer"); | 97 | Config cfg("OpiePlayer"); |
98 | cfg.setGroup("Options"); | 98 | cfg.setGroup("Options"); |
99 | skin = cfg.readEntry("Skin","default"); | 99 | skin = cfg.readEntry("Skin","default"); |
100 | //skin = "scaleTest"; | 100 | //skin = "scaleTest"; |
101 | // color of background, frame, degree of transparency | 101 | // color of background, frame, degree of transparency |
102 | 102 | ||
103 | QString skinPath = "opieplayer2/skins/" + skin; | 103 | QString skinPath = "opieplayer2/skins/" + skin; |
104 | pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); | 104 | pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); |
105 | imgUp = QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); | 105 | imgUp = QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); |
106 | imgDn = QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); | 106 | imgDn = QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); |
107 | 107 | ||
108 | buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); | 108 | buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); |
109 | buttonMask.fill( 0 ); | 109 | buttonMask.fill( 0 ); |
110 | 110 | ||
111 | masks.reserve( buttonCount ); | 111 | masks.reserve( buttonCount ); |
112 | 112 | ||
113 | for ( uint i = 0; i < masks.capacity(); i++ ) { | 113 | for ( uint i = 0; i < masks.capacity(); i++ ) { |
114 | QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skinInfo[i].fileName + ".png" ); | 114 | QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skinInfo[i].fileName + ".png" ); |
115 | masks.push_back( QBitmap( filename ) ); | 115 | masks.push_back( QBitmap( filename ) ); |
@@ -366,49 +366,49 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
366 | if ( isOnButton && !buttons[i].isHeld ) { | 366 | if ( isOnButton && !buttons[i].isHeld ) { |
367 | buttons[i].isHeld = TRUE; | 367 | buttons[i].isHeld = TRUE; |
368 | toggleButton(i); | 368 | toggleButton(i); |
369 | switch (i) { | 369 | switch (i) { |
370 | case VolumeUp: | 370 | case VolumeUp: |
371 | emit moreClicked(); | 371 | emit moreClicked(); |
372 | return; | 372 | return; |
373 | case VolumeDown: | 373 | case VolumeDown: |
374 | emit lessClicked(); | 374 | emit lessClicked(); |
375 | return; | 375 | return; |
376 | case Forward: | 376 | case Forward: |
377 | emit forwardClicked(); | 377 | emit forwardClicked(); |
378 | return; | 378 | return; |
379 | case Back: | 379 | case Back: |
380 | emit backClicked(); | 380 | emit backClicked(); |
381 | return; | 381 | return; |
382 | } | 382 | } |
383 | } else if ( !isOnButton && buttons[i].isHeld ) { | 383 | } else if ( !isOnButton && buttons[i].isHeld ) { |
384 | buttons[i].isHeld = FALSE; | 384 | buttons[i].isHeld = FALSE; |
385 | toggleButton(i); | 385 | toggleButton(i); |
386 | } | 386 | } |
387 | } else { | 387 | } else { |
388 | if ( buttons[i].isHeld ) { | 388 | if ( buttons[i].isHeld ) { |
389 | buttons[i].isHeld = FALSE; | 389 | buttons[i].isHeld = FALSE; |
390 | if ( buttons[i].buttonType != ToggleButton ) { | 390 | if ( buttons[i].type != ToggleButton ) { |
391 | setToggleButton( i, FALSE ); | 391 | setToggleButton( i, FALSE ); |
392 | } | 392 | } |
393 | qDebug("mouseEvent %d", i); | 393 | qDebug("mouseEvent %d", i); |
394 | handleCommand( static_cast<Command>( i ), buttons[ i ].isDown ); | 394 | handleCommand( static_cast<Command>( i ), buttons[ i ].isDown ); |
395 | } | 395 | } |
396 | } | 396 | } |
397 | } | 397 | } |
398 | } | 398 | } |
399 | 399 | ||
400 | 400 | ||
401 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { | 401 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { |
402 | mouseMoveEvent( event ); | 402 | mouseMoveEvent( event ); |
403 | } | 403 | } |
404 | 404 | ||
405 | 405 | ||
406 | void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { | 406 | void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { |
407 | mouseMoveEvent( event ); | 407 | mouseMoveEvent( event ); |
408 | } | 408 | } |
409 | 409 | ||
410 | 410 | ||
411 | void AudioWidget::showEvent( QShowEvent* ) { | 411 | void AudioWidget::showEvent( QShowEvent* ) { |
412 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | 412 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); |
413 | mouseMoveEvent( &event ); | 413 | mouseMoveEvent( &event ); |
414 | } | 414 | } |