author | harlekin <harlekin> | 2002-07-09 14:00:53 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-07-09 14:00:53 (UTC) |
commit | f9e07dc2c8e489c48debb31a6ae5afd46b77faee (patch) (unidiff) | |
tree | a35a5d7eb9cf1e9f1e3f2dfb1e7086929b27636d | |
parent | 87bb55055c826b6c75d4a66a7ff6e21058cf6361 (diff) | |
download | opie-f9e07dc2c8e489c48debb31a6ae5afd46b77faee.zip opie-f9e07dc2c8e489c48debb31a6ae5afd46b77faee.tar.gz opie-f9e07dc2c8e489c48debb31a6ae5afd46b77faee.tar.bz2 |
fullscreen toogle connected
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 7407e4e..497636a 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -1,70 +1,76 @@ | |||
1 | 1 | #include <qtimer.h> | |
2 | #include "xinecontrol.h" | 2 | #include "xinecontrol.h" |
3 | #include "mediaplayerstate.h" | 3 | #include "mediaplayerstate.h" |
4 | 4 | ||
5 | 5 | ||
6 | extern MediaPlayerState *mediaPlayerState; | 6 | extern MediaPlayerState *mediaPlayerState; |
7 | 7 | ||
8 | XineControl::XineControl( QObject *parent, const char *name ) | 8 | XineControl::XineControl( QObject *parent, const char *name ) |
9 | : QObject( parent, name ) { | 9 | : QObject( parent, name ) { |
10 | libXine = new XINE::Lib(); | 10 | libXine = new XINE::Lib(); |
11 | 11 | ||
12 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); | 12 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); |
13 | connect( this, SIGNAL( positionChanged( int position ) ), mediaPlayerState, SLOT( updatePosition( long p ) ) ); | 13 | connect( this, SIGNAL( positionChanged( int position ) ), mediaPlayerState, SLOT( updatePosition( long p ) ) ); |
14 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); | 14 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); |
15 | 15 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); | |
16 | } | 16 | } |
17 | 17 | ||
18 | XineControl::~XineControl() { | 18 | XineControl::~XineControl() { |
19 | delete libXine; | 19 | delete libXine; |
20 | } | 20 | } |
21 | 21 | ||
22 | void XineControl::play( const QString& fileName ) { | 22 | void XineControl::play( const QString& fileName ) { |
23 | libXine->play( fileName ); | 23 | libXine->play( fileName ); |
24 | mediaPlayerState->setPlaying( true ); | 24 | mediaPlayerState->setPlaying( true ); |
25 | // default to audio view until we know how to handle video | 25 | // default to audio view until we know how to handle video |
26 | // MediaDetect mdetect; | 26 | // MediaDetect mdetect; |
27 | char whichGui = mdetect.videoOrAudio( fileName ); | 27 | char whichGui = mdetect.videoOrAudio( fileName ); |
28 | if (whichGui == 'f') { | 28 | if (whichGui == 'f') { |
29 | qDebug("Nicht erkannter Dateityp"); | 29 | qDebug("Nicht erkannter Dateityp"); |
30 | return; | 30 | return; |
31 | } | 31 | } |
32 | 32 | ||
33 | // which gui (video / audio) | ||
34 | mediaPlayerState->setView( whichGui ); | ||
35 | |||
36 | // determine if slider is shown | 33 | // determine if slider is shown |
37 | mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); | 34 | mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); |
35 | |||
36 | // which gui (video / audio) | ||
37 | mediaPlayerState->setView( whichGui ); | ||
38 | |||
38 | } | 39 | } |
39 | 40 | ||
40 | void XineControl::stop( bool isSet ) { | 41 | void XineControl::stop( bool isSet ) { |
41 | if ( !isSet) { | 42 | if ( !isSet) { |
42 | libXine->stop(); | 43 | libXine->stop(); |
43 | mediaPlayerState->setList(); | 44 | mediaPlayerState->setList(); |
44 | //mediaPlayerState->setPlaying( false ); | 45 | //mediaPlayerState->setPlaying( false ); |
45 | } else { | 46 | } else { |
46 | // play again | 47 | // play again |
47 | } | 48 | } |
48 | } | 49 | } |
49 | 50 | ||
50 | void XineControl::pause( bool isSet) { | 51 | void XineControl::pause( bool isSet) { |
51 | libXine->pause(); | 52 | libXine->pause(); |
52 | } | 53 | } |
53 | 54 | ||
54 | int XineControl::currentTime() { | 55 | int XineControl::currentTime() { |
55 | // todo: jede sekunde überprüfen | 56 | // todo: jede sekunde überprüfen |
56 | m_currentTime = libXine->currentTime(); | 57 | m_currentTime = libXine->currentTime(); |
57 | return m_currentTime; | 58 | return m_currentTime; |
58 | } | 59 | } |
59 | 60 | ||
60 | void XineControl::length() { | 61 | void XineControl::length() { |
61 | m_length = libXine->length(); | 62 | m_length = libXine->length(); |
62 | mediaPlayerState->setLength( m_length ); | 63 | mediaPlayerState->setLength( m_length ); |
63 | } | 64 | } |
64 | 65 | ||
65 | int XineControl::position() { | 66 | int XineControl::position() { |
66 | m_position = (m_currentTime/m_length*100); | 67 | m_position = (m_currentTime/m_length*100); |
67 | mediaPlayerState->setPosition( m_position ); | 68 | mediaPlayerState->setPosition( m_position ); |
68 | return m_position; | 69 | return m_position; |
69 | emit positionChanged( m_position ); | 70 | emit positionChanged( m_position ); |
71 | QTimer::singleShot( 1000, this, SLOT( position ) ); | ||
72 | } | ||
73 | |||
74 | void XineControl::setFullscreen( bool isSet ) { | ||
75 | libXine-> showVideoFullScreen( isSet); | ||
70 | } | 76 | } |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index aab00cd..145cd0c 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h | |||
@@ -1,40 +1,40 @@ | |||
1 | 1 | ||
2 | #ifndef XINECONTROL_H | 2 | #ifndef XINECONTROL_H |
3 | #define XINECONTROL_H | 3 | #define XINECONTROL_H |
4 | 4 | ||
5 | #include "lib.h" | 5 | #include "lib.h" |
6 | #include "mediadetect.h" | 6 | #include "mediadetect.h" |
7 | #include <qobject.h> | 7 | #include <qobject.h> |
8 | 8 | ||
9 | class XineControl : public QObject { | 9 | class XineControl : public QObject { |
10 | Q_OBJECT | 10 | Q_OBJECT |
11 | public: | 11 | public: |
12 | XineControl( QObject *parent = 0, const char *name =0 ); | 12 | XineControl( QObject *parent = 0, const char *name =0 ); |
13 | ~XineControl(); | 13 | ~XineControl(); |
14 | 14 | ||
15 | public slots: | 15 | public slots: |
16 | void play( const QString& fileName ); | 16 | void play( const QString& fileName ); |
17 | void stop( bool ); | 17 | void stop( bool ); |
18 | void pause( bool ); | 18 | void pause( bool ); |
19 | 19 | void setFullscreen( bool ); | |
20 | int currentTime(); | 20 | int currentTime(); |
21 | 21 | ||
22 | // get length of media file and set it | 22 | // get length of media file and set it |
23 | void length(); | 23 | void length(); |
24 | 24 | ||
25 | int position(); | 25 | int position(); |
26 | 26 | ||
27 | private: | 27 | private: |
28 | XINE::Lib *libXine; | 28 | XINE::Lib *libXine; |
29 | MediaDetect mdetect; | 29 | MediaDetect mdetect; |
30 | int m_length; | 30 | int m_length; |
31 | int m_currentTime; | 31 | int m_currentTime; |
32 | int m_position; | 32 | int m_position; |
33 | 33 | ||
34 | signals: | 34 | signals: |
35 | void positionChanged( int position ); | 35 | void positionChanged( int position ); |
36 | 36 | ||
37 | }; | 37 | }; |
38 | 38 | ||
39 | 39 | ||
40 | #endif | 40 | #endif |