summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2005-02-19 01:41:12 (UTC)
committer llornkcor <llornkcor>2005-02-19 01:41:12 (UTC)
commit42ff7b7515ef2220d3400c468f4cea5828f4faea (patch) (unidiff)
tree3358e973ff98fcd79311298ffc56c88e39c8b4eb
parente24ddf0db8e3e4329caeb8d0bee5db87cec1d2da (diff)
downloadopie-42ff7b7515ef2220d3400c468f4cea5828f4faea.zip
opie-42ff7b7515ef2220d3400c468f4cea5828f4faea.tar.gz
opie-42ff7b7515ef2220d3400c468f4cea5828f4faea.tar.bz2
simplify some things
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opierec/device.cpp286
-rw-r--r--noncore/multimedia/opierec/device.h4
-rw-r--r--noncore/multimedia/opierec/qtrec.cpp121
-rw-r--r--noncore/multimedia/opierec/waveform.cpp2
4 files changed, 125 insertions, 288 deletions
diff --git a/noncore/multimedia/opierec/device.cpp b/noncore/multimedia/opierec/device.cpp
index cb47b77..e7e0f4b 100644
--- a/noncore/multimedia/opierec/device.cpp
+++ b/noncore/multimedia/opierec/device.cpp
@@ -7,2 +7,4 @@
7 7
8#include <opie2/odebug.h>
9
8/* STD */ 10/* STD */
@@ -19,23 +21,48 @@
19//extern QtRec *qperec; 21//extern QtRec *qperec;
22#if defined(QT_QWS_SL5XXX)
23///#if defined(QT_QWS_EBX)
24
25#define DSPSTROUT "/dev/dsp"
26#define DSPSTRMIXEROUT "/dev/mixer"
27
28#ifdef SHARP
29#define DSPSTRIN "/dev/dsp1"
30#define DSPSTRMIXERIN "/dev/mixer1"
31#else
32#define DSPSTRIN "/dev/dsp"
33#define DSPSTRMIXERIN "/dev/mixer"
34#endif
35
36#else
37
38#ifdef QT_QWS_DEVFS
39#define DSPSTROUT "/dev/sound/dsp"
40#define DSPSTRIN "/dev/sound/dsp"
41#define DSPSTRMIXERIN "/dev/sound/mixer"
42#define DSPSTRMIXEROUT "/dev/sound/mixer"
43#else
44#define DSPSTROUT "/dev/dsp"
45#define DSPSTRIN "/dev/dsp"
46#define DSPSTRMIXERIN "/dev/mixer"
47#define DSPSTRMIXEROUT "/dev/mixer"
48#endif
49
50#endif
20 51
21Device::Device( QObject * parent, const char * dsp, const char * mixr, bool record ) 52Device::Device( QObject * parent, bool record )
22 : QObject( parent) 53 : QObject( parent)
23{ 54{
24 dspstr = (char *)dsp; 55// dspstr = dsp;
25 mixstr = (char *)mixr; 56 devForm = -1;
26 57 devCh = -1;
27 devForm=-1; 58 devRate = -1;
28 devCh=-1;
29 devRate=-1;
30 59
31 if( !record){ //playing 60 if( !record){ //playing
32 qDebug( "setting up DSP for playing" ); 61 owarn << "setting up DSP for playing" << oendl;
33 flags = O_WRONLY; 62 flags = O_WRONLY;
34 } else { //recording 63 } else { //recording
35 qDebug( "setting up DSP for recording" ); 64 owarn << "setting up DSP for recording" << oendl;
36 flags = O_RDWR; 65 flags = O_RDWR;
37// flags = O_RDONLY; 66// flags = O_RDONLY;
38 67 selectMicInput();
39// selectMicInput();
40
41 } 68 }
@@ -52,84 +79,15 @@ bool Device::openDsp() {
52int Device::openDevice( int flags) { 79int Device::openDevice( int flags) {
53/* pid_t pid; 80 owarn << "Opening"<< dspstr;
54 int status; 81
55 int pipefd[2]; 82 if (( sd = ::open( DSPSTROUT, flags)) == -1) {
56 char message[20]; 83 perror("open(\"/dev/dsp\")");
57 if (pipe(pipefd) == -1){ 84 QString errorMsg="Could not open audio device\n /dev/dsp\n"
58 perror ("Error creating pipe"); 85 +(QString)strerror(errno);
59exit(1); 86 qDebug( "XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg );
60 } 87 return -1;
61 switch (pid = fork()) { 88 }
62 case -1: 89
63 perror("The fork failed!"); 90 if(ioctl(sd,SNDCTL_DSP_RESET,0)<0){
64 break; 91 perror("ioctl RESET");
65 case 0: { 92 }
66 */
67qDebug( "Opening %s",dspstr);
68 if (( sd = ::open( dspstr, flags)) == -1) {
69 perror("open(\"/dev/dsp\")");
70 QString errorMsg="Could not open audio device\n /dev/dsp\n"
71 +(QString)strerror(errno);
72 qDebug( "XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg );
73 return -1;
74 }
75
76qDebug( "Opening mixer" );
77 int mixerHandle=0;
78#ifdef QT_QWS_DEVFS
79 if (( mixerHandle = open("/dev/sound/mixer",O_RDWR))<0) {
80#else
81 if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) {
82#endif
83 perror("open(\"/dev/mixer\")");
84 QString errorMsg="Could not open audio device\n /dev/dsp\n"
85 +(QString)strerror(errno);
86 qDebug( "XXXXXXXXXXXXXXXXXXXXXX "+errorMsg );
87 }
88
89 if(ioctl(sd,SNDCTL_DSP_RESET,0)<0){
90 perror("ioctl RESET");
91 }
92// sprintf(message, "%d", sd);
93
94/* QFile f1("/pid");
95 f1.open(IO_WriteOnly );
96 f1.writeBlock(message, strlen(message));
97 f1.close();
98 */
99 /* close(pipefd[0]);
100 write(pipefd[1], message, sizeof(message));
101 close(pipefd[1]);
102 // qDebug( "" + soundDevice->sd );
103 _exit(0);
104 }
105 default:
106 // pid greater than zero is parent getting the child's pid
107 printf("Child's pid is %d\n",pid);
108 QString s;
109 close(pipefd[1]);
110 read(pipefd[0], message, sizeof(message));
111 s = message;
112 close(pipefd[0]);
113
114// while(wait(NULL)!=pid)
115 // ;
116 printf("child %ld terminated normally, return status is zero\n", (long) pid);
117 */
118 // filePara.sd=(long) pid;
119 /* QFile f2("/pid");
120 f2.open(IO_ReadOnly);
121 QTextStream t(&f2);
122 // for(int f=0; f < t.atEnd() ;f++) {
123 s = t.readLine();
124 // }
125 */
126// bool ok;
127// sd = s.toInt(&ok, 10);
128// qDebug( "<<<<<<<<<<<<<>>>>>>>>>>>>"+s );
129
130// f2.close();
131// }
132::close(mixerHandle );
133// qDebug( "open device " + dspstr );
134// qDebug( "success! " + sd );
135 return sd; 93 return sd;
@@ -137,2 +95,9 @@ qDebug( "Opening mixer" );
137 95
96int Device::getInVolume() {
97 unsigned int volume = 0;
98 Config cfg("qpe");
99 cfg.setGroup("Volume");
100
101 return cfg.readNumEntry("Mic");
102}
138 103
@@ -140,11 +105,2 @@ int Device::getOutVolume( ) {
140 unsigned int volume; 105 unsigned int volume;
141 int mixerHandle = open( mixstr, O_RDWR );
142 if ( mixerHandle >= 0 ) {
143 if(ioctl( mixerHandle, MIXER_READ(SOUND_MIXER_VOLUME), &volume )==-1)
144 perror("<<<<<<<<<<<<<<ioctl(\"MIXER_READ\")");
145 ::close( mixerHandle );
146 } else
147 perror("open(\"/dev/mixer\")");
148 printf("<<<<<<<<<<<<<<<<<<<<output volume %d\n",volume);
149
150 Config cfg("qpe"); 106 Config cfg("qpe");
@@ -155,16 +111,8 @@ int Device::getOutVolume( ) {
155 111
156int Device::getInVolume() {
157 unsigned int volume=0;
158 int mixerHandle = ::open( mixstr, O_RDWR );
159 if ( mixerHandle >= 0 ) {
160 if(ioctl( mixerHandle, MIXER_READ(SOUND_MIXER_MIC), &volume )==-1)
161 perror("<<<<<<<<<<<<<<<ioctl(\"MIXER_READ\")");
162 ::close( mixerHandle );
163 } else
164 perror("open(\"/dev/mixer\")");
165 printf("<<<<<<<<<<<<<<input volume %d\n", volume );
166 Config cfg("qpe");
167 cfg.setGroup("Volume");
168 112
169 return cfg.readNumEntry("Mic"); 113void Device::changedInVolume(int vol ) {
114 Config cfg("qpe");
115 cfg.setGroup("Volume");
116 cfg.writeEntry("Mic", QString::number(vol ));
117 QCopEnvelope( "QPE/System", "micChange(bool)" ) << false;
170} 118}
@@ -172,38 +120,9 @@ int Device::getInVolume() {
172void Device::changedOutVolume(int vol) { 120void Device::changedOutVolume(int vol) {
173 int level = (vol << 8) + vol; 121 Config cfg("qpe");
174 int fd = 0; 122 cfg.setGroup("Volume");
175#ifdef QT_QWS_DEVFS 123 cfg.writeEntry("VolumePercent", QString::number( vol ));
176 if ((fd = open("/dev/sound/mixer", O_RDWR))>=0) {
177#else
178 if ((fd = open("/dev/mixer", O_RDWR))>=0) {
179#endif
180 if(ioctl(fd, MIXER_WRITE(SOUND_MIXER_VOLUME), &level) == -1)
181 perror("ioctl(\"MIXER_IN_WRITE\")");
182
183 Config cfg("qpe");
184 cfg.setGroup("Volume");
185 cfg.writeEntry("VolumePercent", QString::number( vol ));
186 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false;
187 qDebug("changing output vol %d" ,vol );
188 }
189 ::close(fd);
190}
191 124
192void Device::changedInVolume(int vol ) { 125 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false;
193 int level = (vol << 8) + vol; 126
194 int fd = 0; 127 owarn << "changing output vol " << vol << oendl;
195#ifdef QT_QWS_DEVFS
196 if ((fd = open("/dev/sound/mixer", O_RDWR))>=0) {
197#else
198 if ((fd = open("/dev/mixer", O_RDWR))>=0) {
199#endif
200 if(ioctl(fd, MIXER_WRITE(SOUND_MIXER_MIC), &level) == -1)
201 perror("ioctl(\"MIXER_IN_WRITE\")");
202 Config cfg("qpe");
203 cfg.setGroup("Volume");
204 cfg.writeEntry("Mic", QString::number(vol ));
205 QCopEnvelope( "QPE/System", "micChange(bool)" ) << false;
206 qDebug("changing input volume %d",vol);
207 }
208 ::close(fd);
209} 128}
@@ -212,18 +131,18 @@ bool Device::selectMicInput() {
212 131
213 int md=0; 132 int md = 0;
214 int info=MIXER_WRITE(SOUND_MIXER_MIC); 133 int info = SOUND_MASK_MIC;//MIXER_WRITE(SOUND_MIXER_MIC);
215#ifdef QT_QWS_DEVFS 134 owarn << "sectMicInput" << oendl;
216 md = ::open( "/dev/sound/mixer", O_RDWR ); 135 md = ::open( DSPSTRMIXEROUT, O_RDWR );
217#else 136
218 md = ::open( "/dev/mixer", O_RDWR ); 137 if ( md <= 0) {
219#endif 138 QString err;
220 if ( md == -1) 139 err.sprintf("open %s", DSPSTRMIXEROUT);
221 perror("open(\"/dev/mixer\")"); 140 perror(err.latin1());
222 else { 141 } else {
223 if( ioctl( md, SOUND_MIXER_WRITE_RECSRC, &info) == -1) 142 if( ioctl( md, SOUND_MIXER_WRITE_RECSRC, &info) == -1)
224 perror("ioctl(\"SOUND_MIXER_WRITE_RECSRC\")"); 143 perror("ioctl(\"SOUND_MIXER_WRITE_RECSRC\")");
225 ::close(md); 144 ::close(md);
226 return false; 145 return false;
227 } 146 }
228 ::close(md); 147 ::close(md);
229 148
@@ -233,16 +152,3 @@ bool Device::selectMicInput() {
233bool Device::closeDevice( bool) { 152bool Device::closeDevice( bool) {
234// if(b) {//close now
235// if (ioctl( sd, SNDCTL_DSP_RESET, 0) == -1) {
236// perror("ioctl(\"SNDCTL_DSP_RESET\")");
237// }
238// } else { //let play
239// if (ioctl( sd, SNDCTL_DSP_SYNC, 0) == -1) {
240// perror("ioctl(\"SNDCTL_DSP_SYNC\")");
241// }
242// }
243
244 ::close( sd); //close sound device 153 ::close( sd); //close sound device
245// sdfd=0;
246 // sd=0;
247// qDebug( "closed dsp" );
248 return true; 154 return true;
@@ -304,3 +210,3 @@ int Device::getDeviceFormat() {
304int Device::getDeviceRate() { 210int Device::getDeviceRate() {
305 int dRate=0; 211 int dRate = 0;
306 if (ioctl( sd, SOUND_PCM_READ_RATE, &dRate) == -1) { 212 if (ioctl( sd, SOUND_PCM_READ_RATE, &dRate) == -1) {
@@ -313,4 +219,3 @@ int Device::getDeviceRate() {
313int Device::getDeviceBits() { 219int Device::getDeviceBits() {
314 int dBits=0; 220 int dBits = 0;
315#ifndef QT_QWS_EBX // zaurus doesnt have this
316 if (ioctl( sd, SOUND_PCM_READ_BITS, &dBits) == -1) { 221 if (ioctl( sd, SOUND_PCM_READ_BITS, &dBits) == -1) {
@@ -318,3 +223,2 @@ int Device::getDeviceBits() {
318 } 223 }
319#endif
320 return dBits; 224 return dBits;
@@ -323,3 +227,3 @@ int Device::getDeviceBits() {
323int Device::getDeviceChannels() { 227int Device::getDeviceChannels() {
324 int dCh=0; 228 int dCh = 0;
325 if (ioctl( sd, SOUND_PCM_READ_CHANNELS, &dCh) == -1) { 229 if (ioctl( sd, SOUND_PCM_READ_CHANNELS, &dCh) == -1) {
@@ -361,5 +265,5 @@ int Device::devRead(int soundDescriptor, short *buf, int size) {
361 Q_UNUSED(soundDescriptor); 265 Q_UNUSED(soundDescriptor);
362 int number = 0; 266 int number = 0;
363 number = ::read( sd /*soundDescriptor*/, (char *)buf, size); 267 number = ::read( sd /*soundDescriptor*/, (char *)buf, size);
364 return number; 268 return number;
365} 269}
@@ -369,6 +273,4 @@ int Device::devWrite(int soundDescriptor, short * buf, int size) {
369 int bytesWritten = 0; 273 int bytesWritten = 0;
370 bytesWritten = ::write( sd /*soundDescriptor*/, buf, size); 274 bytesWritten = ::write( sd /*soundDescriptor*/, buf, size);
371 return bytesWritten; 275 return bytesWritten;
372} 276}
373
374
diff --git a/noncore/multimedia/opierec/device.h b/noncore/multimedia/opierec/device.h
index 8152e85..dbc7b00 100644
--- a/noncore/multimedia/opierec/device.h
+++ b/noncore/multimedia/opierec/device.h
@@ -9,3 +9,3 @@ class Device : public QObject {
9public: 9public:
10 Device( QObject * parent=0, const char * dspStr=0, const char * mixerStr=0, bool record=0 ); 10 Device( QObject * parent=0, bool record=0 );
11 ~Device() {}; 11 ~Device() {};
@@ -38,3 +38,3 @@ private:
38 int devRes, devCh, devRate, devForm, flags; 38 int devRes, devCh, devRate, devForm, flags;
39 char *dspstr, *mixstr; 39 QString dspstr, mixstr;
40 bool selectMicInput(); 40 bool selectMicInput();
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp
index 6793b4e..e827083 100644
--- a/noncore/multimedia/opierec/qtrec.cpp
+++ b/noncore/multimedia/opierec/qtrec.cpp
@@ -5,3 +5,3 @@
5****************************************************************************/ 5****************************************************************************/
6#define DEV_VERSION 6//#define DEV_VERSION
7 7
@@ -65,31 +65,2 @@ static int deviceBitRates[] = { 8, 16, -1 };
65 65
66#if defined(QT_QWS_SL5XXX)
67///#if defined(QT_QWS_EBX)
68
69#define DSPSTROUT "/dev/dsp"
70#define DSPSTRMIXEROUT "/dev/mixer"
71
72#ifdef SHARP
73#define DSPSTRIN "/dev/dsp1"
74#define DSPSTRMIXERIN "/dev/mixer1"
75#else
76#define DSPSTRIN "/dev/dsp"
77#define DSPSTRMIXERIN "/dev/mixer"
78#endif
79
80#else
81
82#ifdef QT_QWS_DEVFS
83#define DSPSTROUT "/dev/sound/dsp"
84#define DSPSTRIN "/dev/sound/dsp"
85#define DSPSTRMIXERIN "/dev/sound/mixer"
86#define DSPSTRMIXEROUT "/dev/sound/mixer"
87#else
88#define DSPSTROUT "/dev/dsp"
89#define DSPSTRIN "/dev/dsp"
90#define DSPSTRMIXERIN "/dev/mixer"
91#define DSPSTRMIXEROUT "/dev/mixer"
92#endif
93
94#endif
95 66
@@ -195,4 +166,4 @@ void quickRec()
195 166
196 printf("%d, bytes %d,total %d\r",number, bytesWritten, total); 167 printf("%d, bytes %d,total %d\r", number, bytesWritten, total);
197 fflush(stdout); 168 fflush(stdout);
198 169
@@ -245,4 +216,4 @@ void quickRec()
245 timeSlider->setValue( total); 216 timeSlider->setValue( total);
246 printf("%d, bytes %d,total %d\r",number, bytesWritten , total); 217 printf("%d, bytes %d,total %d\r",number, bytesWritten , total);
247 fflush(stdout); 218 fflush(stdout);
248 219
@@ -298,2 +269,3 @@ void quickRec()
298 } 269 }
270 printf("\n");
299} /// END quickRec() 271} /// END quickRec()
@@ -452,10 +424,3 @@ QtRec::QtRec( QWidget* parent, const char* name, WFlags fl )
452 424
453 soundDevice = new Device( this, 425 soundDevice = new Device( this, false); //open play
454 hwcfg.readEntry( "Audio",DSPSTROUT),
455 hwcfg.readEntry( "Mixer",DSPSTRMIXEROUT), false);
456// soundDevice = new Device( this, hwcfg.readEntry( "Audio","hw:0"), hwcfg.readEntry( "Mixer","hw:0"), false);
457
458// soundDevice->setDeviceFormat(AFMT_S16_LE);
459// soundDevice->setDeviceChannels(1);
460// soundDevice->setDeviceRate( 22050);
461 426
@@ -506,3 +471,3 @@ void QtRec::init() {
506 stopped = true; 471 stopped = true;
507 setCaption( tr( "OpieRecord " ) + QString::number(VERSION) ); 472 setCaption( tr( "OpieRecord " ));
508 QGridLayout *layout = new QGridLayout( this ); 473 QGridLayout *layout = new QGridLayout( this );
@@ -578,17 +543,6 @@ void QtRec::init() {
578 ListView1->addColumn( tr( "Name" ) ); 543 ListView1->addColumn( tr( "Name" ) );
579 // ListView1->setColumnWidth( 0, 140);
580 ListView1->setSorting( 1, false); 544 ListView1->setSorting( 1, false);
581 ListView1->addColumn( tr( "Time" ) ); //in seconds 545 ListView1->addColumn( tr( "Time" ) ); //in seconds
582 // ListView1->setColumnWidth( 1, -1);
583 // ListView1->addColumn( tr("Location") );
584 // ListView1->setColumnWidth( 2, -1);
585 // ListView1->addColumn( tr("Date") );
586 // ListView1->setColumnWidth( 3, -1);
587 ListView1->setColumnWidthMode(0, QListView::Maximum); 546 ListView1->setColumnWidthMode(0, QListView::Maximum);
588 // ListView1->setColumnWidthMode(1, QListView::Maximum);
589
590 // ListView1->setColumnWidthMode( 0, QListView::Manual);
591 ListView1->setColumnAlignment( 1, QListView::AlignCenter); 547 ListView1->setColumnAlignment( 1, QListView::AlignCenter);
592 // ListView1->setColumnAlignment( 2, QListView::AlignRight);
593 // ListView1->setColumnAlignment( 3, QListView::AlignLeft);
594 ListView1->setAllColumnsShowFocus( true ); 548 ListView1->setAllColumnsShowFocus( true );
@@ -610,3 +564,2 @@ void QtRec::init() {
610 sampleRateComboBox->setGeometry( QRect( 10, 20, 80, 25 ) ); 564 sampleRateComboBox->setGeometry( QRect( 10, 20, 80, 25 ) );
611//#ifndef QT_QWS_EBX
612 QString s; 565 QString s;
@@ -719,5 +672,3 @@ void QtRec::init() {
719 672
720
721 waveform = new Waveform( this, "waveform" ); 673 waveform = new Waveform( this, "waveform" );
722// waveform->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, waveform->sizePolicy().hasHeightForWidth() ) );
723 waveform->setMinimumSize( QSize( 0, 50 ) ); 674 waveform->setMinimumSize( QSize( 0, 50 ) );
@@ -729,3 +680,2 @@ void QtRec::init() {
729void QtRec::initIconView() { 680void QtRec::initIconView() {
730 owarn << "initIconView" << oendl;
731 ListView1->clear(); 681 ListView1->clear();
@@ -737,3 +687,3 @@ void QtRec::initIconView() {
737 int nFiles = cfg.readNumEntry("NumberofFiles",0); 687 int nFiles = cfg.readNumEntry("NumberofFiles",0);
738 owarn << "init number of files " << nFiles << "" << oendl; 688// owarn << "init number of files " << nFiles << "" << oendl;
739 689
@@ -754,3 +704,3 @@ void QtRec::initIconView() {
754 if( info.exists()) { 704 if( info.exists()) {
755 owarn << "new item " << temp << oendl; 705 // owarn << "new item " << temp << oendl;
756 item = new QListViewItem( ListView1, temp, fileS /*, mediaLocation, fileDate*/); 706 item = new QListViewItem( ListView1, temp, fileS /*, mediaLocation, fileDate*/);
@@ -858,3 +808,3 @@ void QtRec::initConfig() {
858void QtRec::stop() { 808void QtRec::stop() {
859 owarn << "STOP" << oendl; 809 // owarn << "STOP" << oendl;
860 setRecordButton(false); 810 setRecordButton(false);
@@ -1063,6 +1013,2 @@ bool QtRec::setupAudio( bool b) {
1063 flags = O_WRONLY; 1013 flags = O_WRONLY;
1064 Config hwcfg("OpieRec");
1065 hwcfg.setGroup("Hardware");
1066 dspString = hwcfg.readEntry( "Audio", DSPSTROUT);
1067 mixerString = hwcfg.readEntry( "Mixer", DSPSTRMIXEROUT);
1068 recording = false; 1014 recording = false;
@@ -1100,6 +1046,2 @@ bool QtRec::setupAudio( bool b) {
1100// flags= O_RDONLY; 1046// flags= O_RDONLY;
1101 Config hwcfg("OpieRec");
1102 hwcfg.setGroup("Hardware");
1103 dspString = hwcfg.readEntry( "Audio", DSPSTRIN);
1104 mixerString = hwcfg.readEntry( "Mixer", DSPSTRMIXERIN);
1105 recording = true; 1047 recording = true;
@@ -1109,6 +1051,6 @@ bool QtRec::setupAudio( bool b) {
1109 odebug << "<<<<<<<<<<<<<<<<<<<open dsp " << filePara.sampleRate << " " << filePara.channels << " " << sampleformat << "" << oendl; 1051 odebug << "<<<<<<<<<<<<<<<<<<<open dsp " << filePara.sampleRate << " " << filePara.channels << " " << sampleformat << "" << oendl;
1110 owarn << "change waveform settings" << oendl; 1052 // owarn << "change waveform settings" << oendl;
1111 waveform->changeSettings( filePara.sampleRate, filePara.channels ); 1053 waveform->changeSettings( filePara.sampleRate, filePara.channels );
1112 1054
1113 soundDevice = new Device( this, dspString, mixerString, b); 1055 soundDevice = new Device( this, b); //open rec
1114// soundDevice->openDsp(); 1056// soundDevice->openDsp();
@@ -1283,9 +1225,9 @@ void QtRec::deleteSound() {
1283 return; 1225 return;
1284#ifndef DEV_VERSION 1226// #ifndef DEV_VERSION
1285 switch ( QMessageBox::warning(this,tr("Delete"), 1227 // switch ( QMessageBox::warning(this,tr("Delete"),
1286 tr("Do you really want to <font size=+2><B>DELETE</B></font>\nthe selected file?"), 1228 // tr("Do you really want to <font size=+2><B>DELETE</B></font>\nthe selected file?"),
1287 tr("Yes"),tr("No"),0,1,1) ) { 1229 // tr("Yes"),tr("No"),0,1,1) ) {
1288 case 0: 1230 // case 0:
1289#endif 1231// #endif
1290 { 1232 // {
1291 QString file = ListView1->currentItem()->text(0); 1233 QString file = ListView1->currentItem()->text(0);
@@ -1322,8 +1264,3 @@ void QtRec::deleteSound() {
1322 update(); 1264 update();
1323 } 1265 setCaption( tr( "OpieRecord " ));
1324#ifndef DEV_VERSION
1325 };
1326#endif
1327 setCaption( tr( "OpieRecord " ) + QString::number(VERSION) );
1328
1329} 1266}
@@ -1445,2 +1382,3 @@ void QtRec::keyReleaseEvent( QKeyEvent *e) {
1445void QtRec::endRecording() { 1382void QtRec::endRecording() {
1383
1446 monitoring = false; 1384 monitoring = false;
@@ -1505,2 +1443,4 @@ void QtRec::endRecording() {
1505 selectItemByName( currentFile); 1443 selectItemByName( currentFile);
1444 setCaption( tr( "OpieRecord " ));
1445
1506} 1446}
@@ -1537,3 +1477,3 @@ void QtRec::endPlaying() {
1537 killTimers(); 1477 killTimers();
1538 owarn << "reset slider" << oendl; 1478 // owarn << "reset slider" << oendl;
1539 timeSlider->setValue(0); 1479 timeSlider->setValue(0);
@@ -1570,3 +1510,3 @@ bool QtRec::openPlayFile() {
1570 monitoring = false; 1510 monitoring = false;
1571 setCaption( tr( "OpieRecord " ) + QString::number(VERSION) ); 1511 setCaption( tr( "OpieRecord " ));
1572 QMessageBox::message(tr("Note"), tr("Could not open audio file.\n") 1512 QMessageBox::message(tr("Note"), tr("Could not open audio file.\n")
@@ -1587,3 +1527,3 @@ bool QtRec::openPlayFile() {
1587 1527
1588 owarn << "seconds " << sec << "" << oendl; 1528 // owarn << "seconds " << sec << "" << oendl;
1589 1529
@@ -1604,3 +1544,3 @@ void QtRec::listPressed( int mouse, QListViewItem *item, const QPoint &, int ) {
1604 currentFile = item->text(0); 1544 currentFile = item->text(0);
1605 setCaption( "OpieRecord " + currentFile); 1545 // setCaption( "OpieRecord " + currentFile);
1606 } 1546 }
@@ -1854,7 +1794,2 @@ void QtRec::timerEvent( QTimerEvent * ) {
1854 QString timeString; 1794 QString timeString;
1855#ifdef DEV_VERSION
1856 QString msg;
1857 msg.sprintf("%d, %d, %d", filePara.sampleRate, filePara.channels, filePara.resolution);
1858 setCaption( msg +" :: "+QString::number(secCount));
1859#endif
1860 1795
diff --git a/noncore/multimedia/opierec/waveform.cpp b/noncore/multimedia/opierec/waveform.cpp
index 7c9a25f..d1838e1 100644
--- a/noncore/multimedia/opierec/waveform.cpp
+++ b/noncore/multimedia/opierec/waveform.cpp
@@ -46,3 +46,3 @@ void Waveform::changeSettings( int frequency, int channels )
46 samplesPerPixel = frequency * channels / (5 * windowSize); 46 samplesPerPixel = frequency * channels / (5 * windowSize);
47 owarn << "Waveform::changeSettings " << samplesPerPixel << "" << oendl; 47// owarn << "Waveform::changeSettings " << samplesPerPixel << "" << oendl;
48 if ( !samplesPerPixel ) 48 if ( !samplesPerPixel )