summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-27 05:29:36 (UTC)
committer llornkcor <llornkcor>2002-03-27 05:29:36 (UTC)
commit347240bf66daf78f6a0e7c98bc32a53810f710a9 (patch) (side-by-side diff)
tree8b638f2e12cb32b8bdbe329aa2a1d03635105329
parent531e1365f5ae7ffcbfc9c9ebe92274282358025e (diff)
downloadopie-347240bf66daf78f6a0e7c98bc32a53810f710a9.zip
opie-347240bf66daf78f6a0e7c98bc32a53810f710a9.tar.gz
opie-347240bf66daf78f6a0e7c98bc32a53810f710a9.tar.bz2
forgot to uncomment ipaq code again
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index e6c4ff9..4d4d598 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -191,130 +191,130 @@ static char * vmemo_xpm[] = {
" n n n n n n n n n "};
VMemo::VMemo( QWidget *parent, const char *_name )
: QWidget( parent, _name )
{
setFixedHeight( 18 );
setFixedWidth( 14 );
recording = FALSE;
struct utsname name; /* check for embedix kernel running on the zaurus*/
if (uname(&name) != -1) {
QString release=name.release;
if(release.find("embedix",0,TRUE) !=-1)
systemZaurus=TRUE;
else {
systemZaurus=FALSE;
myChannel = new QCopChannel( "QPE/VMemo", this );
connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)),
this, SLOT(receive(const QCString&, const QByteArray&)) );
// // Register the REC key press, for ipaq only
QCopEnvelope e("QPE/Desktop", "keyRegister(int key, QString channel, QString message)");
e << 4096;
e << QString("QPE/VMemo");
e << QString("toggleRecord()");
}
}
}
VMemo::~VMemo()
{
}
void VMemo::receive( const QCString &msg, const QByteArray &data )
{
QDataStream stream( data, IO_ReadOnly );
if (msg == "toggleRecord()") {
if (recording)
mouseReleaseEvent(NULL);
else
mousePressEvent(NULL);
}
}
void VMemo::paintEvent( QPaintEvent* )
{
QPainter p(this);
p.drawPixmap( 0, 1,( const char** ) vmemo_xpm );
}
void VMemo::mousePressEvent( QMouseEvent *me )
{
// just to be safe
if (recording) {
recording = FALSE;
return;
}
/*
No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions
mousePressEvent and mouseReleaseEvent with a NULL parameter.
*/
-// if (!systemZaurus && me != NULL)
-// return;
+ if (!systemZaurus && me != NULL)
+ return;
// Config config( "Sound" );
// config.setGroup( "System" );
// useAlerts = config.readBoolEntry("Alert");
// if(useAlerts) {
// if( QMessageBox::warning(this,"VMemo","Really Record?","Yes","No",0,0,1) ==1)
// return;
// } else {
QSound::play(Resource::findSound("vmemob"));
// }
qDebug("Start recording");
recording = TRUE;
if (openDSP() == -1) {
QMessageBox::critical(0, "VMemo", "Could not open dsp device.", "Abort");
recording = FALSE;
return;
}
Config vmCfg("VMemo");
vmCfg.setGroup("Defaults");
QDateTime dt = QDateTime::currentDateTime();
QString fileName;
if(systemZaurus)
fileName=vmCfg.readEntry("Dir", "/mnt/cf/"); // zaurus does not have /mnt/ramfs
else
fileName=vmCfg.readEntry("Dir", "/mnt/ramfs/");
fileName += "vm_";
fileName += dt.toString();
fileName += ".wav";
// No spaces in the filename
fileName.replace(QRegExp("'"),"");
fileName.replace(QRegExp(" "),"_");
fileName.replace(QRegExp(":"),".");
fileName.replace(QRegExp(","),"");
if(openWAV(fileName.latin1()) == -1) {
QString err("Could not open the output file: ");
err += fileName;
QMessageBox::critical(0, "VMemo", err, "Abort");
close(dsp);
return;
}
QArray<int> cats(1);
cats[0] = vmCfg.readNumEntry("Category", 0);
QString dlName("vm_");
dlName += dt.toString();
DocLnk l;
l.setFile(fileName);
l.setName(dlName);
l.setType("audio/x-wav");
l.setCategories(cats);
l.writeLink();
record();
}