summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-03-26 14:44:01 (UTC)
committer llornkcor <llornkcor>2003-03-26 14:44:01 (UTC)
commit86f5b1b916949da47d23549ffcff68e039d38ebb (patch) (unidiff)
treedbc9f78f514af7c6e64218b9cfcb256d2bc4143e
parent2b040bc1d3fafccfcb1d7773f005f038e1032277 (diff)
downloadopie-86f5b1b916949da47d23549ffcff68e039d38ebb.zip
opie-86f5b1b916949da47d23549ffcff68e039d38ebb.tar.gz
opie-86f5b1b916949da47d23549ffcff68e039d38ebb.tar.bz2
part implement of new qcop massages
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp46
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h4
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
@@ -143,4 +143,7 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
143// menuTimer = new QTimer( this ,"menu timer"), 143// menuTimer = new QTimer( this ,"menu timer"),
144// connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); 144// connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) );
145 channel = new QCopChannel( "QPE/Application/opieplayer", this );
146 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
147 this, SLOT( qcopReceive(const QCString&, const QByteArray&)) );
145 148
146 setBackgroundMode( PaletteButton ); 149 setBackgroundMode( PaletteButton );
@@ -1421,2 +1424,45 @@ void PlayListWidget::skinsMenuActivated( int item ) {
1421 cfg.writeEntry("Skin", skinsMenu->text( item ) ); 1424 cfg.writeEntry("Skin", skinsMenu->text( item ) );
1422} 1425}
1426
1427void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
1428 qDebug("qcop message "+msg );
1429 QDataStream stream ( data, IO_ReadOnly );
1430 if ( msg == "play()" ) { //plays current selection
1431 btnPlay( true);
1432 } else if ( msg == "stop()" ) {
1433 mediaPlayerState->setPlaying( false);
1434 } else if ( msg == "togglePause()" ) {
1435 mediaPlayerState->togglePaused();
1436 } else if ( msg == "next()" ) { //select next in list
1437 mediaPlayerState->setNext();
1438 } else if ( msg == "prev()" ) { //select previous in list
1439 mediaPlayerState->setPrev();
1440 } else if ( msg == "toggleLooping()" ) { //loop or not loop
1441 mediaPlayerState->toggleLooping();
1442 } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled
1443 mediaPlayerState->toggleShuffled();
1444 } else if ( msg == "volUp()" ) { //volume more
1445// emit moreClicked();
1446// emit moreReleased();
1447 } else if ( msg == "volDown()" ) { //volume less
1448// emit lessClicked();
1449// emit lessReleased();
1450 } else if ( msg == "play(QString)" ) { //play this now
1451 QString file;
1452 stream >> file;
1453 setDocument( (const QString &) file);
1454 } else if ( msg == "add(QString)" ) { //add to playlist
1455 QString file;
1456 stream >> file;
1457 QFileInfo fileInfo(file);
1458 DocLnk lnk;
1459 lnk.setName( fileInfo.baseName() ); //sets name
1460 lnk.setFile( file ); //sets file name
1461 addToSelection( lnk );
1462 } else if ( msg == "rem(QString)" ) { //remove from playlist
1463 QString file;
1464 stream >> file;
1465
1466 }
1467
1468}
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
@@ -27,4 +27,6 @@
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28 28
29#include <qpe/qcopenvelope_qws.h>
30
29#include "om3u.h" 31#include "om3u.h"
30/* #include <qtimer.h> */ 32/* #include <qtimer.h> */
@@ -69,4 +71,5 @@ public slots:
69/* void setScaled(); */ 71/* void setScaled(); */
70protected: 72protected:
73 QCopChannel * channel;
71 QPopupMenu *skinsMenu; 74 QPopupMenu *skinsMenu;
72/* void contentsMousePressEvent( QMouseEvent * e ); */ 75/* void contentsMousePressEvent( QMouseEvent * e ); */
@@ -91,4 +94,5 @@ private:
91private slots: 94private slots:
92 95
96 void qcopReceive(const QCString&, const QByteArray&);
93 void populateSkinsMenu(); 97 void populateSkinsMenu();
94 void skinsMenuActivated(int); 98 void skinsMenuActivated(int);