summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opierec/qtrec.cpp101
-rw-r--r--noncore/multimedia/opierec/qtrec.h2
2 files changed, 40 insertions, 63 deletions
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp
index c237726..6793b4e 100644
--- a/noncore/multimedia/opierec/qtrec.cpp
+++ b/noncore/multimedia/opierec/qtrec.cpp
@@ -457,32 +457,30 @@ QtRec::QtRec( QWidget* parent, const char* name, WFlags fl )
457 457
458// soundDevice->setDeviceFormat(AFMT_S16_LE); 458// soundDevice->setDeviceFormat(AFMT_S16_LE);
459// soundDevice->setDeviceChannels(1); 459// soundDevice->setDeviceChannels(1);
460// soundDevice->setDeviceRate( 22050); 460// soundDevice->setDeviceRate( 22050);
461 461
462 getInVol(); 462 getInVol();
463 getOutVol(); 463 getOutVol();
464 464
465 soundDevice->closeDevice( true); 465 soundDevice->closeDevice( true);
466 soundDevice->sd = -1; 466 soundDevice->sd = -1;
467 soundDevice = 0; 467 soundDevice = 0;
468 wavFile = 0; 468 wavFile = 0;
469
470// if( soundDevice) delete soundDevice; 469// if( soundDevice) delete soundDevice;
471 470 QTimer::singleShot(100,this, SLOT(initIconView()));
472 initIconView();
473 471
474 if( autoMute) 472 if( autoMute)
475 doMute( true); 473 doMute( true);
476 ListView1->setFocus(); 474 // ListView1->setFocus();
477 playing = false; 475 playing = false;
478} 476}
479 477
480QtRec::~QtRec() { 478QtRec::~QtRec() {
481// if( soundDevice) delete soundDevice; 479// if( soundDevice) delete soundDevice;
482 480
483} 481}
484 482
485void QtRec::cleanUp() { 483void QtRec::cleanUp() {
486 484
487 if( !stopped) { 485 if( !stopped) {
488 stopped = true; 486 stopped = true;
@@ -720,113 +718,92 @@ void QtRec::init() {
720 TabWidget->insertTab( tab_5, tr( "Volume" ) ); 718 TabWidget->insertTab( tab_5, tr( "Volume" ) );
721 719
722 720
723 waveform = new Waveform( this, "waveform" ); 721 waveform = new Waveform( this, "waveform" );
724// waveform->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, waveform->sizePolicy().hasHeightForWidth() ) ); 722// waveform->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, waveform->sizePolicy().hasHeightForWidth() ) );
725 waveform->setMinimumSize( QSize( 0, 50 ) ); 723 waveform->setMinimumSize( QSize( 0, 50 ) );
726 724
727 layout->addMultiCellWidget( waveform, 8, 8, 0, 8); 725 layout->addMultiCellWidget( waveform, 8, 8, 0, 8);
728 waveform->setBackgroundColor ( black ); 726 waveform->setBackgroundColor ( black );
729} 727}
730 728
731void QtRec::initIconView() { 729void QtRec::initIconView() {
732 730 owarn << "initIconView" << oendl;
733 ListView1->clear(); 731 ListView1->clear();
734 Config cfg("OpieRec"); 732 Config cfg("OpieRec");
735 cfg.setGroup("Sounds"); 733 cfg.setGroup("Sounds");
736 QString temp; 734 QString temp;
737 QPixmap image0( ( const char** ) image0_data ); 735 QPixmap image0( ( const char** ) image0_data );
738 736
739 int nFiles = cfg.readNumEntry("NumberofFiles",0); 737 int nFiles = cfg.readNumEntry("NumberofFiles",0);
740// odebug << "init number of files " << nFiles << "" << oendl; 738 owarn << "init number of files " << nFiles << "" << oendl;
741 739
742 for(int i=1;i<= nFiles;i++) { 740 for(int i = 1; i <= nFiles; i++) {
743 741
744 QListViewItem * item; 742 QListViewItem * item;
745 QString fileS, mediaLocation, fileDate, filePath; 743 QString fileS, mediaLocation, fileDate, filePath;
746 744
747 temp.sprintf( "%d",i); 745 temp.sprintf( "%d",i);
748 temp = cfg.readEntry( temp,""); //reads currentFile 746 temp = cfg.readEntry( temp,""); //reads currentFile
749 filePath = cfg.readEntry( temp,""); //currentFileName 747 filePath = cfg.readEntry( temp,""); //currentFileName
750 748
751 QFileInfo info(filePath); 749 QFileInfo info(filePath);
752 fileDate = info.lastModified().toString(); 750 fileDate = info.lastModified().toString();
753 751
754 fileS = cfg.readEntry( filePath, "0" );// file length in seconds 752 fileS = cfg.readEntry( filePath, "0" );// file length in seconds
755 mediaLocation = getStorage( filePath); 753 mediaLocation = getStorage( filePath);
756 if( info.exists()) { 754 if( info.exists()) {
755 owarn << "new item " << temp << oendl;
757 item = new QListViewItem( ListView1, temp, fileS /*, mediaLocation, fileDate*/); 756 item = new QListViewItem( ListView1, temp, fileS /*, mediaLocation, fileDate*/);
758 item->setPixmap( 0, image0); 757 item->setPixmap( 0, image0);
759 if( currentFileName == filePath) 758 if( currentFileName == filePath)
760 ListView1->setSelected( item, true); 759 ListView1->setSelected( item, true);
761 } 760 }
762 } 761 }
763} 762}
764 763
765void QtRec::initConnections() { 764void QtRec::initConnections() {
766 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 765 connect(qApp,SIGNAL(aboutToQuit()),SLOT(cleanUp()));
767 766
768 connect( toBeginningButton, SIGNAL( pressed()), 767 connect(toBeginningButton,SIGNAL(pressed()),this,SLOT(rewindPressed()));
769 this, SLOT( rewindPressed() )); 768 connect(toBeginningButton,SIGNAL(released()),this,SLOT(rewindReleased()));
770 connect( toBeginningButton, SIGNAL( released()), 769 connect(toEndButton,SIGNAL(pressed()),this,SLOT(FastforwardPressed()));
771 this, SLOT( rewindReleased() )); 770 connect(toEndButton,SIGNAL(released()),this,SLOT(FastforwardReleased()));
772 connect( toEndButton, SIGNAL( pressed()), 771 connect(deleteSoundButton,SIGNAL(released()),this,SLOT(deleteSound()));
773 this, SLOT( FastforwardPressed() )); 772 connect(Stop_PushButton,SIGNAL(released()),this,SLOT(doPlayBtn()));
774 connect( toEndButton, SIGNAL( released()), 773 connect(Rec_PushButton,SIGNAL(released()),this,SLOT(newSound()));
775 this, SLOT( FastforwardReleased() )); 774
776 connect( deleteSoundButton, SIGNAL(released()), 775 connect(TabWidget,SIGNAL(currentChanged(QWidget*)),this,SLOT(thisTab(QWidget*)));
777 this, SLOT( deleteSound() )); 776
778 connect( Stop_PushButton, SIGNAL(released()), 777 connect(OutputSlider,SIGNAL(sliderReleased()),this,SLOT(changedOutVolume()));
779 this, SLOT( doPlayBtn() )); 778 connect(InputSlider,SIGNAL(sliderReleased()),this,SLOT(changedInVolume()));
780 connect( Rec_PushButton, SIGNAL(released()), 779
781 this, SLOT( newSound() ) ); 780 connect(sampleRateComboBox,SIGNAL(activated(int)),this,SLOT(changesamplerateCombo(int)));
782 connect( TabWidget, SIGNAL( currentChanged(QWidget*)), 781 connect(bitRateComboBox,SIGNAL(activated(int)),this,SLOT(changebitrateCombo(int)));
783 this, SLOT(thisTab(QWidget*) )); 782 connect(directoryComboBox,SIGNAL(activated(int)),this,SLOT(changeDirCombo(int)));
784 connect( OutputSlider, SIGNAL(sliderReleased()), 783 connect(sizeLimitCombo,SIGNAL(activated(int)),this,SLOT(changeSizeLimitCombo(int)));
785 this, SLOT( changedOutVolume()) ); 784
786 connect( InputSlider, SIGNAL(sliderReleased()), 785 connect(stereoCheckBox,SIGNAL(toggled(bool)),this,SLOT(changeStereoCheck(bool)));
787 this, SLOT( changedInVolume()) ); 786 connect(outMuteCheckBox,SIGNAL(toggled(bool)),this,SLOT(doVolMuting(bool)));
788 787 connect(inMuteCheckBox,SIGNAL(toggled(bool)),this,SLOT(doMicMuting(bool)));
789 connect( sampleRateComboBox, SIGNAL(activated(int)), 788
790 this, SLOT( changesamplerateCombo(int)) ); 789 connect(ListView1,SIGNAL(doubleClicked(QListViewItem*)),this,SLOT(itClick(QListViewItem*)));
791 connect( bitRateComboBox, SIGNAL(activated(int)), 790 connect(ListView1,SIGNAL(mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),this,SLOT(listPressed(int,QListViewItem*,const QPoint&,int)));
792 this, SLOT( changebitrateCombo(int)) ); 791
793 792 connect(timeSlider,SIGNAL(sliderMoved(int)),this,SLOT(changeTimeSlider(int)));
794 connect( directoryComboBox, SIGNAL(activated(int)), 793 connect(timeSlider,SIGNAL(sliderPressed()),this,SLOT(timeSliderPressed()));
795 this, SLOT( changeDirCombo(int)) ); 794 connect(timeSlider,SIGNAL(sliderReleased()),this,SLOT(timeSliderReleased()));
796 connect( sizeLimitCombo, SIGNAL(activated(int)), 795
797 this, SLOT( changeSizeLimitCombo(int)) ); 796 connect(compressionCheckBox,SIGNAL(toggled(bool)),this,SLOT(compressionSelected(bool)));
798 797 connect(autoMuteCheckBox,SIGNAL(toggled(bool)),this,SLOT(slotAutoMute(bool)));
799 connect( stereoCheckBox, SIGNAL(toggled(bool)),
800 this, SLOT( changeStereoCheck(bool)) );
801
802 connect( outMuteCheckBox, SIGNAL(toggled(bool)),
803 this, SLOT( doVolMuting(bool)) );
804 connect( inMuteCheckBox , SIGNAL(toggled(bool)),
805 this, SLOT( doMicMuting(bool)) );
806
807 connect( ListView1,SIGNAL(doubleClicked(QListViewItem*)),
808 this,SLOT( itClick(QListViewItem*)));
809 connect( ListView1, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),
810 this,SLOT( listPressed(int,QListViewItem*,const QPoint&,int)) );
811 connect( timeSlider, SIGNAL( sliderMoved(int)),
812 this, SLOT( changeTimeSlider(int) ));
813 connect( timeSlider, SIGNAL( sliderPressed()),
814 this, SLOT( timeSliderPressed() ));
815 connect( timeSlider, SIGNAL( sliderReleased()),
816 this, SLOT( timeSliderReleased() ));
817 connect( compressionCheckBox, SIGNAL( toggled(bool)),
818 this, SLOT( compressionSelected(bool)));
819 connect( autoMuteCheckBox, SIGNAL( toggled(bool)),
820 this, SLOT( slotAutoMute(bool)));
821} 798}
822 799
823void QtRec::initConfig() { 800void QtRec::initConfig() {
824 int index, fred, i; 801 int index, fred, i;
825 Config cfg("OpieRec"); 802 Config cfg("OpieRec");
826 cfg.setGroup("Settings"); 803 cfg.setGroup("Settings");
827 804
828 index = cfg.readNumEntry("samplerate",22050); 805 index = cfg.readNumEntry("samplerate",22050);
829 bool ok; 806 bool ok;
830 807
831 for(int ws=0;ws<sampleRateComboBox->count();ws++) { 808 for(int ws=0;ws<sampleRateComboBox->count();ws++) {
832 fred = sampleRateComboBox->text(ws).toInt(&ok, 10); 809 fred = sampleRateComboBox->text(ws).toInt(&ok, 10);
diff --git a/noncore/multimedia/opierec/qtrec.h b/noncore/multimedia/opierec/qtrec.h
index 3808d99..642048a 100644
--- a/noncore/multimedia/opierec/qtrec.h
+++ b/noncore/multimedia/opierec/qtrec.h
@@ -121,24 +121,25 @@ private slots:
121 void forwardTimerTimeout(); 121 void forwardTimerTimeout();
122 void itClick(QListViewItem *item); 122 void itClick(QListViewItem *item);
123 void listPressed(int, QListViewItem *, const QPoint&, int); 123 void listPressed(int, QListViewItem *, const QPoint&, int);
124 void newSound(); 124 void newSound();
125 void rewindPressed(); 125 void rewindPressed();
126 void rewindReleased(); 126 void rewindReleased();
127 void rewindTimerTimeout(); 127 void rewindTimerTimeout();
128 void slotAutoMute(bool); 128 void slotAutoMute(bool);
129 void thisTab(QWidget*); 129 void thisTab(QWidget*);
130 void timeSliderPressed(); 130 void timeSliderPressed();
131 void timeSliderReleased(); 131 void timeSliderReleased();
132 void timerBreak(); 132 void timerBreak();
133 void initIconView();
133/* void changedOutVolume(int); */ 134/* void changedOutVolume(int); */
134/* void changedInVolume(int); */ 135/* void changedInVolume(int); */
135 136
136protected: 137protected:
137 138
138 WavFile *wavFile; 139 WavFile *wavFile;
139 QButtonGroup *ButtonGroup1; 140 QButtonGroup *ButtonGroup1;
140 QCheckBox *outMuteCheckBox, *inMuteCheckBox, *compressionCheckBox, *autoMuteCheckBox, *stereoCheckBox; 141 QCheckBox *outMuteCheckBox, *inMuteCheckBox, *compressionCheckBox, *autoMuteCheckBox, *stereoCheckBox;
141 QComboBox* sampleRateComboBox, * bitRateComboBox, *directoryComboBox, *sizeLimitCombo; 142 QComboBox* sampleRateComboBox, * bitRateComboBox, *directoryComboBox, *sizeLimitCombo;
142 QHBoxLayout* Layout12; 143 QHBoxLayout* Layout12;
143 QHBoxLayout* Layout13; 144 QHBoxLayout* Layout13;
144 QHBoxLayout* Layout14; 145 QHBoxLayout* Layout14;
@@ -163,25 +164,24 @@ protected:
163 QGroupBox *sampleGroup, *bitGroup, *dirGroup, *sizeGroup; 164 QGroupBox *sampleGroup, *bitGroup, *dirGroup, *sizeGroup;
164/* short inbuffer[65536], outbuffer[65536]; */ 165/* short inbuffer[65536], outbuffer[65536]; */
165/* unsigned short unsigned_inbuffer[65536], unsigned_outbuffer[65536]; */ 166/* unsigned short unsigned_inbuffer[65536], unsigned_outbuffer[65536]; */
166 167
167 168
168 bool doPlay(); 169 bool doPlay();
169 bool openPlayFile(); 170 bool openPlayFile();
170 bool setUpFile(); 171 bool setUpFile();
171 bool setupAudio( bool b); 172 bool setupAudio( bool b);
172 void endPlaying(); 173 void endPlaying();
173 void endRecording(); 174 void endRecording();
174 void fileBeamFinished( Ir *ir); 175 void fileBeamFinished( Ir *ir);
175 void initIconView();
176 void keyPressEvent( QKeyEvent *e); 176 void keyPressEvent( QKeyEvent *e);
177 void keyReleaseEvent( QKeyEvent *e); 177 void keyReleaseEvent( QKeyEvent *e);
178 void receive( const QCString &, const QByteArray & ); 178 void receive( const QCString &, const QByteArray & );
179 void showListMenu(QListViewItem * ); 179 void showListMenu(QListViewItem * );
180#ifndef THREADED 180#ifndef THREADED
181 void quickRec(); 181 void quickRec();
182 void playIt(); 182 void playIt();
183#endif 183#endif
184 184
185}; 185};
186 186
187#endif // QTREC_H 187#endif // QTREC_H