-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 32 | ||||
-rw-r--r-- | core/applets/vmemo/vmemo.h | 2 |
2 files changed, 21 insertions, 13 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 6f04c66..6bd1622 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -14,6 +14,7 @@ | |||
14 | * $Id$ | 14 | * $Id$ |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <sys/utsname.h> | ||
17 | #include <sys/time.h> | 18 | #include <sys/time.h> |
18 | #include <sys/types.h> | 19 | #include <sys/types.h> |
19 | #include <unistd.h> | 20 | #include <unistd.h> |
@@ -136,6 +137,17 @@ VMemo::VMemo( QWidget *parent, const char *name ) | |||
136 | setFixedWidth( 14 ); | 137 | setFixedWidth( 14 ); |
137 | 138 | ||
138 | recording = FALSE; | 139 | recording = FALSE; |
140 | |||
141 | struct utsname name; //check for embedix kernel running on the zaurus, if lineo change string, this break | ||
142 | if (uname(&name) != -1) { | ||
143 | QString release=name.release; | ||
144 | if(release.find("embedix",0,TRUE) !=-1) { | ||
145 | systemZaurus=TRUE; | ||
146 | printf("System release: %s\n", name.release); | ||
147 | } else | ||
148 | systemZaurus=FALSE; | ||
149 | } | ||
150 | |||
139 | } | 151 | } |
140 | 152 | ||
141 | VMemo::~VMemo() | 153 | VMemo::~VMemo() |
@@ -167,12 +179,11 @@ void VMemo::mousePressEvent( QMouseEvent * ) | |||
167 | vmCfg.setGroup("Defaults"); | 179 | vmCfg.setGroup("Defaults"); |
168 | 180 | ||
169 | QDateTime dt = QDateTime::currentDateTime(); | 181 | QDateTime dt = QDateTime::currentDateTime(); |
170 | 182 | QString fileName; | |
171 | #if defined(QT_QWS_EBX) //if zaurus | 183 | if(systemZaurus) |
172 | QString fileName(vmCfg.readEntry("Dir", "/mnt/cf/")); // zaurus does not have /mnt/ramfs | 184 | fileName=vmCfg.readEntry("Dir", "/mnt/cf/"); // zaurus does not have /mnt/ramfs |
173 | #else | 185 | else |
174 | QString fileName(vmCfg.readEntry("Dir", "/mnt/ramfs/")); | 186 | fileName=vmCfg.readEntry("Dir", "/mnt/ramfs/"); |
175 | #endif | ||
176 | 187 | ||
177 | fileName += "vm_"; | 188 | fileName += "vm_"; |
178 | fileName += dt.toString(); | 189 | fileName += dt.toString(); |
@@ -232,13 +243,10 @@ int VMemo::openDSP() | |||
232 | resolution = 8; | 243 | resolution = 8; |
233 | } | 244 | } |
234 | 245 | ||
235 | #if defined(QT_QWS_EBX) //if zaurus | 246 | if(systemZaurus) |
236 | //dsp = open("/dev/dsp1", O_RDONLY); //on the Zaurus this needs to be /dev/dsp1 !!!! | 247 | dsp = open("/dev/dsp1", O_RDWR); //Zaurus needs /dev/dsp1 |
237 | dsp = open("/dev/dsp1", O_RDWR); //on the Zaurus this needs to be /dev/dsp1 !!!! | 248 | else |
238 | #else | ||
239 | //dsp = open("/dev/dsp", O_RDONLY); | ||
240 | dsp = open("/dev/dsp", O_RDWR); | 249 | dsp = open("/dev/dsp", O_RDWR); |
241 | #endif | ||
242 | 250 | ||
243 | qWarning("speed = %i", speed); | 251 | qWarning("speed = %i", speed); |
244 | 252 | ||
diff --git a/core/applets/vmemo/vmemo.h b/core/applets/vmemo/vmemo.h index 9ce08f2..ee375b0 100644 --- a/core/applets/vmemo/vmemo.h +++ b/core/applets/vmemo/vmemo.h | |||
@@ -41,7 +41,7 @@ private: | |||
41 | int openWAV(const char *filename); | 41 | int openWAV(const char *filename); |
42 | 42 | ||
43 | QPixmap vmemoPixmap; | 43 | QPixmap vmemoPixmap; |
44 | 44 | bool systemZaurus; | |
45 | int dsp, wav, rate, speed, channels, format, resolution; | 45 | int dsp, wav, rate, speed, channels, format, resolution; |
46 | bool recording; | 46 | bool recording; |
47 | }; | 47 | }; |