-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 15 | ||||
-rw-r--r-- | core/multimedia/opieplayer/libflash/libflashplugin.cpp | 4 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 6 |
3 files changed, 21 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index d01d2ba..6a38fc9 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp | |||
@@ -90,9 +90,13 @@ unsigned int AudioDevicePrivate::rightVolume = 0; | |||
90 | 90 | ||
91 | void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume, bool &muted ) { | 91 | void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume, bool &muted ) { |
92 | muted = AudioDevicePrivate::muted; | 92 | muted = AudioDevicePrivate::muted; |
93 | unsigned int volume; | 93 | unsigned int volume; |
94 | #ifdef QT_QWS_DEVFS | ||
95 | int mixerHandle = open( "/dev/sound/mixer", O_RDWR ); | ||
96 | #else | ||
94 | int mixerHandle = open( "/dev/mixer", O_RDWR ); | 97 | int mixerHandle = open( "/dev/mixer", O_RDWR ); |
98 | #endif | ||
95 | if ( mixerHandle >= 0 ) { | 99 | if ( mixerHandle >= 0 ) { |
96 | if(ioctl( mixerHandle, MIXER_READ(0), &volume )==-1) | 100 | if(ioctl( mixerHandle, MIXER_READ(0), &volume )==-1) |
97 | perror("ioctl(\"MIXER_READ\")"); | 101 | perror("ioctl(\"MIXER_READ\")"); |
98 | close( mixerHandle ); | 102 | close( mixerHandle ); |
@@ -120,9 +124,13 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
120 | # if 0 | 124 | # if 0 |
121 | unsigned int lV = (leftVolume * 101) >> 16; | 125 | unsigned int lV = (leftVolume * 101) >> 16; |
122 | unsigned int volume = ((rV << 8) & 0xFF00) | (lV & 0x00FF); | 126 | unsigned int volume = ((rV << 8) & 0xFF00) | (lV & 0x00FF); |
123 | int mixerHandle = 0; | 127 | int mixerHandle = 0; |
128 | #ifdef QT_QWS_DEVFS | ||
129 | if ( ( mixerHandle = open( "/dev/sound/mixer", O_RDWR ) ) >= 0 ) { | ||
130 | #else | ||
124 | if ( ( mixerHandle = open( "/dev/mixer", O_RDWR ) ) >= 0 ) { | 131 | if ( ( mixerHandle = open( "/dev/mixer", O_RDWR ) ) >= 0 ) { |
132 | #endif | ||
125 | if(ioctl( mixerHandle, MIXER_WRITE(0), &volume ) ==-1) | 133 | if(ioctl( mixerHandle, MIXER_WRITE(0), &volume ) ==-1) |
126 | perror("ioctl(\"MIXER_WRITE\")"); | 134 | perror("ioctl(\"MIXER_WRITE\")"); |
127 | close( mixerHandle ); | 135 | close( mixerHandle ); |
128 | } else | 136 | } else |
@@ -167,17 +175,18 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
167 | 175 | ||
168 | #ifdef KEEP_DEVICE_OPEN | 176 | #ifdef KEEP_DEVICE_OPEN |
169 | if ( AudioDevicePrivate::dspFd == 0 ) { | 177 | if ( AudioDevicePrivate::dspFd == 0 ) { |
170 | #endif | 178 | #endif |
179 | #ifdef QT_QWS_DEVFS | ||
180 | if ( ( d->handle = ::open( "/dev/sound/dsp", O_WRONLY ) ) < 0 ) { | ||
181 | #else | ||
171 | if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) { | 182 | if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) { |
183 | #endif | ||
172 | 184 | ||
173 | // perror("open(\"/dev/dsp\") sending to /dev/null instead"); | ||
174 | perror("open(\"/dev/dsp\")"); | 185 | perror("open(\"/dev/dsp\")"); |
175 | QString errorMsg=tr("Somethin's wrong with\nyour sound device.\nopen(\"/dev/dsp\")\n")+(QString)strerror(errno)+tr("\n\nClosing player now."); | 186 | QString errorMsg=tr("Somethin's wrong with\nyour sound device.\nopen(\"/dev/dsp\")\n")+(QString)strerror(errno)+tr("\n\nClosing player now."); |
176 | QMessageBox::critical(0, "Vmemo", errorMsg, tr("Abort")); | 187 | QMessageBox::critical(0, "Vmemo", errorMsg, tr("Abort")); |
177 | exit(-1); //harsh? | 188 | exit(-1); //harsh? |
178 | // d->handle = ::open( "/dev/null", O_WRONLY ); | ||
179 | // WTF?!?! | ||
180 | } | 189 | } |
181 | #ifdef KEEP_DEVICE_OPEN | 190 | #ifdef KEEP_DEVICE_OPEN |
182 | AudioDevicePrivate::dspFd = d->handle; | 191 | AudioDevicePrivate::dspFd = d->handle; |
183 | } else { | 192 | } else { |
diff --git a/core/multimedia/opieplayer/libflash/libflashplugin.cpp b/core/multimedia/opieplayer/libflash/libflashplugin.cpp index 538c695..78cf555 100644 --- a/core/multimedia/opieplayer/libflash/libflashplugin.cpp +++ b/core/multimedia/opieplayer/libflash/libflashplugin.cpp | |||
@@ -150,9 +150,13 @@ bool LibFlashPlugin::open( const QString& fileName ) { | |||
150 | free(buffer); | 150 | free(buffer); |
151 | FlashGetInfo(file, &fi); | 151 | FlashGetInfo(file, &fi); |
152 | //FlashSettings(flashHandle, PLAYER_LOOP); | 152 | //FlashSettings(flashHandle, PLAYER_LOOP); |
153 | FlashGraphicInit(file, fd); | 153 | FlashGraphicInit(file, fd); |
154 | #ifdef QT_QWS_DEVFS | ||
155 | FlashSoundInit(file, "/dev/sound/dsp"); | ||
156 | #else | ||
154 | FlashSoundInit(file, "/dev/dsp"); | 157 | FlashSoundInit(file, "/dev/dsp"); |
158 | #endif | ||
155 | FlashSetGetUrlMethod(file, showUrl, 0); | 159 | FlashSetGetUrlMethod(file, showUrl, 0); |
156 | FlashSetGetSwfMethod(file, getSwf, (void*)file); | 160 | FlashSetGetSwfMethod(file, getSwf, (void*)file); |
157 | 161 | ||
158 | printf("opened file\n"); | 162 | printf("opened file\n"); |
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index efea385..b393230 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -1371,10 +1371,14 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) | |||
1371 | // } | 1371 | // } |
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | void PlayListWidget::doBlank() { | 1374 | void PlayListWidget::doBlank() { |
1375 | // qDebug("do blanking"); | 1375 | // TODO: why do we blank this way, why don't we use ODevice or ScreenSaver? |
1376 | #ifdef QT_QWS_DEVFS | ||
1377 | fd=open("/dev/fb/0",O_RDWR); | ||
1378 | #else | ||
1376 | fd=open("/dev/fb0",O_RDWR); | 1379 | fd=open("/dev/fb0",O_RDWR); |
1380 | #endif | ||
1377 | if (fd != -1) { | 1381 | if (fd != -1) { |
1378 | ioctl(fd,FBIOBLANK,1); | 1382 | ioctl(fd,FBIOBLANK,1); |
1379 | // close(fd); | 1383 | // close(fd); |
1380 | } | 1384 | } |