author | llornkcor <llornkcor> | 2003-03-26 14:44:01 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-03-26 14:44:01 (UTC) |
commit | 86f5b1b916949da47d23549ffcff68e039d38ebb (patch) (side-by-side diff) | |
tree | dbc9f78f514af7c6e64218b9cfcb256d2bc4143e /core | |
parent | 2b040bc1d3fafccfcb1d7773f005f038e1032277 (diff) | |
download | opie-86f5b1b916949da47d23549ffcff68e039d38ebb.zip opie-86f5b1b916949da47d23549ffcff68e039d38ebb.tar.gz opie-86f5b1b916949da47d23549ffcff68e039d38ebb.tar.bz2 |
part implement of new qcop massages
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 46 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 4 |
2 files changed, 50 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index a0bf4db..5e1be2f 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -142,6 +142,9 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) videoScan = FALSE; // menuTimer = new QTimer( this ,"menu timer"), // connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); + channel = new QCopChannel( "QPE/Application/opieplayer", this ); + connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), + this, SLOT( qcopReceive(const QCString&, const QByteArray&)) ); setBackgroundMode( PaletteButton ); @@ -1420,3 +1423,46 @@ void PlayListWidget::skinsMenuActivated( int item ) { cfg.setGroup("Options"); cfg.writeEntry("Skin", skinsMenu->text( item ) ); } + +void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { + qDebug("qcop message "+msg ); + QDataStream stream ( data, IO_ReadOnly ); + if ( msg == "play()" ) { //plays current selection + btnPlay( true); + } else if ( msg == "stop()" ) { + mediaPlayerState->setPlaying( false); + } else if ( msg == "togglePause()" ) { + mediaPlayerState->togglePaused(); + } else if ( msg == "next()" ) { //select next in list + mediaPlayerState->setNext(); + } else if ( msg == "prev()" ) { //select previous in list + mediaPlayerState->setPrev(); + } else if ( msg == "toggleLooping()" ) { //loop or not loop + mediaPlayerState->toggleLooping(); + } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled + mediaPlayerState->toggleShuffled(); + } else if ( msg == "volUp()" ) { //volume more +// emit moreClicked(); +// emit moreReleased(); + } else if ( msg == "volDown()" ) { //volume less +// emit lessClicked(); +// emit lessReleased(); + } else if ( msg == "play(QString)" ) { //play this now + QString file; + stream >> file; + setDocument( (const QString &) file); + } else if ( msg == "add(QString)" ) { //add to playlist + QString file; + stream >> file; + QFileInfo fileInfo(file); + DocLnk lnk; + lnk.setName( fileInfo.baseName() ); //sets name + lnk.setFile( file ); //sets file name + addToSelection( lnk ); + } else if ( msg == "rem(QString)" ) { //remove from playlist + QString file; + stream >> file; + + } + +} diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h index 1118b76..e66bcb9 100644 --- a/core/multimedia/opieplayer/playlistwidget.h +++ b/core/multimedia/opieplayer/playlistwidget.h @@ -26,6 +26,8 @@ #include <qpe/fileselector.h> #include <qpushbutton.h> +#include <qpe/qcopenvelope_qws.h> + #include "om3u.h" /* #include <qtimer.h> */ @@ -68,6 +70,7 @@ public slots: /* void setFullScreen(); */ /* void setScaled(); */ protected: + QCopChannel * channel; QPopupMenu *skinsMenu; /* void contentsMousePressEvent( QMouseEvent * e ); */ /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ @@ -90,6 +93,7 @@ private: void populateVideoView(); private slots: + void qcopReceive(const QCString&, const QByteArray&); void populateSkinsMenu(); void skinsMenuActivated(int); void writem3u(); |