author | llornkcor <llornkcor> | 2002-04-21 17:51:24 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-21 17:51:24 (UTC) |
commit | 53a4a3f6398640d182a067a8ffef9b402cd35d7a (patch) (side-by-side diff) | |
tree | 3c989e5ebde8cab36d0a089aa6d63e5e017c86d8 | |
parent | 746afd0d27f33eed5451b54819773cf055858964 (diff) | |
download | opie-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
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 32 | ||||
-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 | 12 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 28 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 1 |
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 @@ -26,4 +26,5 @@ #include <qpainter.h> #include <qframe.h> +#include <qlayout.h> #include "audiowidget.h" @@ -64,6 +65,10 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : QWidget( parent, name, f ) { -// QPEApplication::grabKeyboard(); setCaption( tr("OpiePlayer") ); + +// QGridLayout *layout = new QGridLayout( this ); +// layout->setSpacing( 2); +// layout->setMargin( 2); + setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); pixmaps[0] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButtonsAll" ) ); @@ -74,6 +79,7 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : songInfo = new Ticker( this ); 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 ); slider->setFixedWidth( 220 ); @@ -84,4 +90,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : slider->setFocusPolicy( QWidget::NoFocus ); slider->setGeometry( QRect( 7, 262, 220, 20 ) ); + // layout->addMultiCellWidget( slider, 4, 4, 0, 2 ); connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); @@ -105,4 +112,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : AudioWidget::~AudioWidget() { + mediaPlayerState->isStreaming = FALSE; for ( int i = 0; i < 4; i++ ) delete pixmaps[i]; @@ -138,4 +146,5 @@ void AudioWidget::setLength( long max ) { void AudioWidget::setView( char view ) { + if (mediaPlayerState->isStreaming) { if( !slider->isHidden()) slider->hide(); @@ -145,5 +154,5 @@ void AudioWidget::setView( char view ) { // this stops the slider from being moved, thus // 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) ) ); connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); @@ -151,9 +160,10 @@ void AudioWidget::setView( char view ) { if ( view == 'a' ) { - startTimer( 150 ); - showMaximized(); + startTimer( 150 ); +// show(); + showMaximized(); } else { - killTimers(); - hide(); + killTimers(); + hide(); } } @@ -291,5 +301,7 @@ void AudioWidget::paintEvent( QPaintEvent * ) { } - +void AudioWidget::showMe() { + show(); +} void AudioWidget::keyReleaseEvent( QKeyEvent *e) { @@ -299,4 +311,6 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) break; case Key_F9: //activity + hide(); +// qDebug("Audio F9"); break; case Key_F10: //contacts 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 @@ -131,5 +131,5 @@ protected: void closeEvent( QCloseEvent *event ); void keyReleaseEvent( QKeyEvent *e); - + void showMe(); private: void toggleButton( int ); 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 @@ -436,7 +436,4 @@ bool LoopControl::init( const QString& filename ) { prev_frame = -1; - if( fileName.left(7) == "http://") - mediaPlayerState->isStreaming = TRUE; - connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( setPosition( long ) ) ); connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( setPaused( bool ) ) ); 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 @@ -46,4 +46,5 @@ extern MediaPlayerState *mediaPlayerState; MediaPlayer::MediaPlayer( QObject *parent, const char *name ) : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { + QPEApplication::grabKeyboard(); connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); @@ -60,4 +61,6 @@ 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 @@ -48,4 +48,5 @@ private slots: protected: void timerEvent( QTimerEvent *e ); +// void keyReleaseEvent( QKeyEvent *e); private: 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 @@ -99,9 +99,13 @@ MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) { QValueList<MediaPlayerPlugin>::Iterator it; 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 @@ -60,4 +60,6 @@ #include <stdlib.h> +#include "audiowidget.h" +#include "videowidget.h" #define BUTTONS_ON_TOOLBAR @@ -65,4 +67,6 @@ #define CAN_SAVE_LOAD_PLAYLISTS +extern AudioWidget *audioUI; +extern VideoWidget *videoUI; extern MediaPlayerState *mediaPlayerState; @@ -202,5 +206,6 @@ 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)) ); @@ -741,5 +746,7 @@ void PlayListWidget::removeSelected() { void PlayListWidget::playIt( QListViewItem *it) { // d->setDocumentUsed = FALSE; + mediaPlayerState->setPlaying(FALSE); mediaPlayerState->setPlaying(TRUE); + d->selectedFiles->unSelect(); } @@ -881,4 +888,5 @@ void PlayListWidget::playSelected() { btnPlay( TRUE); + d->selectedFiles->unSelect(); } @@ -887,4 +895,5 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const switch (mouse) { case 1: + break; case 2:{ @@ -1039,2 +1048,19 @@ void PlayListWidget::openFile() { delete fileDlg; } + +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 @@ -68,5 +68,5 @@ protected: /* void contentsMousePressEvent( QMouseEvent * e ); */ /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ - +void keyReleaseEvent( QKeyEvent *e); private: void initializeStates(); 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 @@ -433,4 +433,5 @@ void VideoWidget::keyReleaseEvent( QKeyEvent *e) break; case Key_F10: //contacts + hide(); break; case Key_F11: //menu |