summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-21 17:51:24 (UTC)
committer llornkcor <llornkcor>2002-04-21 17:51:24 (UTC)
commit53a4a3f6398640d182a067a8ffef9b402cd35d7a (patch) (side-by-side diff)
tree3c989e5ebde8cab36d0a089aa6d63e5e017c86d8
parent746afd0d27f33eed5451b54819773cf055858964 (diff)
downloadopie-53a4a3f6398640d182a067a8ffef9b402cd35d7a.zip
opie-53a4a3f6398640d182a067a8ffef9b402cd35d7a.tar.gz
opie-53a4a3f6398640d182a067a8ffef9b402cd35d7a.tar.bz2
added f9= hide/show audio widget, f10= hide/show video widget, fixed laylist stuff, and fixed slier for the last time
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp32
-rw-r--r--core/multimedia/opieplayer/audiowidget.h2
-rw-r--r--core/multimedia/opieplayer/loopcontrol.cpp3
-rw-r--r--core/multimedia/opieplayer/mediaplayer.cpp3
-rw-r--r--core/multimedia/opieplayer/mediaplayer.h1
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.cpp12
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp28
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h2
-rw-r--r--core/multimedia/opieplayer/videowidget.cpp1
9 files changed, 65 insertions, 19 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" ) );
@@ -75,4 +80,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
songInfo->setFocusPolicy( QWidget::NoFocus );
- songInfo->setGeometry( QRect( 7, 3, 220, 20 ) );
-
+ songInfo->setGeometry( QRect( 7, 3, 220, 20 ) );
+// layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 );
+
slider = new QSlider( Qt::Horizontal, this );
@@ -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) ) );
@@ -152,7 +161,8 @@ void AudioWidget::setView( char view ) {
if ( view == 'a' ) {
- startTimer( 150 );
- showMaximized();
+ startTimer( 150 );
+// show();
+ showMaximized();
} else {
- killTimers();
- hide();
+ killTimers();
+ hide();
}
@@ -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
@@ -100,7 +100,11 @@ MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) {
for ( it = pluginList.begin(); it != pluginList.end(); ++it ) {
- if ( (*it).decoder->isFileSupported( file ) ) {
- tmpDecoder = (*it).decoder;
- break;
- }
+ if ( (*it).decoder->isFileSupported( file ) ) {
+ tmpDecoder = (*it).decoder;
+ break;
+ }
}
+ 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,3 +207,4 @@ 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)),
+
+ connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
this,SLOT( playlistViewPressed(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;