author | llornkcor <llornkcor> | 2002-03-18 01:50:17 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-18 01:50:17 (UTC) |
commit | c09cb25eb6bbf31bed0d4a415802469cfd1efedf (patch) (unidiff) | |
tree | 86ced0fa482bd5fb244629f2baa1b1a4f25c9189 /core/multimedia/opieplayer/audiodevice.cpp | |
parent | 848182342d81b4e6ab4ce6b75bdaa0b109828af3 (diff) | |
download | opie-c09cb25eb6bbf31bed0d4a415802469cfd1efedf.zip opie-c09cb25eb6bbf31bed0d4a415802469cfd1efedf.tar.gz opie-c09cb25eb6bbf31bed0d4a415802469cfd1efedf.tar.bz2 |
added stuff and fixed stuff that I dont remember- plays w/o going to playlist among other things
Diffstat (limited to 'core/multimedia/opieplayer/audiodevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index 5fef792..2087c7f 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp | |||
@@ -184,37 +184,35 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
184 | } | 184 | } |
185 | 185 | ||
186 | 186 | ||
187 | 187 | ||
188 | 188 | ||
189 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | 189 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { |
190 | qDebug("creating new audio device"); | 190 | qDebug("creating new audio device"); |
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 | |||
201 | qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); | 200 | 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) ) ); | 201 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); |
203 | 202 | ||
204 | |||
205 | int fragments = 0x10000 * 8 + sound_fragment_shift; | 203 | int fragments = 0x10000 * 8 + sound_fragment_shift; |
206 | int capabilities = 0; | 204 | int capabilities = 0; |
207 | 205 | ||
208 | #ifdef KEEP_DEVICE_OPEN | 206 | #ifdef KEEP_DEVICE_OPEN |
209 | if ( AudioDevicePrivate::dspFd == 0 ) { | 207 | if ( AudioDevicePrivate::dspFd == 0 ) { |
210 | #endif | 208 | #endif |
211 | if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) { | 209 | if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) { |
212 | perror("open(\"/dev/dsp\") sending to /dev/null instead"); | 210 | perror("open(\"/dev/dsp\") sending to /dev/null instead"); |
213 | d->handle = ::open( "/dev/null", O_WRONLY ); | 211 | d->handle = ::open( "/dev/null", O_WRONLY ); |
214 | } | 212 | } |
215 | #ifdef KEEP_DEVICE_OPEN | 213 | #ifdef KEEP_DEVICE_OPEN |
216 | AudioDevicePrivate::dspFd = d->handle; | 214 | AudioDevicePrivate::dspFd = d->handle; |
217 | } else { | 215 | } else { |
218 | d->handle = AudioDevicePrivate::dspFd; | 216 | d->handle = AudioDevicePrivate::dspFd; |
219 | } | 217 | } |
220 | #endif | 218 | #endif |