author | llornkcor <llornkcor> | 2004-06-28 11:35:26 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-06-28 11:35:26 (UTC) |
commit | 6944350eaea708414b9c0ff26122d7b2d19cd8f5 (patch) (side-by-side diff) | |
tree | 725c3e90cd724a6f43c03bcdadfa40d88508aa34 /noncore/multimedia/opierec | |
parent | dd7341867ccd9f9718c4d10698f5ee0d292dba24 (diff) | |
download | opie-6944350eaea708414b9c0ff26122d7b2d19cd8f5.zip opie-6944350eaea708414b9c0ff26122d7b2d19cd8f5.tar.gz opie-6944350eaea708414b9c0ff26122d7b2d19cd8f5.tar.bz2 |
fix up interface
-rw-r--r-- | noncore/multimedia/opierec/qtrec.cpp | 137 | ||||
-rw-r--r-- | noncore/multimedia/opierec/qtrec.h | 2 |
2 files changed, 72 insertions, 67 deletions
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp index 3b8cb0d..fb2d819 100644 --- a/noncore/multimedia/opierec/qtrec.cpp +++ b/noncore/multimedia/opierec/qtrec.cpp @@ -75,4 +75,4 @@ static int deviceBitRates[] = { 8, 16, -1 }; -#define DSPSTROUT "/dev/dsp" -#define DSPSTRIN "/dev/dsp" +#define DSPSTROUT "/dev/dsp1" +#define DSPSTRIN "/dev/dsp1" #define DSPSTRMIXERIN "/dev/mixer" @@ -135,9 +135,9 @@ void quickRec() int threshold = 0; -// int bits = filePara.resolution; -// odebug << "bits " << bits << "" << oendl; + int bits = filePara.resolution; + odebug << "bits " << bits << "" << oendl; if( filePara.resolution == 16 ) { //AFMT_S16_LE) -// odebug << "AFMT_S16_LE size " << filePara.SecondsToRecord << "" << oendl; -// odebug << "samples to record " << filePara.samplesToRecord << "" << oendl; -// odebug << "" << filePara.sd << "" << oendl; + odebug << "AFMT_S16_LE size " << filePara.SecondsToRecord << "" << oendl; + odebug << "samples to record " << filePara.samplesToRecord << "" << oendl; + odebug << "" << filePara.sd << "" << oendl; level = 7; @@ -146,3 +146,3 @@ void quickRec() if( filePara.format == WAVE_FORMAT_DVI_ADPCM) { -// odebug << "start recording WAVE_FORMAT_DVI_ADPCM" << oendl; + odebug << "start recording WAVE_FORMAT_DVI_ADPCM" << oendl; // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_DVI_ADPCM >>>>>>>>>>>>>>>>>>>>>> @@ -157,3 +157,3 @@ void quickRec() if ( stopped) { -// odebug << "quickRec:: stopped" << oendl; + odebug << "quickRec:: stopped" << oendl; break; @@ -182,4 +182,6 @@ void quickRec() - filePara.numberOfRecordedSeconds = (float)total / (float)filePara.sampleRate * (float)2 - / filePara.channels; + printf("%d, bytes %d,total %d\r",number, bytesWritten, total); + fflush(stdout); + + filePara.numberOfRecordedSeconds = (float)total / (float)filePara.sampleRate * (float)2 / filePara.channels; @@ -206,3 +208,3 @@ void quickRec() - number = soundDevice->devRead( filePara.sd, (short *)inbuffer, BUFSIZE); + number = soundDevice->devRead( soundDevice->sd /*filePara.sd*/, (short *)inbuffer, BUFSIZE); @@ -230,4 +232,4 @@ void quickRec() timeSlider->setValue( total); -// printf("Writing number %d, bytes %d,total %d\r",number, bytesWritten , total); -// fflush(stdout); + printf("%d, bytes %d,total %d\r",number, bytesWritten , total); + fflush(stdout); @@ -256,3 +258,3 @@ void quickRec() - number = ::read( filePara.sd, unsigned_inbuffer, BUFSIZE); + number = ::read( soundDevice->sd /*filePara.sd*/ , unsigned_inbuffer, BUFSIZE); bytesWritten = ::write( filePara.fd , unsigned_inbuffer, number); @@ -269,3 +271,3 @@ void quickRec() filePara.numberSamples = total; - // printf("\nWriting number %d, bytes %d,total %d \r",number, bytesWritten , total); + // printf("%d, bytes %d,total %d \r",number, bytesWritten , total); // fflush(stdout); @@ -499,3 +501,3 @@ void QtRec::init() { TabWidget = new QTabWidget( this, "TabWidget" ); - layout->addMultiCellWidget(TabWidget, 0, 7, 0, 7); + layout->addMultiCellWidget(TabWidget, 0, 7, 0, 8); // TabWidget->setTabShape(QTabWidget::Triangular); @@ -512,9 +514,9 @@ void QtRec::init() { - timeLabel = new QLabel( tab, "TimeLabel" ); - layout1->addMultiCellWidget( timeLabel, 0, 0, 0, 3); +// timeLabel = new QLabel( tab, "TimeLabel" ); +// layout1->addMultiCellWidget( timeLabel, 0, 0, 0, 3); - playLabel2 = new QLabel(tab, "PlayLabel2" ); - playLabel2->setText(tr("Play") ); - playLabel2->setFixedHeight( 18); - layout1->addMultiCellWidget( playLabel2, 0, 0, 4, 4); +// playLabel2 = new QLabel(tab, "PlayLabel2" ); +// playLabel2->setText(tr("Play") ); +// playLabel2->setFixedHeight( 18); +// layout1->addMultiCellWidget( playLabel2, 0, 0, 4, 4); @@ -535,7 +537,7 @@ void QtRec::init() { - QLabel *recLabel2; - recLabel2 = new QLabel( tab, "recLabel2" ); - recLabel2->setText(tr("Rec")); - recLabel2->setFixedHeight( 18); - layout1->addMultiCellWidget( recLabel2, 0, 0, 7, 7); +// QLabel *recLabel2; +// recLabel2 = new QLabel( tab, "recLabel2" ); +// recLabel2->setText(tr("Rec")); +// recLabel2->setFixedHeight( 18); +// layout1->addMultiCellWidget( recLabel2, 0, 0, 7, 7); @@ -559,3 +561,3 @@ void QtRec::init() { layout1->addMultiCellWidget( deleteSoundButton, 1, 1, 8, 8); - deleteSoundButton->setText( tr( "Delete" ) ); + deleteSoundButton->setText( tr( "Del" ) ); @@ -565,15 +567,17 @@ void QtRec::init() { ListView1->addColumn( tr( "Name" ) ); - ListView1->setColumnWidth( 0, 140); +// ListView1->setColumnWidth( 0, 140); ListView1->setSorting( 1, false); ListView1->addColumn( tr( "Time" ) ); //in seconds - ListView1->setColumnWidth( 1, 50); - ListView1->addColumn( tr("Location") ); - ListView1->setColumnWidth( 2, 50); - ListView1->addColumn( tr("Date") ); - ListView1->setColumnWidth( 3, 63); - - ListView1->setColumnWidthMode( 0, QListView::Manual); +// ListView1->setColumnWidth( 1, -1); +// ListView1->addColumn( tr("Location") ); +// ListView1->setColumnWidth( 2, -1); +// ListView1->addColumn( tr("Date") ); +// ListView1->setColumnWidth( 3, -1); + ListView1->setColumnWidthMode(0, QListView::Maximum); +// ListView1->setColumnWidthMode(1, QListView::Maximum); + +// ListView1->setColumnWidthMode( 0, QListView::Manual); ListView1->setColumnAlignment( 1, QListView::AlignCenter); - ListView1->setColumnAlignment( 2, QListView::AlignRight); - ListView1->setColumnAlignment( 3, QListView::AlignLeft); +// ListView1->setColumnAlignment( 2, QListView::AlignRight); +// ListView1->setColumnAlignment( 3, QListView::AlignLeft); ListView1->setAllColumnsShowFocus( true ); @@ -648,3 +652,3 @@ void QtRec::init() { autoMuteCheckBox = new QCheckBox ( tr("Auto Mute"), tab_3 ); - stereoCheckBox = new QCheckBox ( tr("Stereo Channels"), tab_3 ); + stereoCheckBox = new QCheckBox ( tr("Stereo"), tab_3 ); @@ -709,3 +713,3 @@ void QtRec::init() { - layout->addMultiCellWidget( waveform, 8, 8, 0, 7 ); + layout->addMultiCellWidget( waveform, 8, 8, 0, 8); waveform->setBackgroundColor ( black ); @@ -739,3 +743,3 @@ void QtRec::initIconView() { if( info.exists()) { - item = new QListViewItem( ListView1, temp, fileS, mediaLocation, fileDate); + item = new QListViewItem( ListView1, temp, fileS /*, mediaLocation, fileDate*/); item->setPixmap( 0, image0); @@ -877,3 +881,3 @@ void QtRec::doPlayBtn() { if(!stopped) { - playLabel2->setText(tr("Play")); +// playLabel2->setText(tr("Play")); stop(); @@ -881,3 +885,3 @@ void QtRec::doPlayBtn() { if(ListView1->currentItem() == 0) return; - playLabel2->setText(tr("Stop")); +// playLabel2->setText(tr("Stop")); currentFile = ListView1->currentItem()->text(0); @@ -905,3 +909,3 @@ bool QtRec::rec() { //record timeString.sprintf("%.0f", 0.0); - timeLabel->setText( timeString+ " seconds"); +// timeLabel->setText( timeString+ " seconds"); if(!stopped) { @@ -911,3 +915,3 @@ bool QtRec::rec() { //record secCount = 1; - playLabel2->setText(tr("Stop")); +// playLabel2->setText(tr("Stop")); monitoring = false; @@ -969,3 +973,3 @@ bool QtRec::rec() { //record filePara.fileName=currentFile.latin1(); - odebug << "Start recording thread" << oendl; + odebug << "Start recording" << oendl; stopped = false; @@ -973,2 +977,3 @@ bool QtRec::rec() { //record #ifdef THREADED + odebug << "Start recording thread" << oendl; pthread_t thread1; @@ -1190,3 +1195,3 @@ bool QtRec::doPlay() { timeString.sprintf("%f", filePara.numberOfRecordedSeconds); - timeLabel->setText( timeString+ tr(" seconds")); +// timeLabel->setText( timeString+ tr(" seconds")); @@ -1478,3 +1483,3 @@ void QtRec::endRecording() { cmd.sprintf("mv "+ wavFile->trackName() + " " + wavFile->currentFileName); -// odebug << "moving tmp file to "+currentFileName << oendl; + odebug << "moving tmp file to "+currentFileName << oendl; system( cmd.latin1()); @@ -1498,3 +1503,3 @@ void QtRec::endRecording() { cfg.writeEntry( wavFile->currentFileName, time ); -// odebug << "writing config numberOfRecordedSeconds "+time << oendl; + odebug << "writing config numberOfRecordedSeconds "+time << oendl; @@ -1502,3 +1507,3 @@ void QtRec::endRecording() { odebug << "finished recording" << oendl; - timeLabel->setText(""); +// timeLabel->setText(""); } @@ -1519,3 +1524,3 @@ void QtRec::endPlaying() { // errorStop(); -// odebug << "end playing" << oendl; + odebug << "end playing" << oendl; setRecordButton( false); @@ -1531,4 +1536,4 @@ void QtRec::endPlaying() { // if(soundDevice) delete soundDevice; -// odebug << "file and sound device closed" << oendl; - timeLabel->setText(""); + odebug << "file and sound device closed" << oendl; +// timeLabel->setText(""); total = 0; @@ -1540,3 +1545,3 @@ void QtRec::endPlaying() { -// odebug << "track closed" << oendl; + odebug << "track closed" << oendl; killTimers(); @@ -1866,3 +1871,3 @@ void QtRec::timerEvent( QTimerEvent * ) { timeString.sprintf("%d", secCount); - timeLabel->setText( timeString + " seconds"); +// timeLabel->setText( timeString + " seconds"); @@ -1873,3 +1878,3 @@ void QtRec::changeTimeSlider(int index) { if( ListView1->currentItem() == 0 || !wavFile->track.isOpen()) return; - // odebug << "Slider moved to " << index << "" << oendl; + odebug << "Slider moved to " << index << "" << oendl; paused = true; @@ -1883,3 +1888,3 @@ void QtRec::changeTimeSlider(int index) { secCount = (int)filePara.numberOfRecordedSeconds; - timeLabel->setText( timeString + tr(" seconds")); +// timeLabel->setText( timeString + tr(" seconds")); } @@ -1888,3 +1893,3 @@ void QtRec::timeSliderPressed() { if( ListView1->currentItem() == 0) return; - // odebug << "slider pressed" << oendl; + odebug << "slider pressed" << oendl; paused = true; @@ -1897,3 +1902,3 @@ void QtRec::timeSliderReleased() { - // odebug << "slider released " << sliderPos << "" << oendl; + odebug << "slider released " << sliderPos << "" << oendl; stopped = false; @@ -1927,3 +1932,3 @@ void QtRec::rewindTimerTimeout() { timeSlider->setValue( sliderValue ) ; - // odebug << "" << sliderValue << "" << oendl; + odebug << "" << sliderValue << "" << oendl; QString timeString; @@ -1931,3 +1936,3 @@ void QtRec::rewindTimerTimeout() { timeString.sprintf( "%.2f", filePara.numberOfRecordedSeconds); - timeLabel->setText( timeString+ tr(" seconds")); +// timeLabel->setText( timeString+ tr(" seconds")); } @@ -1941,3 +1946,3 @@ void QtRec::rewindReleased() { total = newPos * 4; - // odebug << "rewind released " << total << "" << oendl; + odebug << "rewind released " << total << "" << oendl; startTimer( 1000); @@ -1973,3 +1978,3 @@ void QtRec::forwardTimerTimeout() { timeString.sprintf( "%.2f", filePara.numberOfRecordedSeconds); - timeLabel->setText( timeString+ tr(" seconds")); +// timeLabel->setText( timeString+ tr(" seconds")); } @@ -2029,3 +2034,3 @@ void QtRec::setRecordButton(bool b) { Stop_PushButton->setDown( true); - playLabel2->setText( tr("Stop") ); +// playLabel2->setText( tr("Stop") ); @@ -2037,3 +2042,3 @@ void QtRec::setRecordButton(bool b) { Stop_PushButton->setDown( false); - playLabel2->setText( tr("Play") ); +// playLabel2->setText( tr("Play") ); if(Rec_PushButton->isDown()) diff --git a/noncore/multimedia/opierec/qtrec.h b/noncore/multimedia/opierec/qtrec.h index 5878d37..3808d99 100644 --- a/noncore/multimedia/opierec/qtrec.h +++ b/noncore/multimedia/opierec/qtrec.h @@ -6,3 +6,3 @@ copyright 2002 by L.J. Potter ljp@llornkcor.com #define QTREC_H -#define VERSION 20040101 +#define VERSION 20040628 |