summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp12
-rw-r--r--core/multimedia/opieplayer/loopcontrol.cpp20
2 files changed, 18 insertions, 14 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp
index 9a55608..3dfe182 100644
--- a/core/multimedia/opieplayer/audiowidget.cpp
+++ b/core/multimedia/opieplayer/audiowidget.cpp
@@ -26,9 +26,9 @@
#include <qbutton.h>
#include <qpainter.h>
#include <qframe.h>
#include <qlayout.h>
-
+#include <qdir.h>
#include "audiowidget.h"
#include "mediaplayerstate.h"
#include <stdlib.h>
@@ -80,14 +80,18 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
Config cfg("OpiePlayer");
cfg.setGroup("Options");
skin = cfg.readEntry("Skin","default");
- //skin = "scaleTest";
+ //skin = "scaleTest";
// color of background, frame, degree of transparency
// QString skinPath = "opieplayer/skins/" + skin;
- QString skinPath = "opieplayer2/skins/" + skin;
- qDebug("skin path "+skinPath);
+ QString skinPath;
+ skinPath = "opieplayer2/skins/" + skin;
+ if(!QDir(skinPath).exists())
+ skinPath = "opieplayer2/skins/default";
+
+ qDebug("skin path " + skinPath);
pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) );
imgDn = new QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) );
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp
index ba14882..8cf0a75 100644
--- a/core/multimedia/opieplayer/loopcontrol.cpp
+++ b/core/multimedia/opieplayer/loopcontrol.cpp
@@ -99,9 +99,9 @@ Mutex *audioMutex;
LoopControl::LoopControl( QObject *parent, const char *name )
: QObject( parent, name ) {
isMuted = FALSE;
connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) );
-//qDebug("starting loopcontrol");
+qDebug("starting loopcontrol");
audioMutex = new Mutex;
pthread_attr_init(&audio_attr);
#define USE_REALTIME_AUDIO_THREAD
@@ -116,9 +116,9 @@ LoopControl::LoopControl( QObject *parent, const char *name )
pthread_attr_destroy(&audio_attr);
pthread_attr_init(&audio_attr);
}
#endif
-//qDebug("create audio thread");
+qDebug("create audio thread");
pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this);
}
@@ -363,14 +363,14 @@ bool LoopControl::init( const QString& filename ) {
qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() );
// ### Hack to use libmpeg3plugin to get the number of audio samples if we are using the libmad plugin
- if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibMadPlugin") ) {
- if ( mediaPlayerState->libMpeg3Decoder() && mediaPlayerState->libMpeg3Decoder()->open( filename )) {
- total_audio_samples = mediaPlayerState->libMpeg3Decoder()->audioSamples( 0 );
- mediaPlayerState->libMpeg3Decoder()->close();
- }
- }
+// if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibMadPlugin") ) {
+// if ( mediaPlayerState->libMpeg3Decoder() && mediaPlayerState->libMpeg3Decoder()->open( filename )) {
+// total_audio_samples = mediaPlayerState->libMpeg3Decoder()->audioSamples( 0 );
+// mediaPlayerState->libMpeg3Decoder()->close();
+// }
+// }
if ( !mediaPlayerState->curDecoder()|| !mediaPlayerState->curDecoder()->open( filename ) ) {
audioMutex->unlock();
return FALSE;
@@ -388,13 +388,13 @@ bool LoopControl::init( const QString& filename ) {
channels = mediaPlayerState->curDecoder()->audioChannels( astream );
qDebug( "LC- channels = %d", channels );
- if ( !total_audio_samples )
+// if ( !total_audio_samples )
total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream );
total_audio_samples += 1000;
-
+ qDebug("total samples %d", total_audio_samples);
mediaPlayerState->setLength( total_audio_samples );
freq = mediaPlayerState->curDecoder()->audioFrequency( astream );
qDebug( "LC- frequency = %d", freq );