author | llornkcor <llornkcor> | 2002-08-03 14:19:05 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-03 14:19:05 (UTC) |
commit | aa06a62511cabebeaad1d3dda34b30640f967dea (patch) (unidiff) | |
tree | a6887240b094f46de46b743135a2e918ba3254ad /noncore | |
parent | d3c13036415713932f1706e46fa7c99ef38188df (diff) | |
download | opie-aa06a62511cabebeaad1d3dda34b30640f967dea.zip opie-aa06a62511cabebeaad1d3dda34b30640f967dea.tar.gz opie-aa06a62511cabebeaad1d3dda34b30640f967dea.tar.bz2 |
audiowidget now shows time and slider moves.
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/opieplayer2.pro | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 9 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 5 |
7 files changed, 22 insertions, 20 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 303834a..23f4329 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -252,5 +252,5 @@ void AudioWidget::sliderReleased() { | |||
252 | 252 | ||
253 | void AudioWidget::setPosition( long i ) { | 253 | void AudioWidget::setPosition( long i ) { |
254 | qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); | 254 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); |
255 | updateSlider( i, mediaPlayerState->length() ); | 255 | updateSlider( i, mediaPlayerState->length() ); |
256 | } | 256 | } |
@@ -291,5 +291,4 @@ void AudioWidget::setView( char view ) { | |||
291 | 291 | ||
292 | static QString timeAsString( long length ) { | 292 | static QString timeAsString( long length ) { |
293 | length /= 44100; | ||
294 | int minutes = length / 60; | 293 | int minutes = length / 60; |
295 | int seconds = length % 60; | 294 | int seconds = length % 60; |
@@ -300,5 +299,6 @@ void AudioWidget::updateSlider( long i, long max ) { | |||
300 | 299 | ||
301 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); | 300 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); |
302 | 301 | // qDebug( timeAsString( i ) + " / " + timeAsString( max ) ) ; | |
302 | |||
303 | if ( max == 0 ) { | 303 | if ( max == 0 ) { |
304 | return; | 304 | return; |
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 778cd1e..135c67c 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp | |||
@@ -110,4 +110,5 @@ char MediaPlayerState::view() { | |||
110 | // slots | 110 | // slots |
111 | void MediaPlayerState::setIsStreaming( bool b ) { | 111 | void MediaPlayerState::setIsStreaming( bool b ) { |
112 | |||
112 | if ( isStreaming == b ) { | 113 | if ( isStreaming == b ) { |
113 | return; | 114 | return; |
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index 79ba579..887c527 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h | |||
@@ -49,4 +49,7 @@ public: | |||
49 | ~MediaPlayerState(); | 49 | ~MediaPlayerState(); |
50 | 50 | ||
51 | bool isPaused; | ||
52 | bool isPlaying; | ||
53 | bool isStoped; | ||
51 | bool streaming(); | 54 | bool streaming(); |
52 | bool fullscreen(); | 55 | bool fullscreen(); |
@@ -115,7 +118,4 @@ private: | |||
115 | bool isShuffled; | 118 | bool isShuffled; |
116 | bool usePlaylist; | 119 | bool usePlaylist; |
117 | bool isPaused; | ||
118 | bool isPlaying; | ||
119 | bool isStoped; | ||
120 | long curPosition; | 120 | long curPosition; |
121 | long curLength; | 121 | long curLength; |
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro index 448dd34..d8cacd0 100644 --- a/noncore/multimedia/opieplayer2/opieplayer2.pro +++ b/noncore/multimedia/opieplayer2/opieplayer2.pro | |||
@@ -4,11 +4,11 @@ CONFIG = qt warn_on release | |||
4 | DESTDIR = $(OPIEDIR)/bin | 4 | DESTDIR = $(OPIEDIR)/bin |
5 | HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\ | 5 | HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\ |
6 | videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \ | 6 | videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \ |
7 | frame.h lib.h xinevideowidget.h \ | 7 | frame.h lib.h xinevideowidget.h \ |
8 | alphablend.h yuv2rgb.h | 8 | alphablend.h yuv2rgb.h |
9 | SOURCES = main.cpp \ | 9 | SOURCES = main.cpp \ |
10 | playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp mediadetect.cpp\ | 10 | playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp mediadetect.cpp\ |
11 | videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp inputDialog.cpp \ | 11 | videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp inputDialog.cpp \ |
12 | frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp \ | 12 | frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp \ |
13 | alphablend.c yuv2rgb.c yuv2rgb_mlib.c yuv2rgb_mmx.c | 13 | alphablend.c yuv2rgb.c yuv2rgb_mlib.c yuv2rgb_mmx.c |
14 | TARGET = opieplayer2 | 14 | TARGET = opieplayer2 |
@@ -16,4 +16,6 @@ INCLUDEPATH += $(OPIEDIR)/include | |||
16 | DEPENDPATH += $(OPIEDIR)/include | 16 | DEPENDPATH += $(OPIEDIR)/include |
17 | LIBS += -lqpe -lpthread -lopie -lxine -lxineutils | 17 | LIBS += -lqpe -lpthread -lopie -lxine -lxineutils |
18 | MOC_DIR=qpeobj | ||
19 | OBJECTS_DIR=qpeobj | ||
18 | 20 | ||
19 | INCLUDEPATH += $(OPIEDIR)/include | 21 | INCLUDEPATH += $(OPIEDIR)/include |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index cce445b..1dee422 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -173,5 +173,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
173 | 173 | ||
174 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 174 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
175 | tabWidget->setTabShape(QTabWidget::Triangular); | 175 | // tabWidget->setTabShape(QTabWidget::Triangular); |
176 | 176 | ||
177 | QWidget *pTab; | 177 | QWidget *pTab; |
@@ -427,4 +427,5 @@ void PlayListWidget::setDocument(const QString& fileref) { | |||
427 | 427 | ||
428 | void PlayListWidget::setActiveWindow() { | 428 | void PlayListWidget::setActiveWindow() { |
429 | qDebug("SETTING active window"); | ||
429 | // When we get raised we need to ensure that it switches views | 430 | // When we get raised we need to ensure that it switches views |
430 | char origView = mediaPlayerState->view(); | 431 | char origView = mediaPlayerState->view(); |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 878cd4a..19a9172 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -81,5 +81,4 @@ void XineControl::play( const QString& fileName ) { | |||
81 | length(); | 81 | length(); |
82 | position(); | 82 | position(); |
83 | |||
84 | } | 83 | } |
85 | 84 | ||
@@ -98,5 +97,5 @@ void XineControl::pause( bool isSet) { | |||
98 | } | 97 | } |
99 | 98 | ||
100 | int XineControl::currentTime() { | 99 | long XineControl::currentTime() { |
101 | // todo: jede sekunde überprüfen | 100 | // todo: jede sekunde überprüfen |
102 | m_currentTime = libXine->currentTime(); | 101 | m_currentTime = libXine->currentTime(); |
@@ -111,12 +110,12 @@ void XineControl::length() { | |||
111 | 110 | ||
112 | long XineControl::position() { | 111 | long XineControl::position() { |
113 | qDebug("<<<<<<<<<<<< xinecontrol setPostion>>>>>>>>>"); | 112 | m_position = ( currentTime() ); |
114 | m_position = (m_currentTime/m_length*100); | ||
115 | mediaPlayerState->setPosition( m_position ); | 113 | mediaPlayerState->setPosition( m_position ); |
116 | long emitPos = (long)m_position; | 114 | long emitPos = (long)m_position; |
117 | emit positionChanged( emitPos ); | 115 | emit positionChanged( emitPos ); |
116 | if(mediaPlayerState->isPlaying) | ||
118 | // needs to be stopped the media is stopped | 117 | // needs to be stopped the media is stopped |
119 | QTimer::singleShot( 1000, this, SLOT( position() ) ); | 118 | QTimer::singleShot( 1000, this, SLOT( position() ) ); |
120 | qDebug("POSITION : " + m_position); | 119 | // qDebug("POSITION : %d", m_position); |
121 | return m_position; | 120 | return m_position; |
122 | } | 121 | } |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 07ad309..295d2b4 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h | |||
@@ -51,9 +51,8 @@ public slots: | |||
51 | void pause( bool ); | 51 | void pause( bool ); |
52 | void setFullscreen( bool ); | 52 | void setFullscreen( bool ); |
53 | int currentTime(); | 53 | long currentTime(); |
54 | void seekTo( long ); | 54 | void seekTo( long ); |
55 | // get length of media file and set it | 55 | // get length of media file and set it |
56 | void length(); | 56 | void length(); |
57 | |||
58 | long position(); | 57 | long position(); |
59 | 58 | ||
@@ -61,5 +60,5 @@ private: | |||
61 | XINE::Lib *libXine; | 60 | XINE::Lib *libXine; |
62 | MediaDetect mdetect; | 61 | MediaDetect mdetect; |
63 | int m_currentTime; | 62 | long m_currentTime; |
64 | long m_position; | 63 | long m_position; |
65 | 64 | ||