summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-02 18:17:40 (UTC)
committer simon <simon>2002-12-02 18:17:40 (UTC)
commit2aa2e01cd678012d4b28365c9c765a2076f64a3b (patch) (side-by-side diff)
tree53fb067b1670b734cd65ce1d2fddd920e059d200
parentdaf5a1cfa07615a3259dce3f7f980d30241fa3d5 (diff)
downloadopie-2aa2e01cd678012d4b28365c9c765a2076f64a3b.zip
opie-2aa2e01cd678012d4b28365c9c765a2076f64a3b.tar.gz
opie-2aa2e01cd678012d4b28365c9c765a2076f64a3b.tar.bz2
- adapted to the new MediaPlayerState::MediaType
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp15
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h4
2 files changed, 10 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 46d374d..74bc390 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -151,25 +151,25 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
// cofg.setGroup("Appearance");
// QColor backgroundcolor = QColor( cofg.readEntry( "Background", "#E5E1D5" ) );
time.setFocusPolicy( QWidget::NoFocus );
time.setAlignment( Qt::AlignCenter );
// time.setFrame(FALSE);
// changeTextColor( &time );
resizeEvent( NULL );
connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) );
- connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
+ connect( mediaPlayerState, SIGNAL( mediaTypeChanged(MediaPlayerState::MediaType) ), this, SLOT( setMediaType(MediaPlayerState::MediaType) ) );
connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) );
connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) );
connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) );
connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) );
connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) );
connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) );
// Intialise state
setLength( mediaPlayerState->length() );
setPosition( mediaPlayerState->position() );
@@ -255,34 +255,33 @@ void AudioWidget::sliderReleased() {
void AudioWidget::setPosition( long i ) {
// qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i);
updateSlider( i, mediaPlayerState->length() );
}
void AudioWidget::setLength( long max ) {
updateSlider( mediaPlayerState->position(), max );
}
-void AudioWidget::setView( char view ) {
-
-if ( view == 'a' ) {
- // startTimer( 150 );
- showMaximized();
- } else {
+void AudioWidget::setMediaType( MediaPlayerState::MediaType mediaType ) {
+ if ( mediaType == MediaPlayerState::Video ) {
killTimers();
hide();
+ return;
}
- // qApp->processEvents();
+
+ // startTimer( 150 );
+ showMaximized();
}
void AudioWidget::setSeekable( bool isSeekable ) {
if ( !isSeekable ) {
qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>");
if( !slider.isHidden()) {
slider.hide();
}
disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index 54adb36..3f0c059 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -37,24 +37,26 @@
#include <qwidget.h>
#include <qpainter.h>
#include <qdrawutil.h>
#include <qpixmap.h>
#include <qstring.h>
#include <qslider.h>
#include <qframe.h>
#include <qlineedit.h>
#include <qimage.h>
#include <opie/oticker.h>
+#include "mediaplayerstate.h"
+
class QPixmap;
namespace {
enum AudioButtons {
AudioPlay=0,
AudioStop,
AudioNext,
AudioPrevious,
AudioVolumeUp,
AudioVolumeDown,
AudioLoop,
@@ -70,25 +72,25 @@ public:
AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 );
~AudioWidget();
void setTickerText( const QString &text ) { songInfo.setText( text ); }
public slots:
void updateSlider( long, long );
void sliderPressed( );
void sliderReleased( );
void setLooping( bool b) { setToggleButton( AudioLoop, b ); }
void setPlaying( bool b) { setToggleButton( AudioPlay, b ); }
void setPosition( long );
void setLength( long );
void setSeekable( bool );
- void setView( char );
+ void setMediaType( MediaPlayerState::MediaType mediaType );
signals:
void moreClicked();
void lessClicked();
void moreReleased();
void lessReleased();
void forwardClicked();
void backClicked();
void forwardReleased();
void backReleased();
void sliderMoved(long);