summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-02-15 02:36:29 (UTC)
committer llornkcor <llornkcor>2002-02-15 02:36:29 (UTC)
commite5ac946b3ced52f4aba73dfc64398bb3d8245734 (patch) (unidiff)
tree32f88c29a365816eb0b888244e299bd24a164d5d
parent77ea163d796ac330ad688210e049ab3763d9dd11 (diff)
downloadopie-e5ac946b3ced52f4aba73dfc64398bb3d8245734.zip
opie-e5ac946b3ced52f4aba73dfc64398bb3d8245734.tar.gz
opie-e5ac946b3ced52f4aba73dfc64398bb3d8245734.tar.bz2
changed default format
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index 83f19f5..25ee476 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -213,65 +213,65 @@ void VMemo::mousePressEvent( QMouseEvent * )
213 // ### Display an error box 213 // ### Display an error box
214 qWarning("VMemo::mousePress() -> WAV error"); 214 qWarning("VMemo::mousePress() -> WAV error");
215 close(dsp); 215 close(dsp);
216 return; 216 return;
217 } 217 }
218 218
219 QArray<int> cats(1); 219 QArray<int> cats(1);
220 cats[0] = vmCfg.readNumEntry("Category", 0); 220 cats[0] = vmCfg.readNumEntry("Category", 0);
221 221
222 QString dlName("vm_"); 222 QString dlName("vm_");
223 dlName += dt.toString(); 223 dlName += dt.toString();
224 DocLnk l; 224 DocLnk l;
225 l.setFile(fileName); 225 l.setFile(fileName);
226 l.setName(dlName); 226 l.setName(dlName);
227 l.setType("audio/x-wav"); 227 l.setType("audio/x-wav");
228 l.setCategories(cats); 228 l.setCategories(cats);
229 l.writeLink(); 229 l.writeLink();
230 230
231 record(); 231 record();
232} 232}
233 233
234void VMemo::mouseReleaseEvent( QMouseEvent * ) 234void VMemo::mouseReleaseEvent( QMouseEvent * )
235{ 235{
236 qWarning("VMemo::mouseRelese() -> Done recording"); 236 qWarning("VMemo::mouseRelese() -> Done recording");
237 recording = FALSE; 237 recording = FALSE;
238} 238}
239 239
240int VMemo::openDSP() 240int VMemo::openDSP()
241{ 241{
242 Config cfg("Sound"); 242 Config cfg("Sound");
243 cfg.setGroup("Record"); 243 cfg.setGroup("Record");
244 244
245 speed = cfg.readNumEntry("SampleRate", 11025); 245 speed = cfg.readNumEntry("SampleRate", 22050);
246 channels = cfg.readNumEntry("Stereo", 1) ? 2 : 1; // 1 = stereo(2), 0 = mono(1) 246 channels = cfg.readNumEntry("Stereo", 1) ? 2 : 1; // 1 = stereo(2), 0 = mono(1)
247 if (cfg.readNumEntry("SixteenBit", 1)==1) 247 if (cfg.readNumEntry("SixteenBit", 1)==1)
248 { 248 {
249 format = AFMT_S16_LE; 249 format = AFMT_S16_LE;
250 resolution = 16; 250 resolution = 16;
251 } 251 }
252 else 252 else
253 { 253 {
254 format = AFMT_U8; 254 format = AFMT_U8;
255 resolution = 8; 255 resolution = 8;
256 } 256 }
257 257
258 if(systemZaurus) 258 if(systemZaurus)
259 { 259 {
260 dsp = open("/dev/dsp1", O_RDWR); //Zaurus needs /dev/dsp1 260 dsp = open("/dev/dsp1", O_RDWR); //Zaurus needs /dev/dsp1
261 channels=1; //zaurus has one input channel 261 channels=1; //zaurus has one input channel
262 } 262 }
263 else 263 else
264 dsp = open("/dev/dsp", O_RDWR); 264 dsp = open("/dev/dsp", O_RDWR);
265 265
266 if(dsp == -1) 266 if(dsp == -1)
267 { 267 {
268 perror("open(\"/dev/dsp\")"); 268 perror("open(\"/dev/dsp\")");
269 return -1; 269 return -1;
270 } 270 }
271 271
272 if(ioctl(dsp, SNDCTL_DSP_SETFMT , &format)==-1) 272 if(ioctl(dsp, SNDCTL_DSP_SETFMT , &format)==-1)
273 { 273 {
274 perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); 274 perror("ioctl(\"SNDCTL_DSP_SETFMT\")");
275 return -1; 275 return -1;
276 } 276 }
277 if(ioctl(dsp, SNDCTL_DSP_CHANNELS , &channels)==-1) 277 if(ioctl(dsp, SNDCTL_DSP_CHANNELS , &channels)==-1)