-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 20 | ||||
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.h | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 3 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayer.cpp | 3 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayer.h | 1 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayerstate.cpp | 4 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 26 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 1 |
9 files changed, 54 insertions, 8 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index e2e3603..94b979f 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp @@ -27,2 +27,3 @@ #include <qframe.h> +#include <qlayout.h> @@ -65,4 +66,8 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : { -// QPEApplication::grabKeyboard(); setCaption( tr("OpiePlayer") ); + +// QGridLayout *layout = new QGridLayout( this ); +// layout->setSpacing( 2); +// layout->setMargin( 2); + setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); @@ -76,2 +81,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); +// layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 ); @@ -85,2 +91,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : slider->setGeometry( QRect( 7, 262, 220, 20 ) ); + // layout->addMultiCellWidget( slider, 4, 4, 0, 2 ); @@ -106,2 +113,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : AudioWidget::~AudioWidget() { + mediaPlayerState->isStreaming = FALSE; for ( int i = 0; i < 4; i++ ) @@ -139,2 +147,3 @@ void AudioWidget::setLength( long max ) { void AudioWidget::setView( char view ) { + if (mediaPlayerState->isStreaming) { @@ -146,3 +155,3 @@ void AudioWidget::setView( char view ) { // does not stop stream when it reaches the end - if( slider->isHidden()) slider->show(); + slider->show(); connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); @@ -153,2 +162,3 @@ void AudioWidget::setView( char view ) { startTimer( 150 ); +// show(); showMaximized(); @@ -292,3 +302,5 @@ void AudioWidget::paintEvent( QPaintEvent * ) { - +void AudioWidget::showMe() { + show(); +} void AudioWidget::keyReleaseEvent( QKeyEvent *e) @@ -300,2 +312,4 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) case Key_F9: //activity + hide(); +// qDebug("Audio F9"); break; diff --git a/core/multimedia/opieplayer/audiowidget.h b/core/multimedia/opieplayer/audiowidget.h index 4ffd167..41ae4b6 100644 --- a/core/multimedia/opieplayer/audiowidget.h +++ b/core/multimedia/opieplayer/audiowidget.h @@ -132,3 +132,3 @@ protected: void keyReleaseEvent( QKeyEvent *e); - + void showMe(); private: diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 7005886..faa8e56 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp @@ -437,5 +437,2 @@ bool LoopControl::init( const QString& filename ) { - if( fileName.left(7) == "http://") - mediaPlayerState->isStreaming = TRUE; - connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( setPosition( long ) ) ); diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp index e0c4dba..ab46a7d 100644 --- a/core/multimedia/opieplayer/mediaplayer.cpp +++ b/core/multimedia/opieplayer/mediaplayer.cpp @@ -47,2 +47,3 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { + QPEApplication::grabKeyboard(); @@ -61,2 +62,4 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) MediaPlayer::~MediaPlayer() { + QPEApplication::grabKeyboard(); + QPEApplication::ungrabKeyboard(); } diff --git a/core/multimedia/opieplayer/mediaplayer.h b/core/multimedia/opieplayer/mediaplayer.h index d6e90cb..0354d21 100644 --- a/core/multimedia/opieplayer/mediaplayer.h +++ b/core/multimedia/opieplayer/mediaplayer.h @@ -49,2 +49,3 @@ protected: void timerEvent( QTimerEvent *e ); +// void keyReleaseEvent( QKeyEvent *e); diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp index 4e14436..3ac9ac4 100644 --- a/core/multimedia/opieplayer/mediaplayerstate.cpp +++ b/core/multimedia/opieplayer/mediaplayerstate.cpp @@ -105,2 +105,6 @@ MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) { } + if(file.left(4)=="http") + isStreaming = TRUE; + else + isStreaming = FALSE; return decoder = tmpDecoder; diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 7c76400..faa6e3f 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -61,2 +61,4 @@ #include <stdlib.h> +#include "audiowidget.h" +#include "videowidget.h" @@ -66,2 +68,4 @@ +extern AudioWidget *audioUI; +extern VideoWidget *videoUI; extern MediaPlayerState *mediaPlayerState; @@ -203,2 +207,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); + connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), @@ -742,3 +747,5 @@ void PlayListWidget::playIt( QListViewItem *it) { // d->setDocumentUsed = FALSE; + mediaPlayerState->setPlaying(FALSE); mediaPlayerState->setPlaying(TRUE); + d->selectedFiles->unSelect(); } @@ -882,2 +889,3 @@ void PlayListWidget::playSelected() btnPlay( TRUE); + d->selectedFiles->unSelect(); } @@ -888,2 +896,3 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const case 1: + break; @@ -1040 +1049,18 @@ void PlayListWidget::openFile() { } + +void PlayListWidget::keyReleaseEvent( QKeyEvent *e) +{ + switch ( e->key() ) { +////////////////////////////// Zaurus keys + case Key_F9: //activity + if(audioUI->isHidden()) + audioUI->showMaximized(); + break; + case Key_F10: //contacts + if( videoUI->isHidden()) + videoUI->showMaximized(); + + break; + + } +} diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h index 02cdba6..16b9905 100644 --- a/core/multimedia/opieplayer/playlistwidget.h +++ b/core/multimedia/opieplayer/playlistwidget.h @@ -69,3 +69,3 @@ protected: /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ - +void keyReleaseEvent( QKeyEvent *e); private: diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp index 70b4a95..d0cb764 100644 --- a/core/multimedia/opieplayer/videowidget.cpp +++ b/core/multimedia/opieplayer/videowidget.cpp @@ -434,2 +434,3 @@ void VideoWidget::keyReleaseEvent( QKeyEvent *e) case Key_F10: //contacts + hide(); break; |