-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 8 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 16 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 47 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 12 |
4 files changed, 44 insertions, 39 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 | |||
@@ -109,7 +109,7 @@ void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume | |||
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; |
@@ -151,7 +151,7 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
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 |
@@ -192,13 +192,13 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
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 | ||
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 859a67a..1ae0059 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp | |||
@@ -235,14 +235,14 @@ void LoopControl::startAudio() { | |||
235 | long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000; | 235 | long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000; |
236 | long sampleWaitTime = currentSample - sampleWeShouldBeAt; | 236 | long sampleWaitTime = currentSample - sampleWeShouldBeAt; |
237 | 237 | ||
238 | // if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 5000 ) ) { | 238 | if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { |
239 | // usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); | 239 | usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); |
240 | // } | 240 | } |
241 | // else if ( sampleWaitTime <= -5000 ) { | 241 | else if ( sampleWaitTime <= -5000 ) { |
242 | // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); | 242 | qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); |
243 | // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); | 243 | //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); |
244 | // currentSample = sampleWeShouldBeAt; | 244 | currentSample = sampleWeShouldBeAt; |
245 | // } | 245 | } |
246 | 246 | ||
247 | audioDevice->write( audioBuffer, samplesRead * 2 * channels ); | 247 | audioDevice->write( audioBuffer, samplesRead * 2 * channels ); |
248 | audioSampleCounter = currentSample + samplesRead - 1; | 248 | audioSampleCounter = currentSample + samplesRead - 1; |
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 4e1543e..269aed8 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <qtabwidget.h> | 39 | #include <qtabwidget.h> |
40 | #include <qlistview.h> | 40 | #include <qlistview.h> |
41 | #include <qpoint.h> | 41 | #include <qpoint.h> |
42 | #include <qtimer.h> | 42 | //#include <qtimer.h> |
43 | 43 | ||
44 | #include "playlistselection.h" | 44 | #include "playlistselection.h" |
45 | #include "playlistwidget.h" | 45 | #include "playlistwidget.h" |
@@ -98,8 +98,8 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
98 | d = new PlayListWidgetPrivate; | 98 | d = new PlayListWidgetPrivate; |
99 | d->setDocumentUsed = FALSE; | 99 | d->setDocumentUsed = FALSE; |
100 | d->current = NULL; | 100 | d->current = NULL; |
101 | menuTimer = new QTimer( this ,"menu timer"), | 101 | // menuTimer = new QTimer( this ,"menu timer"), |
102 | connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); | 102 | // connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); |
103 | 103 | ||
104 | setBackgroundMode( PaletteButton ); | 104 | setBackgroundMode( PaletteButton ); |
105 | 105 | ||
@@ -204,11 +204,13 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
204 | for ( ; dit.current(); ++dit ) { | 204 | for ( ; dit.current(); ++dit ) { |
205 | QListViewItem * newItem; | 205 | QListViewItem * newItem; |
206 | if(dit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; | 206 | if(dit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; |
207 | else if(dit.current()->file().find("/mnt/hda") != -1 ) storage="CF"; | ||
207 | else if(dit.current()->file().find("/mnt/card") != -1 ) storage="SD"; | 208 | else if(dit.current()->file().find("/mnt/card") != -1 ) storage="SD"; |
208 | else storage="RAM"; | 209 | else storage="RAM"; |
209 | 210 | if ( QFile( dit.current()->file()).exists() ) { | |
210 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); | 211 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); |
211 | newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" )); | 212 | newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" )); |
213 | } | ||
212 | } | 214 | } |
213 | // videowidget | 215 | // videowidget |
214 | 216 | ||
@@ -229,11 +231,14 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
229 | QListIterator<DocLnk> Vdit( vFiles.children() ); | 231 | QListIterator<DocLnk> Vdit( vFiles.children() ); |
230 | for ( ; Vdit.current(); ++Vdit ) { | 232 | for ( ; Vdit.current(); ++Vdit ) { |
231 | if( Vdit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; | 233 | if( Vdit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; |
234 | else if( Vdit.current()->file().find("/mnt/hda") != -1 ) storage="CF"; | ||
232 | else if( Vdit.current()->file().find("/mnt/card") != -1 ) storage="SD"; | 235 | else if( Vdit.current()->file().find("/mnt/card") != -1 ) storage="SD"; |
233 | else storage="RAM"; | 236 | else storage="RAM"; |
234 | QListViewItem * newItem; | 237 | QListViewItem * newItem; |
238 | if ( QFile( Vdit.current()->file()).exists() ) { | ||
235 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); | 239 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); |
236 | newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" )); | 240 | newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" )); |
241 | } | ||
237 | } | 242 | } |
238 | 243 | ||
239 | 244 | ||
@@ -663,28 +668,28 @@ void PlayListWidget::tabChanged(QWidget *widg) { | |||
663 | }; | 668 | }; |
664 | } | 669 | } |
665 | 670 | ||
666 | void PlayListWidget::cancelMenuTimer() { | 671 | // void PlayListWidget::cancelMenuTimer() { |
667 | if( menuTimer->isActive() ) | 672 | // if( menuTimer->isActive() ) |
668 | menuTimer->stop(); | 673 | // menuTimer->stop(); |
669 | } | 674 | // } |
670 | 675 | ||
671 | void PlayListWidget::showFileMenu() { | 676 | // void PlayListWidget::showFileMenu() { |
672 | 677 | ||
673 | } | 678 | // } |
674 | 679 | ||
675 | void PlayListWidget::contentsMousePressEvent( QMouseEvent * e ) | 680 | // void PlayListWidget::contentsMousePressEvent( QMouseEvent * e ) |
676 | { | 681 | // { |
677 | // QListView::contentsMousePressEvent( e ); | 682 | // // QListView::contentsMousePressEvent( e ); |
678 | menuTimer->start( 750, TRUE ); | 683 | // menuTimer->start( 750, TRUE ); |
679 | } | 684 | // } |
680 | 685 | ||
681 | 686 | ||
682 | void PlayListWidget::contentsMouseReleaseEvent( QMouseEvent * e ) | 687 | // void PlayListWidget::contentsMouseReleaseEvent( QMouseEvent * e ) |
683 | { | 688 | // { |
684 | // QListView::contentsMouseReleaseEvent( e ); | 689 | // // QListView::contentsMouseReleaseEvent( e ); |
685 | menuTimer->stop(); | 690 | // menuTimer->stop(); |
686 | } | 691 | // } |
687 | // void PlayListWidget::setFullScreen() { | 692 | // // void PlayListWidget::setFullScreen() { |
688 | // mediaPlayerState->toggleFullscreen( ); | 693 | // mediaPlayerState->toggleFullscreen( ); |
689 | // } | 694 | // } |
690 | 695 | ||
diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h index 3a52dd5..6fe2211 100644 --- a/core/multimedia/opieplayer/playlistwidget.h +++ b/core/multimedia/opieplayer/playlistwidget.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <qmainwindow.h> | 24 | #include <qmainwindow.h> |
25 | #include <qpe/applnk.h> | 25 | #include <qpe/applnk.h> |
26 | #include <qtabwidget.h> | 26 | #include <qtabwidget.h> |
27 | #include <qtimer.h> | 27 | /* #include <qtimer.h> */ |
28 | 28 | ||
29 | 29 | ||
30 | class PlayListWidgetPrivate; | 30 | class PlayListWidgetPrivate; |
@@ -49,7 +49,7 @@ public: | |||
49 | // retrieve the current playlist entry (media file link) | 49 | // retrieve the current playlist entry (media file link) |
50 | const DocLnk *current(); | 50 | const DocLnk *current(); |
51 | void useSelectedDocument(); | 51 | void useSelectedDocument(); |
52 | QTimer * menuTimer; | 52 | /* QTimer * menuTimer; */ |
53 | 53 | ||
54 | public slots: | 54 | public slots: |
55 | void setDocument( const QString& fileref ); | 55 | void setDocument( const QString& fileref ); |
@@ -76,8 +76,8 @@ public slots: | |||
76 | /* void setFullScreen(); */ | 76 | /* void setFullScreen(); */ |
77 | /* void setScaled(); */ | 77 | /* void setScaled(); */ |
78 | protected: | 78 | protected: |
79 | void contentsMousePressEvent( QMouseEvent * e ); | 79 | /* void contentsMousePressEvent( QMouseEvent * e ); */ |
80 | void contentsMouseReleaseEvent( QMouseEvent * e ); | 80 | /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ |
81 | 81 | ||
82 | private: | 82 | private: |
83 | void initializeStates(); | 83 | void initializeStates(); |
@@ -86,8 +86,8 @@ private: | |||
86 | PlayListWidgetPrivate *d; // Private implementation data | 86 | PlayListWidgetPrivate *d; // Private implementation data |
87 | 87 | ||
88 | protected slots: | 88 | protected slots: |
89 | void cancelMenuTimer(); | 89 | /* void cancelMenuTimer(); */ |
90 | void showFileMenu(); | 90 | /* void showFileMenu(); */ |
91 | 91 | ||
92 | 92 | ||
93 | }; | 93 | }; |