summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/playlistwidget.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 580460e..c91a565 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -139,24 +139,29 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par
139 d->tbLoop, SLOT( setOn( bool ) ) ); 139 d->tbLoop, SLOT( setOn( bool ) ) );
140 connect( &mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), 140 connect( &mediaPlayerState, SIGNAL( shuffledToggled( bool ) ),
141 d->tbShuffle, SLOT( setOn( bool ) ) ); 141 d->tbShuffle, SLOT( setOn( bool ) ) );
142 connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), 142 connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ),
143 this, SLOT( playIt( QListViewItem *) ) ); 143 this, SLOT( playIt( QListViewItem *) ) );
144 connect ( gammaSlider, SIGNAL( valueChanged( int ) ), 144 connect ( gammaSlider, SIGNAL( valueChanged( int ) ),
145 &mediaPlayerState, SLOT( setVideoGamma( int ) ) ); 145 &mediaPlayerState, SLOT( setVideoGamma( int ) ) );
146 146
147 // see which skins are installed 147 // see which skins are installed
148 populateSkinsMenu(); 148 populateSkinsMenu();
149 initializeStates(); 149 initializeStates();
150 150
151 channel = new QCopChannel( "QPE/Application/opieplayer2", this );
152 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
153 this, SLOT( qcopReceive(const QCString&, const QByteArray&)) );
154
155
151 cfg.setGroup("PlayList"); 156 cfg.setGroup("PlayList");
152 QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); 157 QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default");
153 loadList(DocLnk( currentPlaylist ) ); 158 loadList(DocLnk( currentPlaylist ) );
154 159
155 tabWidget->showPage( playListTab ); 160 tabWidget->showPage( playListTab );
156} 161}
157 162
158 163
159PlayListWidget::~PlayListWidget() { 164PlayListWidget::~PlayListWidget() {
160 delete d; 165 delete d;
161} 166}
162 167
@@ -905,12 +910,56 @@ PlayListWidget::Entry PlayListWidget::currentEntry() const
905{ 910{
906 if ( currentTab() == CurrentPlayList ) { 911 if ( currentTab() == CurrentPlayList ) {
907 const DocLnk *lnk = current(); 912 const DocLnk *lnk = current();
908 return Entry( lnk->name(), lnk->file() ); 913 return Entry( lnk->name(), lnk->file() );
909 } 914 }
910 915
911 return Entry( currentFileListPathName() ); 916 return Entry( currentFileListPathName() );
912} 917}
913 918
914QString PlayListWidget::currentFileListPathName() const { 919QString PlayListWidget::currentFileListPathName() const {
915 return currentFileListView->currentItem()->text( 3 ); 920 return currentFileListView->currentItem()->text( 3 );
916} 921}
922
923
924void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
925 qDebug("qcop message "+msg );
926 QDataStream stream ( data, IO_ReadOnly );
927 if ( msg == "play()" ) { //plays current selection
928 btnPlay( true);
929 } else if ( msg == "stop()" ) {
930 mediaPlayerState.setPlaying( false);
931 } else if ( msg == "togglePause()" ) {
932 mediaPlayerState.togglePaused();
933 } else if ( msg == "next()" ) { //select next in list
934 mediaPlayerState.setNext();
935 } else if ( msg == "prev()" ) { //select previous in list
936 mediaPlayerState.setPrev();
937 } else if ( msg == "toggleLooping()" ) { //loop or not loop
938 mediaPlayerState.toggleLooping();
939 } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled
940 mediaPlayerState.toggleShuffled();
941 } else if ( msg == "volUp()" ) { //volume more
942// emit moreClicked();
943// emit moreReleased();
944 } else if ( msg == "volDown()" ) { //volume less
945// emit lessClicked();
946// emit lessReleased();
947 } else if ( msg == "play(QString)" ) { //play this now
948 QString file;
949 stream >> file;
950 setDocument( (const QString &) file);
951 } else if ( msg == "add(QString)" ) { //add to playlist
952 QString file;
953 stream >> file;
954 QFileInfo fileInfo(file);
955 DocLnk lnk;
956 lnk.setName( fileInfo.baseName() ); //sets name
957 lnk.setFile( file ); //sets file name
958 addToSelection( lnk );
959 } else if ( msg == "rem(QString)" ) { //remove from playlist
960 QString file;
961 stream >> file;
962
963 }
964
965}