summaryrefslogtreecommitdiff
Unidiff
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 @@
26#include <qbutton.h> 26#include <qbutton.h>
27#include <qpainter.h> 27#include <qpainter.h>
28#include <qframe.h> 28#include <qframe.h>
29#include <qlayout.h> 29#include <qlayout.h>
30 30#include <qdir.h>
31#include "audiowidget.h" 31#include "audiowidget.h"
32#include "mediaplayerstate.h" 32#include "mediaplayerstate.h"
33 33
34#include <stdlib.h> 34#include <stdlib.h>
@@ -80,14 +80,18 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
80 80
81 Config cfg("OpiePlayer"); 81 Config cfg("OpiePlayer");
82 cfg.setGroup("Options"); 82 cfg.setGroup("Options");
83 skin = cfg.readEntry("Skin","default"); 83 skin = cfg.readEntry("Skin","default");
84 //skin = "scaleTest"; 84 //skin = "scaleTest";
85// color of background, frame, degree of transparency 85// color of background, frame, degree of transparency
86 86
87// QString skinPath = "opieplayer/skins/" + skin; 87// QString skinPath = "opieplayer/skins/" + skin;
88 QString skinPath = "opieplayer2/skins/" + skin; 88 QString skinPath;
89 qDebug("skin path "+skinPath); 89 skinPath = "opieplayer2/skins/" + skin;
90 if(!QDir(skinPath).exists())
91 skinPath = "opieplayer2/skins/default";
92
93 qDebug("skin path " + skinPath);
90 94
91 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); 95 pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
92 imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); 96 imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) );
93 imgDn = new QImage( Resource::loadImage( QString("%1/skin_down").arg(skinPath) ) ); 97 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;
99LoopControl::LoopControl( QObject *parent, const char *name ) 99LoopControl::LoopControl( QObject *parent, const char *name )
100 : QObject( parent, name ) { 100 : QObject( parent, name ) {
101 isMuted = FALSE; 101 isMuted = FALSE;
102 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) ); 102 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) );
103//qDebug("starting loopcontrol"); 103qDebug("starting loopcontrol");
104 audioMutex = new Mutex; 104 audioMutex = new Mutex;
105 105
106 pthread_attr_init(&audio_attr); 106 pthread_attr_init(&audio_attr);
107#define USE_REALTIME_AUDIO_THREAD 107#define USE_REALTIME_AUDIO_THREAD
@@ -116,9 +116,9 @@ LoopControl::LoopControl( QObject *parent, const char *name )
116 pthread_attr_destroy(&audio_attr); 116 pthread_attr_destroy(&audio_attr);
117 pthread_attr_init(&audio_attr); 117 pthread_attr_init(&audio_attr);
118 } 118 }
119#endif 119#endif
120//qDebug("create audio thread"); 120qDebug("create audio thread");
121 pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this); 121 pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this);
122} 122}
123 123
124 124
@@ -363,14 +363,14 @@ bool LoopControl::init( const QString& filename ) {
363 363
364 qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); 364 qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() );
365 365
366 // ### Hack to use libmpeg3plugin to get the number of audio samples if we are using the libmad plugin 366 // ### Hack to use libmpeg3plugin to get the number of audio samples if we are using the libmad plugin
367 if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibMadPlugin") ) { 367// if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibMadPlugin") ) {
368 if ( mediaPlayerState->libMpeg3Decoder() && mediaPlayerState->libMpeg3Decoder()->open( filename )) { 368// if ( mediaPlayerState->libMpeg3Decoder() && mediaPlayerState->libMpeg3Decoder()->open( filename )) {
369 total_audio_samples = mediaPlayerState->libMpeg3Decoder()->audioSamples( 0 ); 369// total_audio_samples = mediaPlayerState->libMpeg3Decoder()->audioSamples( 0 );
370 mediaPlayerState->libMpeg3Decoder()->close(); 370// mediaPlayerState->libMpeg3Decoder()->close();
371 } 371// }
372 } 372// }
373 373
374 if ( !mediaPlayerState->curDecoder()|| !mediaPlayerState->curDecoder()->open( filename ) ) { 374 if ( !mediaPlayerState->curDecoder()|| !mediaPlayerState->curDecoder()->open( filename ) ) {
375 audioMutex->unlock(); 375 audioMutex->unlock();
376 return FALSE; 376 return FALSE;
@@ -388,13 +388,13 @@ bool LoopControl::init( const QString& filename ) {
388 channels = mediaPlayerState->curDecoder()->audioChannels( astream ); 388 channels = mediaPlayerState->curDecoder()->audioChannels( astream );
389 389
390 qDebug( "LC- channels = %d", channels ); 390 qDebug( "LC- channels = %d", channels );
391 391
392 if ( !total_audio_samples ) 392// if ( !total_audio_samples )
393 total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream ); 393 total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream );
394 394
395 total_audio_samples += 1000; 395 total_audio_samples += 1000;
396 396 qDebug("total samples %d", total_audio_samples);
397 mediaPlayerState->setLength( total_audio_samples ); 397 mediaPlayerState->setLength( total_audio_samples );
398 398
399 freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); 399 freq = mediaPlayerState->curDecoder()->audioFrequency( astream );
400 qDebug( "LC- frequency = %d", freq ); 400 qDebug( "LC- frequency = %d", freq );