summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-08-15 21:18:17 (UTC)
committer llornkcor <llornkcor>2002-08-15 21:18:17 (UTC)
commit78fead876601c4218eda97ec1da95b01a70155cd (patch) (side-by-side diff)
treeedf21f7d3df75c88470fa511db1a3065a6adb9bc
parent8b6d28983e62dd26acfeb9cf7408e21f68558a16 (diff)
downloadopie-78fead876601c4218eda97ec1da95b01a70155cd.zip
opie-78fead876601c4218eda97ec1da95b01a70155cd.tar.gz
opie-78fead876601c4218eda97ec1da95b01a70155cd.tar.bz2
fix cruft
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp26
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h3
2 files changed, 14 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index cc6187c..132a911 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -181,39 +181,39 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
time.setAlignment( Qt::AlignCenter );
time.setFrame(FALSE);
changeTextColor( &time );
resizeEvent( NULL );
connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) );
connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) );
- connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) );
+// connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) );
connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) );
connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) );
connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) );
connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) );
// Intialise state
setLength( mediaPlayerState->length() );
setPosition( mediaPlayerState->position() );
setLooping( mediaPlayerState->fullscreen() );
- setPaused( mediaPlayerState->paused() );
+// setPaused( mediaPlayerState->paused() );
setPlaying( mediaPlayerState->playing() );
}
AudioWidget::~AudioWidget() {
for ( int i = 0; i < 10; i++ ) {
delete buttonPixUp[i];
delete buttonPixDown[i];
}
delete pixBg;
delete imgUp;
@@ -350,24 +350,25 @@ void AudioWidget::updateSlider( long i, long max ) {
if ( slider.value() != val ) {
slider.setValue( val );
}
if ( slider.maxValue() != width ) {
slider.setMaxValue( width );
}
}
}
void AudioWidget::setToggleButton( int i, bool down ) {
+ qDebug("setToggleButton %d", i);
if ( down != audioButtons[i].isDown ) {
toggleButton( i );
}
}
void AudioWidget::toggleButton( int i ) {
audioButtons[i].isDown = !audioButtons[i].isDown;
QPainter p(this);
paintButton ( &p, i );
}
@@ -414,58 +415,57 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
if ( event->state() == QMouseEvent::LeftButton ) {
// The test to see if the mouse click is inside the button or not
int x = event->pos().x() - xoff;
int y = event->pos().y() - yoff;
bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width()
&& y < imgButtonMask->height()
&& imgButtonMask->pixelIndex( x, y ) == i + 1 );
if ( isOnButton && !audioButtons[i].isHeld ) {
audioButtons[i].isHeld = TRUE;
toggleButton(i);
-
switch (i) {
case AudioVolumeUp:
emit moreClicked();
return;
case AudioVolumeDown:
emit lessClicked();
return;
case AudioForward:
emit forwardClicked();
return;
case AudioBack:
emit backClicked();
return;
}
- } else if ( !isOnButton && audioButtons[i].isHeld ) {
- audioButtons[i].isHeld = FALSE;
- toggleButton(i);
}
+ else if ( !isOnButton && audioButtons[i].isHeld ) {
+ audioButtons[i].isHeld = FALSE;
+ toggleButton(i);
+ }
} else {
if ( audioButtons[i].isHeld ) {
audioButtons[i].isHeld = FALSE;
if ( !audioButtons[i].isToggle ) {
setToggleButton( i, FALSE );
- qDebug("button toggled3 %d",i);
}
switch (i) {
case AudioPlay:
if( mediaPlayerState->isPaused ) {
- setToggleButton( i, FALSE );
+// setToggleButton( i, FALSE );
mediaPlayerState->setPaused( FALSE );
return;
} else if( !mediaPlayerState->isPaused ) {
- setToggleButton( i, TRUE );
+// setToggleButton( i, TRUE );
mediaPlayerState->setPaused( TRUE );
return;
} else {
// setToggleButton( i, TRUE );
// mediaPlayerState->setPlaying( videoButtons[i].isDown );
}
case AudioStop: mediaPlayerState->setPlaying(FALSE); return;
case AudioNext: mediaPlayerState->setNext(); return;
case AudioPrevious: mediaPlayerState->setPrev(); return;
case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return;
case AudioVolumeUp: emit moreReleased(); return;
case AudioVolumeDown: emit lessReleased(); return;
@@ -540,34 +540,34 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
if(mediaPlayerState->playing()) {
// toggleButton(1);
mediaPlayerState->setPlaying(FALSE);
// toggleButton(1);
} else {
// toggleButton(0);
mediaPlayerState->setPlaying(TRUE);
// toggleButton(0);
}
}
break;
case Key_Down:
- toggleButton(6);
+// toggleButton(6);
emit lessClicked();
emit lessReleased();
- toggleButton(6);
+// toggleButton(6);
break;
case Key_Up:
- toggleButton(5);
+// toggleButton(5);
emit moreClicked();
emit moreReleased();
- toggleButton(5);
+// toggleButton(5);
break;
case Key_Right:
// toggleButton(3);
mediaPlayerState->setNext();
// toggleButton(3);
break;
case Key_Left:
// toggleButton(4);
mediaPlayerState->setPrev();
// toggleButton(4);
break;
case Key_Escape:
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index 772d1d1..e7da6c5 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -40,25 +40,24 @@
#include <qpixmap.h>
#include <qstring.h>
#include <qslider.h>
#include <qframe.h>
#include <qlineedit.h>
class QPixmap;
enum AudioButtons {
AudioPlay=0,
AudioStop,
- AudioPause,
AudioNext,
AudioPrevious,
AudioVolumeUp,
AudioVolumeDown,
AudioLoop,
AudioPlayList,
AudioForward,
AudioBack
};
class Ticker : public QFrame {
@@ -80,25 +79,25 @@ private:
class AudioWidget : public QWidget {
Q_OBJECT
public:
AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 );
~AudioWidget();
void setTickerText( const QString &text ) { songInfo.setText( text ); }
bool isStreaming;
public slots:
void updateSlider( long, long );
void sliderPressed( );
void sliderReleased( );
- void setPaused( bool b) { setToggleButton( AudioPause, b ); }
+// void setPaused( bool b) { setToggleButton( AudioPause, b ); }
void setLooping( bool b) { setToggleButton( AudioLoop, b ); }
void setPlaying( bool b) { setToggleButton( AudioPlay, b ); }
void setPosition( long );
void setLength( long );
void setView( char );
signals:
void moreClicked();
void lessClicked();
void moreReleased();
void lessReleased();
void forwardClicked();