summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-21 17:51:24 (UTC)
committer llornkcor <llornkcor>2002-04-21 17:51:24 (UTC)
commit53a4a3f6398640d182a067a8ffef9b402cd35d7a (patch) (unidiff)
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 @@
27#include <qframe.h> 27#include <qframe.h>
28#include <qlayout.h>
28 29
@@ -65,4 +66,8 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
65{ 66{
66// QPEApplication::grabKeyboard();
67 setCaption( tr("OpiePlayer") ); 67 setCaption( tr("OpiePlayer") );
68
69// QGridLayout *layout = new QGridLayout( this );
70// layout->setSpacing( 2);
71// layout->setMargin( 2);
72
68 setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); 73 setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) );
@@ -75,4 +80,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
75 songInfo->setFocusPolicy( QWidget::NoFocus ); 80 songInfo->setFocusPolicy( QWidget::NoFocus );
76 songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); 81 songInfo->setGeometry( QRect( 7, 3, 220, 20 ) );
77 82// layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 );
83
78 slider = new QSlider( Qt::Horizontal, this ); 84 slider = new QSlider( Qt::Horizontal, this );
@@ -85,2 +91,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
85 slider->setGeometry( QRect( 7, 262, 220, 20 ) ); 91 slider->setGeometry( QRect( 7, 262, 220, 20 ) );
92 // layout->addMultiCellWidget( slider, 4, 4, 0, 2 );
86 93
@@ -106,2 +113,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
106AudioWidget::~AudioWidget() { 113AudioWidget::~AudioWidget() {
114 mediaPlayerState->isStreaming = FALSE;
107 for ( int i = 0; i < 4; i++ ) 115 for ( int i = 0; i < 4; i++ )
@@ -139,2 +147,3 @@ void AudioWidget::setLength( long max ) {
139void AudioWidget::setView( char view ) { 147void AudioWidget::setView( char view ) {
148
140 if (mediaPlayerState->isStreaming) { 149 if (mediaPlayerState->isStreaming) {
@@ -146,3 +155,3 @@ void AudioWidget::setView( char view ) {
146 // does not stop stream when it reaches the end 155 // does not stop stream when it reaches the end
147 if( slider->isHidden()) slider->show(); 156 slider->show();
148 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 157 connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
@@ -152,7 +161,8 @@ void AudioWidget::setView( char view ) {
152 if ( view == 'a' ) { 161 if ( view == 'a' ) {
153 startTimer( 150 ); 162 startTimer( 150 );
154 showMaximized(); 163// show();
164 showMaximized();
155 } else { 165 } else {
156 killTimers(); 166 killTimers();
157 hide(); 167 hide();
158 } 168 }
@@ -292,3 +302,5 @@ void AudioWidget::paintEvent( QPaintEvent * ) {
292 302
293 303void AudioWidget::showMe() {
304 show();
305}
294void AudioWidget::keyReleaseEvent( QKeyEvent *e) 306void AudioWidget::keyReleaseEvent( QKeyEvent *e)
@@ -300,2 +312,4 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e)
300 case Key_F9: //activity 312 case Key_F9: //activity
313 hide();
314// qDebug("Audio F9");
301 break; 315 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:
132 void keyReleaseEvent( QKeyEvent *e); 132 void keyReleaseEvent( QKeyEvent *e);
133 133 void showMe();
134private: 134private:
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 ) {
437 437
438 if( fileName.left(7) == "http://")
439 mediaPlayerState->isStreaming = TRUE;
440
441 connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( setPosition( long ) ) ); 438 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 )
47 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { 47 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) {
48 QPEApplication::grabKeyboard();
48 49
@@ -61,2 +62,4 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
61MediaPlayer::~MediaPlayer() { 62MediaPlayer::~MediaPlayer() {
63 QPEApplication::grabKeyboard();
64 QPEApplication::ungrabKeyboard();
62} 65}
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:
49 void timerEvent( QTimerEvent *e ); 49 void timerEvent( QTimerEvent *e );
50// void keyReleaseEvent( QKeyEvent *e);
50 51
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 ) {
100 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { 100 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) {
101 if ( (*it).decoder->isFileSupported( file ) ) { 101 if ( (*it).decoder->isFileSupported( file ) ) {
102 tmpDecoder = (*it).decoder; 102 tmpDecoder = (*it).decoder;
103 break; 103 break;
104 } 104 }
105 } 105 }
106 if(file.left(4)=="http")
107 isStreaming = TRUE;
108 else
109 isStreaming = FALSE;
106 return decoder = tmpDecoder; 110 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 @@
61#include <stdlib.h> 61#include <stdlib.h>
62#include "audiowidget.h"
63#include "videowidget.h"
62 64
@@ -66,2 +68,4 @@
66 68
69extern AudioWidget *audioUI;
70extern VideoWidget *videoUI;
67extern MediaPlayerState *mediaPlayerState; 71extern MediaPlayerState *mediaPlayerState;
@@ -203,3 +207,4 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
203 QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); 207 QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold);
204 connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 208
209 connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
205 this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); 210 this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) );
@@ -742,3 +747,5 @@ void PlayListWidget::playIt( QListViewItem *it) {
742// d->setDocumentUsed = FALSE; 747// d->setDocumentUsed = FALSE;
748 mediaPlayerState->setPlaying(FALSE);
743 mediaPlayerState->setPlaying(TRUE); 749 mediaPlayerState->setPlaying(TRUE);
750 d->selectedFiles->unSelect();
744} 751}
@@ -882,2 +889,3 @@ void PlayListWidget::playSelected()
882 btnPlay( TRUE); 889 btnPlay( TRUE);
890 d->selectedFiles->unSelect();
883} 891}
@@ -888,2 +896,3 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const
888 case 1: 896 case 1:
897
889 break; 898 break;
@@ -1040 +1049,18 @@ void PlayListWidget::openFile() {
1040} 1049}
1050
1051void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
1052{
1053 switch ( e->key() ) {
1054////////////////////////////// Zaurus keys
1055 case Key_F9: //activity
1056 if(audioUI->isHidden())
1057 audioUI->showMaximized();
1058 break;
1059 case Key_F10: //contacts
1060 if( videoUI->isHidden())
1061 videoUI->showMaximized();
1062
1063 break;
1064
1065 }
1066}
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:
69/* void contentsMouseReleaseEvent( QMouseEvent * e ); */ 69/* void contentsMouseReleaseEvent( QMouseEvent * e ); */
70 70void keyReleaseEvent( QKeyEvent *e);
71private: 71private:
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)
434 case Key_F10: //contacts 434 case Key_F10: //contacts
435 hide();
435 break; 436 break;