Diffstat (limited to 'core/multimedia/opieplayer/audiodevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index 020f6be..136e06c 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp | |||
@@ -37,7 +37,2 @@ | |||
37 | 37 | ||
38 | // #ifdef Q_WS_WIN | ||
39 | // #include <windows.h> | ||
40 | // #include <mmsystem.h> | ||
41 | // #include <mmreg.h> | ||
42 | // #endif | ||
43 | #if defined(Q_WS_X11) || defined(Q_WS_QWS) | 38 | #if defined(Q_WS_X11) || defined(Q_WS_QWS) |
@@ -52,7 +47,2 @@ | |||
52 | 47 | ||
53 | // #if defined(Q_OS_WIN32) | ||
54 | // static const int expectedBytesPerMilliSecond = 2 * 2 * 44000 / 1000; | ||
55 | // static const int timerResolutionMilliSeconds = 30; | ||
56 | // static const int sound_fragment_bytes = timerResolutionMilliSeconds * expectedBytesPerMilliSecond; | ||
57 | // #else | ||
58 | # if defined(QT_QWS_IPAQ) | 48 | # if defined(QT_QWS_IPAQ) |
@@ -103,19 +93,2 @@ void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume | |||
103 | unsigned int volume; | 93 | unsigned int volume; |
104 | // #ifdef Q_OS_WIN32 | ||
105 | // HWAVEOUT handle; | ||
106 | // WAVEFORMATEX formatData; | ||
107 | // formatData.cbSize = sizeof(WAVEFORMATEX); | ||
108 | // formatData.wFormatTag = WAVE_FORMAT_PCM; | ||
109 | // formatData.nAvgBytesPerSec = 4 * 44000; | ||
110 | // formatData.nBlockAlign = 4; | ||
111 | // formatData.nChannels = 2; | ||
112 | // formatData.nSamplesPerSec = 44000; | ||
113 | // formatData.wBitsPerSample = 16; | ||
114 | // waveOutOpen(&handle, WAVE_MAPPER, &formatData, 0L, 0L, CALLBACK_NULL); | ||
115 | // if ( waveOutGetVolume( handle, (LPDWORD)&volume ) ) | ||
116 | // // qDebug( "get volume of audio device failed" ); | ||
117 | // waveOutClose( handle ); | ||
118 | // leftVolume = volume & 0xFFFF; | ||
119 | // rightVolume = volume >> 16; | ||
120 | // #else | ||
121 | int mixerHandle = open( "/dev/mixer", O_RDWR ); | 94 | int mixerHandle = open( "/dev/mixer", O_RDWR ); |
@@ -129,3 +102,2 @@ void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume | |||
129 | rightVolume = ((volume & 0xFF00) << 8) / 101; | 102 | rightVolume = ((volume & 0xFF00) << 8) / 101; |
130 | //#endif | ||
131 | } | 103 | } |
@@ -144,18 +116,2 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
144 | } | 116 | } |
145 | // #ifdef Q_OS_WIN32 | ||
146 | // HWAVEOUT handle; | ||
147 | // WAVEFORMATEX formatData; | ||
148 | // formatData.cbSize = sizeof(WAVEFORMATEX); | ||
149 | // formatData.wFormatTag = WAVE_FORMAT_PCM; | ||
150 | // formatData.nAvgBytesPerSec = 4 * 44000; | ||
151 | // formatData.nBlockAlign = 4; | ||
152 | // formatData.nChannels = 2; | ||
153 | // formatData.nSamplesPerSec = 44000; | ||
154 | // formatData.wBitsPerSample = 16; | ||
155 | // waveOutOpen(&handle, WAVE_MAPPER, &formatData, 0L, 0L, CALLBACK_NULL); | ||
156 | // unsigned int volume = (rightVolume << 16) | leftVolume; | ||
157 | // if ( waveOutSetVolume( handle, volume ) ) | ||
158 | // // qDebug( "set volume of audio device failed" ); | ||
159 | // waveOutClose( handle ); | ||
160 | // #else | ||
161 | // Volume can be from 0 to 100 which is 101 distinct values | 117 | // Volume can be from 0 to 100 which is 101 distinct values |
@@ -192,3 +148,2 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
192 | 148 | ||
193 | |||
194 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | 149 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { |
@@ -268,5 +223,2 @@ AudioDevice::~AudioDevice() { | |||
268 | 223 | ||
269 | // #ifdef Q_OS_WIN32 | ||
270 | // waveOutClose( (HWAVEOUT)d->handle ); | ||
271 | // #else | ||
272 | # ifndef KEEP_DEVICE_OPEN | 224 | # ifndef KEEP_DEVICE_OPEN |
@@ -276,3 +228,2 @@ AudioDevice::~AudioDevice() { | |||
276 | delete d; | 228 | delete d; |
277 | //#endif | ||
278 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; | 229 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; |
@@ -290,16 +241,2 @@ void AudioDevice::write( char *buffer, unsigned int length ) | |||
290 | { | 241 | { |
291 | // #ifdef Q_OS_WIN32 | ||
292 | // // returns immediately and (to be implemented) emits completedIO() when finished writing | ||
293 | // WAVEHDR *lpWaveHdr = (WAVEHDR *)malloc( sizeof(WAVEHDR) ); | ||
294 | // // maybe the buffer should be copied so that this fool proof, but its a performance hit | ||
295 | // lpWaveHdr->lpData = buffer; | ||
296 | // lpWaveHdr->dwBufferLength = length; | ||
297 | // lpWaveHdr->dwFlags = 0L; | ||
298 | // lpWaveHdr->dwLoops = 0L; | ||
299 | // waveOutPrepareHeader( (HWAVEOUT)d->handle, lpWaveHdr, sizeof(WAVEHDR) ); | ||
300 | // // waveOutWrite returns immediately. the data is sent in the background. | ||
301 | // if ( waveOutWrite( (HWAVEOUT)d->handle, lpWaveHdr, sizeof(WAVEHDR) ) ) | ||
302 | // qDebug( "failed to write block to audio device" ); | ||
303 | // // emit completedIO(); | ||
304 | // #else | ||
305 | int t = ::write( d->handle, buffer, length ); | 242 | int t = ::write( d->handle, buffer, length ); |
@@ -340,5 +277,2 @@ unsigned int AudioDevice::canWrite() const | |||
340 | { | 277 | { |
341 | // #ifdef Q_OS_WIN32 | ||
342 | // return bufferSize(); // Any better? | ||
343 | // #else | ||
344 | audio_buf_info info; | 278 | audio_buf_info info; |
@@ -367,3 +301,2 @@ unsigned int AudioDevice::canWrite() const | |||
367 | } | 301 | } |
368 | //#endif | ||
369 | } | 302 | } |
@@ -372,10 +305,2 @@ unsigned int AudioDevice::canWrite() const | |||
372 | int AudioDevice::bytesWritten() { | 305 | int AudioDevice::bytesWritten() { |
373 | // #ifdef Q_OS_WIN32 | ||
374 | // MMTIME pmmt = { TIME_BYTES, 0 }; | ||
375 | // if ( ( waveOutGetPosition( (HWAVEOUT)d->handle, &pmmt, sizeof(MMTIME) ) != MMSYSERR_NOERROR ) || ( pmmt.wType != TIME_BYTES ) ) { | ||
376 | // qDebug( "failed to get audio device position" ); | ||
377 | // return -1; | ||
378 | // } | ||
379 | // return pmmt.u.cb; | ||
380 | // #else | ||
381 | int buffered = 0; | 306 | int buffered = 0; |
@@ -386,3 +311,2 @@ int AudioDevice::bytesWritten() { | |||
386 | return buffered; | 311 | return buffered; |
387 | //#endif | ||
388 | } | 312 | } |