summaryrefslogtreecommitdiff
path: root/core
authorschurig <schurig>2004-09-10 12:18:17 (UTC)
committer schurig <schurig>2004-09-10 12:18:17 (UTC)
commit9d0ccc1c5ca687bc017b2b515a9d3a47e98ce521 (patch) (unidiff)
tree53927c6a19c69d54bb3d0e092ac57180bcb60222 /core
parented70ec4945c7816ec6e899207ec8b99e20e10da5 (diff)
downloadopie-9d0ccc1c5ca687bc017b2b515a9d3a47e98ce521.zip
opie-9d0ccc1c5ca687bc017b2b515a9d3a47e98ce521.tar.gz
opie-9d0ccc1c5ca687bc017b2b515a9d3a47e98ce521.tar.bz2
added support for DEVFS
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp10
-rw-r--r--core/applets/vtapplet/vt.cpp8
2 files changed, 15 insertions, 3 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index e747a19..07ef15c 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -408,24 +408,28 @@ int VMemo::openDSP() {
408 odebug << "samplerate: " << speed << ", channels " << channels << ", resolution " << resolution << "" << oendl; 408 odebug << "samplerate: " << speed << ", channels " << channels << ", resolution " << resolution << "" << oendl;
409 409
410 if(systemZaurus) { 410 if(systemZaurus) {
411 dsp = open("/dev/dsp1", O_RDONLY); //Zaurus needs /dev/dsp1 411 dsp = open("/dev/dsp1", O_RDONLY); //Zaurus needs /dev/dsp1
412 channels=1; //zaurus has one input channel 412 channels=1; //zaurus has one input channel
413 } else { 413 } else {
414#ifdef QT_QWS_DEVFS
415 dsp = open("/dev/sound/dsp", O_RDONLY);
416#else
414 dsp = open("/dev/dsp", O_RDONLY); 417 dsp = open("/dev/dsp", O_RDONLY);
418#endif
415 } 419 }
416 420
417 if(dsp == -1) { 421 if (dsp == -1) {
418 msgLabel->close(); 422 msgLabel->close();
419 msgLabel=0; 423 msgLabel=0;
420 delete msgLabel; 424 delete msgLabel;
421 425
422 perror("open(\"/dev/dsp\")"); 426 perror("open(\"/dev/dsp\")");
423 errorMsg="open(\"/dev/dsp\")\n "+(QString)strerror(errno); 427 errorMsg="open(\"/dev/dsp\")\n "+(QString)strerror(errno);
424 QMessageBox::critical(0, "vmemo", errorMsg, "Abort"); 428 QMessageBox::critical(0, "vmemo", errorMsg, "Abort");
425 return -1; 429 return -1;
426 } 430 }
427 431
428 if(ioctl(dsp, SNDCTL_DSP_SETFMT , &format)==-1) { 432 if(ioctl(dsp, SNDCTL_DSP_SETFMT , &format)==-1) {
429 perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); 433 perror("ioctl(\"SNDCTL_DSP_SETFMT\")");
430 return -1; 434 return -1;
431 } 435 }
diff --git a/core/applets/vtapplet/vt.cpp b/core/applets/vtapplet/vt.cpp
index aec63c3..7832ee0 100644
--- a/core/applets/vtapplet/vt.cpp
+++ b/core/applets/vtapplet/vt.cpp
@@ -77,13 +77,17 @@ QIconSet VTApplet::icon ( ) const
77 77
78QPopupMenu *VTApplet::popup ( QWidget* parent ) const 78QPopupMenu *VTApplet::popup ( QWidget* parent ) const
79{ 79{
80 odebug << "VTApplet::popup" << oendl; 80 odebug << "VTApplet::popup" << oendl;
81 81
82 struct vt_stat vtstat; 82 struct vt_stat vtstat;
83#ifdef QT_QWS_DEVFS
84 int fd = ::open( "/dev/vc/0", O_RDWR );
85#else
83 int fd = ::open( "/dev/tty0", O_RDWR ); 86 int fd = ::open( "/dev/tty0", O_RDWR );
87#endif
84 if ( fd == -1 ) return 0; 88 if ( fd == -1 ) return 0;
85 if ( ioctl( fd, VT_GETSTATE, &vtstat ) == -1 ) return 0; 89 if ( ioctl( fd, VT_GETSTATE, &vtstat ) == -1 ) return 0;
86 90
87 m_subMenu = new QPopupMenu( parent ); 91 m_subMenu = new QPopupMenu( parent );
88 m_subMenu->setCheckable( true ); 92 m_subMenu->setCheckable( true );
89 for ( int i = 1; i < 10; ++i ) 93 for ( int i = 1; i < 10; ++i )
@@ -101,13 +105,17 @@ QPopupMenu *VTApplet::popup ( QWidget* parent ) const
101 105
102 106
103void VTApplet::changeVT( int index ) 107void VTApplet::changeVT( int index )
104{ 108{
105 //odebug << "VTApplet::changeVT( " << index-500 << " )" << oendl; 109 //odebug << "VTApplet::changeVT( " << index-500 << " )" << oendl;
106 110
111#ifdef QT_QWS_DEVFS
112 int fd = ::open("/dev/vc/0", O_RDWR);
113#else
107 int fd = ::open("/dev/tty0", O_RDWR); 114 int fd = ::open("/dev/tty0", O_RDWR);
115#endif
108 if ( fd == -1 ) return; 116 if ( fd == -1 ) return;
109 ioctl( fd, VT_ACTIVATE, index-500 ); 117 ioctl( fd, VT_ACTIVATE, index-500 );
110} 118}
111 119
112 120
113void VTApplet::updateMenu() 121void VTApplet::updateMenu()