summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp70
-rw-r--r--core/applets/vmemo/vmemo.h5
2 files changed, 42 insertions, 33 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index 7af3d8b..6ec4583 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -15,3 +15,4 @@
*/
-// Sun 03-17-2002 L.J.Potter <ljp@llornkcor.com>
+// copyright 2002 and 2003 L.J.Potter <ljp@llornkcor.com>
+
extern "C" {
@@ -20,8 +21,4 @@ extern "C" {
-#include <sys/utsname.h>
-#include <sys/time.h>
-#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
-#include <sys/stat.h>
#include <fcntl.h>
@@ -30,6 +27,5 @@ extern "C" {
-#include <string.h>
-#include <stdlib.h>
#include <errno.h>
+
typedef struct _waveheader {
@@ -210,6 +206,2 @@ VMemo::VMemo( QWidget *parent, const char *_name )
- struct utsname name; /* check for embedix kernel running on the zaurus*/
- if (uname(&name) != -1) {
- QString release=name.release;
-
Config vmCfg("Vmemo");
@@ -219,6 +211,5 @@ VMemo::VMemo( QWidget *parent, const char *_name )
- qDebug("toggleKey %d", toggleKey);
-
- if(release.find("embedix",0,TRUE) !=-1)
- systemZaurus=TRUE;
+ qDebug("toggleKey %d", toggleKey);
+ if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ))
+ systemZaurus=TRUE;
else
@@ -246,3 +237,3 @@ VMemo::VMemo( QWidget *parent, const char *_name )
recording = FALSE;
- }
+ // }
}
@@ -310,4 +301,8 @@ bool VMemo::startRecording() {
config.setGroup("Defaults");
-
- QDateTime dt = QDateTime::currentDateTime();
+
+ date = TimeString::dateString( QDateTime::currentDateTime(),false,true);
+ date.replace(QRegExp("'"),"");
+ date.replace(QRegExp(" "),"_");
+ date.replace(QRegExp(":"),".");
+ date.replace(QRegExp(","),"");
@@ -328,12 +323,5 @@ bool VMemo::startRecording() {
fileName+="/";
- fName = "vm_"+ dt.toString()+ ".wav";
+ fName = "vm_"+ date+ ".wav";
fileName+=fName;
- // No spaces in the filename
- fileName.replace(QRegExp("'"),"");
- fileName.replace(QRegExp(" "),"_");
- fileName.replace(QRegExp(":"),".");
- fileName.replace(QRegExp(","),"");
-
-
qDebug("filename is "+fileName);
@@ -346,3 +334,2 @@ bool VMemo::startRecording() {
-// if(openWAV(fileName.latin1()) == -1) {
QString err("Could not open the temp file\n");
@@ -368,3 +355,3 @@ bool VMemo::startRecording() {
QString dlName("vm_");
- dlName += dt.toString();
+ dlName += date;
DocLnk l;
@@ -491,4 +478,4 @@ int VMemo::openWAV(const char *filename) {
bool VMemo::record() {
-
- int length=0, result, value;
+ length=0;
+ int result, value;
QString msg;
@@ -578,3 +565,24 @@ bool VMemo::record() {
- qDebug("done recording "+fileName);
+ Config cfgO("OpieRec");
+ cfgO.setGroup("Sounds");
+
+ int nFiles = cfgO.readNumEntry( "NumberofFiles",0);
+
+ QString currentFileName = fileName;
+ QString currentFile = "vm_"+ date;
+
+ float numberOfRecordedSeconds=(float) length / (float)speed * (float)2;
+
+ cfgO.writeEntry( "NumberofFiles", nFiles + 1);
+ cfgO.writeEntry( QString::number( nFiles + 1), currentFile);
+ cfgO.writeEntry( currentFile, currentFileName);
+
+ QString time;
+ time.sprintf("%.2f", numberOfRecordedSeconds);
+ cfgO.writeEntry( currentFileName, time );
+ // qDebug("writing config numberOfRecordedSeconds "+time);
+
+ cfgO.write();
+
+ qDebug("done recording "+fileName);
diff --git a/core/applets/vmemo/vmemo.h b/core/applets/vmemo/vmemo.h
index 9ee08ff..31d0a25 100644
--- a/core/applets/vmemo/vmemo.h
+++ b/core/applets/vmemo/vmemo.h
@@ -34,4 +34,5 @@ public:
~VMemo();
- QFile track;
- QString fileName, errorMsg;
+ QFile track;
+ int length;
+ QString fileName, errorMsg, date;
QLabel* msgLabel;