summaryrefslogtreecommitdiff
path: root/core/applets
authorllornkcor <llornkcor>2002-03-18 01:56:12 (UTC)
committer llornkcor <llornkcor>2002-03-18 01:56:12 (UTC)
commit2ed59c2eb1694b3dda2ab709f54a4ad25a24c6cc (patch) (unidiff)
treef14f5f50b091add26e880e6268bde46e836864af /core/applets
parentc09cb25eb6bbf31bed0d4a415802469cfd1efedf (diff)
downloadopie-2ed59c2eb1694b3dda2ab709f54a4ad25a24c6cc.zip
opie-2ed59c2eb1694b3dda2ab709f54a4ad25a24c6cc.tar.gz
opie-2ed59c2eb1694b3dda2ab709f54a4ad25a24c6cc.tar.bz2
added Portuguese translations from 'covarde_anonimo' on #opie
Diffstat (limited to 'core/applets') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/batteryapplet/batteryapplet.pro1
-rw-r--r--core/applets/clipboardapplet/clipboardapplet.pro2
-rw-r--r--core/applets/clockapplet/clockapplet.pro1
-rw-r--r--core/applets/screenshotapplet/screenshotapplet.pro1
-rw-r--r--core/applets/vmemo/vmemo.cpp262
-rw-r--r--core/applets/vmemo/vmemo.pro1
-rw-r--r--core/applets/volumeapplet/volumeapplet.pro1
7 files changed, 164 insertions, 105 deletions
diff --git a/core/applets/batteryapplet/batteryapplet.pro b/core/applets/batteryapplet/batteryapplet.pro
index dcb606d..d139e58 100644
--- a/core/applets/batteryapplet/batteryapplet.pro
+++ b/core/applets/batteryapplet/batteryapplet.pro
@@ -10,3 +10,4 @@ LIBS += -lqpe
10 VERSION = 1.0.0 10 VERSION = 1.0.0
11 11
12TRANSLATIONS += ../../i18n/de/libbatteryapplet.ts 12TRANSLATIONS += ../../i18n/de/libbatteryapplet.ts
13TRANSLATIONS = ../../i18n/pt_BR/libbatteryapplet.ts
diff --git a/core/applets/clipboardapplet/clipboardapplet.pro b/core/applets/clipboardapplet/clipboardapplet.pro
index 9832984..f71c787 100644
--- a/core/applets/clipboardapplet/clipboardapplet.pro
+++ b/core/applets/clipboardapplet/clipboardapplet.pro
@@ -8,3 +8,5 @@ INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += ../$(OPIEDIR)/include 8DEPENDPATH += ../$(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe
10 VERSION = 1.0.0 10 VERSION = 1.0.0
11
12TRANSLATIONS = ../../i18n/pt_BR/libclipboardapplet.ts
diff --git a/core/applets/clockapplet/clockapplet.pro b/core/applets/clockapplet/clockapplet.pro
index 1392680..0397340 100644
--- a/core/applets/clockapplet/clockapplet.pro
+++ b/core/applets/clockapplet/clockapplet.pro
@@ -10,3 +10,4 @@ LIBS += -lqpe
10 VERSION = 1.0.0 10 VERSION = 1.0.0
11 11
12TRANSLATIONS += ../../i18n/de/libclockapplet.ts 12TRANSLATIONS += ../../i18n/de/libclockapplet.ts
13TRANSLATIONS = ../../i18n/pt_BR/libclockapplet.ts
diff --git a/core/applets/screenshotapplet/screenshotapplet.pro b/core/applets/screenshotapplet/screenshotapplet.pro
index 095cce2..d03bacc 100644
--- a/core/applets/screenshotapplet/screenshotapplet.pro
+++ b/core/applets/screenshotapplet/screenshotapplet.pro
@@ -11,3 +11,4 @@ VERSION = 1.0.0
11MOC_DIR=opieobj 11MOC_DIR=opieobj
12OBJECTS_DIR=opieobj 12OBJECTS_DIR=opieobj
13 13
14TRANSLATIONS = ../../i18n/pt_BR/libscreenshotapplet.ts
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index 48dd193..9d69130 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -13,7 +13,7 @@
13/* 13/*
14 * $Id$ 14 * $Id$
15 */ 15 */
16 16// Sun 03-17-2002 L.J.Potter <ljp@llornkcor.com>
17#include <sys/utsname.h> 17#include <sys/utsname.h>
18#include <sys/time.h> 18#include <sys/time.h>
19#include <sys/types.h> 19#include <sys/types.h>
@@ -141,29 +141,24 @@ VMemo::VMemo( QWidget *parent, const char *name )
141 141
142 recording = FALSE; 142 recording = FALSE;
143 143
144 myChannel = new QCopChannel( "QPE/VMemo", this ); 144 struct utsname name; /* check for embedix kernel running on the zaurus*/
145 connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)), 145 if (uname(&name) != -1) {
146 this, SLOT(receive(const QCString&, const QByteArray&)) ); 146 QString release=name.release;
147 147 if(release.find("embedix",0,TRUE) !=-1)
148 struct utsname name; /* check for embedix kernel running on the zaurus, if 148 systemZaurus=TRUE;
149 lineo change string, this break 149 else {
150 */ 150 systemZaurus=FALSE;
151 if (uname(&name) != -1) 151// myChannel = new QCopChannel( "QPE/VMemo", this );
152 { 152// connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)),
153 QString release=name.release; 153// this, SLOT(receive(const QCString&, const QByteArray&)) );
154 if(release.find("embedix",0,TRUE) !=-1) 154
155 systemZaurus=TRUE; 155// // Register the REC key press, for ipaq only
156 else 156// QCopEnvelope e("QPE/Desktop", "keyRegister(int key, QString channel, QString message)");
157 { 157// e << 4096;
158 systemZaurus=FALSE; 158// e << QString("QPE/VMemo");
159 159// e << QString("toggleRecord()");
160 // Register the REC key press. 160 }
161 QCopEnvelope e("QPE/Desktop", "keyRegister(int key, QString channel, QString message)"); 161 }
162 e << 4096;
163 e << QString("QPE/VMemo");
164 e << QString("toggleRecord()");
165 }
166 }
167} 162}
168 163
169VMemo::~VMemo() 164VMemo::~VMemo()
@@ -174,12 +169,12 @@ void VMemo::receive( const QCString &msg, const QByteArray &data )
174{ 169{
175 QDataStream stream( data, IO_ReadOnly ); 170 QDataStream stream( data, IO_ReadOnly );
176 if (msg == "toggleRecord()") 171 if (msg == "toggleRecord()")
177 { 172 {
178 if (recording) 173 if (recording)
179 mouseReleaseEvent(NULL); 174 mouseReleaseEvent(NULL);
180 else 175 else
181 mousePressEvent(NULL); 176 mousePressEvent(NULL);
182 } 177 }
183} 178}
184 179
185void VMemo::paintEvent( QPaintEvent* ) 180void VMemo::paintEvent( QPaintEvent* )
@@ -192,27 +187,27 @@ void VMemo::mousePressEvent( QMouseEvent *me )
192{ 187{
193 // just to be safe 188 // just to be safe
194 if (recording) 189 if (recording)
195 { 190 {
196 recording = FALSE; 191 recording = FALSE;
197 return; 192 return;
198 } 193 }
199 194
200 /* 195 /*
201 No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions 196 No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions
202 mousePressEvent and mouseReleaseEvent with a NULL parameter. 197 mousePressEvent and mouseReleaseEvent with a NULL parameter.
203 */ 198 */
204 if (!systemZaurus && me != NULL) 199// if (!systemZaurus && me != NULL)
205 return; 200// return;
206 201
207 QSound::play(Resource::findSound("vmemob")); 202 QSound::play(Resource::findSound("vmemob"));
208 203 qDebug("Start recording");
209 recording = TRUE; 204 recording = TRUE;
210 if (openDSP() == -1) 205 if (openDSP() == -1)
211 { 206 {
212 QMessageBox::critical(0, "VMemo", "Could not open dsp device.", "Abort"); 207 QMessageBox::critical(0, "VMemo", "Could not open dsp device.", "Abort");
213 recording = FALSE; 208 recording = FALSE;
214 return; 209 return;
215 } 210 }
216 211
217 Config vmCfg("VMemo"); 212 Config vmCfg("VMemo");
218 vmCfg.setGroup("Defaults"); 213 vmCfg.setGroup("Defaults");
@@ -221,9 +216,9 @@ void VMemo::mousePressEvent( QMouseEvent *me )
221 QString fileName; 216 QString fileName;
222 217
223 if(systemZaurus) 218 if(systemZaurus)
224 fileName=vmCfg.readEntry("Dir", "/mnt/cf/"); // zaurus does not have /mnt/ramfs 219 fileName=vmCfg.readEntry("Dir", "/mnt/cf/"); // zaurus does not have /mnt/ramfs
225 else 220 else
226 fileName=vmCfg.readEntry("Dir", "/mnt/ramfs/"); 221 fileName=vmCfg.readEntry("Dir", "/mnt/ramfs/");
227 222
228 fileName += "vm_"; 223 fileName += "vm_";
229 fileName += dt.toString(); 224 fileName += dt.toString();
@@ -236,14 +231,14 @@ void VMemo::mousePressEvent( QMouseEvent *me )
236 fileName.replace(QRegExp(","),""); 231 fileName.replace(QRegExp(","),"");
237 232
238 if(openWAV(fileName.latin1()) == -1) 233 if(openWAV(fileName.latin1()) == -1)
239 { 234 {
240 QString err("Could not open the output file: "); 235 QString err("Could not open the output file: ");
241 err += fileName; 236 err += fileName;
242 237
243 QMessageBox::critical(0, "VMemo", err, "Abort"); 238 QMessageBox::critical(0, "VMemo", err, "Abort");
244 close(dsp); 239 close(dsp);
245 return; 240 return;
246 } 241 }
247 242
248 QArray<int> cats(1); 243 QArray<int> cats(1);
249 cats[0] = vmCfg.readNumEntry("Category", 0); 244 cats[0] = vmCfg.readNumEntry("Category", 0);
@@ -272,51 +267,43 @@ int VMemo::openDSP()
272 267
273 speed = cfg.readNumEntry("SampleRate", 22050); 268 speed = cfg.readNumEntry("SampleRate", 22050);
274 channels = cfg.readNumEntry("Stereo", 1) ? 2 : 1; // 1 = stereo(2), 0 = mono(1) 269 channels = cfg.readNumEntry("Stereo", 1) ? 2 : 1; // 1 = stereo(2), 0 = mono(1)
275 if (cfg.readNumEntry("SixteenBit", 1)==1) 270 if (cfg.readNumEntry("SixteenBit", 1)==1) {
276 { 271 format = AFMT_S16_LE;
277 format = AFMT_S16_LE; 272 resolution = 16;
278 resolution = 16; 273 }
279 } 274// else {
280 else 275// format = AFMT_U8;
281 { 276// resolution = 8;
282 format = AFMT_U8; 277// }
283 resolution = 8;
284 }
285 278
286 if(systemZaurus) 279 if(systemZaurus) {
287 { 280 dsp = open("/dev/dsp1", O_RDWR); //Zaurus needs /dev/dsp1
288 dsp = open("/dev/dsp1", O_RDWR); //Zaurus needs /dev/dsp1 281 channels=1; //zaurus has one input channel
289 channels=1; //zaurus has one input channel 282 } else {
290 } 283 dsp = open("/dev/dsp", O_RDWR);
291 else 284 }
292 dsp = open("/dev/dsp", O_RDWR);
293 285
294 if(dsp == -1) 286 if(dsp == -1) {
295 {
296 perror("open(\"/dev/dsp\")"); 287 perror("open(\"/dev/dsp\")");
297 return -1; 288 return -1;
298 } 289 }
299 290
300 if(ioctl(dsp, SNDCTL_DSP_SETFMT , &format)==-1) 291 if(ioctl(dsp, SNDCTL_DSP_SETFMT , &format)==-1) {
301 { 292 perror("ioctl(\"SNDCTL_DSP_SETFMT\")");
302 perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); 293 return -1;
303 return -1; 294 }
304 } 295 if(ioctl(dsp, SNDCTL_DSP_CHANNELS , &channels)==-1) {
305 if(ioctl(dsp, SNDCTL_DSP_CHANNELS , &channels)==-1) 296 perror("ioctl(\"SNDCTL_DSP_CHANNELS\")");
306 { 297 return -1;
307 perror("ioctl(\"SNDCTL_DSP_CHANNELS\")"); 298 }
308 return -1; 299 if(ioctl(dsp, SNDCTL_DSP_SPEED , &speed)==-1) {
309 } 300 perror("ioctl(\"SNDCTL_DSP_SPEED\")");
310 if(ioctl(dsp, SNDCTL_DSP_SPEED , &speed)==-1) 301 return -1;
311 { 302 }
312 perror("ioctl(\"SNDCTL_DSP_SPEED\")"); 303 if(ioctl(dsp, SOUND_PCM_READ_RATE , &rate)==-1) {
313 return -1; 304 perror("ioctl(\"SOUND_PCM_READ_RATE\")");
314 } 305 return -1;
315 if(ioctl(dsp, SOUND_PCM_READ_RATE , &rate)==-1) 306 }
316 {
317 perror("ioctl(\"SOUND_PCM_READ_RATE\")");
318 return -1;
319 }
320 307
321 return 1; 308 return 1;
322} 309}
@@ -324,8 +311,8 @@ int VMemo::openDSP()
324int VMemo::openWAV(const char *filename) 311int VMemo::openWAV(const char *filename)
325{ 312{
326 track.setName(filename); 313 track.setName(filename);
327 if(!track.open(IO_WriteOnly|IO_Truncate|IO_Raw)) 314 if(!track.open(IO_WriteOnly|IO_Truncate|IO_Raw))
328 return -1; 315 return -1;
329 316
330 wav=track.handle(); 317 wav=track.handle();
331 318
@@ -354,18 +341,81 @@ int VMemo::openWAV(const char *filename)
354void VMemo::record(void) 341void VMemo::record(void)
355{ 342{
356 int length=0, result, value; 343 int length=0, result, value;
357 char sound[512]; 344 qDebug("Recording");
345
346 if(format==AFMT_S16_LE) {
347 signed short sound[512], monoBuffer[512];
348 while(recording) {
349 result = read(dsp, sound, 512); // 8192
350 qApp->processEvents();
351 int j=0;
352 if(systemZaurus) {
353 for (int i = 0; i < result; i++) { //since Z is mono do normally
354 monoBuffer[i] = sound[i];
355 }
356 qApp->processEvents();
357 length+=write(wav, monoBuffer, result);
358 } else { //ipaq /stereo inputs
359 for (int i = 0; i < result; i+=2) {
360 monoBuffer[j] = (sound[i]+sound[i+1])/2;
361 j++;
362 }
363 qApp->processEvents();
364 length+=write(wav, monoBuffer, result/2);
365 }
366 printf("%d\r",length);
367 fflush(stdout);
368 }
369 }
370 // else { //AFMT_U8 // don't try this yet.. as player doesn't understand
371// 8bit unsigned
372 // unsigned short sound[512], monoBuffer[512];
373// while(recording)
374// {
375// result = read(dsp, sound, 512); // 8192
376// qApp->processEvents();
377// int j=0;
378// if(systemZaurus)
379// {
380// for (int i = 0; i < result; i++) { //since Z is mono do normally
381// monoBuffer[i] = sound[i];
382// }
383// qApp->processEvents();
384// length+=write(wav, monoBuffer, result);
385// } else { //ipaq /stereo inputs
386// for (int i = 0; i < result; i+=2) {
387// monoBuffer[j] = (sound[i]+sound[i+1])/2;
388// j++;
389// }
390// qApp->processEvents();
391// length+=write(wav, monoBuffer, result/2);
392// }
393// // length += result;
394// printf("%d\r",length);
395// fflush(stdout);
396
397// qApp->processEvents();
398// }
399// }
400
401
358 402
359 while(recording) 403// char sound[512]; //char is 8 bit
360 { 404
361 result = read(dsp, sound, 512); // 8192 405// while(recording)
362 qApp->processEvents(); 406// {
407// result = read(dsp, sound, 512); // 8192
408// qApp->processEvents();
363 409
364 write(wav, sound, result); 410// write(wav, sound, result);
365 length += result; 411// length += result;
366 412
367 qApp->processEvents(); 413// qApp->processEvents();
368 } 414// }
415// qDebug("file has length of %d lasting %d seconds",
416// length, (( length / speed) / channels) / 2 );
417// medialplayer states wrong length in secs
418
369 419
370 value = length+36; 420 value = length+36;
371 lseek(wav, 4, SEEK_SET); 421 lseek(wav, 4, SEEK_SET);
@@ -375,8 +425,10 @@ void VMemo::record(void)
375 track.close(); 425 track.close();
376 426
377 if( ioctl( dsp, SNDCTL_DSP_RESET,0) == -1) 427 if( ioctl( dsp, SNDCTL_DSP_RESET,0) == -1)
378 perror("ioctl(\"SNDCTL_DSP_RESET\")"); 428 perror("ioctl(\"SNDCTL_DSP_RESET\")");
379 ::close(dsp); 429 ::close(dsp);
430// if(systemZaurus)
431 QMessageBox::message("Vmemo"," Done recording");
380 432
381 QSound::play(Resource::findSound("vmemoe")); 433 QSound::play(Resource::findSound("vmemoe"));
382} 434}
diff --git a/core/applets/vmemo/vmemo.pro b/core/applets/vmemo/vmemo.pro
index bf9af4b..29f99fb 100644
--- a/core/applets/vmemo/vmemo.pro
+++ b/core/applets/vmemo/vmemo.pro
@@ -9,3 +9,4 @@ DEPENDPATH += ../$(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe
10 VERSION = 1.0.0 10 VERSION = 1.0.0
11 11
12TRANSLATIONS = ../../i18n/pt_BR/libvmemoapplet.ts
diff --git a/core/applets/volumeapplet/volumeapplet.pro b/core/applets/volumeapplet/volumeapplet.pro
index fedaed7..c5b764b 100644
--- a/core/applets/volumeapplet/volumeapplet.pro
+++ b/core/applets/volumeapplet/volumeapplet.pro
@@ -10,3 +10,4 @@ LIBS += -lqpe
10 VERSION = 1.0.0 10 VERSION = 1.0.0
11 11
12TRANSLATIONS += ../../i18n/de/libvolumeapplet.ts 12TRANSLATIONS += ../../i18n/de/libvolumeapplet.ts
13TRANSLATIONS = ../../i18n/pt_BR/libvolumeapplet.ts