summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opierec
Unidiff
Diffstat (limited to 'noncore/multimedia/opierec') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opierec/qtrec.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp
index 0a6e5ae..f2035ef 100644
--- a/noncore/multimedia/opierec/qtrec.cpp
+++ b/noncore/multimedia/opierec/qtrec.cpp
@@ -716,130 +716,130 @@ void QtRec::initIconView() {
716 Config cfg("OpieRec"); 716 Config cfg("OpieRec");
717 cfg.setGroup("Sounds"); 717 cfg.setGroup("Sounds");
718 QString temp; 718 QString temp;
719 QPixmap image0( ( const char** ) image0_data ); 719 QPixmap image0( ( const char** ) image0_data );
720 720
721 int nFiles = cfg.readNumEntry("NumberofFiles",0); 721 int nFiles = cfg.readNumEntry("NumberofFiles",0);
722 // qDebug("init number of files %d", nFiles); 722 // qDebug("init number of files %d", nFiles);
723 723
724 for(int i=1;i<= nFiles;i++) { 724 for(int i=1;i<= nFiles;i++) {
725 725
726 QListViewItem * item; 726 QListViewItem * item;
727 QString fileS, mediaLocation, fileDate, filePath; 727 QString fileS, mediaLocation, fileDate, filePath;
728 728
729 temp.sprintf( "%d",i); 729 temp.sprintf( "%d",i);
730 temp = cfg.readEntry( temp,""); //reads currentFile 730 temp = cfg.readEntry( temp,""); //reads currentFile
731 filePath = cfg.readEntry( temp,""); //currentFileName 731 filePath = cfg.readEntry( temp,""); //currentFileName
732 732
733 QFileInfo info(filePath); 733 QFileInfo info(filePath);
734 fileDate = info.lastModified().toString(); 734 fileDate = info.lastModified().toString();
735 735
736 fileS = cfg.readEntry( filePath, "0" );// file length in seconds 736 fileS = cfg.readEntry( filePath, "0" );// file length in seconds
737 mediaLocation = getStorage( filePath); 737 mediaLocation = getStorage( filePath);
738 if( info.exists()) { 738 if( info.exists()) {
739 item = new QListViewItem( ListView1, temp, fileS, mediaLocation, fileDate); 739 item = new QListViewItem( ListView1, temp, fileS, mediaLocation, fileDate);
740 item->setPixmap( 0, image0); 740 item->setPixmap( 0, image0);
741 if( currentFileName == filePath) 741 if( currentFileName == filePath)
742 ListView1->setSelected( item, true); 742 ListView1->setSelected( item, true);
743 } 743 }
744 } 744 }
745} 745}
746 746
747void QtRec::initConnections() { 747void QtRec::initConnections() {
748 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 748 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
749 749
750 connect( toBeginningButton, SIGNAL( pressed()), 750 connect( toBeginningButton, SIGNAL( pressed()),
751 this, SLOT( rewindPressed() )); 751 this, SLOT( rewindPressed() ));
752 connect( toBeginningButton, SIGNAL( released()), 752 connect( toBeginningButton, SIGNAL( released()),
753 this, SLOT( rewindReleased() )); 753 this, SLOT( rewindReleased() ));
754 connect( toEndButton, SIGNAL( pressed()), 754 connect( toEndButton, SIGNAL( pressed()),
755 this, SLOT( FastforwardPressed() )); 755 this, SLOT( FastforwardPressed() ));
756 connect( toEndButton, SIGNAL( released()), 756 connect( toEndButton, SIGNAL( released()),
757 this, SLOT( FastforwardReleased() )); 757 this, SLOT( FastforwardReleased() ));
758 connect( deleteSoundButton, SIGNAL(released()), 758 connect( deleteSoundButton, SIGNAL(released()),
759 this, SLOT( deleteSound() )); 759 this, SLOT( deleteSound() ));
760 connect( Stop_PushButton, SIGNAL(released()), 760 connect( Stop_PushButton, SIGNAL(released()),
761 this, SLOT( doPlayBtn() )); 761 this, SLOT( doPlayBtn() ));
762 connect( Rec_PushButton, SIGNAL(released()), 762 connect( Rec_PushButton, SIGNAL(released()),
763 this, SLOT( newSound() ) ); 763 this, SLOT( newSound() ) );
764 connect( TabWidget, SIGNAL( currentChanged( QWidget*)), 764 connect( TabWidget, SIGNAL( currentChanged(QWidget*)),
765 this, SLOT(thisTab(QWidget*) )); 765 this, SLOT(thisTab(QWidget*) ));
766 connect( OutputSlider, SIGNAL(sliderReleased()), 766 connect( OutputSlider, SIGNAL(sliderReleased()),
767 this, SLOT( changedOutVolume()) ); 767 this, SLOT( changedOutVolume()) );
768 connect( InputSlider, SIGNAL(sliderReleased()), 768 connect( InputSlider, SIGNAL(sliderReleased()),
769 this, SLOT( changedInVolume()) ); 769 this, SLOT( changedInVolume()) );
770 770
771 connect( sampleRateComboBox, SIGNAL(activated( int)), 771 connect( sampleRateComboBox, SIGNAL(activated(int)),
772 this, SLOT( changesamplerateCombo(int)) ); 772 this, SLOT( changesamplerateCombo(int)) );
773 connect( bitRateComboBox, SIGNAL(activated( int)), 773 connect( bitRateComboBox, SIGNAL(activated(int)),
774 this, SLOT( changebitrateCombo(int)) ); 774 this, SLOT( changebitrateCombo(int)) );
775 775
776 connect( directoryComboBox, SIGNAL(activated( int)), 776 connect( directoryComboBox, SIGNAL(activated(int)),
777 this, SLOT( changeDirCombo(int)) ); 777 this, SLOT( changeDirCombo(int)) );
778 connect( sizeLimitCombo, SIGNAL(activated( int)), 778 connect( sizeLimitCombo, SIGNAL(activated(int)),
779 this, SLOT( changeSizeLimitCombo(int)) ); 779 this, SLOT( changeSizeLimitCombo(int)) );
780 780
781 connect( stereoCheckBox, SIGNAL(toggled( bool)), 781 connect( stereoCheckBox, SIGNAL(toggled(bool)),
782 this, SLOT( changeStereoCheck(bool)) ); 782 this, SLOT( changeStereoCheck(bool)) );
783 783
784 connect( outMuteCheckBox, SIGNAL(toggled( bool)), 784 connect( outMuteCheckBox, SIGNAL(toggled(bool)),
785 this, SLOT( doVolMuting(bool)) ); 785 this, SLOT( doVolMuting(bool)) );
786 connect( inMuteCheckBox , SIGNAL(toggled( bool)), 786 connect( inMuteCheckBox , SIGNAL(toggled(bool)),
787 this, SLOT( doMicMuting(bool)) ); 787 this, SLOT( doMicMuting(bool)) );
788 788
789 connect( ListView1,SIGNAL(doubleClicked( QListViewItem*)), 789 connect( ListView1,SIGNAL(doubleClicked(QListViewItem*)),
790 this,SLOT( itClick(QListViewItem*))); 790 this,SLOT( itClick(QListViewItem*)));
791 connect( ListView1, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 791 connect( ListView1, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),
792 this,SLOT( listPressed(int, QListViewItem *, const QPoint&, int)) ); 792 this,SLOT( listPressed(int,QListViewItem*,const QPoint&,int)) );
793 connect( timeSlider, SIGNAL( sliderMoved( int)), 793 connect( timeSlider, SIGNAL( sliderMoved(int)),
794 this, SLOT( changeTimeSlider(int) )); 794 this, SLOT( changeTimeSlider(int) ));
795 connect( timeSlider, SIGNAL( sliderPressed( )), 795 connect( timeSlider, SIGNAL( sliderPressed()),
796 this, SLOT( timeSliderPressed() )); 796 this, SLOT( timeSliderPressed() ));
797 connect( timeSlider, SIGNAL( sliderReleased( )), 797 connect( timeSlider, SIGNAL( sliderReleased()),
798 this, SLOT( timeSliderReleased() )); 798 this, SLOT( timeSliderReleased() ));
799 connect( compressionCheckBox, SIGNAL( toggled(bool)), 799 connect( compressionCheckBox, SIGNAL( toggled(bool)),
800 this, SLOT( compressionSelected(bool))); 800 this, SLOT( compressionSelected(bool)));
801 connect( autoMuteCheckBox, SIGNAL( toggled(bool)), 801 connect( autoMuteCheckBox, SIGNAL( toggled(bool)),
802 this, SLOT( slotAutoMute(bool))); 802 this, SLOT( slotAutoMute(bool)));
803} 803}
804 804
805void QtRec::initConfig() { 805void QtRec::initConfig() {
806 int index, fred, i; 806 int index, fred, i;
807 Config cfg("OpieRec"); 807 Config cfg("OpieRec");
808 cfg.setGroup("Settings"); 808 cfg.setGroup("Settings");
809 809
810 index = cfg.readNumEntry("samplerate",22050); 810 index = cfg.readNumEntry("samplerate",22050);
811 bool ok; 811 bool ok;
812 812
813 for(int ws=0;ws<sampleRateComboBox->count();ws++) { 813 for(int ws=0;ws<sampleRateComboBox->count();ws++) {
814 fred = sampleRateComboBox->text(ws).toInt(&ok, 10); 814 fred = sampleRateComboBox->text(ws).toInt(&ok, 10);
815 if( index == fred) { 815 if( index == fred) {
816 filePara.sampleRate = fred; 816 filePara.sampleRate = fred;
817 sampleRateComboBox->setCurrentItem(ws); 817 sampleRateComboBox->setCurrentItem(ws);
818 } 818 }
819 } 819 }
820 820
821 i = cfg.readNumEntry("bitrate",16); 821 i = cfg.readNumEntry("bitrate",16);
822 if(i == 16) 822 if(i == 16)
823 bitRateComboBox->setCurrentItem( 1); 823 bitRateComboBox->setCurrentItem( 1);
824 elseif(i == 24) 824 elseif(i == 24)
825 bitRateComboBox->setCurrentItem( 2); 825 bitRateComboBox->setCurrentItem( 2);
826 elseif(i == 32) 826 elseif(i == 32)
827 bitRateComboBox->setCurrentItem( 3); 827 bitRateComboBox->setCurrentItem( 3);
828 else 828 else
829 bitRateComboBox->setCurrentItem( 0); 829 bitRateComboBox->setCurrentItem( 0);
830 830
831 filePara.resolution = i; 831 filePara.resolution = i;
832 832
833 i = cfg.readNumEntry("sizeLimit", 5 ); 833 i = cfg.readNumEntry("sizeLimit", 5 );
834 QString temp; 834 QString temp;
835 sizeLimitCombo->setCurrentItem((i/5)); 835 sizeLimitCombo->setCurrentItem((i/5));
836 836
837 stereoCheckBox->setChecked( cfg.readBoolEntry("stereo", 1)); 837 stereoCheckBox->setChecked( cfg.readBoolEntry("stereo", 1));
838 if( stereoCheckBox->isChecked()) { 838 if( stereoCheckBox->isChecked()) {
839 filePara.channels = 2; 839 filePara.channels = 2;
840 } else { 840 } else {
841 filePara.channels = 1; 841 filePara.channels = 1;
842 } 842 }
843 843
844 compressionCheckBox->setChecked( cfg.readBoolEntry("wavCompression",1)); 844 compressionCheckBox->setChecked( cfg.readBoolEntry("wavCompression",1));
845 if( compressionCheckBox->isChecked()) { 845 if( compressionCheckBox->isChecked()) {
@@ -1611,97 +1611,97 @@ void QtRec::listPressed( int mouse, QListViewItem *item, const QPoint &, int ) {
1611 } 1611 }
1612 break; 1612 break;
1613 case 2: 1613 case 2:
1614 showListMenu(item); 1614 showListMenu(item);
1615 ListView1->clearSelection(); 1615 ListView1->clearSelection();
1616 break; 1616 break;
1617 }; 1617 };
1618} 1618}
1619 1619
1620void QtRec::showListMenu(QListViewItem * item) { 1620void QtRec::showListMenu(QListViewItem * item) {
1621 if(item == NULL) 1621 if(item == NULL)
1622 return; 1622 return;
1623 QPopupMenu *m = new QPopupMenu(this); 1623 QPopupMenu *m = new QPopupMenu(this);
1624 m->insertItem( tr("Play"), this, SLOT( doMenuPlay() )); 1624 m->insertItem( tr("Play"), this, SLOT( doMenuPlay() ));
1625 if(Ir::supported()) m->insertItem( tr( "Send with Ir" ), this, SLOT( doBeam() )); 1625 if(Ir::supported()) m->insertItem( tr( "Send with Ir" ), this, SLOT( doBeam() ));
1626 m->insertItem( tr( "Rename" ), this, SLOT( doRename() )); 1626 m->insertItem( tr( "Rename" ), this, SLOT( doRename() ));
1627 // #if defined (QTOPIA_INTERNAL_FSLP) 1627 // #if defined (QTOPIA_INTERNAL_FSLP)
1628 // m->insertItem( tr( "Properties" ), this, SLOT( doProperties() )); 1628 // m->insertItem( tr( "Properties" ), this, SLOT( doProperties() ));
1629 // #endif 1629 // #endif
1630 m->insertSeparator(); 1630 m->insertSeparator();
1631 m->insertItem( tr("Delete"), this, SLOT( deleteSound() ) ); 1631 m->insertItem( tr("Delete"), this, SLOT( deleteSound() ) );
1632 m->exec( QCursor::pos() ); 1632 m->exec( QCursor::pos() );
1633 qApp->processEvents(); 1633 qApp->processEvents();
1634} 1634}
1635 1635
1636void QtRec::fileBeamFinished( Ir *ir) { 1636void QtRec::fileBeamFinished( Ir *ir) {
1637 if(ir) 1637 if(ir)
1638 QMessageBox::message( tr("Ir Beam out"), tr("Ir sent.") ,tr("Ok") ); 1638 QMessageBox::message( tr("Ir Beam out"), tr("Ir sent.") ,tr("Ok") );
1639 1639
1640} 1640}
1641 1641
1642void QtRec::doBeam() { 1642void QtRec::doBeam() {
1643 qApp->processEvents(); 1643 qApp->processEvents();
1644 if( ListView1->currentItem() == NULL) 1644 if( ListView1->currentItem() == NULL)
1645 return; 1645 return;
1646 Ir ir; 1646 Ir ir;
1647 if( ir.supported()) { 1647 if( ir.supported()) {
1648 QString file = ListView1->currentItem()->text(0); 1648 QString file = ListView1->currentItem()->text(0);
1649 Config cfg("OpieRec"); 1649 Config cfg("OpieRec");
1650 cfg.setGroup("Sounds"); 1650 cfg.setGroup("Sounds");
1651 1651
1652 int nFiles = cfg.readNumEntry("NumberofFiles",0); 1652 int nFiles = cfg.readNumEntry("NumberofFiles",0);
1653 1653
1654 for(int i=0;i<nFiles+1;i++) { 1654 for(int i=0;i<nFiles+1;i++) {
1655 if( cfg.readEntry( QString::number( i),"").find( file, 0, true) != -1) { 1655 if( cfg.readEntry( QString::number( i),"").find( file, 0, true) != -1) {
1656 QString filePath = cfg.readEntry(file,""); 1656 QString filePath = cfg.readEntry(file,"");
1657 Ir *file = new Ir(this, "IR"); 1657 Ir *file = new Ir(this, "IR");
1658 connect( file, SIGNAL( done(Ir*)), 1658 connect( file, SIGNAL( done(Ir*)),
1659 this, SLOT( fileBeamFinished( Ir * ))); 1659 this, SLOT( fileBeamFinished(Ir*)));
1660 file->send( filePath, "OPieRec audio file\n" + filePath ); 1660 file->send( filePath, "OPieRec audio file\n" + filePath );
1661 } 1661 }
1662 } 1662 }
1663 } 1663 }
1664} 1664}
1665 1665
1666void QtRec::doMenuPlay() { 1666void QtRec::doMenuPlay() {
1667 qApp->processEvents(); 1667 qApp->processEvents();
1668 currentFile = ListView1->currentItem()->text(0); 1668 currentFile = ListView1->currentItem()->text(0);
1669} 1669}
1670 1670
1671void QtRec::doRename() { 1671void QtRec::doRename() {
1672 QRect r = ListView1->itemRect( ListView1->currentItem( )); 1672 QRect r = ListView1->itemRect( ListView1->currentItem( ));
1673 r = QRect( ListView1->viewportToContents( r.topLeft() ), r.size() ); 1673 r = QRect( ListView1->viewportToContents( r.topLeft() ), r.size() );
1674 r.setX( ListView1->contentsX() ); 1674 r.setX( ListView1->contentsX() );
1675 if ( r.width() > ListView1->visibleWidth() ) 1675 if ( r.width() > ListView1->visibleWidth() )
1676 r.setWidth( ListView1->visibleWidth() ); 1676 r.setWidth( ListView1->visibleWidth() );
1677 1677
1678 renameBox = new QLineEdit( ListView1->viewport(), "qt_renamebox" ); 1678 renameBox = new QLineEdit( ListView1->viewport(), "qt_renamebox" );
1679 renameBox->setFrame(true); 1679 renameBox->setFrame(true);
1680 1680
1681 renameBox->setText( ListView1->currentItem()->text(0) ); 1681 renameBox->setText( ListView1->currentItem()->text(0) );
1682 1682
1683 renameBox->selectAll(); 1683 renameBox->selectAll();
1684 renameBox->installEventFilter( this ); 1684 renameBox->installEventFilter( this );
1685 ListView1->addChild( renameBox, r.x(), r.y() ); 1685 ListView1->addChild( renameBox, r.x(), r.y() );
1686 renameBox->resize( r.size() ); 1686 renameBox->resize( r.size() );
1687 ListView1->viewport()->setFocusProxy( renameBox ); 1687 ListView1->viewport()->setFocusProxy( renameBox );
1688 renameBox->setFocus(); 1688 renameBox->setFocus();
1689 renameBox->show(); 1689 renameBox->show();
1690 1690
1691} 1691}
1692 1692
1693void QtRec::okRename() { 1693void QtRec::okRename() {
1694 qDebug(renameBox->text()); 1694 qDebug(renameBox->text());
1695 QString filename = renameBox->text(); 1695 QString filename = renameBox->text();
1696 cancelRename(); 1696 cancelRename();
1697 1697
1698 if( ListView1->currentItem() == NULL) 1698 if( ListView1->currentItem() == NULL)
1699 return; 1699 return;
1700 1700
1701 Config cfg("OpieRec"); 1701 Config cfg("OpieRec");
1702 cfg.setGroup("Sounds"); 1702 cfg.setGroup("Sounds");
1703 1703
1704 QString file = ListView1->currentItem()->text(0); 1704 QString file = ListView1->currentItem()->text(0);
1705 1705
1706 qDebug("filename is " + filename); 1706 qDebug("filename is " + filename);
1707 1707