summaryrefslogtreecommitdiff
path: root/libopie
authorllornkcor <llornkcor>2002-07-01 01:43:24 (UTC)
committer llornkcor <llornkcor>2002-07-01 01:43:24 (UTC)
commit9c51797971bf5ec9dc6c4d7704b44672aa00741c (patch) (unidiff)
treed99933fc446110857580136159c632e4b7ce5e5a /libopie
parentc96791c0cb6fe7ddf87ea092ca498caea3ba3bd7 (diff)
downloadopie-9c51797971bf5ec9dc6c4d7704b44672aa00741c.zip
opie-9c51797971bf5ec9dc6c4d7704b44672aa00741c.tar.gz
opie-9c51797971bf5ec9dc6c4d7704b44672aa00741c.tar.bz2
had to add some ifndef QT_QWS_EBX around Sound things for some odd reason. added sharp_buz empty defines for future usage
Diffstat (limited to 'libopie') (more/less context) (show whitespace changes)
-rw-r--r--libopie/odevice.cpp45
1 files changed, 42 insertions, 3 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 61c24f4..dea24a8 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -133,49 +133,58 @@ OModel ODevice::model ( )
133QString ODevice::systemString ( ) 133QString ODevice::systemString ( )
134{ 134{
135 return d-> m_systemstr; 135 return d-> m_systemstr;
136} 136}
137 137
138OSystem ODevice::system ( ) 138OSystem ODevice::system ( )
139{ 139{
140 return d-> m_system; 140 return d-> m_system;
141} 141}
142 142
143void ODevice::alarmSound ( ) 143void ODevice::alarmSound ( )
144{ 144{
145#ifndef QT_QWS_EBX
145#ifndef QT_NO_SOUND 146#ifndef QT_NO_SOUND
146 static Sound snd ( "alarm" ); 147 static Sound snd ( "alarm" );
147 148
148 if ( snd. isFinished ( )) 149 if ( snd. isFinished ( ))
149 snd. play ( ); 150 snd. play ( );
150#endif 151#endif
152#endif
151} 153}
152 154
153void ODevice::keySound ( ) 155void ODevice::keySound ( )
154{ 156{
157#ifndef QT_QWS_EBX
155#ifndef QT_NO_SOUND 158#ifndef QT_NO_SOUND
156 static Sound snd ( "keysound" ); 159 static Sound snd ( "keysound" );
157 160
158 if ( snd. isFinished ( )) 161 if ( snd. isFinished ( ))
159 snd. play ( ); 162 snd. play ( );
160#endif 163#endif
164#endif
161} 165}
162 166
163void ODevice::touchSound ( ) 167void ODevice::touchSound ( )
164{ 168{
169
170#ifndef QT_QWS_EBX
165#ifndef QT_NO_SOUND 171#ifndef QT_NO_SOUND
166 static Sound snd ( "touchsound" ); 172 static Sound snd ( "touchsound" );
167 173qDebug("touchSound");
168 if ( snd. isFinished ( )) 174 if ( snd. isFinished ( )) {
169 snd. play ( ); 175 snd. play ( );
176 qDebug("sound should play");
177 }
178#endif
170#endif 179#endif
171} 180}
172 181
173uint ODevice::hasLeds ( ) const 182uint ODevice::hasLeds ( ) const
174{ 183{
175 return 0; 184 return 0;
176} 185}
177 186
178OLedState ODevice::led ( uint /*which*/ ) const 187OLedState ODevice::led ( uint /*which*/ ) const
179{ 188{
180 return OLED_Off; 189 return OLED_Off;
181} 190}
@@ -240,24 +249,25 @@ typedef struct h3600_ts_led {
240 unsigned char OnTime; /* units of 100m/s */ 249 unsigned char OnTime; /* units of 100m/s */
241 unsigned char OffTime; /* units of 100m/s */ 250 unsigned char OffTime; /* units of 100m/s */
242} LED_IN; 251} LED_IN;
243 252
244 253
245// #define IOC_H3600_TS_MAGIC 'f' 254// #define IOC_H3600_TS_MAGIC 'f'
246// #define LED_ON _IOW(IOC_H3600_TS_MAGIC, 5, struct h3600_ts_led) 255// #define LED_ON _IOW(IOC_H3600_TS_MAGIC, 5, struct h3600_ts_led)
247#define LED_ON (( 1<<30 ) | ( 'f'<<8 ) | ( 5 ) | ( sizeof(struct h3600_ts_led)<<16 )) // _IOW only defined in kernel headers :( 256#define LED_ON (( 1<<30 ) | ( 'f'<<8 ) | ( 5 ) | ( sizeof(struct h3600_ts_led)<<16 )) // _IOW only defined in kernel headers :(
248 257
249 258
250void ODeviceIPAQ::alarmSound ( ) 259void ODeviceIPAQ::alarmSound ( )
251{ 260{
261#if defined( QT_QWS_IPAQ ) // IPAQ
252#ifndef QT_NO_SOUND 262#ifndef QT_NO_SOUND
253 static Sound snd ( "alarm" ); 263 static Sound snd ( "alarm" );
254 int fd; 264 int fd;
255 int vol; 265 int vol;
256 bool vol_reset = false; 266 bool vol_reset = false;
257 267
258 if ((( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) || 268 if ((( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) ||
259 (( fd = ::open ( "/dev/mixer", O_RDWR )) >= 0 )) { 269 (( fd = ::open ( "/dev/mixer", O_RDWR )) >= 0 )) {
260 270
261 if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) { 271 if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) {
262 Config cfg ( "qpe" ); 272 Config cfg ( "qpe" );
263 cfg. setGroup ( "Volume" ); 273 cfg. setGroup ( "Volume" );
@@ -277,24 +287,25 @@ void ODeviceIPAQ::alarmSound ( )
277 } 287 }
278 288
279 snd. play ( ); 289 snd. play ( );
280 while ( !snd. isFinished ( )) 290 while ( !snd. isFinished ( ))
281 qApp-> processEvents ( ); 291 qApp-> processEvents ( );
282 292
283 if ( fd >= 0 ) { 293 if ( fd >= 0 ) {
284 if ( vol_reset ) 294 if ( vol_reset )
285 ::ioctl ( fd, MIXER_WRITE( 0 ), &vol ); 295 ::ioctl ( fd, MIXER_WRITE( 0 ), &vol );
286 ::close ( fd ); 296 ::close ( fd );
287 } 297 }
288#endif 298#endif
299#endif
289} 300}
290 301
291uint ODeviceIPAQ::hasLeds ( ) const 302uint ODeviceIPAQ::hasLeds ( ) const
292{ 303{
293 return 1; 304 return 1;
294} 305}
295 306
296OLedState ODeviceIPAQ::led ( uint which ) const 307OLedState ODeviceIPAQ::led ( uint which ) const
297{ 308{
298 if ( which == 0 ) 309 if ( which == 0 )
299 return d-> m_leds [0]; 310 return d-> m_leds [0];
300 else 311 else
@@ -328,25 +339,25 @@ bool ODeviceIPAQ::setLed ( uint which, OLedState st )
328 } 339 }
329 } 340 }
330 return false; 341 return false;
331} 342}
332 343
333 344
334//#endif 345//#endif
335 346
336 347
337 348
338 349
339 350
340//#if defined( QT_QWS_CUSTOM ) // Zaurus 351//#if defined( QT_QWS_EBX ) // Zaurus
341 352
342void ODeviceZaurus::init ( ) 353void ODeviceZaurus::init ( )
343 { 354 {
344 d-> m_modelstr = "Zaurus SL5000"; 355 d-> m_modelstr = "Zaurus SL5000";
345 d-> m_model = OMODEL_Zaurus_SL5000; 356 d-> m_model = OMODEL_Zaurus_SL5000;
346 d-> m_vendorstr = "Sharp"; 357 d-> m_vendorstr = "Sharp";
347 d-> m_vendor = OVENDOR_Sharp; 358 d-> m_vendor = OVENDOR_Sharp;
348 359
349 QFile f ( "/proc/filesystems" ); 360 QFile f ( "/proc/filesystems" );
350 361
351 if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read ( ). find ( "\tjffs2\n" ) >= 0 )) { 362 if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read ( ). find ( "\tjffs2\n" ) >= 0 )) {
352 d-> m_systemstr = "OpenZaurus"; 363 d-> m_systemstr = "OpenZaurus";
@@ -368,24 +379,52 @@ void ODeviceZaurus::init ( )
368 379
369//#include <asm/sharp_char.h> // including kernel headers is evil ... 380//#include <asm/sharp_char.h> // including kernel headers is evil ...
370 381
371#define SHARP_DEV_IOCTL_COMMAND_START 0x5680 382#define SHARP_DEV_IOCTL_COMMAND_START 0x5680
372 383
373 #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) 384 #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START)
374#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) 385#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START)
375 386
376#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ 387#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */
377#define SHARP_BUZ_KEYSOUND 2 /* key sound */ 388#define SHARP_BUZ_KEYSOUND 2 /* key sound */
378#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ 389#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */
379 390
391/* --- for SHARP_BUZZER device --- */
392
393 //#defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START)
394//#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START)
395
396#define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1)
397#define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2)
398#define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3)
399#define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4)
400#define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5)
401
402//#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */
403//#define SHARP_BUZ_KEYSOUND 2 /* key sound */
404
405//#define SHARP_PDA_ILLCLICKSOUND 3 /* illegal click */
406//#define SHARP_PDA_WARNSOUND 4 /* warning occurred */
407//#define SHARP_PDA_ERRORSOUND 5 /* error occurred */
408//#define SHARP_PDA_CRITICALSOUND 6 /* critical error occurred */
409//#define SHARP_PDA_SYSSTARTSOUND 7 /* system start */
410//#define SHARP_PDA_SYSTEMENDSOUND 8 /* system shutdown */
411//#define SHARP_PDA_APPSTART 9 /* application start */
412//#define SHARP_PDA_APPQUIT 10 /* application ends */
413
414//#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */
415//#define SHARP_BUZ_DAILY_ALARM 12 /* daily alarm */
416//#define SHARP_BUZ_GOT_PHONE_CALL 13 /* phone call sound */
417//#define SHARP_BUZ_GOT_MAIL 14 /* mail sound */
418//
380 419
381 #defineSHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) 420 #defineSHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START)
382#define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) 421#define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1)
383 422
384typedef struct sharp_led_status { 423typedef struct sharp_led_status {
385 int which; /* select which LED status is wanted. */ 424 int which; /* select which LED status is wanted. */
386 int status; /* set new led status if you call SHARP_LED_SETSTATUS */ 425 int status; /* set new led status if you call SHARP_LED_SETSTATUS */
387} sharp_led_status; 426} sharp_led_status;
388 427
389#define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ 428#define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */
390 429
391#define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ 430#define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */