summaryrefslogtreecommitdiff
authorschurig <schurig>2004-09-10 12:34:40 (UTC)
committer schurig <schurig>2004-09-10 12:34:40 (UTC)
commit85928a3781d9a91b58ea414c0d7982459cc21920 (patch) (unidiff)
tree10aeedf3a79fe2372c55bda730b6913b5562231b
parent9d0ccc1c5ca687bc017b2b515a9d3a47e98ce521 (diff)
downloadopie-85928a3781d9a91b58ea414c0d7982459cc21920.zip
opie-85928a3781d9a91b58ea414c0d7982459cc21920.tar.gz
opie-85928a3781d9a91b58ea414c0d7982459cc21920.tar.bz2
support for DEVFS
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp4
-rw-r--r--noncore/multimedia/opierec/device.cpp16
-rw-r--r--noncore/multimedia/opierec/qtrec.cpp7
3 files changed, 27 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 7b4bfd9..e6afbd8 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -281,7 +281,11 @@ void MediaPlayer::timerEvent( QTimerEvent * ) {
281 281
282 282
283void MediaPlayer::blank( bool b ) { 283void MediaPlayer::blank( bool b ) {
284#ifdef QT_QWS_DEVFS
285 fd=open("/dev/fb/0",O_RDWR);
286#else
284 fd=open("/dev/fb0",O_RDWR); 287 fd=open("/dev/fb0",O_RDWR);
288#endif
285#ifdef QT_QWS_SL5XXX 289#ifdef QT_QWS_SL5XXX
286 fl= open( "/dev/fl", O_RDWR ); 290 fl= open( "/dev/fl", O_RDWR );
287#endif 291#endif
diff --git a/noncore/multimedia/opierec/device.cpp b/noncore/multimedia/opierec/device.cpp
index 683f0a5..cb47b77 100644
--- a/noncore/multimedia/opierec/device.cpp
+++ b/noncore/multimedia/opierec/device.cpp
@@ -75,7 +75,11 @@ qDebug( "Opening %s",dspstr);
75 75
76qDebug( "Opening mixer" ); 76qDebug( "Opening mixer" );
77 int mixerHandle=0; 77 int mixerHandle=0;
78#ifdef QT_QWS_DEVFS
79 if (( mixerHandle = open("/dev/sound/mixer",O_RDWR))<0) {
80#else
78 if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) { 81 if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) {
82#endif
79 perror("open(\"/dev/mixer\")"); 83 perror("open(\"/dev/mixer\")");
80 QString errorMsg="Could not open audio device\n /dev/dsp\n" 84 QString errorMsg="Could not open audio device\n /dev/dsp\n"
81 +(QString)strerror(errno); 85 +(QString)strerror(errno);
@@ -168,7 +172,11 @@ int Device::getInVolume() {
168void Device::changedOutVolume(int vol) { 172void Device::changedOutVolume(int vol) {
169 int level = (vol << 8) + vol; 173 int level = (vol << 8) + vol;
170 int fd = 0; 174 int fd = 0;
175#ifdef QT_QWS_DEVFS
176 if ((fd = open("/dev/sound/mixer", O_RDWR))>=0) {
177#else
171 if ((fd = open("/dev/mixer", O_RDWR))>=0) { 178 if ((fd = open("/dev/mixer", O_RDWR))>=0) {
179#endif
172 if(ioctl(fd, MIXER_WRITE(SOUND_MIXER_VOLUME), &level) == -1) 180 if(ioctl(fd, MIXER_WRITE(SOUND_MIXER_VOLUME), &level) == -1)
173 perror("ioctl(\"MIXER_IN_WRITE\")"); 181 perror("ioctl(\"MIXER_IN_WRITE\")");
174 182
@@ -184,7 +192,11 @@ void Device::changedOutVolume(int vol) {
184void Device::changedInVolume(int vol ) { 192void Device::changedInVolume(int vol ) {
185 int level = (vol << 8) + vol; 193 int level = (vol << 8) + vol;
186 int fd = 0; 194 int fd = 0;
195#ifdef QT_QWS_DEVFS
196 if ((fd = open("/dev/sound/mixer", O_RDWR))>=0) {
197#else
187 if ((fd = open("/dev/mixer", O_RDWR))>=0) { 198 if ((fd = open("/dev/mixer", O_RDWR))>=0) {
199#endif
188 if(ioctl(fd, MIXER_WRITE(SOUND_MIXER_MIC), &level) == -1) 200 if(ioctl(fd, MIXER_WRITE(SOUND_MIXER_MIC), &level) == -1)
189 perror("ioctl(\"MIXER_IN_WRITE\")"); 201 perror("ioctl(\"MIXER_IN_WRITE\")");
190 Config cfg("qpe"); 202 Config cfg("qpe");
@@ -200,7 +212,11 @@ bool Device::selectMicInput() {
200 212
201 int md=0; 213 int md=0;
202 int info=MIXER_WRITE(SOUND_MIXER_MIC); 214 int info=MIXER_WRITE(SOUND_MIXER_MIC);
215#ifdef QT_QWS_DEVFS
216 md = ::open( "/dev/sound/mixer", O_RDWR );
217#else
203 md = ::open( "/dev/mixer", O_RDWR ); 218 md = ::open( "/dev/mixer", O_RDWR );
219#endif
204 if ( md == -1) 220 if ( md == -1)
205 perror("open(\"/dev/mixer\")"); 221 perror("open(\"/dev/mixer\")");
206 else { 222 else {
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp
index 1141faa..c237726 100644
--- a/noncore/multimedia/opierec/qtrec.cpp
+++ b/noncore/multimedia/opierec/qtrec.cpp
@@ -79,10 +79,17 @@ static int deviceBitRates[] = { 8, 16, -1 };
79 79
80#else 80#else
81 81
82#ifdef QT_QWS_DEVFS
83#define DSPSTROUT "/dev/sound/dsp"
84#define DSPSTRIN "/dev/sound/dsp"
85#define DSPSTRMIXERIN "/dev/sound/mixer"
86#define DSPSTRMIXEROUT "/dev/sound/mixer"
87#else
82#define DSPSTROUT "/dev/dsp" 88#define DSPSTROUT "/dev/dsp"
83#define DSPSTRIN "/dev/dsp" 89#define DSPSTRIN "/dev/dsp"
84#define DSPSTRMIXERIN "/dev/mixer" 90#define DSPSTRMIXERIN "/dev/mixer"
85#define DSPSTRMIXEROUT "/dev/mixer" 91#define DSPSTRMIXEROUT "/dev/mixer"
92#endif
86 93
87#endif 94#endif
88 95