summaryrefslogtreecommitdiff
path: root/library
authorharlekin <harlekin>2002-12-13 19:37:59 (UTC)
committer harlekin <harlekin>2002-12-13 19:37:59 (UTC)
commite348262d418e3a133d13d039ed23da4625726f9d (patch) (unidiff)
tree36cdf26700d424b06b6c37b86e5f1e07bc233b88 /library
parent11ccc2e5341677cd54037a1f9cfb04831feed0f9 (diff)
downloadopie-e348262d418e3a133d13d039ed23da4625726f9d.zip
opie-e348262d418e3a133d13d039ed23da4625726f9d.tar.gz
opie-e348262d418e3a133d13d039ed23da4625726f9d.tar.bz2
added Bass and Treble handling - next stop should be odevice
Diffstat (limited to 'library') (more/less context) (show whitespace changes)
-rw-r--r--library/qpeapplication.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index c41dd06..852671a 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -330,6 +330,48 @@ static void setMic( int t = 0, int percent = -1 )
330} 330}
331 331
332 332
333static void setBass( int t = 0, int percent = -1 )
334{
335 switch ( t ) {
336 case 0: {
337 Config cfg( "qpe" );
338 cfg.setGroup( "Volume" );
339 if ( percent < 0 )
340 percent = cfg.readNumEntry( "BassPercent", 50 );
341
342 int fd = 0;
343 int bass = percent;
344 if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
345 ioctl( fd, MIXER_WRITE( SOUND_MIXER_BASS ), &bass );
346 ::close( fd );
347 }
348 }
349 break;
350 }
351}
352
353
354static void setTreble( int t = 0, int percent = -1 )
355{
356 switch ( t ) {
357 case 0: {
358 Config cfg( "qpe" );
359 cfg.setGroup( "Volume" );
360 if ( percent < 0 )
361 percent = cfg.readNumEntry( "TreblePercent", 50 );
362
363 int fd = 0;
364 int treble = percent;
365 if ( ( fd = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
366 ioctl( fd, MIXER_WRITE( SOUND_MIXER_TREBLE ), &treble );
367 ::close( fd );
368 }
369 }
370 break;
371 }
372}
373
374
333/*! 375/*!
334 \class QPEApplication qpeapplication.h 376 \class QPEApplication qpeapplication.h
335 \brief The QPEApplication class implements various system services 377 \brief The QPEApplication class implements various system services
@@ -1116,6 +1158,25 @@ void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data
1116 setMic(); 1158 setMic();
1117 emit micChanged( micMuted ); 1159 emit micChanged( micMuted );
1118 } 1160 }
1161 else if ( msg == "setBass(int,int)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org>
1162 int t, v;
1163 stream >> t >> v;
1164 setBass( t, v );
1165 }
1166 else if ( msg == "bassChange(bool)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org>
1167 setBass();
1168 }
1169 else if ( msg == "setTreble(int,int)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org>
1170 int t, v;
1171 stream >> t >> v;
1172 setTreble( t, v );
1173 }
1174 else if ( msg == "trebleChange(bool)" ) { // Added: 2002-12-13 by Maximilian Reiss <harlekin@handhelds.org>
1175 setTreble();
1176 }
1177
1178
1179
1119#endif 1180#endif
1120} 1181}
1121 1182