Diffstat (limited to 'core/multimedia/opieplayer/audiodevice.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index 59136af..11fd9e8 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp | |||
@@ -106,13 +106,13 @@ void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume | |||
106 | formatData.nBlockAlign = 4; | 106 | formatData.nBlockAlign = 4; |
107 | formatData.nChannels = 2; | 107 | formatData.nChannels = 2; |
108 | formatData.nSamplesPerSec = 44000; | 108 | formatData.nSamplesPerSec = 44000; |
109 | formatData.wBitsPerSample = 16; | 109 | formatData.wBitsPerSample = 16; |
110 | waveOutOpen(&handle, WAVE_MAPPER, &formatData, 0L, 0L, CALLBACK_NULL); | 110 | waveOutOpen(&handle, WAVE_MAPPER, &formatData, 0L, 0L, CALLBACK_NULL); |
111 | if ( waveOutGetVolume( handle, (LPDWORD)&volume ) ) | 111 | if ( waveOutGetVolume( handle, (LPDWORD)&volume ) ) |
112 | qDebug( "get volume of audio device failed" ); | 112 | // qDebug( "get volume of audio device failed" ); |
113 | waveOutClose( handle ); | 113 | waveOutClose( handle ); |
114 | leftVolume = volume & 0xFFFF; | 114 | leftVolume = volume & 0xFFFF; |
115 | rightVolume = volume >> 16; | 115 | rightVolume = volume >> 16; |
116 | #else | 116 | #else |
117 | int mixerHandle = open( "/dev/mixer", O_RDWR ); | 117 | int mixerHandle = open( "/dev/mixer", O_RDWR ); |
118 | if ( mixerHandle >= 0 ) { | 118 | if ( mixerHandle >= 0 ) { |
@@ -148,13 +148,13 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
148 | formatData.nChannels = 2; | 148 | formatData.nChannels = 2; |
149 | formatData.nSamplesPerSec = 44000; | 149 | formatData.nSamplesPerSec = 44000; |
150 | formatData.wBitsPerSample = 16; | 150 | formatData.wBitsPerSample = 16; |
151 | waveOutOpen(&handle, WAVE_MAPPER, &formatData, 0L, 0L, CALLBACK_NULL); | 151 | waveOutOpen(&handle, WAVE_MAPPER, &formatData, 0L, 0L, CALLBACK_NULL); |
152 | unsigned int volume = (rightVolume << 16) | leftVolume; | 152 | unsigned int volume = (rightVolume << 16) | leftVolume; |
153 | if ( waveOutSetVolume( handle, volume ) ) | 153 | if ( waveOutSetVolume( handle, volume ) ) |
154 | qDebug( "set volume of audio device failed" ); | 154 | // qDebug( "set volume of audio device failed" ); |
155 | waveOutClose( handle ); | 155 | waveOutClose( handle ); |
156 | #else | 156 | #else |
157 | // Volume can be from 0 to 100 which is 101 distinct values | 157 | // Volume can be from 0 to 100 which is 101 distinct values |
158 | unsigned int rV = (rightVolume * 101) >> 16; | 158 | unsigned int rV = (rightVolume * 101) >> 16; |
159 | 159 | ||
160 | # if 0 | 160 | # if 0 |
@@ -189,19 +189,19 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
189 | 189 | ||
190 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | 190 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { |
191 | d = new AudioDevicePrivate; | 191 | d = new AudioDevicePrivate; |
192 | d->frequency = f; | 192 | d->frequency = f; |
193 | d->channels = chs; | 193 | d->channels = chs; |
194 | d->bytesPerSample = bps; | 194 | d->bytesPerSample = bps; |
195 | qDebug("%d",bps); | 195 | // qDebug("%d",bps); |
196 | int format=0; | 196 | int format=0; |
197 | if( bps == 8) format = AFMT_U8; | 197 | if( bps == 8) format = AFMT_U8; |
198 | else if( bps <= 0) format = AFMT_S16_LE; | 198 | else if( bps <= 0) format = AFMT_S16_LE; |
199 | else format = AFMT_S16_LE; | 199 | else format = AFMT_S16_LE; |
200 | 200 | ||
201 | qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); | 201 | // qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); |
202 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); | 202 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); |
203 | 203 | ||
204 | 204 | ||
205 | int fragments = 0x10000 * 8 + sound_fragment_shift; | 205 | int fragments = 0x10000 * 8 + sound_fragment_shift; |
206 | int capabilities = 0; | 206 | int capabilities = 0; |
207 | 207 | ||