summaryrefslogtreecommitdiff
path: root/core/applets
authorllornkcor <llornkcor>2003-08-10 23:00:44 (UTC)
committer llornkcor <llornkcor>2003-08-10 23:00:44 (UTC)
commit41b3267ce7142a62ac3d3d6eef3feb33f00deda5 (patch) (unidiff)
tree2b9a5d64a867101ec09e4f662acfa6d71ef36aac /core/applets
parent0a95378893ef32a775182f9fa3a93381c05a9670 (diff)
downloadopie-41b3267ce7142a62ac3d3d6eef3feb33f00deda5.zip
opie-41b3267ce7142a62ac3d3d6eef3feb33f00deda5.tar.gz
opie-41b3267ce7142a62ac3d3d6eef3feb33f00deda5.tar.bz2
change filename used, and other things
Diffstat (limited to 'core/applets') (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 @@
15 */ 15 */
16// Sun 03-17-2002 L.J.Potter <ljp@llornkcor.com> 16// copyright 2002 and 2003 L.J.Potter <ljp@llornkcor.com>
17
17extern "C" { 18extern "C" {
@@ -20,8 +21,4 @@ extern "C" {
20 21
21#include <sys/utsname.h>
22#include <sys/time.h>
23#include <sys/types.h>
24#include <unistd.h> 22#include <unistd.h>
25#include <stdio.h> 23#include <stdio.h>
26#include <sys/stat.h>
27#include <fcntl.h> 24#include <fcntl.h>
@@ -30,6 +27,5 @@ extern "C" {
30 27
31#include <string.h>
32#include <stdlib.h>
33#include <errno.h> 28#include <errno.h>
34 29
30
35typedef struct _waveheader { 31typedef struct _waveheader {
@@ -210,6 +206,2 @@ VMemo::VMemo( QWidget *parent, const char *_name )
210 206
211 struct utsname name; /* check for embedix kernel running on the zaurus*/
212 if (uname(&name) != -1) {
213 QString release=name.release;
214
215 Config vmCfg("Vmemo"); 207 Config vmCfg("Vmemo");
@@ -219,6 +211,5 @@ VMemo::VMemo( QWidget *parent, const char *_name )
219 211
220 qDebug("toggleKey %d", toggleKey); 212 qDebug("toggleKey %d", toggleKey);
221 213 if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ))
222 if(release.find("embedix",0,TRUE) !=-1) 214 systemZaurus=TRUE;
223 systemZaurus=TRUE;
224 else 215 else
@@ -246,3 +237,3 @@ VMemo::VMemo( QWidget *parent, const char *_name )
246 recording = FALSE; 237 recording = FALSE;
247 } 238 // }
248} 239}
@@ -310,4 +301,8 @@ bool VMemo::startRecording() {
310 config.setGroup("Defaults"); 301 config.setGroup("Defaults");
311 302
312 QDateTime dt = QDateTime::currentDateTime(); 303 date = TimeString::dateString( QDateTime::currentDateTime(),false,true);
304 date.replace(QRegExp("'"),"");
305 date.replace(QRegExp(" "),"_");
306 date.replace(QRegExp(":"),".");
307 date.replace(QRegExp(","),"");
313 308
@@ -328,12 +323,5 @@ bool VMemo::startRecording() {
328 fileName+="/"; 323 fileName+="/";
329 fName = "vm_"+ dt.toString()+ ".wav"; 324 fName = "vm_"+ date+ ".wav";
330 325
331 fileName+=fName; 326 fileName+=fName;
332 // No spaces in the filename
333 fileName.replace(QRegExp("'"),"");
334 fileName.replace(QRegExp(" "),"_");
335 fileName.replace(QRegExp(":"),".");
336 fileName.replace(QRegExp(","),"");
337
338
339 qDebug("filename is "+fileName); 327 qDebug("filename is "+fileName);
@@ -346,3 +334,2 @@ bool VMemo::startRecording() {
346 334
347// if(openWAV(fileName.latin1()) == -1) {
348 QString err("Could not open the temp file\n"); 335 QString err("Could not open the temp file\n");
@@ -368,3 +355,3 @@ bool VMemo::startRecording() {
368 QString dlName("vm_"); 355 QString dlName("vm_");
369 dlName += dt.toString(); 356 dlName += date;
370 DocLnk l; 357 DocLnk l;
@@ -491,4 +478,4 @@ int VMemo::openWAV(const char *filename) {
491bool VMemo::record() { 478bool VMemo::record() {
492 479 length=0;
493 int length=0, result, value; 480 int result, value;
494 QString msg; 481 QString msg;
@@ -578,3 +565,24 @@ bool VMemo::record() {
578 565
579 qDebug("done recording "+fileName); 566 Config cfgO("OpieRec");
567 cfgO.setGroup("Sounds");
568
569 int nFiles = cfgO.readNumEntry( "NumberofFiles",0);
570
571 QString currentFileName = fileName;
572 QString currentFile = "vm_"+ date;
573
574 float numberOfRecordedSeconds=(float) length / (float)speed * (float)2;
575
576 cfgO.writeEntry( "NumberofFiles", nFiles + 1);
577 cfgO.writeEntry( QString::number( nFiles + 1), currentFile);
578 cfgO.writeEntry( currentFile, currentFileName);
579
580 QString time;
581 time.sprintf("%.2f", numberOfRecordedSeconds);
582 cfgO.writeEntry( currentFileName, time );
583 // qDebug("writing config numberOfRecordedSeconds "+time);
584
585 cfgO.write();
586
587 qDebug("done recording "+fileName);
580 588
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:
34 ~VMemo(); 34 ~VMemo();
35 QFile track; 35 QFile track;
36 QString fileName, errorMsg; 36 int length;
37 QString fileName, errorMsg, date;
37 QLabel* msgLabel; 38 QLabel* msgLabel;