-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index ccf654f..1138dc2 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -493,145 +493,146 @@ bool PlayListWidget::next() { | |||
493 | } | 493 | } |
494 | 494 | ||
495 | 495 | ||
496 | bool PlayListWidget::first() { | 496 | bool PlayListWidget::first() { |
497 | if ( mediaPlayerState->playlist() ) | 497 | if ( mediaPlayerState->playlist() ) |
498 | return d->selectedFiles->first(); | 498 | return d->selectedFiles->first(); |
499 | else | 499 | else |
500 | return mediaPlayerState->looping(); | 500 | return mediaPlayerState->looping(); |
501 | } | 501 | } |
502 | 502 | ||
503 | 503 | ||
504 | bool PlayListWidget::last() { | 504 | bool PlayListWidget::last() { |
505 | if ( mediaPlayerState->playlist() ) | 505 | if ( mediaPlayerState->playlist() ) |
506 | return d->selectedFiles->last(); | 506 | return d->selectedFiles->last(); |
507 | else | 507 | else |
508 | return mediaPlayerState->looping(); | 508 | return mediaPlayerState->looping(); |
509 | } | 509 | } |
510 | 510 | ||
511 | 511 | ||
512 | void PlayListWidget::saveList() { | 512 | void PlayListWidget::saveList() { |
513 | writem3u(); | 513 | writem3u(); |
514 | } | 514 | } |
515 | 515 | ||
516 | 516 | ||
517 | void PlayListWidget::loadList( const DocLnk & lnk) { | 517 | void PlayListWidget::loadList( const DocLnk & lnk) { |
518 | QString name = lnk.name(); | 518 | QString name = lnk.name(); |
519 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); | 519 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); |
520 | 520 | ||
521 | if( name.length()>0) { | 521 | if( name.length()>0) { |
522 | setCaption("OpiePlayer: "+name); | 522 | setCaption("OpiePlayer: "+name); |
523 | // qDebug("<<<<<<<<<<<<load list "+ lnk.file()); | 523 | // qDebug("<<<<<<<<<<<<load list "+ lnk.file()); |
524 | clearList(); | 524 | clearList(); |
525 | readm3u(lnk.file()); | 525 | readm3u(lnk.file()); |
526 | tabWidget->setCurrentPage(0); | 526 | tabWidget->setCurrentPage(0); |
527 | } | 527 | } |
528 | } | 528 | } |
529 | 529 | ||
530 | 530 | ||
531 | void PlayListWidget::setPlaylist( bool shown ) { | 531 | void PlayListWidget::setPlaylist( bool shown ) { |
532 | if ( shown ) { | 532 | if ( shown ) { |
533 | d->playListFrame->show(); | 533 | d->playListFrame->show(); |
534 | } else { | 534 | } else { |
535 | d->playListFrame->hide(); | 535 | d->playListFrame->hide(); |
536 | } | 536 | } |
537 | } | 537 | } |
538 | 538 | ||
539 | 539 | ||
540 | void PlayListWidget::addSelected() { | 540 | void PlayListWidget::addSelected() { |
541 | qDebug("addSelected"); | 541 | qDebug("addSelected"); |
542 | DocLnk lnk; | 542 | DocLnk lnk; |
543 | QString filename; | 543 | QString filename; |
544 | switch (whichList()) { | 544 | switch (whichList()) { |
545 | 545 | ||
546 | case 0: //playlist | 546 | case 0: //playlist |
547 | return; | 547 | return; |
548 | break; | 548 | break; |
549 | case 1: { //audio | 549 | case 1: { //audio |
550 | QListViewItemIterator it( audioView ); | 550 | QListViewItemIterator it( audioView ); |
551 | for ( ; it.current(); ++it ) { | 551 | for ( ; it.current(); ++it ) { |
552 | if ( it.current()->isSelected() ) { | 552 | if ( it.current()->isSelected() ) { |
553 | filename=it.current()->text(3); | 553 | filename=it.current()->text(3); |
554 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 554 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
555 | lnk.setFile( filename ); //sets file name | 555 | lnk.setFile( filename ); //sets file name |
556 | d->selectedFiles->addToSelection( lnk); | 556 | d->selectedFiles->addToSelection( lnk); |
557 | |||
557 | } | 558 | } |
558 | } | 559 | } |
560 | audioView->clearSelection(); | ||
559 | } | 561 | } |
560 | break; | 562 | break; |
561 | 563 | ||
562 | case 2: { // video | 564 | case 2: { // video |
563 | QListViewItemIterator it( videoView ); | 565 | QListViewItemIterator it( videoView ); |
564 | for ( ; it.current(); ++it ) { | 566 | for ( ; it.current(); ++it ) { |
565 | if ( it.current()->isSelected() ) { | 567 | if ( it.current()->isSelected() ) { |
566 | // myFile = (*it); | ||
567 | |||
568 | filename=it.current()->text(3); | 568 | filename=it.current()->text(3); |
569 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 569 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
570 | lnk.setFile( filename ); //sets file name | 570 | lnk.setFile( filename ); //sets file name |
571 | d->selectedFiles->addToSelection( lnk); | 571 | d->selectedFiles->addToSelection( lnk); |
572 | } | 572 | } |
573 | } | 573 | } |
574 | videoView->clearSelection(); | ||
574 | } | 575 | } |
575 | break; | 576 | break; |
576 | }; | 577 | }; |
577 | tabWidget->setCurrentPage(0); | 578 | tabWidget->setCurrentPage(0); |
578 | writeCurrentM3u(); | 579 | writeCurrentM3u(); |
579 | } | 580 | } |
580 | 581 | ||
581 | 582 | ||
582 | void PlayListWidget::removeSelected() { | 583 | void PlayListWidget::removeSelected() { |
583 | d->selectedFiles->removeSelected( ); | 584 | d->selectedFiles->removeSelected( ); |
584 | writeCurrentM3u(); | 585 | writeCurrentM3u(); |
585 | } | 586 | } |
586 | 587 | ||
587 | 588 | ||
588 | void PlayListWidget::playIt( QListViewItem *it) { | 589 | void PlayListWidget::playIt( QListViewItem *it) { |
589 | if(!it) return; | 590 | if(!it) return; |
590 | mediaPlayerState->setPlaying(FALSE); | 591 | mediaPlayerState->setPlaying(FALSE); |
591 | mediaPlayerState->setPlaying(TRUE); | 592 | mediaPlayerState->setPlaying(TRUE); |
592 | d->selectedFiles->unSelect(); | 593 | d->selectedFiles->unSelect(); |
593 | } | 594 | } |
594 | 595 | ||
595 | 596 | ||
596 | void PlayListWidget::addToSelection( QListViewItem *it) { | 597 | void PlayListWidget::addToSelection( QListViewItem *it) { |
597 | d->setDocumentUsed = FALSE; | 598 | d->setDocumentUsed = FALSE; |
598 | 599 | ||
599 | if(it) { | 600 | if(it) { |
600 | switch ( whichList()) { | 601 | switch ( whichList()) { |
601 | case 0: //playlist | 602 | case 0: //playlist |
602 | return; | 603 | return; |
603 | break; | 604 | break; |
604 | }; | 605 | }; |
605 | // case 1: { | 606 | // case 1: { |
606 | DocLnk lnk; | 607 | DocLnk lnk; |
607 | QString filename; | 608 | QString filename; |
608 | 609 | ||
609 | filename=it->text(3); | 610 | filename=it->text(3); |
610 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 611 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
611 | lnk.setFile( filename ); //sets file name | 612 | lnk.setFile( filename ); //sets file name |
612 | d->selectedFiles->addToSelection( lnk); | 613 | d->selectedFiles->addToSelection( lnk); |
613 | 614 | ||
614 | writeCurrentM3u(); | 615 | writeCurrentM3u(); |
615 | tabWidget->setCurrentPage(0); | 616 | tabWidget->setCurrentPage(0); |
616 | 617 | ||
617 | } | 618 | } |
618 | } | 619 | } |
619 | 620 | ||
620 | 621 | ||
621 | void PlayListWidget::tabChanged(QWidget *) { | 622 | void PlayListWidget::tabChanged(QWidget *) { |
622 | 623 | ||
623 | switch ( whichList()) { | 624 | switch ( whichList()) { |
624 | case 0: | 625 | case 0: |
625 | { | 626 | { |
626 | if( !tbDeletePlaylist->isHidden() ) { | 627 | if( !tbDeletePlaylist->isHidden() ) { |
627 | tbDeletePlaylist->hide(); | 628 | tbDeletePlaylist->hide(); |
628 | } | 629 | } |
629 | d->tbRemoveFromList->setEnabled(TRUE); | 630 | d->tbRemoveFromList->setEnabled(TRUE); |
630 | d->tbAddToList->setEnabled(FALSE); | 631 | d->tbAddToList->setEnabled(FALSE); |
631 | } | 632 | } |
632 | break; | 633 | break; |
633 | case 1: | 634 | case 1: |
634 | { | 635 | { |
635 | // audioView->clear(); | 636 | // audioView->clear(); |
636 | if(!audioPopulated) populateAudioView(); | 637 | if(!audioPopulated) populateAudioView(); |
637 | 638 | ||