-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 3 | ||||
-rw-r--r-- | core/multimedia/opieplayer/libmpeg3/libmpeg3.pro | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/wavplugin/wavplugin.pro | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index 20345b7..b9561d5 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp | |||
@@ -75,65 +75,66 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
75 | songInfo->setFocusPolicy( QWidget::NoFocus ); | 75 | songInfo->setFocusPolicy( QWidget::NoFocus ); |
76 | songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); | 76 | songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); |
77 | 77 | ||
78 | slider = new QSlider( Qt::Horizontal, this ); | 78 | slider = new QSlider( Qt::Horizontal, this ); |
79 | slider->setFixedWidth( 220 ); | 79 | slider->setFixedWidth( 220 ); |
80 | slider->setFixedHeight( 20 ); | 80 | slider->setFixedHeight( 20 ); |
81 | slider->setMinValue( 0 ); | 81 | slider->setMinValue( 0 ); |
82 | slider->setMaxValue( 1 ); | 82 | slider->setMaxValue( 1 ); |
83 | slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); | 83 | slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); |
84 | slider->setFocusPolicy( QWidget::NoFocus ); | 84 | slider->setFocusPolicy( QWidget::NoFocus ); |
85 | slider->setGeometry( QRect( 7, 262, 220, 20 ) ); | 85 | slider->setGeometry( QRect( 7, 262, 220, 20 ) ); |
86 | 86 | ||
87 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 87 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
88 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 88 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
89 | 89 | ||
90 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 90 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
91 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 91 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
92 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 92 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
93 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); | 93 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); |
94 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 94 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
95 | 95 | ||
96 | if( !mediaPlayerState->isStreaming) { // this stops the slider from being moved, thus | 96 | if( !mediaPlayerState->isStreaming) { // this stops the slider from being moved, thus |
97 | // does not stop stream when it reaches the end | 97 | // does not stop stream when it reaches the end |
98 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 98 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
99 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 99 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
100 | } | 100 | } |
101 | // Intialise state | 101 | // Intialise state |
102 | setLength( mediaPlayerState->length() ); | 102 | setLength( mediaPlayerState->length() ); |
103 | setPosition( mediaPlayerState->position() ); | 103 | setPosition( mediaPlayerState->position() ); |
104 | setLooping( mediaPlayerState->fullscreen() ); | 104 | setLooping( mediaPlayerState->fullscreen() ); |
105 | setPaused( mediaPlayerState->paused() ); | 105 | setPaused( mediaPlayerState->paused() ); |
106 | setPlaying( mediaPlayerState->playing() ); | 106 | setPlaying( mediaPlayerState->playing() ); |
107 | 107 | if (mediaPlayerState->isStreaming) slider->hide(); | |
108 | |||
108 | } | 109 | } |
109 | 110 | ||
110 | 111 | ||
111 | AudioWidget::~AudioWidget() { | 112 | AudioWidget::~AudioWidget() { |
112 | for ( int i = 0; i < 4; i++ ) | 113 | for ( int i = 0; i < 4; i++ ) |
113 | delete pixmaps[i]; | 114 | delete pixmaps[i]; |
114 | } | 115 | } |
115 | 116 | ||
116 | 117 | ||
117 | static bool audioSliderBeingMoved = FALSE; | 118 | static bool audioSliderBeingMoved = FALSE; |
118 | 119 | ||
119 | 120 | ||
120 | void AudioWidget::sliderPressed() { | 121 | void AudioWidget::sliderPressed() { |
121 | audioSliderBeingMoved = TRUE; | 122 | audioSliderBeingMoved = TRUE; |
122 | } | 123 | } |
123 | 124 | ||
124 | 125 | ||
125 | void AudioWidget::sliderReleased() { | 126 | void AudioWidget::sliderReleased() { |
126 | audioSliderBeingMoved = FALSE; | 127 | audioSliderBeingMoved = FALSE; |
127 | if ( slider->width() == 0 ) | 128 | if ( slider->width() == 0 ) |
128 | return; | 129 | return; |
129 | long val = long((double)slider->value() * mediaPlayerState->length() / slider->width()); | 130 | long val = long((double)slider->value() * mediaPlayerState->length() / slider->width()); |
130 | mediaPlayerState->setPosition( val ); | 131 | mediaPlayerState->setPosition( val ); |
131 | } | 132 | } |
132 | 133 | ||
133 | 134 | ||
134 | void AudioWidget::setPosition( long i ) { | 135 | void AudioWidget::setPosition( long i ) { |
135 | updateSlider( i, mediaPlayerState->length() ); | 136 | updateSlider( i, mediaPlayerState->length() ); |
136 | } | 137 | } |
137 | 138 | ||
138 | 139 | ||
139 | void AudioWidget::setLength( long max ) { | 140 | void AudioWidget::setLength( long max ) { |
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3.pro b/core/multimedia/opieplayer/libmpeg3/libmpeg3.pro index e50aa4e..f5e5954 100644 --- a/core/multimedia/opieplayer/libmpeg3/libmpeg3.pro +++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3.pro | |||
@@ -7,37 +7,37 @@ SOURCES = libmpeg3plugin.cpp libmpeg3pluginimpl.cpp \ | |||
7 | mpeg3atrack.c \ | 7 | mpeg3atrack.c \ |
8 | mpeg3css.c \ | 8 | mpeg3css.c \ |
9 | mpeg3demux.c \ | 9 | mpeg3demux.c \ |
10 | mpeg3io.c \ | 10 | mpeg3io.c \ |
11 | mpeg3title.c \ | 11 | mpeg3title.c \ |
12 | mpeg3vtrack.c \ | 12 | mpeg3vtrack.c \ |
13 | audio/ac3.c \ | 13 | audio/ac3.c \ |
14 | audio/bit_allocation.c \ | 14 | audio/bit_allocation.c \ |
15 | audio/dct.c \ | 15 | audio/dct.c \ |
16 | audio/exponents.c \ | 16 | audio/exponents.c \ |
17 | audio/header.c \ | 17 | audio/header.c \ |
18 | audio/layer2.c \ | 18 | audio/layer2.c \ |
19 | audio/layer3.c \ | 19 | audio/layer3.c \ |
20 | audio/mantissa.c \ | 20 | audio/mantissa.c \ |
21 | audio/mpeg3audio.c \ | 21 | audio/mpeg3audio.c \ |
22 | audio/pcm.c \ | 22 | audio/pcm.c \ |
23 | audio/synthesizers.c \ | 23 | audio/synthesizers.c \ |
24 | audio/tables.c \ | 24 | audio/tables.c \ |
25 | video/getpicture.c \ | 25 | video/getpicture.c \ |
26 | video/headers.c \ | 26 | video/headers.c \ |
27 | video/idct.c \ | 27 | video/idct.c \ |
28 | video/macroblocks.c \ | 28 | video/macroblocks.c \ |
29 | video/mmxtest.c \ | 29 | video/mmxtest.c \ |
30 | video/motion.c \ | 30 | video/motion.c \ |
31 | video/mpeg3video.c \ | 31 | video/mpeg3video.c \ |
32 | video/output.c \ | 32 | video/output.c \ |
33 | video/reconstruct.c \ | 33 | video/reconstruct.c \ |
34 | video/seek.c \ | 34 | video/seek.c \ |
35 | video/slice.c \ | 35 | video/slice.c \ |
36 | video/vlc.c | 36 | video/vlc.c |
37 | TARGET = mpeg3plugin | 37 | TARGET = mpeg3plugin |
38 | TMAKE_CC=g++ | 38 | TMAKE_CC=g++ |
39 | DESTDIR = ../../plugins/codecs | 39 | DESTDIR = $(OPIEDIR)/plugins/codecs |
40 | INCLUDEPATH += $(OPIEDIR)/include .. | 40 | INCLUDEPATH += $(OPIEDIR)/include .. |
41 | DEPENDPATH += ../$(OPIEDIR)/include .. | 41 | DEPENDPATH += ../$(OPIEDIR)/include .. |
42 | LIBS += -lqpe -lpthread -lm | 42 | LIBS += -lqpe -lpthread -lm |
43 | VERSION = 1.0.0 | 43 | VERSION = 1.0.0 |
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 15175d0..01596a0 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp | |||
@@ -218,66 +218,66 @@ void LoopControl::startVideo() { | |||
218 | } | 218 | } |
219 | 219 | ||
220 | 220 | ||
221 | void LoopControl::startAudio() { | 221 | void LoopControl::startAudio() { |
222 | 222 | ||
223 | //qDebug("start audio"); | 223 | //qDebug("start audio"); |
224 | audioMutex->lock(); | 224 | audioMutex->lock(); |
225 | if ( moreAudio ) { | 225 | if ( moreAudio ) { |
226 | 226 | ||
227 | if ( !isMuted && mediaPlayerState->curDecoder() ) { | 227 | if ( !isMuted && mediaPlayerState->curDecoder() ) { |
228 | 228 | ||
229 | currentSample = audioSampleCounter + 1; | 229 | currentSample = audioSampleCounter + 1; |
230 | 230 | ||
231 | if ( currentSample != audioSampleCounter + 1 ) | 231 | if ( currentSample != audioSampleCounter + 1 ) |
232 | qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); | 232 | qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); |
233 | 233 | ||
234 | long samplesRead = 0; | 234 | long samplesRead = 0; |
235 | bool readOk=mediaPlayerState->curDecoder()->audioReadSamples( (short*)audioBuffer, channels, 1024, samplesRead, stream ); | 235 | bool readOk=mediaPlayerState->curDecoder()->audioReadSamples( (short*)audioBuffer, channels, 1024, samplesRead, stream ); |
236 | long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000; | 236 | long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000; |
237 | long sampleWaitTime = currentSample - sampleWeShouldBeAt; | 237 | long sampleWaitTime = currentSample - sampleWeShouldBeAt; |
238 | 238 | ||
239 | // this causes drop outs not sure why its even here | 239 | // this causes drop outs not sure why its even here |
240 | // if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { | 240 | // if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { |
241 | // usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); | 241 | // usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); |
242 | // } | 242 | // } |
243 | // else if ( sampleWaitTime <= -5000 ) { | 243 | // else if ( sampleWaitTime <= -5000 ) { |
244 | // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); | 244 | // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); |
245 | // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); | 245 | // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); |
246 | // currentSample = sampleWeShouldBeAt; | 246 | // currentSample = sampleWeShouldBeAt; |
247 | // } | 247 | // } |
248 | 248 | ||
249 | audioDevice->write( audioBuffer, samplesRead * 2 * channels ); | 249 | audioDevice->write( audioBuffer, samplesRead * 2 * channels ); |
250 | if( mediaPlayerState->isStreaming == FALSE); | ||
251 | 250 | ||
251 | // if( mediaPlayerState->isStreaming == FALSE) | ||
252 | audioSampleCounter = currentSample + samplesRead - 1; | 252 | audioSampleCounter = currentSample + samplesRead - 1; |
253 | 253 | ||
254 | moreAudio = readOk && (audioSampleCounter <= total_audio_samples); | 254 | moreAudio = readOk && (audioSampleCounter <= total_audio_samples); |
255 | 255 | ||
256 | } else { | 256 | } else { |
257 | 257 | ||
258 | moreAudio = FALSE; | 258 | moreAudio = FALSE; |
259 | 259 | ||
260 | } | 260 | } |
261 | 261 | ||
262 | } | 262 | } |
263 | 263 | ||
264 | audioMutex->unlock(); | 264 | audioMutex->unlock(); |
265 | } | 265 | } |
266 | 266 | ||
267 | 267 | ||
268 | void LoopControl::killTimers() { | 268 | void LoopControl::killTimers() { |
269 | 269 | ||
270 | audioMutex->lock(); | 270 | audioMutex->lock(); |
271 | 271 | ||
272 | if ( hasVideoChannel ) | 272 | if ( hasVideoChannel ) |
273 | killTimer( videoId ); | 273 | killTimer( videoId ); |
274 | killTimer( sliderId ); | 274 | killTimer( sliderId ); |
275 | threadOkToGo = FALSE; | 275 | threadOkToGo = FALSE; |
276 | 276 | ||
277 | audioMutex->unlock(); | 277 | audioMutex->unlock(); |
278 | } | 278 | } |
279 | 279 | ||
280 | 280 | ||
281 | void LoopControl::startTimers() { | 281 | void LoopControl::startTimers() { |
282 | 282 | ||
283 | audioMutex->lock(); | 283 | audioMutex->lock(); |
diff --git a/core/multimedia/opieplayer/wavplugin/wavplugin.pro b/core/multimedia/opieplayer/wavplugin/wavplugin.pro index 2160431..f0834de 100644 --- a/core/multimedia/opieplayer/wavplugin/wavplugin.pro +++ b/core/multimedia/opieplayer/wavplugin/wavplugin.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | HEADERS = wavplugin.h wavpluginimpl.h | 3 | HEADERS = wavplugin.h wavpluginimpl.h |
4 | SOURCES = wavplugin.cpp wavpluginimpl.cpp | 4 | SOURCES = wavplugin.cpp wavpluginimpl.cpp |
5 | TARGET = wavplugin | 5 | TARGET = wavplugin |
6 | DESTDIR = ../../plugins/codecs | 6 | DESTDIR = $(OPIEDIR)/plugins/codecs |
7 | INCLUDEPATH += $(OPIEDIR)/include .. | 7 | INCLUDEPATH += $(OPIEDIR)/include .. |
8 | DEPENDPATH += ../$(OPIEDIR)/include .. | 8 | DEPENDPATH += ../$(OPIEDIR)/include .. |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |