summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp67
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp4
-rw-r--r--noncore/multimedia/opieplayer2/mediadetect.cpp5
-rw-r--r--noncore/multimedia/opieplayer2/opieplayer2.pro1
4 files changed, 39 insertions, 38 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 6d867e5..bf3590b 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -80,10 +80,11 @@ void Ticker::timerEvent( QTimerEvent * ) {
repaint( FALSE );
}
void Ticker::drawContents( QPainter *p ) {
- for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen )
- p->drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText );
+ for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) {
+ p->drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText );
+ }
QPixmap pm( width(), height() );
pm.fill( colorGroup().base() );
QPainter pmp( &pm );
for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) {
@@ -92,9 +93,9 @@ void Ticker::drawContents( QPainter *p ) {
p->drawPixmap( 0, 0, pm );
}
struct MediaButton {
- bool isToggle, isHeld, isDown;
+ bool isToggle, isHeld, isDown;
};
//Layout information for the audioButtons (and if it is a toggle button or not)
MediaButton audioButtons[] = {
@@ -126,19 +127,18 @@ static void changeTextColor( QWidget *w ) {
static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton));
AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
- QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) {
-
+ QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) {
setCaption( tr("OpiePlayer") );
Config cfg("OpiePlayer");
cfg.setGroup("Options");
skin = cfg.readEntry("Skin","default");
- //skin = "scaleTest";
-// color of background, frame, degree of transparency
+ //skin = "scaleTest";
+ // color of background, frame, degree of transparency
QString skinPath = "opieplayer2/skins/" + skin;
pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) );
@@ -192,9 +192,9 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
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() ) );
@@ -206,9 +206,9 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
// Intialise state
setLength( mediaPlayerState->length() );
setPosition( mediaPlayerState->position() );
setLooping( mediaPlayerState->fullscreen() );
-// setPaused( mediaPlayerState->paused() );
+ // setPaused( mediaPlayerState->paused() );
setPlaying( mediaPlayerState->playing() );
}
@@ -235,10 +235,9 @@ QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) {
return new QPixmap( pix );
}
-QPixmap *maskPixToMask( QPixmap pix, QBitmap mask )
-{
+QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) {
QPixmap *pixmap = new QPixmap( pix );
pixmap->setMask( mask );
return pixmap;
}
@@ -291,9 +290,9 @@ void AudioWidget::sliderReleased() {
mediaPlayerState->setPosition( val );
}
void AudioWidget::setPosition( long i ) {
-// qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i);
+ // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i);
updateSlider( i, mediaPlayerState->length() );
}
@@ -303,9 +302,9 @@ void AudioWidget::setLength( long max ) {
void AudioWidget::setView( char view ) {
-// this isnt working for some reason
+ // this isnt working for some reason
if ( mediaPlayerState->streaming() ) {
qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>");
if( !slider.isHidden()) {
@@ -405,10 +404,10 @@ void AudioWidget::stopSkip() {
}
void AudioWidget::timerEvent( QTimerEvent * ) {
- if ( skipDirection == +1 ) {
- mediaPlayerState->setPosition( mediaPlayerState->position() + 2 );
+ if ( skipDirection == +1 ) {
+ mediaPlayerState->setPosition( mediaPlayerState->position() + 2 );
} else if ( skipDirection == -1 ) {
mediaPlayerState->setPosition( mediaPlayerState->position() - 2 );
}
}
@@ -441,13 +440,12 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
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 ) {
@@ -521,17 +519,16 @@ void AudioWidget::paintEvent( QPaintEvent * pe) {
paintButton( &p, i );
}
}
-void AudioWidget::keyReleaseEvent( QKeyEvent *e)
-{
+void AudioWidget::keyReleaseEvent( QKeyEvent *e) {
switch ( e->key() ) {
-////////////////////////////// Zaurus keys
+ ////////////////////////////// Zaurus keys
case Key_Home:
break;
case Key_F9: //activity
hide();
-// qDebug("Audio F9");
+ // qDebug("Audio F9");
break;
case Key_F10: //contacts
break;
case Key_F11: //menu
@@ -543,39 +540,39 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
mediaPlayerState->toggleBlank();
break;
case Key_Space: {
if(mediaPlayerState->playing()) {
-// toggleButton(1);
+ // toggleButton(1);
mediaPlayerState->setPlaying(FALSE);
-// toggleButton(1);
+ // toggleButton(1);
} else {
-// toggleButton(0);
+ // toggleButton(0);
mediaPlayerState->setPlaying(TRUE);
-// toggleButton(0);
+ // 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);
+ // toggleButton(3);
mediaPlayerState->setNext();
-// toggleButton(3);
+ // toggleButton(3);
break;
case Key_Left:
-// toggleButton(4);
+ // toggleButton(4);
mediaPlayerState->setPrev();
-// toggleButton(4);
+ // toggleButton(4);
break;
case Key_Escape: {
#if defined(QT_QWS_IPAQ)
if( mediaPlayerState->isPaused ) {
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 39364ab..3a82a50 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -164,10 +164,10 @@ int Lib::play( const QString& fileName,
int startPos,
int start_time ) {
QString str = fileName.stripWhiteSpace();
//workaround OpiePlayer bug
- if (str.right(1) == QString::fromLatin1("/") )
- str = str.mid( str.length() -1 );
+ //f (str.right(1) == QString::fromLatin1("/") )
+ // str = str.mid( str.length() -1 );
return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(),
startPos, start_time);
}
void Lib::stop() {
diff --git a/noncore/multimedia/opieplayer2/mediadetect.cpp b/noncore/multimedia/opieplayer2/mediadetect.cpp
index 5e0da88..91137db 100644
--- a/noncore/multimedia/opieplayer2/mediadetect.cpp
+++ b/noncore/multimedia/opieplayer2/mediadetect.cpp
@@ -21,10 +21,13 @@ char MediaDetect::videoOrAudio( const QString& fileName ) {
(fileName.lower()).right(4) == ".ogg" ||
(fileName.lower()).right(4) == ".wav" ) {
qDebug("AUDIO out taken");
return 'a';
+ } else if ( (fileName.lower()).left(7) == "http://" &&
+ (fileName.lower()).right(1) == "/" ) {
+ return 'a';
} else {
- return 'f';
+ return 'f';
}
}
bool MediaDetect::isStreaming( const QString& fileName ) {
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro
index edc4624..03540a1 100644
--- a/noncore/multimedia/opieplayer2/opieplayer2.pro
+++ b/noncore/multimedia/opieplayer2/opieplayer2.pro
@@ -1,6 +1,7 @@
TEMPLATE = app
CONFIG = qt warn_on release
+#CONFIG = qt warn_on debug
#release
DESTDIR = $(OPIEDIR)/bin
HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\
videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \