-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index b6525e1..897c458 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -125,64 +125,65 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
125 | this,SLOT( playIt( QListViewItem *) ) ); | 125 | this,SLOT( playIt( QListViewItem *) ) ); |
126 | connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), | 126 | connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), |
127 | this, SLOT( addToSelection( QListViewItem *) ) ); | 127 | this, SLOT( addToSelection( QListViewItem *) ) ); |
128 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int) ), | 128 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int) ), |
129 | this,SLOT( viewPressed( int, QListViewItem *, const QPoint&, int) ) ); | 129 | this,SLOT( viewPressed( int, QListViewItem *, const QPoint&, int) ) ); |
130 | connect( videoView, SIGNAL( returnPressed( QListViewItem *) ), | 130 | connect( videoView, SIGNAL( returnPressed( QListViewItem *) ), |
131 | this,SLOT( playIt( QListViewItem *) ) ); | 131 | this,SLOT( playIt( QListViewItem *) ) ); |
132 | connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), | 132 | connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), |
133 | this, SLOT( addToSelection( QListViewItem *) ) ); | 133 | this, SLOT( addToSelection( QListViewItem *) ) ); |
134 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), | 134 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), |
135 | this, SLOT( loadList( const DocLnk & ) ) ); | 135 | this, SLOT( loadList( const DocLnk & ) ) ); |
136 | connect( tabWidget, SIGNAL ( currentChanged(QWidget*) ), | 136 | connect( tabWidget, SIGNAL ( currentChanged(QWidget*) ), |
137 | this, SLOT( tabChanged( QWidget* ) ) ); | 137 | this, SLOT( tabChanged( QWidget* ) ) ); |
138 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), | 138 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), |
139 | d->tbPlay, SLOT( setOn( bool ) ) ); | 139 | d->tbPlay, SLOT( setOn( bool ) ) ); |
140 | connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), | 140 | connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), |
141 | d->tbLoop, SLOT( setOn( bool ) ) ); | 141 | d->tbLoop, SLOT( setOn( bool ) ) ); |
142 | connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), | 142 | connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), |
143 | d->tbShuffle, SLOT( setOn( bool ) ) ); | 143 | d->tbShuffle, SLOT( setOn( bool ) ) ); |
144 | connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), | 144 | connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), |
145 | this, SLOT( setPlaylist( bool ) ) ); | 145 | this, SLOT( setPlaylist( bool ) ) ); |
146 | connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), | 146 | connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), |
147 | this, SLOT( playIt( QListViewItem *) ) ); | 147 | this, SLOT( playIt( QListViewItem *) ) ); |
148 | connect ( gammaSlider, SIGNAL( valueChanged( int ) ), | 148 | connect ( gammaSlider, SIGNAL( valueChanged( int ) ), |
149 | mediaPlayerState, SLOT( setVideoGamma( int ) ) ); | 149 | mediaPlayerState, SLOT( setVideoGamma( int ) ) ); |
150 | 150 | ||
151 | // see which skins are installed | 151 | // see which skins are installed |
152 | videoScan=FALSE; | 152 | videoScan=FALSE; |
153 | audioScan=FALSE; | 153 | audioScan=FALSE; |
154 | populateSkinsMenu(); | 154 | populateSkinsMenu(); |
155 | initializeStates(); | 155 | initializeStates(); |
156 | 156 | ||
157 | cfg.setGroup("PlayList"); | ||
157 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "" ); | 158 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "" ); |
158 | loadList(DocLnk( currentPlaylist ) ); | 159 | loadList(DocLnk( currentPlaylist ) ); |
159 | setCaption( tr( "OpiePlayer: " ) + currentPlaylist ); | 160 | setCaption( tr( "OpiePlayer: " ) + currentPlaylist ); |
160 | } | 161 | } |
161 | 162 | ||
162 | 163 | ||
163 | PlayListWidget::~PlayListWidget() { | 164 | PlayListWidget::~PlayListWidget() { |
164 | if ( d->current ) { | 165 | if ( d->current ) { |
165 | delete d->current; | 166 | delete d->current; |
166 | } | 167 | } |
167 | delete d; | 168 | delete d; |
168 | } | 169 | } |
169 | 170 | ||
170 | 171 | ||
171 | void PlayListWidget::initializeStates() { | 172 | void PlayListWidget::initializeStates() { |
172 | d->tbPlay->setOn( mediaPlayerState->playing() ); | 173 | d->tbPlay->setOn( mediaPlayerState->playing() ); |
173 | d->tbLoop->setOn( mediaPlayerState->looping() ); | 174 | d->tbLoop->setOn( mediaPlayerState->looping() ); |
174 | d->tbShuffle->setOn( mediaPlayerState->shuffled() ); | 175 | d->tbShuffle->setOn( mediaPlayerState->shuffled() ); |
175 | setPlaylist( true ); | 176 | setPlaylist( true ); |
176 | } | 177 | } |
177 | 178 | ||
178 | 179 | ||
179 | void PlayListWidget::readConfig( Config& cfg ) { | 180 | void PlayListWidget::readConfig( Config& cfg ) { |
180 | 181 | ||
181 | cfg.setGroup( "PlayList" ); | 182 | cfg.setGroup( "PlayList" ); |
182 | QString currentString = cfg.readEntry( "current", "" ); | 183 | QString currentString = cfg.readEntry( "current", "" ); |
183 | int noOfFiles = cfg.readNumEntry( "NumberOfFiles", 0 ); | 184 | int noOfFiles = cfg.readNumEntry( "NumberOfFiles", 0 ); |
184 | 185 | ||
185 | for ( int i = 0; i < noOfFiles; i++ ) { | 186 | for ( int i = 0; i < noOfFiles; i++ ) { |
186 | QString entryName; | 187 | QString entryName; |
187 | entryName.sprintf( "File%i", i + 1 ); | 188 | entryName.sprintf( "File%i", i + 1 ); |
188 | 189 | ||
@@ -455,65 +456,65 @@ bool PlayListWidget::next() { | |||
455 | } | 456 | } |
456 | return TRUE; | 457 | return TRUE; |
457 | } | 458 | } |
458 | } else { | 459 | } else { |
459 | return mediaPlayerState->looping(); | 460 | return mediaPlayerState->looping(); |
460 | } | 461 | } |
461 | } | 462 | } |
462 | 463 | ||
463 | 464 | ||
464 | bool PlayListWidget::first() { | 465 | bool PlayListWidget::first() { |
465 | if ( mediaPlayerState->playlist() ) | 466 | if ( mediaPlayerState->playlist() ) |
466 | return d->selectedFiles->first(); | 467 | return d->selectedFiles->first(); |
467 | else | 468 | else |
468 | return mediaPlayerState->looping(); | 469 | return mediaPlayerState->looping(); |
469 | } | 470 | } |
470 | 471 | ||
471 | 472 | ||
472 | bool PlayListWidget::last() { | 473 | bool PlayListWidget::last() { |
473 | if ( mediaPlayerState->playlist() ) | 474 | if ( mediaPlayerState->playlist() ) |
474 | return d->selectedFiles->last(); | 475 | return d->selectedFiles->last(); |
475 | else | 476 | else |
476 | return mediaPlayerState->looping(); | 477 | return mediaPlayerState->looping(); |
477 | } | 478 | } |
478 | 479 | ||
479 | 480 | ||
480 | void PlayListWidget::saveList() { | 481 | void PlayListWidget::saveList() { |
481 | writem3u(); | 482 | writem3u(); |
482 | } | 483 | } |
483 | 484 | ||
484 | 485 | ||
485 | void PlayListWidget::loadList( const DocLnk & lnk) { | 486 | void PlayListWidget::loadList( const DocLnk & lnk) { |
486 | QString name = lnk.name(); | 487 | QString name = lnk.name(); |
487 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); | 488 | qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); |
488 | 489 | ||
489 | if( name.length()>0) { | 490 | if( name.length()>0) { |
490 | setCaption("OpiePlayer: "+name); | 491 | setCaption("OpiePlayer: "+name); |
491 | qDebug("<<<<<<<<<<<<load list "+ lnk.file()); | 492 | qDebug("<<<<<<<<<<<<load list "+ lnk.file()); |
492 | clearList(); | 493 | clearList(); |
493 | readm3u(lnk.file()); | 494 | readm3u(lnk.file()); |
494 | tabWidget->setCurrentPage(0); | 495 | tabWidget->setCurrentPage(0); |
495 | } | 496 | } |
496 | } | 497 | } |
497 | 498 | ||
498 | 499 | ||
499 | void PlayListWidget::setPlaylist( bool shown ) { | 500 | void PlayListWidget::setPlaylist( bool shown ) { |
500 | if ( shown ) { | 501 | if ( shown ) { |
501 | d->playListFrame->show(); | 502 | d->playListFrame->show(); |
502 | } else { | 503 | } else { |
503 | d->playListFrame->hide(); | 504 | d->playListFrame->hide(); |
504 | } | 505 | } |
505 | } | 506 | } |
506 | 507 | ||
507 | 508 | ||
508 | void PlayListWidget::addSelected() { | 509 | void PlayListWidget::addSelected() { |
509 | 510 | ||
510 | switch (whichList()) { | 511 | switch (whichList()) { |
511 | case 0: //playlist | 512 | case 0: //playlist |
512 | break; | 513 | break; |
513 | case 1: { //audio | 514 | case 1: { //audio |
514 | QListViewItemIterator it( audioView ); | 515 | QListViewItemIterator it( audioView ); |
515 | // iterate through all items of the listview | 516 | // iterate through all items of the listview |
516 | for ( ; it.current(); ++it ) { | 517 | for ( ; it.current(); ++it ) { |
517 | if ( it.current()->isSelected() ) { | 518 | if ( it.current()->isSelected() ) { |
518 | QListIterator<DocLnk> dit( files.children() ); | 519 | QListIterator<DocLnk> dit( files.children() ); |
519 | for ( ; dit.current(); ++dit ) { | 520 | for ( ; dit.current(); ++dit ) { |