From 441e976481ced45c4884f336b18c06111e1f2ebc Mon Sep 17 00:00:00 2001 From: llornkcor Date: Sat, 18 May 2002 01:36:32 +0000 Subject: added jeremy's copyright, and maybe fixed or broke things for ipaq --- (limited to 'core/applets/vmemo/vmemo.cpp') diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 118fcde..e14d532 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp @@ -9,6 +9,7 @@ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ************************************************************************************/ +// copyright 2002 Jeremy Cowgar /* * $Id$ */ @@ -254,10 +255,10 @@ void VMemo::mousePressEvent( QMouseEvent *me ) No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions mousePressEvent and mouseReleaseEvent with a NULL parameter. */ -#if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) - if (!systemZaurus ) - return; -#endif +// #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) +// if (!systemZaurus ) +// return; +// #endif Config config( "Sound" ); config.setGroup( "System" ); @@ -436,51 +437,43 @@ void VMemo::record(void) if(format==AFMT_S16_LE) { while(recording) { result = read(dsp, sound, 512); // 8192 - qApp->processEvents(); int j=0; if(systemZaurus) { for (int i = 0; i < result; i++) { //since Z is mono do normally monoBuffer[i] = sound[i]; } - qApp->processEvents(); length+=write(wav, monoBuffer, result); } else { //ipaq /stereo inputs for (int i = 0; i < result; i+=2) { monoBuffer[j] = (sound[i]+sound[i+1])/2; j++; } - qApp->processEvents(); length+=write(wav, monoBuffer, result/2); } - printf("%d\r",length); - fflush(stdout); +// printf("%d\r",length); +// fflush(stdout); } } else { //AFMT_U8 // 8bit unsigned unsigned short sound[512], monoBuffer[512]; while(recording) { result = read(dsp, sound, 512); // 8192 - qApp->processEvents(); int j=0; if(systemZaurus) { for (int i = 0; i < result; i++) { //since Z is mono do normally monoBuffer[i] = sound[i]; } - qApp->processEvents(); length+=write(wav, monoBuffer, result); } else { //ipaq /stereo inputs for (int i = 0; i < result; i+=2) { monoBuffer[j] = (sound[i]+sound[i+1])/2; j++; } - qApp->processEvents(); length+=write(wav, monoBuffer, result/2); } length += result; - printf("%d\r",length); - fflush(stdout); - - qApp->processEvents(); +// printf("%d\r",length); +// fflush(stdout); } qApp->processEvents(); @@ -492,15 +485,13 @@ void VMemo::record(void) while(recording) { result = read(dsp, sound, 512); // 8192 - qApp->processEvents(); - write(wav, sound, result); length += result; qApp->processEvents(); } - printf("%d\r",length); - fflush(stdout); +// printf("%d\r",length); +// fflush(stdout); // qDebug("file has length of %d lasting %d seconds", // length, (( length / speed) / channels) / 2 ); // medialplayer states wrong length in secs -- cgit v0.9.0.2