-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 07ef15c..d5808b7 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -215,24 +215,27 @@ VMemo::VMemo( QWidget *parent, const char *_name ) | |||
215 | 215 | ||
216 | // if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) | 216 | // if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) |
217 | // systemZaurus=TRUE; | 217 | // systemZaurus=TRUE; |
218 | // else | 218 | // else |
219 | systemZaurus = FALSE; | 219 | systemZaurus = FALSE; |
220 | 220 | ||
221 | // myChannel = new QCopChannel( "QPE/VMemo", this ); | ||
221 | myChannel = new QCopChannel( "QPE/VMemo", this ); | 222 | myChannel = new QCopChannel( "QPE/VMemo", this ); |
223 | |||
222 | connect( myChannel, SIGNAL(received(const QCString&,const QByteArray&)), | 224 | connect( myChannel, SIGNAL(received(const QCString&,const QByteArray&)), |
223 | this, SLOT(receive(const QCString&,const QByteArray&)) ); | 225 | this, SLOT(receive(const QCString&,const QByteArray&)) ); |
224 | 226 | ||
227 | |||
225 | if( toggleKey != -1 ) { | 228 | if( toggleKey != -1 ) { |
226 | odebug << "Register key " << toggleKey << "" << oendl; | 229 | odebug << "Register key " << toggleKey << "" << oendl; |
227 | QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)"); | 230 | QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)"); |
228 | // e << 4096; // Key_Escape | 231 | // e << 4096; // Key_Escape |
229 | // e << Key_F5; //4148 | 232 | // e << Key_F5; //4148 |
230 | e << toggleKey; | 233 | e << toggleKey; |
231 | e << QString("QPE/VMemo"); | 234 | e << QCString("QPE/VMemo"); |
232 | e << QString("toggleRecord()"); | 235 | e << QCString("toggleRecord()"); |
233 | } | 236 | } |
234 | if(toggleKey == 1) | 237 | if(toggleKey == 1) |
235 | usingIcon = TRUE; | 238 | usingIcon = TRUE; |
236 | else | 239 | else |
237 | usingIcon = FALSE; | 240 | usingIcon = FALSE; |
238 | // if( vmCfg.readNumEntry("hideIcon",0) == 1) | 241 | // if( vmCfg.readNumEntry("hideIcon",0) == 1) |
@@ -248,13 +251,12 @@ VMemo::~VMemo() { | |||
248 | int VMemo::position() | 251 | int VMemo::position() |
249 | { | 252 | { |
250 | return 6; | 253 | return 6; |
251 | } | 254 | } |
252 | 255 | ||
253 | void VMemo::receive( const QCString &msg, const QByteArray &data ) { | 256 | void VMemo::receive( const QCString &msg, const QByteArray &data ) { |
254 | odebug << "Vmemo receive" << oendl; | ||
255 | QDataStream stream( data, IO_ReadOnly ); | 257 | QDataStream stream( data, IO_ReadOnly ); |
256 | 258 | ||
257 | if (msg == "toggleRecord()") { | 259 | if (msg == "toggleRecord()") { |
258 | if (recording) { | 260 | if (recording) { |
259 | fromToggle = TRUE; | 261 | fromToggle = TRUE; |
260 | stopRecording(); | 262 | stopRecording(); |
@@ -517,13 +519,13 @@ bool VMemo::record() { | |||
517 | unsigned short sound[bufsize]; //, monoBuffer[bufsize]; | 519 | unsigned short sound[bufsize]; //, monoBuffer[bufsize]; |
518 | char abuf[bufsize / 2]; | 520 | char abuf[bufsize / 2]; |
519 | short sbuf[bufsize]; | 521 | short sbuf[bufsize]; |
520 | odebug << "ready to record"<< oendl; | 522 | odebug << "ready to record"<< oendl; |
521 | if(useADPCM) { | 523 | if(useADPCM) { |
522 | odebug << "usr ADPCM" << oendl; | 524 | odebug << "usr ADPCM" << oendl; |
523 | 525 | ||
524 | while(recording) { | 526 | while(recording) { |
525 | result = ::read(dsp, sbuf, bufsize); // adpcm read | 527 | result = ::read(dsp, sbuf, bufsize); // adpcm read |
526 | if( result <= 0) { | 528 | if( result <= 0) { |
527 | perror("recording error "); | 529 | perror("recording error "); |
528 | QMessageBox::message(tr("Note"),tr("error recording")); | 530 | QMessageBox::message(tr("Note"),tr("error recording")); |
529 | recording = FALSE; | 531 | recording = FALSE; |
@@ -662,8 +664,8 @@ void VMemo::timerBreak() { | |||
662 | //stop | 664 | //stop |
663 | stopRecording(); | 665 | stopRecording(); |
664 | QMessageBox::message("Vmemo","Vmemo recording has ended"); | 666 | QMessageBox::message("Vmemo","Vmemo recording has ended"); |
665 | } | 667 | } |
666 | 668 | ||
667 | 669 | ||
668 | EXPORT_OPIE_APPLET_v1( VMemo ) | 670 | //EXPORT_OPIE_APPLET_v1( VMemo ) |
669 | 671 | ||