summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-08-18 23:15:50 (UTC)
committer harlekin <harlekin>2002-08-18 23:15:50 (UTC)
commitd92fbca743e676182a8f33ae4c28044031143fb0 (patch) (unidiff)
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) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp15
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp4
-rw-r--r--noncore/multimedia/opieplayer2/mediadetect.cpp3
-rw-r--r--noncore/multimedia/opieplayer2/opieplayer2.pro1
4 files changed, 12 insertions, 11 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
@@ -78,14 +78,15 @@ void Ticker::timerEvent( QTimerEvent * ) {
78 pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1; 78 pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1;
79 scroll( -1, 0, contentsRect() ); 79 scroll( -1, 0, contentsRect() );
80 repaint( FALSE ); 80 repaint( FALSE );
81} 81}
82 82
83void Ticker::drawContents( QPainter *p ) { 83void Ticker::drawContents( QPainter *p ) {
84 for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) 84 for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) {
85 p->drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); 85 p->drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText );
86 }
86 QPixmap pm( width(), height() ); 87 QPixmap pm( width(), height() );
87 pm.fill( colorGroup().base() ); 88 pm.fill( colorGroup().base() );
88 QPainter pmp( &pm ); 89 QPainter pmp( &pm );
89 for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) { 90 for ( int i = 0; i - pos < width() && (i < 1 || pixelLen > width()); i += pixelLen ) {
90 pmp.drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText ); 91 pmp.drawText( i - pos, 0, INT_MAX, height(), AlignVCenter, scrollText );
91 } 92 }
@@ -124,15 +125,14 @@ static void changeTextColor( QWidget *w ) {
124} 125}
125 126
126static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); 127static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton));
127 128
128 129
129AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : 130AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
130 QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) {
131
132 131
132 QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) {
133 133
134 setCaption( tr("OpiePlayer") ); 134 setCaption( tr("OpiePlayer") );
135 135
136 Config cfg("OpiePlayer"); 136 Config cfg("OpiePlayer");
137 cfg.setGroup("Options"); 137 cfg.setGroup("Options");
138 skin = cfg.readEntry("Skin","default"); 138 skin = cfg.readEntry("Skin","default");
@@ -233,14 +233,13 @@ QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) {
233 p.drawTiledPixmap( pix.rect(), bg, offset ); 233 p.drawTiledPixmap( pix.rect(), bg, offset );
234 p.drawImage( 0, 0, img ); 234 p.drawImage( 0, 0, img );
235 return new QPixmap( pix ); 235 return new QPixmap( pix );
236} 236}
237 237
238 238
239QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) 239QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) {
240{
241 QPixmap *pixmap = new QPixmap( pix ); 240 QPixmap *pixmap = new QPixmap( pix );
242 pixmap->setMask( mask ); 241 pixmap->setMask( mask );
243 return pixmap; 242 return pixmap;
244} 243}
245 244
246 245
@@ -439,14 +438,13 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
439 emit forwardClicked(); 438 emit forwardClicked();
440 return; 439 return;
441 case AudioBack: 440 case AudioBack:
442 emit backClicked(); 441 emit backClicked();
443 return; 442 return;
444 } 443 }
445 } 444 } else if ( !isOnButton && audioButtons[i].isHeld ) {
446 else if ( !isOnButton && audioButtons[i].isHeld ) {
447 audioButtons[i].isHeld = FALSE; 445 audioButtons[i].isHeld = FALSE;
448 toggleButton(i); 446 toggleButton(i);
449 } 447 }
450 } else { 448 } else {
451 if ( audioButtons[i].isHeld ) { 449 if ( audioButtons[i].isHeld ) {
452 audioButtons[i].isHeld = FALSE; 450 audioButtons[i].isHeld = FALSE;
@@ -519,14 +517,13 @@ void AudioWidget::paintEvent( QPaintEvent * pe) {
519 QPainter p( this ); 517 QPainter p( this );
520 for ( int i = 0; i < numButtons; i++ ) 518 for ( int i = 0; i < numButtons; i++ )
521 paintButton( &p, i ); 519 paintButton( &p, i );
522 } 520 }
523} 521}
524 522
525void AudioWidget::keyReleaseEvent( QKeyEvent *e) 523void AudioWidget::keyReleaseEvent( QKeyEvent *e) {
526{
527 switch ( e->key() ) { 524 switch ( e->key() ) {
528////////////////////////////// Zaurus keys 525////////////////////////////// Zaurus keys
529 case Key_Home: 526 case Key_Home:
530 break; 527 break;
531 case Key_F9: //activity 528 case Key_F9: //activity
532 hide(); 529 hide();
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
@@ -162,14 +162,14 @@ int Lib::subVersion() {
162} 162}
163int Lib::play( const QString& fileName, 163int Lib::play( const QString& fileName,
164 int startPos, 164 int startPos,
165 int start_time ) { 165 int start_time ) {
166 QString str = fileName.stripWhiteSpace(); 166 QString str = fileName.stripWhiteSpace();
167 //workaround OpiePlayer bug 167 //workaround OpiePlayer bug
168 if (str.right(1) == QString::fromLatin1("/") ) 168 //f (str.right(1) == QString::fromLatin1("/") )
169 str = str.mid( str.length() -1 ); 169 // str = str.mid( str.length() -1 );
170 return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), 170 return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(),
171 startPos, start_time); 171 startPos, start_time);
172} 172}
173void Lib::stop() { 173void Lib::stop() {
174 qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); 174 qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>");
175 xine_stop(m_xine ); 175 xine_stop(m_xine );
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
@@ -19,12 +19,15 @@ char MediaDetect::videoOrAudio( const QString& fileName ) {
19 } else if ( (fileName.lower()).right(4) == "·mp1" || 19 } else if ( (fileName.lower()).right(4) == "·mp1" ||
20 (fileName.lower()).right(4) == ".mp3" || 20 (fileName.lower()).right(4) == ".mp3" ||
21 (fileName.lower()).right(4) == ".ogg" || 21 (fileName.lower()).right(4) == ".ogg" ||
22 (fileName.lower()).right(4) == ".wav" ) { 22 (fileName.lower()).right(4) == ".wav" ) {
23 qDebug("AUDIO out taken"); 23 qDebug("AUDIO out taken");
24 return 'a'; 24 return 'a';
25 } else if ( (fileName.lower()).left(7) == "http://" &&
26 (fileName.lower()).right(1) == "/" ) {
27 return 'a';
25 } else { 28 } else {
26 return 'f'; 29 return 'f';
27 } 30 }
28} 31}
29 32
30bool MediaDetect::isStreaming( const QString& fileName ) { 33bool 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,8 +1,9 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG = qt warn_on release 2CONFIG = qt warn_on release
3#CONFIG = qt warn_on debug
3#release 4#release
4DESTDIR = $(OPIEDIR)/bin 5DESTDIR = $(OPIEDIR)/bin
5HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\ 6HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\
6 videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \ 7 videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \
7 frame.h lib.h xinevideowidget.h volumecontrol.h\ 8 frame.h lib.h xinevideowidget.h volumecontrol.h\
8 alphablend.h yuv2rgb.h 9 alphablend.h yuv2rgb.h