summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-08-18 23:15:50 (UTC)
committer harlekin <harlekin>2002-08-18 23:15:50 (UTC)
commitd92fbca743e676182a8f33ae4c28044031143fb0 (patch) (side-by-side diff)
tree557b19a000a897e46ed1a8e18a4fdd41aa199e0d
parentbec883a38720a1e1a975e5474a3085d149cf935c (diff)
downloadopie-d92fbca743e676182a8f33ae4c28044031143fb0.zip
opie-d92fbca743e676182a8f33ae4c28044031143fb0.tar.gz
opie-d92fbca743e676182a8f33ae4c28044031143fb0.tar.bz2
small fixes regarding shoutcast, but for now user need to have http:// anything / as shoutcast url
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
@@ -83,4 +83,5 @@ void Ticker::timerEvent( QTimerEvent * ) {
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() );
@@ -95,3 +96,3 @@ void Ticker::drawContents( QPainter *p ) {
struct MediaButton {
- bool isToggle, isHeld, isDown;
+ bool isToggle, isHeld, isDown;
};
@@ -129,5 +130,4 @@ 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 ) {
@@ -138,4 +138,4 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
skin = cfg.readEntry("Skin","default");
- //skin = "scaleTest";
-// color of background, frame, degree of transparency
+ //skin = "scaleTest";
+ // color of background, frame, degree of transparency
@@ -195,3 +195,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
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) ) );
@@ -209,3 +209,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
setLooping( mediaPlayerState->fullscreen() );
-// setPaused( mediaPlayerState->paused() );
+ // setPaused( mediaPlayerState->paused() );
setPlaying( mediaPlayerState->playing() );
@@ -238,4 +238,3 @@ QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) {
-QPixmap *maskPixToMask( QPixmap pix, QBitmap mask )
-{
+QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) {
QPixmap *pixmap = new QPixmap( pix );
@@ -294,3 +293,3 @@ void AudioWidget::sliderReleased() {
void AudioWidget::setPosition( long i ) {
-// qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i);
+ // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i);
updateSlider( i, mediaPlayerState->length() );
@@ -306,3 +305,3 @@ void AudioWidget::setView( char view ) {
-// this isnt working for some reason
+ // this isnt working for some reason
@@ -408,4 +407,4 @@ 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 ) {
@@ -444,7 +443,6 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
}
+ } 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 {
@@ -524,6 +522,5 @@ void AudioWidget::paintEvent( QPaintEvent * pe) {
-void AudioWidget::keyReleaseEvent( QKeyEvent *e)
-{
+void AudioWidget::keyReleaseEvent( QKeyEvent *e) {
switch ( e->key() ) {
-////////////////////////////// Zaurus keys
+ ////////////////////////////// Zaurus keys
case Key_Home:
@@ -532,3 +529,3 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
hide();
-// qDebug("Audio F9");
+ // qDebug("Audio F9");
break;
@@ -546,9 +543,9 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
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);
}
@@ -557,22 +554,22 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
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;
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
@@ -167,4 +167,4 @@ int Lib::play( const QString& fileName,
//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(),
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
@@ -24,4 +24,7 @@ char MediaDetect::videoOrAudio( const QString& fileName ) {
return 'a';
+ } else if ( (fileName.lower()).left(7) == "http://" &&
+ (fileName.lower()).right(1) == "/" ) {
+ return 'a';
} else {
- return 'f';
+ return 'f';
}
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
@@ -2,2 +2,3 @@ TEMPLATE = app
CONFIG = qt warn_on release
+#CONFIG = qt warn_on debug
#release